diff options
Diffstat (limited to 'src/com/android/launcher3/WallpaperPickerActivity.java')
-rw-r--r-- | src/com/android/launcher3/WallpaperPickerActivity.java | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/src/com/android/launcher3/WallpaperPickerActivity.java b/src/com/android/launcher3/WallpaperPickerActivity.java index e71a26be1..de540f899 100644 --- a/src/com/android/launcher3/WallpaperPickerActivity.java +++ b/src/com/android/launcher3/WallpaperPickerActivity.java @@ -66,6 +66,7 @@ import android.widget.ListAdapter; import com.android.gallery3d.exif.ExifInterface; import com.android.photos.BitmapRegionTileSource; +import org.cyanogenmod.trebuchet.settings.SettingsProvider; import java.io.BufferedInputStream; import java.io.File; @@ -82,6 +83,9 @@ public class WallpaperPickerActivity extends WallpaperCropActivity { public static final int PICK_LIVE_WALLPAPER = 7; private static final String TEMP_WALLPAPER_TILES = "TEMP_WALLPAPER_TILES"; + private static final int MENU_WALLPAPER_SCROLL = 0; + + private View mSelectedThumb; private boolean mIgnoreNextTap; private OnClickListener mThumbnailOnClickListener; @@ -499,6 +503,39 @@ public class WallpaperPickerActivity extends WallpaperCropActivity { return thumb; } + @Override + public boolean onCreateOptionsMenu(Menu menu) { + menu.add(0, MENU_WALLPAPER_SCROLL, 0, + R.string.wallpaper_scroll).setCheckable(true); + + return super.onCreateOptionsMenu(menu); + } + + @Override + public boolean onPrepareOptionsMenu(Menu menu) { + MenuItem wallpaperScroll = menu.findItem(MENU_WALLPAPER_SCROLL); + + wallpaperScroll.setChecked(SettingsProvider.getBoolean(this, + SettingsProvider.SETTINGS_UI_HOMESCREEN_SCROLLING_WALLPAPER_SCROLL, + R.bool.preferences_interface_homescreen_scrolling_wallpaper_scroll_default)); + + return super.onPrepareOptionsMenu(menu); + } + + @Override + public boolean onOptionsItemSelected(MenuItem item) { + // Handle presses on the action bar items + switch (item.getItemId()) { + case MENU_WALLPAPER_SCROLL: + SettingsProvider.get(this).edit() + .putBoolean(SettingsProvider.SETTINGS_UI_HOMESCREEN_SCROLLING_WALLPAPER_SCROLL, !item.isChecked()) + .commit(); + return true; + default: + return super.onOptionsItemSelected(item); + } + } + protected void onStop() { super.onStop(); mWallpaperStrip = findViewById(R.id.wallpaper_strip); |