diff options
author | d34d <clark@cyngn.com> | 2015-11-05 13:21:43 -0800 |
---|---|---|
committer | d34d <clark@cyngn.com> | 2015-11-05 13:22:15 -0800 |
commit | 4b847d1262bd0f3038a2cdee8c9743c56bb0b803 (patch) | |
tree | 5aa6823d06b1e3f8de701157909846f666f3e9cd | |
parent | 22b8c53850bb9839723e51e898ab25c0b4421474 (diff) | |
download | packages_apps_ThemeChooser-4b847d1262bd0f3038a2cdee8c9743c56bb0b803.zip packages_apps_ThemeChooser-4b847d1262bd0f3038a2cdee8c9743c56bb0b803.tar.gz packages_apps_ThemeChooser-4b847d1262bd0f3038a2cdee8c9743c56bb0b803.tar.bz2 |
Revert "Add live lock screen support for dogefood"
This reverts commit 590804752bc280f2905b3bf86b49e467fd0fd610.
Change-Id: Ifc42fe865677179d6570d457242c6ee469947afc
-rw-r--r-- | res/layout/fragment_pager_list.xml | 3 | ||||
-rw-r--r-- | res/layout/live_lock_screen_card.xml | 43 | ||||
-rw-r--r-- | res/values/dimens.xml | 2 | ||||
-rw-r--r-- | res/values/integers.xml | 1 | ||||
-rw-r--r-- | res/values/strings.xml | 1 | ||||
-rw-r--r-- | src/com/cyngn/theme/chooser/ChooserActivity.java | 3 | ||||
-rw-r--r-- | src/com/cyngn/theme/chooser/ComponentSelector.java | 24 | ||||
-rw-r--r-- | src/com/cyngn/theme/chooser/ThemeFragment.java | 51 | ||||
-rw-r--r-- | src/com/cyngn/theme/util/CursorLoaderHelper.java | 23 |
9 files changed, 3 insertions, 148 deletions
diff --git a/res/layout/fragment_pager_list.xml b/res/layout/fragment_pager_list.xml index 9a635b4..ff76c80 100644 --- a/res/layout/fragment_pager_list.xml +++ b/res/layout/fragment_pager_list.xml @@ -174,9 +174,6 @@ /> <Space android:layout_width="match_parent" android:layout_height="@dimen/expanded_card_margin_top" /> - <include layout="@layout/live_lock_screen_card" /> - <Space android:layout_width="match_parent" - android:layout_height="@dimen/expanded_card_margin_top" /> <include layout="@layout/style_card" /> <Space android:layout_width="match_parent" android:layout_height="@dimen/expanded_card_margin_top" /> diff --git a/res/layout/live_lock_screen_card.xml b/res/layout/live_lock_screen_card.xml deleted file mode 100644 index 33cd847..0000000 --- a/res/layout/live_lock_screen_card.xml +++ /dev/null @@ -1,43 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<!-- - Copyright (C) 2014 Cyanogen, Inc. ---> -<com.cyngn.theme.chooser.ComponentCardView - xmlns:android="http://schemas.android.com/apk/res/android" - android:id="@+id/live_lock_screen_preview_container" - android:layout_width="match_parent" - android:layout_height="320dp" - android:orientation="vertical" - android:background="@drawable/card_bootanim_bg"> - <FrameLayout - android:layout_width="match_parent" - android:layout_height="match_parent"> - <!-- Need to set a valid source so this view can generate a valid bitmap - from drawing cache, otherwise it's size is 0x0 and a null bitmap is returned --> - <ImageView - android:id="@+id/live_lock_screen_preview" - android:layout_width="match_parent" - android:layout_height="wrap_content" - android:layout_marginTop="@dimen/expanded_card_margin_top" - android:adjustViewBounds="true" - android:layout_gravity="center" - android:src="@drawable/card_bootanim_bg"/> - <com.cyngn.theme.widget.LatoTextView - android:id="@+id/label" - android:layout_width="match_parent" - android:layout_height="wrap_content" - android:text="@string/live_lock_screen_label" - style="@style/card_label"/> - <LinearLayout - android:id="@+id/empty" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:layout_gravity="center" - android:visibility="gone"> - <ImageView - android:layout_width="20dp" - android:layout_height="20dp" - android:src="@drawable/ic_addcomponent"/> - </LinearLayout> - </FrameLayout> -</com.cyngn.theme.chooser.ComponentCardView> diff --git a/res/values/dimens.xml b/res/values/dimens.xml index 8eb7bcb..e5b909b 100644 --- a/res/values/dimens.xml +++ b/res/values/dimens.xml @@ -19,8 +19,6 @@ <dimen name="component_selection_content_height">@dimen/component_selection_content_width</dimen> <dimen name="component_selection_bootani_content_width">80dp</dimen> <dimen name="component_selection_bootani_content_height">142dp</dimen> - <dimen name="component_selection_live_lock_screen_content_width">80dp</dimen> - <dimen name="component_selection_live_lock_screen_content_height">142dp</dimen> <dimen name="component_margin_top">12dp</dimen> <dimen name="card_padding_top">4dp</dimen> diff --git a/res/values/integers.xml b/res/values/integers.xml index 30146dd..b2d17f3 100644 --- a/res/values/integers.xml +++ b/res/values/integers.xml @@ -5,5 +5,4 @@ <resources> <integer name="default_items_per_page">4</integer> <integer name="bootani_items_per_page">3</integer> - <integer name="live_lock_screen_items_per_page">3</integer> </resources>
\ No newline at end of file diff --git a/res/values/strings.xml b/res/values/strings.xml index 88b417e..7326940 100644 --- a/res/values/strings.xml +++ b/res/values/strings.xml @@ -31,7 +31,6 @@ <string name="navbar_label">Navigation</string> <string name="wallpaper_label">Wallpaper</string> <string name="lockscreen_label">Lockscreen wallpaper</string> - <string name="live_lock_screen_label">Live lock screen</string> <string name="style_label">Controls</string> <string name="boot_animation_label">Boot animation</string> <string name="alarm_label">Alarm</string> diff --git a/src/com/cyngn/theme/chooser/ChooserActivity.java b/src/com/cyngn/theme/chooser/ChooserActivity.java index b395ecc..c851abe 100644 --- a/src/com/cyngn/theme/chooser/ChooserActivity.java +++ b/src/com/cyngn/theme/chooser/ChooserActivity.java @@ -65,7 +65,6 @@ import java.util.Map; import static android.provider.ThemesContract.ThemesColumns.MODIFIES_ALARMS; import static android.provider.ThemesContract.ThemesColumns.MODIFIES_BOOT_ANIM; -import static android.provider.ThemesContract.ThemesColumns.MODIFIES_LIVE_LOCK_SCREEN; import static android.provider.ThemesContract.ThemesColumns.MODIFIES_NOTIFICATIONS; import static android.provider.ThemesContract.ThemesColumns.MODIFIES_RINGTONES; @@ -507,7 +506,7 @@ public class ChooserActivity extends FragmentActivity final Resources res = getResources(); int itemsPerPage = res.getInteger(R.integer.default_items_per_page); int height = res.getDimensionPixelSize(R.dimen.component_selection_cell_height); - if (MODIFIES_BOOT_ANIM.equals(component) || MODIFIES_LIVE_LOCK_SCREEN.equals(component)) { + if (MODIFIES_BOOT_ANIM.equals(component)) { itemsPerPage = res.getInteger(R.integer.bootani_items_per_page); height = res.getDimensionPixelSize( R.dimen.component_selection_cell_height_boot_anim); diff --git a/src/com/cyngn/theme/chooser/ComponentSelector.java b/src/com/cyngn/theme/chooser/ComponentSelector.java index 9f63344..1898a94 100644 --- a/src/com/cyngn/theme/chooser/ComponentSelector.java +++ b/src/com/cyngn/theme/chooser/ComponentSelector.java @@ -50,7 +50,6 @@ import com.cyngn.theme.util.Utils; import static android.provider.ThemesContract.ThemesColumns.MODIFIES_ALARMS; import static android.provider.ThemesContract.ThemesColumns.MODIFIES_BOOT_ANIM; import static android.provider.ThemesContract.ThemesColumns.MODIFIES_LAUNCHER; -import static android.provider.ThemesContract.ThemesColumns.MODIFIES_LIVE_LOCK_SCREEN; import static android.provider.ThemesContract.ThemesColumns.MODIFIES_LOCKSCREEN; import static android.provider.ThemesContract.ThemesColumns.MODIFIES_NOTIFICATIONS; import static android.provider.ThemesContract.ThemesColumns.MODIFIES_OVERLAYS; @@ -60,7 +59,6 @@ import static android.provider.ThemesContract.ThemesColumns.MODIFIES_NAVIGATION_ import static android.provider.ThemesContract.ThemesColumns.MODIFIES_ICONS; import static android.provider.ThemesContract.ThemesColumns.MODIFIES_FONTS; -import static com.cyngn.theme.util.CursorLoaderHelper.LOADER_ID_LIVE_LOCK_SCREEN; import static com.cyngn.theme.util.CursorLoaderHelper.LOADER_ID_STATUS_BAR; import static com.cyngn.theme.util.CursorLoaderHelper.LOADER_ID_FONT; import static com.cyngn.theme.util.CursorLoaderHelper.LOADER_ID_ICONS; @@ -320,9 +318,6 @@ public class ComponentSelector extends LinearLayout if (MODIFIES_LOCKSCREEN.equals(component)) { return LOADER_ID_LOCKSCREEN; } - if (MODIFIES_LIVE_LOCK_SCREEN.equals(component)) { - return LOADER_ID_LIVE_LOCK_SCREEN; - } return -1; } @@ -353,7 +348,6 @@ public class ComponentSelector extends LinearLayout mContent.setShowDividers(LinearLayout.SHOW_DIVIDER_NONE); break; case LOADER_ID_BOOT_ANIMATION: - case LOADER_ID_LIVE_LOCK_SCREEN: dividerPadding = res.getDimensionPixelSize( R.dimen.component_divider_padding_top_bootani); dividerHeight = res.getDimensionPixelSize(R.dimen.component_divider_height_bootani); @@ -419,9 +413,6 @@ public class ComponentSelector extends LinearLayout return newWallpapersView(cursor, container, position, cursor.getColumnIndex(PreviewColumns.LOCK_WALLPAPER_THUMBNAIL)); } - if (MODIFIES_LIVE_LOCK_SCREEN.equals(mComponentType)) { - return newLiveLockScreenView(cursor, container, position); - } return null; } @@ -622,21 +613,6 @@ public class ComponentSelector extends LinearLayout return container; } - private View newLiveLockScreenView(Cursor cursor, ViewGroup parent, int position) { - cursor.moveToPosition(position); - View v = mInflater.inflate(R.layout.bootani_component_selection_item, parent, - false); - int wallpaperIndex = cursor.getColumnIndex(PreviewColumns.LIVE_LOCK_SCREEN_THUMBNAIL); - int pkgNameIndex = cursor.getColumnIndex(ThemesContract.ThemesColumns.PKG_NAME); - - ((ImageView) v.findViewById(R.id.preview)).setImageBitmap( - Utils.loadBitmapBlob(cursor, wallpaperIndex)); - setTitle(((TextView) v.findViewById(R.id.title)), cursor); - v.setTag(R.id.tag_key_package_name, cursor.getString(pkgNameIndex)); - v.setOnClickListener(mItemClickListener); - return v; - } - private class LoadItemsTask extends AsyncTask<Object, Void, Void> { @Override diff --git a/src/com/cyngn/theme/chooser/ThemeFragment.java b/src/com/cyngn/theme/chooser/ThemeFragment.java index f4cec1a..30090b9 100644 --- a/src/com/cyngn/theme/chooser/ThemeFragment.java +++ b/src/com/cyngn/theme/chooser/ThemeFragment.java @@ -102,7 +102,6 @@ import java.util.zip.ZipFile; import static android.provider.ThemesContract.ThemesColumns.MODIFIES_ALARMS; import static android.provider.ThemesContract.ThemesColumns.MODIFIES_BOOT_ANIM; import static android.provider.ThemesContract.ThemesColumns.MODIFIES_LAUNCHER; -import static android.provider.ThemesContract.ThemesColumns.MODIFIES_LIVE_LOCK_SCREEN; import static android.provider.ThemesContract.ThemesColumns.MODIFIES_LOCKSCREEN; import static android.provider.ThemesContract.ThemesColumns.MODIFIES_NOTIFICATIONS; import static android.provider.ThemesContract.ThemesColumns.MODIFIES_OVERLAYS; @@ -127,7 +126,6 @@ import static com.cyngn.theme.util.CursorLoaderHelper.LOADER_ID_BOOT_ANIMATION; import static com.cyngn.theme.util.CursorLoaderHelper.LOADER_ID_RINGTONE; import static com.cyngn.theme.util.CursorLoaderHelper.LOADER_ID_NOTIFICATION; import static com.cyngn.theme.util.CursorLoaderHelper.LOADER_ID_ALARM; -import static com.cyngn.theme.util.CursorLoaderHelper.LOADER_ID_LIVE_LOCK_SCREEN; import static android.content.pm.ThemeUtils.SYSTEM_TARGET_API; @@ -217,7 +215,6 @@ public class ThemeFragment extends Fragment implements LoaderManager.LoaderCallb protected ComponentCardView mFontCard; protected ComponentCardView mIconCard; protected ComponentCardView mBootAnimationCard; - protected ComponentCardView mLiveLockScreenCard; protected BootAniImageView mBootAnimation; // Nav Bar Views @@ -246,9 +243,6 @@ public class ThemeFragment extends Fragment implements LoaderManager.LoaderCallb // Style views protected ImageView mStylePreview; - // Live lock screen view - protected ImageView mLiveLockScreenView; - // Sound cards protected ComponentCardView mRingtoneCard; protected ImageView mRingtonePlayPause; @@ -351,8 +345,6 @@ public class ThemeFragment extends Fragment implements LoaderManager.LoaderCallb mCardIdsToComponentTypes.put(R.id.ringtone_preview_container, MODIFIES_RINGTONES); mCardIdsToComponentTypes.put(R.id.notification_preview_container, MODIFIES_NOTIFICATIONS); mCardIdsToComponentTypes.put(R.id.alarm_preview_container, MODIFIES_ALARMS); - mCardIdsToComponentTypes.put(R.id.live_lock_screen_preview_container, - MODIFIES_LIVE_LOCK_SCREEN); mMediaPlayers = new HashMap<ImageView, MediaPlayer>(3); } @@ -482,9 +474,6 @@ public class ThemeFragment extends Fragment implements LoaderManager.LoaderCallb mWallpaperCard = (WallpaperCardView) v.findViewById(R.id.wallpaper_card); mLockScreenCard = (WallpaperCardView) v.findViewById(R.id.lockscreen_card); - mLiveLockScreenCard = - (ComponentCardView) v.findViewById(R.id.live_lock_screen_preview_container); - mLiveLockScreenView = (ImageView) v.findViewById(R.id.live_lock_screen_preview); int translationY = getDistanceToMoveBelowScreen(mAdditionalCards); mAdditionalCards.setTranslationY(translationY); @@ -1297,9 +1286,6 @@ public class ThemeFragment extends Fragment implements LoaderManager.LoaderCallb case LOADER_ID_ALARM: loadAudible(RingtoneManager.TYPE_ALARM, c, animate); break; - case LOADER_ID_LIVE_LOCK_SCREEN: - loadLiveLockScreen(c, animate); - break; } } @@ -1367,14 +1353,6 @@ public class ThemeFragment extends Fragment implements LoaderManager.LoaderCallb setAddComponentTitle(mAlarmCard, getAudibleLabel(RingtoneManager.TYPE_ALARM)); } - } else if (MODIFIES_LIVE_LOCK_SCREEN.equals(component)) { - if (hasContent) { - loadLiveLockScreen(c, false); - } else { - mLiveLockScreenCard.setEmptyViewEnabled(true); - setAddComponentTitle(mLiveLockScreenCard, - getString(R.string.live_lock_screen_label)); - } } else { throw new IllegalArgumentException("Don't know how to load: " + component); } @@ -1798,33 +1776,6 @@ public class ThemeFragment extends Fragment implements LoaderManager.LoaderCallb thread.start(); } - protected void loadLiveLockScreen(Cursor c, boolean animate) { - Drawable overlay = null; - if (animate) { - overlay = getOverlayDrawable(mLiveLockScreenView, false); - } - if (mLiveLockScreenCard.isShowingEmptyView()) { - mLiveLockScreenCard.setEmptyViewEnabled(false); - } - - int pkgNameIdx = c.getColumnIndex(ThemesColumns.PKG_NAME); - int styleIdx = c.getColumnIndex(PreviewColumns.LIVE_LOCK_SCREEN_PREVIEW); - mLiveLockScreenView.setImageBitmap(Utils.loadBitmapBlob(c, styleIdx)); - if (pkgNameIdx > -1) { - String pkgName = c.getString(pkgNameIdx); - if (!mPkgName.equals(pkgName) || (mPkgName.equals(pkgName) - && mBaseThemeSupportedComponents.contains(MODIFIES_LIVE_LOCK_SCREEN))) { - mSelectedComponentsMap.put(MODIFIES_LIVE_LOCK_SCREEN, pkgName); - setCardTitle(mLiveLockScreenCard, pkgName, - getString(R.string.live_lock_screen_label)); - } - } - if (animate) { - animateContentChange(R.id.live_lock_screen_preview_container, mLiveLockScreenView, - overlay); - } - } - protected Drawable getOverlayDrawable(View v, boolean requiresTransparency) { if (!v.isDrawingCacheEnabled()) v.setDrawingCacheEnabled(true); Bitmap cache = v.getDrawingCache(true).copy( @@ -2017,8 +1968,6 @@ public class ThemeFragment extends Fragment implements LoaderManager.LoaderCallb loaderId = LOADER_ID_NOTIFICATION; } else if (MODIFIES_ALARMS.equals(component)) { loaderId = LOADER_ID_ALARM; - } else if (MODIFIES_LIVE_LOCK_SCREEN.equals(component)) { - loaderId = LOADER_ID_LIVE_LOCK_SCREEN; } else { return; } diff --git a/src/com/cyngn/theme/util/CursorLoaderHelper.java b/src/com/cyngn/theme/util/CursorLoaderHelper.java index fdbb64f..e4f2ebe 100644 --- a/src/com/cyngn/theme/util/CursorLoaderHelper.java +++ b/src/com/cyngn/theme/util/CursorLoaderHelper.java @@ -18,7 +18,6 @@ import cyanogenmod.app.ThemeVersion; import static android.provider.ThemesContract.ThemesColumns.MODIFIES_ALARMS; import static android.provider.ThemesContract.ThemesColumns.MODIFIES_BOOT_ANIM; import static android.provider.ThemesContract.ThemesColumns.MODIFIES_LAUNCHER; -import static android.provider.ThemesContract.ThemesColumns.MODIFIES_LIVE_LOCK_SCREEN; import static android.provider.ThemesContract.ThemesColumns.MODIFIES_LOCKSCREEN; import static android.provider.ThemesContract.ThemesColumns.MODIFIES_NOTIFICATIONS; import static android.provider.ThemesContract.ThemesColumns.MODIFIES_OVERLAYS; @@ -43,7 +42,6 @@ public class CursorLoaderHelper { public static final int LOADER_ID_RINGTONE = 9; public static final int LOADER_ID_NOTIFICATION = 10; public static final int LOADER_ID_ALARM = 11; - public static final int LOADER_ID_LIVE_LOCK_SCREEN = 12; public static final int LOADER_ID_INSTALLED_THEMES = 1000; public static final int LOADER_ID_APPLIED = 1001; @@ -186,14 +184,6 @@ public class CursorLoaderHelper { }; } break; - case LOADER_ID_LIVE_LOCK_SCREEN: - selection = MODIFIES_LIVE_LOCK_SCREEN + "=?"; - projection = new String[] { - PreviewColumns.LIVE_LOCK_SCREEN_THUMBNAIL, - ThemesColumns.TITLE, - ThemesColumns.PKG_NAME - }; - break; default: return null; } @@ -225,8 +215,7 @@ public class CursorLoaderHelper { PreviewColumns.ICON_PREVIEW_3, PreviewColumns.LOCK_WALLPAPER_PREVIEW, PreviewColumns.STYLE_PREVIEW, - PreviewColumns.NAVBAR_BACKGROUND, - PreviewColumns.LIVE_LOCK_SCREEN_PREVIEW + PreviewColumns.NAVBAR_BACKGROUND }; uri = PreviewColumns.APPLIED_URI; return new CursorLoader(context, uri, projection, null, null, null); @@ -285,8 +274,7 @@ public class CursorLoaderHelper { PreviewColumns.ICON_PREVIEW_2, PreviewColumns.ICON_PREVIEW_3, PreviewColumns.LOCK_WALLPAPER_PREVIEW, - PreviewColumns.STYLE_PREVIEW, - PreviewColumns.LIVE_LOCK_SCREEN_PREVIEW + PreviewColumns.STYLE_PREVIEW }; break; case LOADER_ID_STATUS_BAR: @@ -378,13 +366,6 @@ public class CursorLoaderHelper { ThemesColumns.TITLE }; break; - case LOADER_ID_LIVE_LOCK_SCREEN: - projection = new String[] { - ThemesColumns.PKG_NAME, - ThemesColumns.TITLE, - PreviewColumns.LIVE_LOCK_SCREEN_PREVIEW - }; - break; } return new CursorLoader(context, uri, projection, selection, selectionArgs, null); } |