diff options
author | Clark Scheff <clark@cyngn.com> | 2014-07-18 11:49:04 -0700 |
---|---|---|
committer | Clark Scheff <clark@cyngn.com> | 2014-07-18 11:51:36 -0700 |
commit | d9bb96a6aff24a7ec5ac355ec8ab17caf5dbfea0 (patch) | |
tree | f6b43effbd7bdb50a80f7223d27b8567cfe1856a /src/org/cyanogenmod | |
parent | 9bacea5f074d63119c22a1cc1240cd4fba334784 (diff) | |
download | packages_apps_ThemeChooser-d9bb96a6aff24a7ec5ac355ec8ab17caf5dbfea0.zip packages_apps_ThemeChooser-d9bb96a6aff24a7ec5ac355ec8ab17caf5dbfea0.tar.gz packages_apps_ThemeChooser-d9bb96a6aff24a7ec5ac355ec8ab17caf5dbfea0.tar.bz2 |
Update mAppliedComponentPkgName on every call to setComponentType
This ensures that mAppliedComponentPkgName is updated and that the
appropriate applied component is properly highlighted.
Change-Id: I42d8551b8eb2b17af1a43ff7108f92efd4b39eb5
Diffstat (limited to 'src/org/cyanogenmod')
-rw-r--r-- | src/org/cyanogenmod/theme/chooserv2/ComponentSelector.java | 36 |
1 files changed, 17 insertions, 19 deletions
diff --git a/src/org/cyanogenmod/theme/chooserv2/ComponentSelector.java b/src/org/cyanogenmod/theme/chooserv2/ComponentSelector.java index 10b68c8..8c42e76 100644 --- a/src/org/cyanogenmod/theme/chooserv2/ComponentSelector.java +++ b/src/org/cyanogenmod/theme/chooserv2/ComponentSelector.java @@ -170,26 +170,24 @@ public class ComponentSelector extends LinearLayout } public void setComponentType(String component) { - if (!component.equals(mComponentType)) { - // Find out which theme is currently applied for this component - String selection = MixnMatchColumns.COL_KEY + "=?"; - String[] selectionArgs = {MixnMatchColumns.componentToMixNMatchKey(component)}; - Cursor c = mContext.getContentResolver().query(MixnMatchColumns.CONTENT_URI, - null, selection, selectionArgs, null); - if (c != null) { - if (c.moveToFirst()) { - mAppliedComponentPkgName = c.getString( - c.getColumnIndex(MixnMatchColumns.COL_VALUE)); - } - c.close(); - } else { - mAppliedComponentPkgName = null; + // Find out which theme is currently applied for this component + String selection = MixnMatchColumns.COL_KEY + "=?"; + String[] selectionArgs = {MixnMatchColumns.componentToMixNMatchKey(component)}; + Cursor c = mContext.getContentResolver().query(MixnMatchColumns.CONTENT_URI, + null, selection, selectionArgs, null); + if (c != null) { + if (c.moveToFirst()) { + mAppliedComponentPkgName = c.getString( + c.getColumnIndex(MixnMatchColumns.COL_VALUE)); } - mComponentType = component; - mPager.setCurrentItem(0); - ((FragmentActivity) mContext).getSupportLoaderManager().restartLoader( - getLoaderIdFromComponent(component), null, this); - } + c.close(); + } else { + mAppliedComponentPkgName = null; + } + if (mComponentType == null || !mComponentType.equals(component)) mPager.setCurrentItem(0); + mComponentType = component; + ((FragmentActivity) mContext).getSupportLoaderManager().restartLoader( + getLoaderIdFromComponent(component), null, this); } public String getComponentType() { |