summaryrefslogtreecommitdiffstats
path: root/fmapp2/src/com
diff options
context:
space:
mode:
Diffstat (limited to 'fmapp2/src/com')
-rw-r--r--fmapp2/src/com/caf/fmradio/FMRadio.java23
-rw-r--r--fmapp2/src/com/caf/fmradio/FMTransmitterActivity.java13
-rw-r--r--fmapp2/src/com/caf/fmradio/HorizontalNumberPicker.java52
3 files changed, 15 insertions, 73 deletions
diff --git a/fmapp2/src/com/caf/fmradio/FMRadio.java b/fmapp2/src/com/caf/fmradio/FMRadio.java
index 6c35dd8..92f1019 100644
--- a/fmapp2/src/com/caf/fmradio/FMRadio.java
+++ b/fmapp2/src/com/caf/fmradio/FMRadio.java
@@ -225,6 +225,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;
@@ -355,6 +357,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);
@@ -1875,6 +1879,7 @@ public class FMRadio extends Activity
setMuteModeButtonImage(false);
}
if (bEnable) {
+ mFmSeeker.setVisibility(View.VISIBLE);
if (mRadioTextScroller != null) {
mRadioTextScroller.startScroll();
}
@@ -1899,6 +1904,7 @@ public class FMRadio extends Activity
}
}
}else {
+ mFmSeeker.setVisibility(View.INVISIBLE);
if (mRadioTextScroller != null) {
mRadioTextScroller.stopScroll();
}
@@ -1907,7 +1913,7 @@ public class FMRadio extends Activity
}
for (int nButton = 0; nButton < MAX_PRESETS_PER_PAGE; nButton++) {
if (mPresetButtons[nButton] != null) {
- mPresetButtons[nButton].setTextColor(Color.BLACK);
+ mPresetButtons[nButton].setTextColor(Color.WHITE);
}
}
}
@@ -1943,10 +1949,6 @@ public class FMRadio extends Activity
mRecordingMsgTV.setVisibility(((bEnable == true) ? View.VISIBLE
: View.GONE));
}
- if (mRadioTextTV != null) {
- mRadioTextTV.setVisibility(((bEnable == true) ? View.VISIBLE
- : View.GONE));
- }
if(mERadioTextTV != null) {
mERadioTextTV.setVisibility(((bEnable == true) ? View.VISIBLE
: View.GONE));
@@ -1967,8 +1969,8 @@ public class FMRadio extends Activity
}
}else if (isCallActive()) {
if (mRadioTextTV != null) {
- mRadioTextTV.setText("");
- mRadioTextScroller.mOriginalString = "";
+ mRadioTextTV.setText(getString(R.string.fm_call));
+ mRadioTextScroller.mOriginalString = getString(R.string.fm_call);
}
if (mERadioTextTV != null) {
mERadioTextTV.setText("");
@@ -1980,7 +1982,7 @@ public class FMRadio extends Activity
}
}else {
if (mRadioTextTV != null) {
- mRadioTextTV.setText("");
+ mRadioTextTV.setText(getString(R.string.fm_off));
mRadioTextScroller.mOriginalString = "";
}
if (mERadioTextTV != null) {
@@ -2115,7 +2117,6 @@ public class FMRadio extends Activity
mRadioTextTV.setText("");
mERadioTextTV.setText("");
mERadioTextTV.setVisibility(View.GONE);
- mRadioTextTV.setVisibility(View.GONE);
mRadioTextScroller.mOriginalString = "";
mRadioTextScroller.mStringlength = 0;
mRadioTextScroller.mIteration = 0;
@@ -2611,7 +2612,7 @@ public class FMRadio extends Activity
mTunedStation.setPI(0);
mTunedStation.setRDSSupported(false);
mTunedStation.setPty(0);
- mRadioTextTV.setText("");
+ mRadioTextTV.setText(getString(R.string.fm_off));
mERadioTextTV.setText("");
mRadioTextScroller.mOriginalString = "";
mProgramServiceTV.setText("");
@@ -2717,7 +2718,7 @@ public class FMRadio extends Activity
mRadioTextScroller.mOriginalString = str;
}else if(TextUtils.isEmpty(str)) { /* Rest the string to empty*/
mRadioTextTV.setText("");
- mRadioTextScroller.mOriginalString = "";
+ mRadioTextScroller.mOriginalString = getString(R.string.fm_off);
}else {
//Log.d(LOGTAG, "mUpdateRadioText: Leaving old string " + mRadioTextTV.getText());
}
diff --git a/fmapp2/src/com/caf/fmradio/FMTransmitterActivity.java b/fmapp2/src/com/caf/fmradio/FMTransmitterActivity.java
index 9222eea..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)) {
@@ -937,10 +933,6 @@ public class FMTransmitterActivity extends Activity {
mTuneStationFrequencyTV.setVisibility(((bEnable == true) ? View.VISIBLE
: View.INVISIBLE));
}
- if(mRadioTextTV != null) {
- mRadioTextTV.setVisibility(((bEnable == true) ? View.VISIBLE
- : View.INVISIBLE));
- }
if(mPicker != null) {
mPicker.setVisibility(
bEnable ? View.VISIBLE : View.INVISIBLE );
@@ -960,7 +952,7 @@ public class FMTransmitterActivity extends Activity {
Log.d(LOGTAG,"call active");
if(mRadioTextTV != null) {
mRadioTextTV.setVisibility(View.VISIBLE);
- mRadioTextTV.setText(getString(R.string.msg_callactive));
+ mRadioTextTV.setText(getString(R.string.fm_call));
}
if(mOnOffButton != null) {
mOnOffButton.setEnabled(false);
@@ -976,7 +968,8 @@ public class FMTransmitterActivity extends Activity {
}else {
Log.d(LOGTAG,"Service null");
if(mRadioTextTV != null) {
- mRadioTextTV.setText("");
+ mRadioTextTV.setVisibility(View.VISIBLE);
+ mRadioTextTV.setText(getString(R.string.fm_off));
}
if(mOnOffButton != null) {
mOnOffButton.setEnabled(true);
diff --git a/fmapp2/src/com/caf/fmradio/HorizontalNumberPicker.java b/fmapp2/src/com/caf/fmradio/HorizontalNumberPicker.java
index 53ff9ce..d93fb50 100644
--- a/fmapp2/src/com/caf/fmradio/HorizontalNumberPicker.java
+++ b/fmapp2/src/com/caf/fmradio/HorizontalNumberPicker.java
@@ -138,35 +138,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}
@@ -344,10 +315,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 +777,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 +1459,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 +1485,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 +1621,6 @@ public class HorizontalNumberPicker extends LinearLayout {
*/
private void changeCurrentByOne(boolean increment) {
if (mFlingable) {
- mSelectorWheelPaint.setAlpha(SELECTOR_WHEEL_BRIGHT_ALPHA);
mPreviousScrollerY = 0;
mPreviousScrollerX = 0;
forceCompleteChangeCurrentByOneViaScroll();
@@ -1717,16 +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>.
@@ -1745,7 +1694,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