summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorlinuxxxxx <joey@cyanogenmoditalia.it>2015-04-08 13:45:36 +0200
committerMichael Bestas <mikeioannina@gmail.com>2017-01-04 20:05:23 +0200
commit526fc45f19e4e1ee371aecf09ab0dbe2445d1e23 (patch)
tree0c4e118b831a3bcccafc0aba82433055de4e1ce2
parent65aec567a9bf1e4be42b571d9f67e2997e64118a (diff)
downloadandroid_hardware_qcom_fm-526fc45f19e4e1ee371aecf09ab0dbe2445d1e23.tar.gz
android_hardware_qcom_fm-526fc45f19e4e1ee371aecf09ab0dbe2445d1e23.tar.bz2
android_hardware_qcom_fm-526fc45f19e4e1ee371aecf09ab0dbe2445d1e23.zip
FM2: missing materialization changes
Change-Id: I7d80a889cfecda0deb2916cb0d514dac3d92dc9d Signed-off-by: linuxxxxx <joey@cyanogenmoditalia.it>
-rw-r--r--fmapp2/res/drawable/seeker.pngbin2764 -> 2617 bytes
-rw-r--r--fmapp2/res/layout/action_bar.xml2
-rw-r--r--fmapp2/res/layout/fmradio.xml3
-rw-r--r--fmapp2/res/values/colors.xml7
-rw-r--r--fmapp2/res/values/styles.xml8
-rw-r--r--fmapp2/src/com/caf/fmradio/FMRadio.java6
-rw-r--r--fmapp2/src/com/caf/fmradio/FMTransmitterActivity.java4
-rw-r--r--fmapp2/src/com/caf/fmradio/HorizontalNumberPicker.java54
8 files changed, 17 insertions, 67 deletions
diff --git a/fmapp2/res/drawable/seeker.png b/fmapp2/res/drawable/seeker.png
index 20ce782..9babc55 100644
--- a/fmapp2/res/drawable/seeker.png
+++ b/fmapp2/res/drawable/seeker.png
Binary files differ
diff --git a/fmapp2/res/layout/action_bar.xml b/fmapp2/res/layout/action_bar.xml
index e5952b2..75c8628 100644
--- a/fmapp2/res/layout/action_bar.xml
+++ b/fmapp2/res/layout/action_bar.xml
@@ -17,7 +17,7 @@
<TextView android:id="@+id/title"
android:paddingLeft="10dp"
android:textSize="18sp"
- android:textColor="#fafafa"
+ android:textColor="@color/white"
android:textAllCaps="true"
android:textStyle="bold"
android:layout_width="wrap_content"
diff --git a/fmapp2/res/layout/fmradio.xml b/fmapp2/res/layout/fmradio.xml
index 3d13e76..791769e 100644
--- a/fmapp2/res/layout/fmradio.xml
+++ b/fmapp2/res/layout/fmradio.xml
@@ -57,7 +57,8 @@
<ImageView
android:src="@drawable/seeker"
android:layout_width="match_parent"
- android:layout_height="match_parent"/>
+ android:layout_height="match_parent"
+ android:visibility="gone"/>
</RelativeLayout>
diff --git a/fmapp2/res/values/colors.xml b/fmapp2/res/values/colors.xml
index 64f659a..c783270 100644
--- a/fmapp2/res/values/colors.xml
+++ b/fmapp2/res/values/colors.xml
@@ -3,9 +3,10 @@
<color name="favorite_button_normal">#4DB6AC</color>
<color name="favorite_button_active">#673AB7</color>
<color name="background_color">#4DB6AC</color>
- <color name="picker_background_color">@color/primary_dark</color>
+ <color name="picker_background_color">@color/primary</color>
+ <color name="white">#fafafa</color>
<!-- Material -->
- <color name="primary">#009688</color>
- <color name="primary_dark">#00796B</color>
+ <color name="primary">#00796B</color>
+ <color name="primary_dark">#004D40</color>
<color name="accent">#673AB7</color>
</resources>
diff --git a/fmapp2/res/values/styles.xml b/fmapp2/res/values/styles.xml
index 39b2d3c..a53ced9 100644
--- a/fmapp2/res/values/styles.xml
+++ b/fmapp2/res/values/styles.xml
@@ -48,7 +48,7 @@
<item name="android:layout_width">80dp</item>
<item name="android:layout_height">match_parent</item>
<item name="android:textSize">18sp</item>
- <item name="android:textColor">#004D40</item>
+ <item name="android:textColor">@color/white</item>
<item name="android:background">@drawable/preset_button_background</item>
<item name="android:singleLine">true</item>
<item name="android:text">@string/add_station</item>
@@ -60,7 +60,7 @@
<item name="android:layout_width">wrap_content</item>
<item name="android:layout_height">wrap_content</item>
<item name="android:textSize">18sp</item>
- <item name="android:textColor">#004D40</item>
+ <item name="android:textColor">@color/white</item>
<item name="android:background">@drawable/preset_button_background</item>
<item name="android:singleLine">true</item> </style>
@@ -69,7 +69,7 @@
<item name="android:layout_width">wrap_content</item>
<item name="android:layout_height">wrap_content</item>
<item name="android:textSize">18sp</item>
- <item name="android:textColor">#004D40</item>
+ <item name="android:textColor">@color/white</item>
<item name="android:background">@drawable/preset_button_background</item>
<item name="android:singleLine">true</item>
</style>
@@ -79,7 +79,7 @@
<item name="android:layout_width">wrap_content</item>
<item name="android:layout_height">wrap_content</item>
<item name="android:textSize">18sp</item>
- <item name="android:textColor">#004D40</item>
+ <item name="android:textColor">@color/white</item>
<item name="android:background">@drawable/preset_button_background</item>
<item name="android:singleLine">true</item>
</style>
diff --git a/fmapp2/src/com/caf/fmradio/FMRadio.java b/fmapp2/src/com/caf/fmradio/FMRadio.java
index b5e05ba..64523aa 100644
--- a/fmapp2/src/com/caf/fmradio/FMRadio.java
+++ b/fmapp2/src/com/caf/fmradio/FMRadio.java
@@ -227,6 +227,8 @@ public class FMRadio extends Activity
private TextView mSleepMsgTV;
private TextView mRecordingMsgTV;
+ private ImageView mFmSeeker;
+
private double mOutputFreq;
private int mPresetPageNumber = 0;
private int mStereo = -1;
@@ -358,6 +360,8 @@ public class FMRadio extends Activity
mBackButton.setOnClickListener(mBackClickListener);
}
+ mFmSeeker = (ImageView)findViewById(R.id.fm_seeker);
+
/* 6 Preset Buttons */
mPresetButtons[0] = (Button)findViewById(R.id.presets_button_1);
mPresetButtons[1] = (Button)findViewById(R.id.presets_button_2);
@@ -1944,6 +1948,7 @@ public class FMRadio extends Activity
setMuteModeButtonImage(false);
}
if (bEnable) {
+ mFmSeeker.setVisibility(View.VISIBLE);
if (mRadioTextScroller != null) {
mRadioTextScroller.startScroll();
}
@@ -1968,6 +1973,7 @@ public class FMRadio extends Activity
}
}
}else {
+ mFmSeeker.setVisibility(View.INVISIBLE);
if (mRadioTextScroller != null) {
mRadioTextScroller.stopScroll();
}
diff --git a/fmapp2/src/com/caf/fmradio/FMTransmitterActivity.java b/fmapp2/src/com/caf/fmradio/FMTransmitterActivity.java
index 3350b89..a26339e 100644
--- a/fmapp2/src/com/caf/fmradio/FMTransmitterActivity.java
+++ b/fmapp2/src/com/caf/fmradio/FMTransmitterActivity.java
@@ -231,10 +231,6 @@ public class FMTransmitterActivity extends Activity {
}
mRadioTextTV = (TextView)findViewById(R.id.radio_text_tv);
- //if((mRadioTextScroller == null) && (mRadioTextTV != null)) {
- // mRadioTextScroller = new ScrollerText(mRadioTextTV);
- //}
-
enableRadioOnOffUI(false);
if(false == bindToService(this, osc)) {
diff --git a/fmapp2/src/com/caf/fmradio/HorizontalNumberPicker.java b/fmapp2/src/com/caf/fmradio/HorizontalNumberPicker.java
index 53ff9ce..4f3c3fb 100644
--- a/fmapp2/src/com/caf/fmradio/HorizontalNumberPicker.java
+++ b/fmapp2/src/com/caf/fmradio/HorizontalNumberPicker.java
@@ -139,36 +139,6 @@ public class HorizontalNumberPicker extends LinearLayout {
private static final int SELECTOR_WHEEL_STATE_LARGE = 2;
/**
- * The alpha of the selector wheel when it is bright.
- */
- private static final int SELECTOR_WHEEL_BRIGHT_ALPHA = 255;
-
- /**
- * The alpha of the selector wheel when it is dimmed.
- */
- private static final int SELECTOR_WHEEL_DIM_ALPHA = 60;
-
- /**
- * The alpha for the increment/decrement button when it is transparent.
- */
- private static final int BUTTON_ALPHA_TRANSPARENT = 0;
-
- /**
- * The alpha for the increment/decrement button when it is opaque.
- */
- private static final int BUTTON_ALPHA_OPAQUE = 1;
-
- /**
- * The property for setting the selector paint.
- */
- private static final String PROPERTY_SELECTOR_PAINT_ALPHA = "selectorPaintAlpha";
-
- /**
- * The property for setting the increment/decrement button alpha.
- */
- private static final String PROPERTY_BUTTON_ALPHA = "alpha";
-
- /**
* The numbers accepted by the input text's {@link Filter}
*/
private static final char[] DIGIT_CHARACTERS = new char[] { '0', '1', '2',
@@ -344,10 +314,6 @@ public class HorizontalNumberPicker extends LinearLayout {
* The offset to middle of selector.
*/
private static final int SELECTOR_OFFSET_ZERO = 0;
- /**
- * The colors alpha of selector text.
- */
- private static final int SELECTOR_TEXT_ALPHA_TRANSPARENT_NONE = 76;
private static float mDensity = 1.0f;
private static final float LDPI = 0.75f;
@@ -810,7 +776,6 @@ public class HorizontalNumberPicker extends LinearLayout {
mBeginEditOnUpEvent = false;
mAdjustScrollerOnUpEvent = true;
if (mSelectorWheelState == SELECTOR_WHEEL_STATE_LARGE) {
- mSelectorWheelPaint.setAlpha(SELECTOR_WHEEL_BRIGHT_ALPHA);
boolean scrollersFinished = mFlingScroller.isFinished()
&& mAdjustScroller.isFinished();
if (!scrollersFinished) {
@@ -1493,13 +1458,10 @@ public class HorizontalNumberPicker extends LinearLayout {
.get(selectorIndex);
if(i - mSelectorMiddleItemIndex > 0 ){
mSelectorWheelPaint.setColor(Color.WHITE);
- mSelectorWheelPaint.setAlpha(SELECTOR_TEXT_ALPHA_TRANSPARENT_NONE);
}else if(i - mSelectorMiddleItemIndex < 0 ){
mSelectorWheelPaint.setColor(Color.WHITE);
- mSelectorWheelPaint.setAlpha(SELECTOR_TEXT_ALPHA_TRANSPARENT_NONE);
}else{
mSelectorWheelPaint.setColor(Color.WHITE);
- mSelectorWheelPaint.setAlpha(0);
}
try {
fNumber = Float.valueOf(scrollSelectorValue).floatValue();
@@ -1522,15 +1484,12 @@ public class HorizontalNumberPicker extends LinearLayout {
}
if(bShowNumber){
float originalWidth = mSelectorWheelPaint.getStrokeWidth();
- int originalAlpha = mSelectorWheelPaint.getAlpha();
mSelectorWheelPaint.setTypeface(Typeface.DEFAULT_BOLD);
mSelectorWheelPaint.setStrokeWidth(2);
mSelectorWheelPaint.setStyle(Paint.Style.FILL_AND_STROKE);
- mSelectorWheelPaint.setAlpha(SELECTOR_TEXT_ALPHA_TRANSPARENT_NONE);
canvas.drawText(scrollSelectorValue, x, mTextSize * 2, mSelectorWheelPaint);
mSelectorWheelPaint.setStyle(Paint.Style.FILL);
mSelectorWheelPaint.setStrokeWidth(originalWidth);
- mSelectorWheelPaint.setAlpha(originalAlpha);
}
float left = x;
@@ -1661,7 +1620,6 @@ public class HorizontalNumberPicker extends LinearLayout {
*/
private void changeCurrentByOne(boolean increment) {
if (mFlingable) {
- mSelectorWheelPaint.setAlpha(SELECTOR_WHEEL_BRIGHT_ALPHA);
mPreviousScrollerY = 0;
mPreviousScrollerX = 0;
forceCompleteChangeCurrentByOneViaScroll();
@@ -1718,17 +1676,6 @@ public class HorizontalNumberPicker extends LinearLayout {
}
/**
- * Sets the <code>alpha</code> of the {@link Paint} for drawing the selector
- * wheel.
- */
- @SuppressWarnings("unused")
- // Called via reflection
- private void setSelectorPaintAlpha(int alpha) {
- mSelectorWheelPaint.setAlpha(alpha);
- invalidate();
- }
-
- /**
* @return If the <code>event</code> is in the visible <code>view</code>.
*/
private boolean isEventInVisibleViewHitRect(MotionEvent event, View view) {
@@ -1745,7 +1692,6 @@ public class HorizontalNumberPicker extends LinearLayout {
private void setSelectorWheelState(int selectorWheelState) {
mSelectorWheelState = selectorWheelState;
if (selectorWheelState == SELECTOR_WHEEL_STATE_LARGE) {
- mSelectorWheelPaint.setAlpha(SELECTOR_WHEEL_BRIGHT_ALPHA);
}
if (mFlingable && selectorWheelState == SELECTOR_WHEEL_STATE_LARGE