From 914950a5d70c6e3ea4c0488ed0384449a0c91270 Mon Sep 17 00:00:00 2001 From: Clark Scheff Date: Tue, 13 Jan 2015 16:54:36 -0800 Subject: 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 --- src/com/cyngn/theme/widget/ThemeTagLayout.java | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'src/com/cyngn/theme/widget/ThemeTagLayout.java') 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); + } + } } -- cgit v1.1