Loading java/com/android/dialer/voicemail/settings/RecordButton.java +14 −0 Original line number Diff line number Diff line Loading @@ -18,10 +18,12 @@ package com.android.dialer.voicemail.settings; import android.content.Context; import android.graphics.Canvas; import android.graphics.Color; import android.graphics.Paint; import android.graphics.Rect; import android.graphics.RectF; import android.graphics.drawable.Drawable; import android.graphics.drawable.LayerDrawable; import android.support.v4.content.ContextCompat; import android.util.AttributeSet; import android.widget.Button; Loading Loading @@ -94,6 +96,8 @@ public class RecordButton extends Button { recordedDrawable = ContextCompat.getDrawable(getContext(), R.drawable.start_playback_drawable); playingDrawable = ContextCompat.getDrawable(getContext(), R.drawable.stop_playback_drawable); fixQuantumIconTint(Color.WHITE); mainTrackPaint = getBasePaint(R.color.dialer_call_green); secondaryTrackPaint = getBasePaint(R.color.dialer_call_green); secondaryTrackPaint.setAlpha(secondaryTrackAlpha); Loading @@ -101,6 +105,16 @@ public class RecordButton extends Button { setState(RecordVoicemailGreetingActivity.RECORD_GREETING_INIT); } private void fixQuantumIconTint(int color) { Drawable playArrow = ((LayerDrawable) recordedDrawable).findDrawableByLayerId(R.id.play_icon); playArrow.mutate().setTint(color); ((LayerDrawable) recordedDrawable).setDrawableByLayerId(R.id.play_icon, playArrow); Drawable micIcon = ((LayerDrawable) readyDrawable).findDrawableByLayerId(R.id.record_icon); micIcon.mutate().setTint(color); ((LayerDrawable) readyDrawable).setDrawableByLayerId(R.id.record_icon, micIcon); } /** Returns Paint with base attributes for drawing the main and secondary tracks */ private Paint getBasePaint(int id) { Paint paint = new Paint(); Loading java/com/android/dialer/voicemail/settings/res/drawable/start_playback_drawable.xml +1 −0 Original line number Diff line number Diff line Loading @@ -21,6 +21,7 @@ </shape> </item> <item android:id="@+id/play_icon" android:top="24dp" android:bottom="24dp" android:left="24dp" Loading java/com/android/dialer/voicemail/settings/res/drawable/start_recording_drawable.xml +1 −0 Original line number Diff line number Diff line Loading @@ -21,6 +21,7 @@ </shape> </item> <item android:id="@+id/record_icon" android:top="24dp" android:bottom="24dp" android:left="24dp" Loading java/com/android/incallui/calllocation/impl/LocationHelper.java +8 −1 Original line number Diff line number Diff line Loading @@ -49,6 +49,7 @@ public class LocationHelper { public static final int LOCATION_STATUS_STALE = 2; public static final int LOCATION_STATUS_INACCURATE = 3; public static final int LOCATION_STATUS_NO_LOCATION = 4; public static final int LOCATION_STATUS_MOCK = 5; /** Possible return values for {@code checkLocation()} */ @IntDef({ Loading @@ -56,7 +57,8 @@ public class LocationHelper { LOCATION_STATUS_OK, LOCATION_STATUS_STALE, LOCATION_STATUS_INACCURATE, LOCATION_STATUS_NO_LOCATION LOCATION_STATUS_NO_LOCATION, LOCATION_STATUS_MOCK }) @Retention(RetentionPolicy.SOURCE) public @interface LocationStatus {} Loading Loading @@ -118,6 +120,11 @@ public class LocationHelper { return LOCATION_STATUS_INACCURATE; } if (location.isFromMockProvider()) { LogUtil.i("LocationHelper.checkLocation", "from mock provider"); return LOCATION_STATUS_MOCK; } return LOCATION_STATUS_OK; } Loading Loading
java/com/android/dialer/voicemail/settings/RecordButton.java +14 −0 Original line number Diff line number Diff line Loading @@ -18,10 +18,12 @@ package com.android.dialer.voicemail.settings; import android.content.Context; import android.graphics.Canvas; import android.graphics.Color; import android.graphics.Paint; import android.graphics.Rect; import android.graphics.RectF; import android.graphics.drawable.Drawable; import android.graphics.drawable.LayerDrawable; import android.support.v4.content.ContextCompat; import android.util.AttributeSet; import android.widget.Button; Loading Loading @@ -94,6 +96,8 @@ public class RecordButton extends Button { recordedDrawable = ContextCompat.getDrawable(getContext(), R.drawable.start_playback_drawable); playingDrawable = ContextCompat.getDrawable(getContext(), R.drawable.stop_playback_drawable); fixQuantumIconTint(Color.WHITE); mainTrackPaint = getBasePaint(R.color.dialer_call_green); secondaryTrackPaint = getBasePaint(R.color.dialer_call_green); secondaryTrackPaint.setAlpha(secondaryTrackAlpha); Loading @@ -101,6 +105,16 @@ public class RecordButton extends Button { setState(RecordVoicemailGreetingActivity.RECORD_GREETING_INIT); } private void fixQuantumIconTint(int color) { Drawable playArrow = ((LayerDrawable) recordedDrawable).findDrawableByLayerId(R.id.play_icon); playArrow.mutate().setTint(color); ((LayerDrawable) recordedDrawable).setDrawableByLayerId(R.id.play_icon, playArrow); Drawable micIcon = ((LayerDrawable) readyDrawable).findDrawableByLayerId(R.id.record_icon); micIcon.mutate().setTint(color); ((LayerDrawable) readyDrawable).setDrawableByLayerId(R.id.record_icon, micIcon); } /** Returns Paint with base attributes for drawing the main and secondary tracks */ private Paint getBasePaint(int id) { Paint paint = new Paint(); Loading
java/com/android/dialer/voicemail/settings/res/drawable/start_playback_drawable.xml +1 −0 Original line number Diff line number Diff line Loading @@ -21,6 +21,7 @@ </shape> </item> <item android:id="@+id/play_icon" android:top="24dp" android:bottom="24dp" android:left="24dp" Loading
java/com/android/dialer/voicemail/settings/res/drawable/start_recording_drawable.xml +1 −0 Original line number Diff line number Diff line Loading @@ -21,6 +21,7 @@ </shape> </item> <item android:id="@+id/record_icon" android:top="24dp" android:bottom="24dp" android:left="24dp" Loading
java/com/android/incallui/calllocation/impl/LocationHelper.java +8 −1 Original line number Diff line number Diff line Loading @@ -49,6 +49,7 @@ public class LocationHelper { public static final int LOCATION_STATUS_STALE = 2; public static final int LOCATION_STATUS_INACCURATE = 3; public static final int LOCATION_STATUS_NO_LOCATION = 4; public static final int LOCATION_STATUS_MOCK = 5; /** Possible return values for {@code checkLocation()} */ @IntDef({ Loading @@ -56,7 +57,8 @@ public class LocationHelper { LOCATION_STATUS_OK, LOCATION_STATUS_STALE, LOCATION_STATUS_INACCURATE, LOCATION_STATUS_NO_LOCATION LOCATION_STATUS_NO_LOCATION, LOCATION_STATUS_MOCK }) @Retention(RetentionPolicy.SOURCE) public @interface LocationStatus {} Loading Loading @@ -118,6 +120,11 @@ public class LocationHelper { return LOCATION_STATUS_INACCURATE; } if (location.isFromMockProvider()) { LogUtil.i("LocationHelper.checkLocation", "from mock provider"); return LOCATION_STATUS_MOCK; } return LOCATION_STATUS_OK; } Loading