diff options
Diffstat (limited to 'src/com/cyngn/theme/chooser/ComponentSelector.java')
-rw-r--r-- | src/com/cyngn/theme/chooser/ComponentSelector.java | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/src/com/cyngn/theme/chooser/ComponentSelector.java b/src/com/cyngn/theme/chooser/ComponentSelector.java index 1898a94..9f63344 100644 --- a/src/com/cyngn/theme/chooser/ComponentSelector.java +++ b/src/com/cyngn/theme/chooser/ComponentSelector.java @@ -50,6 +50,7 @@ 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; @@ -59,6 +60,7 @@ 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; @@ -318,6 +320,9 @@ 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; } @@ -348,6 +353,7 @@ 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); @@ -413,6 +419,9 @@ 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; } @@ -613,6 +622,21 @@ 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 |