Loading src/com/android/settings/fuelgauge/BatteryMeterView.java +6 −10 Original line number Diff line number Diff line Loading @@ -19,8 +19,6 @@ package com.android.settings.fuelgauge; import android.annotation.Nullable; import android.content.Context; import android.graphics.ColorFilter; import android.graphics.PorterDuff; import android.graphics.PorterDuffColorFilter; import android.util.AttributeSet; import android.widget.ImageView; Loading Loading @@ -52,14 +50,12 @@ public class BatteryMeterView extends ImageView { super(context, attrs, defStyleAttr); final int frameColor = context.getColor(R.color.meter_background_color); mAccentColorFilter = new PorterDuffColorFilter( Utils.getColorAttrDefaultColor(context, android.R.attr.colorAccent), PorterDuff.Mode.SRC); mErrorColorFilter = new PorterDuffColorFilter( context.getColor(R.color.battery_icon_color_error), PorterDuff.Mode.SRC_IN); mForegroundColorFilter =new PorterDuffColorFilter( Utils.getColorAttrDefaultColor(context, android.R.attr.colorForeground), PorterDuff.Mode.SRC); mAccentColorFilter = Utils.getAlphaInvariantColorFilterForColor( Utils.getColorAttrDefaultColor(context, android.R.attr.colorAccent)); mErrorColorFilter = Utils.getAlphaInvariantColorFilterForColor( context.getColor(R.color.battery_icon_color_error)); mForegroundColorFilter = Utils.getAlphaInvariantColorFilterForColor( Utils.getColorAttrDefaultColor(context, android.R.attr.colorForeground)); mDrawable = new BatteryMeterDrawable(context, frameColor); mDrawable.setColorFilter(mAccentColorFilter); setImageDrawable(mDrawable); Loading Loading
src/com/android/settings/fuelgauge/BatteryMeterView.java +6 −10 Original line number Diff line number Diff line Loading @@ -19,8 +19,6 @@ package com.android.settings.fuelgauge; import android.annotation.Nullable; import android.content.Context; import android.graphics.ColorFilter; import android.graphics.PorterDuff; import android.graphics.PorterDuffColorFilter; import android.util.AttributeSet; import android.widget.ImageView; Loading Loading @@ -52,14 +50,12 @@ public class BatteryMeterView extends ImageView { super(context, attrs, defStyleAttr); final int frameColor = context.getColor(R.color.meter_background_color); mAccentColorFilter = new PorterDuffColorFilter( Utils.getColorAttrDefaultColor(context, android.R.attr.colorAccent), PorterDuff.Mode.SRC); mErrorColorFilter = new PorterDuffColorFilter( context.getColor(R.color.battery_icon_color_error), PorterDuff.Mode.SRC_IN); mForegroundColorFilter =new PorterDuffColorFilter( Utils.getColorAttrDefaultColor(context, android.R.attr.colorForeground), PorterDuff.Mode.SRC); mAccentColorFilter = Utils.getAlphaInvariantColorFilterForColor( Utils.getColorAttrDefaultColor(context, android.R.attr.colorAccent)); mErrorColorFilter = Utils.getAlphaInvariantColorFilterForColor( context.getColor(R.color.battery_icon_color_error)); mForegroundColorFilter = Utils.getAlphaInvariantColorFilterForColor( Utils.getColorAttrDefaultColor(context, android.R.attr.colorForeground)); mDrawable = new BatteryMeterDrawable(context, frameColor); mDrawable.setColorFilter(mAccentColorFilter); setImageDrawable(mDrawable); Loading