import android.view.WindowManager;
import com.android.gallery3d.R;
-import com.android.gallery3d.app.Gallery;
+import com.android.gallery3d.app.GalleryActivity;
import com.android.gallery3d.app.PackagesMonitor;
import com.android.gallery3d.common.ApiHelper;
import com.android.gallery3d.data.DataManager;
import com.android.gallery3d.util.ThreadPool.CancelListener;
import com.android.gallery3d.util.ThreadPool.JobContext;
+import java.io.File;
import java.util.Arrays;
import java.util.List;
import java.util.Locale;
int state = pm.getComponentEnabledSetting(name);
sCameraAvailableInitialized = true;
sCameraAvailable =
- (state == PackageManager.COMPONENT_ENABLED_STATE_DEFAULT)
- || (state == PackageManager.COMPONENT_ENABLED_STATE_ENABLED);
+ (state == PackageManager.COMPONENT_ENABLED_STATE_DEFAULT)
+ || (state == PackageManager.COMPONENT_ENABLED_STATE_ENABLED);
return sCameraAvailable;
}
}
public static void startGalleryActivity(Context context) {
- Intent intent = new Intent(context, Gallery.class)
+ Intent intent = new Intent(context, GalleryActivity.class)
.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP
| Intent.FLAG_ACTIVITY_NEW_TASK);
context.startActivity(intent);
return path.toLowerCase().hashCode();
}
+ // Return the local path that matches the given bucketId. If no match is
+ // found, return null
+ public static String searchDirForPath(File dir, int bucketId) {
+ File[] files = dir.listFiles();
+ if (files != null) {
+ for (File file : files) {
+ if (file.isDirectory()) {
+ String path = file.getAbsolutePath();
+ if (GalleryUtils.getBucketId(path) == bucketId) {
+ return path;
+ } else {
+ path = searchDirForPath(file, bucketId);
+ if (path != null) return path;
+ }
+ }
+ }
+ }
+ return null;
+ }
+
// Returns a (localized) string for the given duration (in seconds).
public static String formatDuration(final Context context, int duration) {
int h = duration / 3600;