Loading packages/SystemUI/plugin/src/com/android/systemui/plugins/IntentButtonProvider.java +1 −0 Original line number Diff line number Diff line Loading @@ -32,6 +32,7 @@ public interface IntentButtonProvider extends Plugin { public boolean isVisible = true; public CharSequence contentDescription = null; public Drawable drawable; public boolean tint = true; } public IconState getIcon(); Loading packages/SystemUI/res/layout/keyguard_bottom_area.xml +0 −2 Original line number Diff line number Diff line Loading @@ -66,7 +66,6 @@ android:layout_height="@dimen/keyguard_affordance_height" android:layout_width="@dimen/keyguard_affordance_width" android:layout_gravity="bottom|end" android:tint="#ffffffff" android:src="@drawable/ic_camera_alt_24dp" android:scaleType="center" android:contentDescription="@string/accessibility_camera_button" /> Loading @@ -76,7 +75,6 @@ android:layout_height="@dimen/keyguard_affordance_height" android:layout_width="@dimen/keyguard_affordance_width" android:layout_gravity="bottom|start" android:tint="#ffffffff" android:src="@drawable/ic_phone_24dp" android:scaleType="center" android:contentDescription="@string/accessibility_phone_button" /> Loading packages/SystemUI/src/com/android/systemui/statusbar/KeyguardAffordanceView.java +9 −0 Original line number Diff line number Diff line Loading @@ -21,6 +21,7 @@ import android.animation.AnimatorListenerAdapter; import android.animation.ArgbEvaluator; import android.animation.PropertyValuesHolder; import android.animation.ValueAnimator; import android.annotation.Nullable; import android.content.Context; import android.graphics.Canvas; import android.graphics.CanvasProperty; Loading Loading @@ -78,6 +79,7 @@ public class KeyguardAffordanceView extends ImageView { private boolean mSupportHardware; private boolean mFinishing; private boolean mLaunchingAffordance; private boolean mShouldTint = true; private CanvasProperty<Float> mHwCircleRadius; private CanvasProperty<Float> mHwCenterX; Loading Loading @@ -137,6 +139,12 @@ public class KeyguardAffordanceView extends ImageView { mFlingAnimationUtils = new FlingAnimationUtils(mContext, 0.3f); } public void setImageDrawable(@Nullable Drawable drawable, boolean tint) { super.setImageDrawable(drawable); mShouldTint = tint; updateIconColor(); } @Override protected void onLayout(boolean changed, int left, int top, int right, int bottom) { super.onLayout(changed, left, top, right, bottom); Loading Loading @@ -165,6 +173,7 @@ public class KeyguardAffordanceView extends ImageView { } private void updateIconColor() { if (!mShouldTint) return; Drawable drawable = getDrawable().mutate(); float alpha = mCircleRadius / mMinBackgroundRadius; alpha = Math.min(1.0f, alpha); Loading packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardBottomAreaView.java +2 −2 Original line number Diff line number Diff line Loading @@ -324,7 +324,7 @@ public class KeyguardBottomAreaView extends FrameLayout implements View.OnClickL private void updateRightAffordanceIcon() { IconState state = mRightButton.getIcon(); mRightAffordanceView.setVisibility(state.isVisible ? View.VISIBLE : View.GONE); mRightAffordanceView.setImageDrawable(state.drawable); mRightAffordanceView.setImageDrawable(state.drawable, state.tint); mRightAffordanceView.setContentDescription(state.contentDescription); } Loading Loading @@ -376,7 +376,7 @@ public class KeyguardBottomAreaView extends FrameLayout implements View.OnClickL private void updateLeftAffordanceIcon() { IconState state = mLeftButton.getIcon(); mLeftAffordanceView.setVisibility(state.isVisible ? View.VISIBLE : View.GONE); mLeftAffordanceView.setImageDrawable(state.drawable); mLeftAffordanceView.setImageDrawable(state.drawable, state.tint); mLeftAffordanceView.setContentDescription(state.contentDescription); } Loading packages/SystemUI/src/com/android/systemui/tuner/LockscreenFragment.java +17 −2 Original line number Diff line number Diff line Loading @@ -26,6 +26,7 @@ import android.content.pm.LauncherApps.ShortcutQuery; import android.content.pm.PackageManager.NameNotFoundException; import android.content.pm.ShortcutInfo; import android.graphics.drawable.Drawable; import android.graphics.drawable.ScaleDrawable; import android.os.Bundle; import android.os.Handler; import android.os.Process; Loading @@ -37,6 +38,9 @@ import android.support.v7.widget.LinearLayoutManager; import android.support.v7.widget.RecyclerView; import android.support.v7.widget.RecyclerView.ViewHolder; import android.text.TextUtils; import android.util.Log; import android.util.TypedValue; import android.view.Gravity; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; Loading @@ -46,6 +50,7 @@ import android.widget.TextView; import com.android.systemui.Dependency; import com.android.systemui.R; import com.android.systemui.plugins.IntentButtonProvider.IntentButton; import com.android.systemui.statusbar.ScalingDrawableWrapper; import com.android.systemui.statusbar.phone.ExpandableIndicator; import com.android.systemui.tuner.ShortcutParser.Shortcut; import com.android.systemui.tuner.TunerService.Tunable; Loading Loading @@ -365,8 +370,13 @@ public class LockscreenFragment extends PreferenceFragment { mShortcut = shortcut; mIconState = new IconState(); mIconState.isVisible = true; mIconState.drawable = shortcut.icon.loadDrawable(context); mIconState.drawable = shortcut.icon.loadDrawable(context).mutate(); mIconState.contentDescription = mShortcut.label; int size = (int) TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, 32, context.getResources().getDisplayMetrics()); mIconState.drawable = new ScalingDrawableWrapper(mIconState.drawable, size / (float) mIconState.drawable.getIntrinsicWidth()); mIconState.tint = false; } @Override Loading @@ -388,8 +398,13 @@ public class LockscreenFragment extends PreferenceFragment { mIntent = new Intent().setComponent(new ComponentName(info.packageName, info.name)); mIconState = new IconState(); mIconState.isVisible = true; mIconState.drawable = info.loadIcon(context.getPackageManager()); mIconState.drawable = info.loadIcon(context.getPackageManager()).mutate(); mIconState.contentDescription = info.loadLabel(context.getPackageManager()); int size = (int) TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, 32, context.getResources().getDisplayMetrics()); mIconState.drawable = new ScalingDrawableWrapper(mIconState.drawable, size / (float) mIconState.drawable.getIntrinsicWidth()); mIconState.tint = false; } @Override Loading Loading
packages/SystemUI/plugin/src/com/android/systemui/plugins/IntentButtonProvider.java +1 −0 Original line number Diff line number Diff line Loading @@ -32,6 +32,7 @@ public interface IntentButtonProvider extends Plugin { public boolean isVisible = true; public CharSequence contentDescription = null; public Drawable drawable; public boolean tint = true; } public IconState getIcon(); Loading
packages/SystemUI/res/layout/keyguard_bottom_area.xml +0 −2 Original line number Diff line number Diff line Loading @@ -66,7 +66,6 @@ android:layout_height="@dimen/keyguard_affordance_height" android:layout_width="@dimen/keyguard_affordance_width" android:layout_gravity="bottom|end" android:tint="#ffffffff" android:src="@drawable/ic_camera_alt_24dp" android:scaleType="center" android:contentDescription="@string/accessibility_camera_button" /> Loading @@ -76,7 +75,6 @@ android:layout_height="@dimen/keyguard_affordance_height" android:layout_width="@dimen/keyguard_affordance_width" android:layout_gravity="bottom|start" android:tint="#ffffffff" android:src="@drawable/ic_phone_24dp" android:scaleType="center" android:contentDescription="@string/accessibility_phone_button" /> Loading
packages/SystemUI/src/com/android/systemui/statusbar/KeyguardAffordanceView.java +9 −0 Original line number Diff line number Diff line Loading @@ -21,6 +21,7 @@ import android.animation.AnimatorListenerAdapter; import android.animation.ArgbEvaluator; import android.animation.PropertyValuesHolder; import android.animation.ValueAnimator; import android.annotation.Nullable; import android.content.Context; import android.graphics.Canvas; import android.graphics.CanvasProperty; Loading Loading @@ -78,6 +79,7 @@ public class KeyguardAffordanceView extends ImageView { private boolean mSupportHardware; private boolean mFinishing; private boolean mLaunchingAffordance; private boolean mShouldTint = true; private CanvasProperty<Float> mHwCircleRadius; private CanvasProperty<Float> mHwCenterX; Loading Loading @@ -137,6 +139,12 @@ public class KeyguardAffordanceView extends ImageView { mFlingAnimationUtils = new FlingAnimationUtils(mContext, 0.3f); } public void setImageDrawable(@Nullable Drawable drawable, boolean tint) { super.setImageDrawable(drawable); mShouldTint = tint; updateIconColor(); } @Override protected void onLayout(boolean changed, int left, int top, int right, int bottom) { super.onLayout(changed, left, top, right, bottom); Loading Loading @@ -165,6 +173,7 @@ public class KeyguardAffordanceView extends ImageView { } private void updateIconColor() { if (!mShouldTint) return; Drawable drawable = getDrawable().mutate(); float alpha = mCircleRadius / mMinBackgroundRadius; alpha = Math.min(1.0f, alpha); Loading
packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardBottomAreaView.java +2 −2 Original line number Diff line number Diff line Loading @@ -324,7 +324,7 @@ public class KeyguardBottomAreaView extends FrameLayout implements View.OnClickL private void updateRightAffordanceIcon() { IconState state = mRightButton.getIcon(); mRightAffordanceView.setVisibility(state.isVisible ? View.VISIBLE : View.GONE); mRightAffordanceView.setImageDrawable(state.drawable); mRightAffordanceView.setImageDrawable(state.drawable, state.tint); mRightAffordanceView.setContentDescription(state.contentDescription); } Loading Loading @@ -376,7 +376,7 @@ public class KeyguardBottomAreaView extends FrameLayout implements View.OnClickL private void updateLeftAffordanceIcon() { IconState state = mLeftButton.getIcon(); mLeftAffordanceView.setVisibility(state.isVisible ? View.VISIBLE : View.GONE); mLeftAffordanceView.setImageDrawable(state.drawable); mLeftAffordanceView.setImageDrawable(state.drawable, state.tint); mLeftAffordanceView.setContentDescription(state.contentDescription); } Loading
packages/SystemUI/src/com/android/systemui/tuner/LockscreenFragment.java +17 −2 Original line number Diff line number Diff line Loading @@ -26,6 +26,7 @@ import android.content.pm.LauncherApps.ShortcutQuery; import android.content.pm.PackageManager.NameNotFoundException; import android.content.pm.ShortcutInfo; import android.graphics.drawable.Drawable; import android.graphics.drawable.ScaleDrawable; import android.os.Bundle; import android.os.Handler; import android.os.Process; Loading @@ -37,6 +38,9 @@ import android.support.v7.widget.LinearLayoutManager; import android.support.v7.widget.RecyclerView; import android.support.v7.widget.RecyclerView.ViewHolder; import android.text.TextUtils; import android.util.Log; import android.util.TypedValue; import android.view.Gravity; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; Loading @@ -46,6 +50,7 @@ import android.widget.TextView; import com.android.systemui.Dependency; import com.android.systemui.R; import com.android.systemui.plugins.IntentButtonProvider.IntentButton; import com.android.systemui.statusbar.ScalingDrawableWrapper; import com.android.systemui.statusbar.phone.ExpandableIndicator; import com.android.systemui.tuner.ShortcutParser.Shortcut; import com.android.systemui.tuner.TunerService.Tunable; Loading Loading @@ -365,8 +370,13 @@ public class LockscreenFragment extends PreferenceFragment { mShortcut = shortcut; mIconState = new IconState(); mIconState.isVisible = true; mIconState.drawable = shortcut.icon.loadDrawable(context); mIconState.drawable = shortcut.icon.loadDrawable(context).mutate(); mIconState.contentDescription = mShortcut.label; int size = (int) TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, 32, context.getResources().getDisplayMetrics()); mIconState.drawable = new ScalingDrawableWrapper(mIconState.drawable, size / (float) mIconState.drawable.getIntrinsicWidth()); mIconState.tint = false; } @Override Loading @@ -388,8 +398,13 @@ public class LockscreenFragment extends PreferenceFragment { mIntent = new Intent().setComponent(new ComponentName(info.packageName, info.name)); mIconState = new IconState(); mIconState.isVisible = true; mIconState.drawable = info.loadIcon(context.getPackageManager()); mIconState.drawable = info.loadIcon(context.getPackageManager()).mutate(); mIconState.contentDescription = info.loadLabel(context.getPackageManager()); int size = (int) TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, 32, context.getResources().getDisplayMetrics()); mIconState.drawable = new ScalingDrawableWrapper(mIconState.drawable, size / (float) mIconState.drawable.getIntrinsicWidth()); mIconState.tint = false; } @Override Loading