diff options
author | Clark Scheff <clark@cyngn.com> | 2015-01-13 16:54:36 -0800 |
---|---|---|
committer | Clark Scheff <clark@cyngn.com> | 2015-01-15 09:18:05 -0800 |
commit | 914950a5d70c6e3ea4c0488ed0384449a0c91270 (patch) | |
tree | bb9ff9468a696bd79efc719cfc9394b5da074bbc /src/com/cyngn/theme/widget | |
parent | c6d36f0b58294bd5e7ca7b2fb1022a8399685c66 (diff) | |
download | packages_apps_ThemeChooser-914950a5d70c6e3ea4c0488ed0384449a0c91270.zip packages_apps_ThemeChooser-914950a5d70c6e3ea4c0488ed0384449a0c91270.tar.gz packages_apps_ThemeChooser-914950a5d70c6e3ea4c0488ed0384449a0c91270.tar.bz2 |
Add legacy theme tag and warning message
This adds a tag at the top of any theme that is designed for
an older version of CM and presents the user with a message
in the apply overlay when they go to apply a theme designed
for an older version of CM.
Change-Id: I7d60f14cbfc376890e06dbf1358745e4490be961
Diffstat (limited to 'src/com/cyngn/theme/widget')
-rw-r--r-- | src/com/cyngn/theme/widget/ThemeTagLayout.java | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/com/cyngn/theme/widget/ThemeTagLayout.java b/src/com/cyngn/theme/widget/ThemeTagLayout.java index cf25fe1..18635a4 100644 --- a/src/com/cyngn/theme/widget/ThemeTagLayout.java +++ b/src/com/cyngn/theme/widget/ThemeTagLayout.java @@ -17,6 +17,7 @@ public class ThemeTagLayout extends LinearLayout { private TextView mCustomizedTag; private TextView mUpdatedTag; private TextView mDefaultTag; + private TextView mLegacyTag; public ThemeTagLayout(Context context) { this(context, null); @@ -39,6 +40,7 @@ public class ThemeTagLayout extends LinearLayout { mCustomizedTag = (TextView) inflater.inflate(R.layout.tag_customized, this, false); mUpdatedTag = (TextView) inflater.inflate(R.layout.tag_updated, this, false); mDefaultTag = (TextView) inflater.inflate(R.layout.tag_default, this, false); + mLegacyTag = (TextView) inflater.inflate(R.layout.tag_legacy, this, false); } public void setAppliedTagEnabled(boolean enabled) { @@ -110,4 +112,14 @@ public class ThemeTagLayout extends LinearLayout { removeView(mDefaultTag); } } + + public void setLegacyTagEnabled(boolean enabled) { + if (enabled) { + if (findViewById(R.id.tag_legacy) != null) return; + addView(mLegacyTag); + } else { + if (findViewById(R.id.tag_legacy) == null) return; + removeView(mLegacyTag); + } + } } |