summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorLuis Vidal <lvidal@cyngn.com>2016-02-02 11:56:12 -0800
committerLuis Vidal <lvidal@cyngn.com>2016-02-04 15:00:22 -0800
commit4028c36068d4d9dac12b989e937e5ad3486a1bd3 (patch)
tree5704942c1d145bc1feafbf74363c9c962d3246a1 /src
parent73b46248a11d3d5f5aa0e706bef89b65f87b715e (diff)
downloadpackages_apps_ThemeChooser-4028c36068d4d9dac12b989e937e5ad3486a1bd3.zip
packages_apps_ThemeChooser-4028c36068d4d9dac12b989e937e5ad3486a1bd3.tar.gz
packages_apps_ThemeChooser-4028c36068d4d9dac12b989e937e5ad3486a1bd3.tar.bz2
Rebadge 'Live' in theme chooser to 'Animated'
Replaces the static red ribon with a text view so the label can be translated. Default text is set to 'ANIM' Change-Id: Ic701d28bfd20568419a4ea2063ee208210037389 TICKET: CYNGNOS-1688
Diffstat (limited to 'src')
-rw-r--r--src/com/cyngn/theme/chooser/ComponentSelector.java2
-rw-r--r--src/com/cyngn/theme/widget/FittedTextView.java8
2 files changed, 8 insertions, 2 deletions
diff --git a/src/com/cyngn/theme/chooser/ComponentSelector.java b/src/com/cyngn/theme/chooser/ComponentSelector.java
index 48704a9..d21a8e1 100644
--- a/src/com/cyngn/theme/chooser/ComponentSelector.java
+++ b/src/com/cyngn/theme/chooser/ComponentSelector.java
@@ -685,7 +685,7 @@ public class ComponentSelector extends LinearLayout
v.setTag(R.id.tag_key_package_name, cursor.getString(pkgNameIndex));
v.setTag(R.id.tag_key_component_id, cmpntId);
v.setTag(R.id.tag_key_live_lock_screen, isLiveLockScreen);
- v.findViewById(R.id.live_lock_screen_ribbon)
+ v.findViewById(R.id.live_lock_screen_badge)
.setVisibility(isLiveLockScreen ? View.VISIBLE : View.GONE);
}
v.setOnClickListener(mItemClickListener);
diff --git a/src/com/cyngn/theme/widget/FittedTextView.java b/src/com/cyngn/theme/widget/FittedTextView.java
index 8469f0d..78e6a16 100644
--- a/src/com/cyngn/theme/widget/FittedTextView.java
+++ b/src/com/cyngn/theme/widget/FittedTextView.java
@@ -5,6 +5,8 @@ package com.cyngn.theme.widget;
import android.content.Context;
import android.graphics.Paint;
+import android.text.method.TransformationMethod;
+import android.text.method.AllCapsTransformationMethod;
import android.util.AttributeSet;
import android.util.TypedValue;
import android.widget.TextView;
@@ -37,7 +39,11 @@ public class FittedTextView extends TextView {
super.onMeasure(widthMeasureSpec, heightMeasureSpec);
final float THRESHOLD = 0.5f;
final float TARGET_WIDTH = getMeasuredWidth();
- final String text = getText().toString();
+ String text = getText().toString();
+ TransformationMethod tm = getTransformationMethod();
+ if (tm != null && tm instanceof AllCapsTransformationMethod) {
+ text = getText().toString().toUpperCase();
+ }
mPaint.set(getPaint());
float max = 200;