Loading core/res/res/values-land/dimens.xml +1 −4 Original line number Diff line number Diff line Loading @@ -29,10 +29,7 @@ <!-- Height of the status bar --> <dimen name="status_bar_height">@dimen/status_bar_height_landscape</dimen> <!-- Height of area above QQS where battery/time go --> <dimen name="quick_qs_offset_height">@dimen/status_bar_height_landscape</dimen> <!-- Total height of QQS in landscape, this is effectively status_bar_height_landscape + 128 --> <dimen name="quick_qs_total_height">152dp</dimen> <!-- Default height of an action bar. --> <dimen name="action_bar_default_height">40dip</dimen> <!-- Vertical padding around action bar icons. --> Loading core/res/res/values/symbols.xml +0 −1 Original line number Diff line number Diff line Loading @@ -1670,7 +1670,6 @@ <java-symbol type="dimen" name="navigation_bar_height_landscape_car_mode" /> <java-symbol type="dimen" name="navigation_bar_width_car_mode" /> <java-symbol type="dimen" name="status_bar_height" /> <java-symbol type="dimen" name="quick_qs_offset_height" /> <java-symbol type="dimen" name="quick_qs_total_height" /> <java-symbol type="drawable" name="ic_jog_dial_sound_off" /> <java-symbol type="drawable" name="ic_jog_dial_sound_on" /> Loading packages/SystemUI/res/layout/quick_status_bar_header_system_icons.xml +12 −9 Original line number Diff line number Diff line Loading @@ -31,23 +31,25 @@ <com.android.systemui.statusbar.policy.Clock android:id="@+id/clock" android:textAppearance="@style/TextAppearance.StatusBar.Clock" android:layout_width="wrap_content" android:layout_height="match_parent" android:gravity="center_vertical|start" android:singleLine="true" android:paddingStart="@dimen/status_bar_left_clock_starting_padding" android:paddingEnd="@dimen/status_bar_left_clock_end_padding" android:singleLine="true" android:textAppearance="@style/TextAppearance.StatusBar.Clock" systemui:showDark="false" /> android:gravity="center_vertical|start" systemui:showDark="false" /> <com.android.systemui.statusbar.policy.DateView android:id="@+id/date" android:layout_width="wrap_content" android:layout_height="wrap_content" android:gravity="center_vertical" android:padding="4dp" android:singleLine="true" android:textAppearance="@style/TextAppearance.StatusBar.Expanded.Date" android:textSize="@dimen/qs_time_collapsed_size" android:gravity="center_vertical" systemui:datePattern="@string/abbrev_wday_month_day_no_year_alarm" /> <android.widget.Space Loading @@ -55,11 +57,12 @@ android:layout_width="0dp" android:layout_height="match_parent" android:layout_weight="1" android:gravity="center_vertical|center_horizontal" /> android:gravity="center_vertical|center_horizontal" /> <com.android.systemui.BatteryMeterView android:id="@+id/battery" <com.android.systemui.BatteryMeterView android:id="@+id/battery" android:layout_height="match_parent" android:layout_width="wrap_content" android:gravity="center_vertical|end" /> android:gravity="center_vertical|end" /> </LinearLayout> packages/SystemUI/src/com/android/systemui/BatteryMeterView.java +10 −46 Original line number Diff line number Diff line Loading @@ -81,14 +81,6 @@ public class BatteryMeterView extends LinearLayout implements private float mDarkIntensity; private int mUser; /** * Whether we should use colors that adapt based on wallpaper/the scrim behind quick settings. */ private boolean mUseWallpaperTextColors; private int mNonAdaptedForegroundColor; private int mNonAdaptedBackgroundColor; public BatteryMeterView(Context context) { this(context, null, 0); } Loading Loading @@ -148,29 +140,6 @@ public class BatteryMeterView extends LinearLayout implements updateShowPercent(); } /** * Sets whether the battery meter view uses the wallpaperTextColor. If we're not using it, we'll * revert back to dark-mode-based/tinted colors. * * @param shouldUseWallpaperTextColor whether we should use wallpaperTextColor for all * components */ public void useWallpaperTextColor(boolean shouldUseWallpaperTextColor) { if (shouldUseWallpaperTextColor == mUseWallpaperTextColors) { return; } mUseWallpaperTextColors = shouldUseWallpaperTextColor; if (mUseWallpaperTextColors) { updateColors( Utils.getColorAttr(mContext, R.attr.wallpaperTextColor), Utils.getColorAttr(mContext, R.attr.wallpaperTextColorSecondary)); } else { updateColors(mNonAdaptedForegroundColor, mNonAdaptedBackgroundColor); } } public void setColorsFromContext(Context context) { if (context == null) { return; Loading Loading @@ -210,8 +179,7 @@ public class BatteryMeterView extends LinearLayout implements getContext().getContentResolver().registerContentObserver( Settings.System.getUriFor(SHOW_BATTERY_PERCENT), false, mSettingObserver, mUser); updateShowPercent(); Dependency.get(TunerService.class) .addTunable(this, StatusBarIconController.ICON_BLACKLIST); Dependency.get(TunerService.class).addTunable(this, StatusBarIconController.ICON_BLACKLIST); Dependency.get(ConfigurationController.class).addCallback(this); mUserTracker.startTracking(); } Loading Loading @@ -305,23 +273,19 @@ public class BatteryMeterView extends LinearLayout implements @Override public void onDarkChanged(Rect area, float darkIntensity, int tint) { mDarkIntensity = darkIntensity; float intensity = DarkIconDispatcher.isInArea(area, this) ? darkIntensity : 0; mNonAdaptedForegroundColor = getColorForDarkIntensity( intensity, mLightModeFillColor, mDarkModeFillColor); mNonAdaptedBackgroundColor = getColorForDarkIntensity( intensity, mLightModeBackgroundColor,mDarkModeBackgroundColor); if (!mUseWallpaperTextColors) { updateColors(mNonAdaptedForegroundColor, mNonAdaptedBackgroundColor); } int foreground = getColorForDarkIntensity(intensity, mLightModeFillColor, mDarkModeFillColor); int background = getColorForDarkIntensity(intensity, mLightModeBackgroundColor, mDarkModeBackgroundColor); mDrawable.setColors(foreground, background); setTextColor(foreground); } private void updateColors(int foregroundColor, int backgroundColor) { mDrawable.setColors(foregroundColor, backgroundColor); mTextColor = foregroundColor; public void setTextColor(int color) { mTextColor = color; if (mBatteryPercentView != null) { mBatteryPercentView.setTextColor(foregroundColor); mBatteryPercentView.setTextColor(color); } } Loading packages/SystemUI/src/com/android/systemui/qs/QSContainerImpl.java +3 −31 Original line number Diff line number Diff line Loading @@ -18,15 +18,17 @@ package com.android.systemui.qs; import android.content.Context; import android.content.res.Configuration; import android.graphics.Canvas; import android.graphics.Path; import android.graphics.Point; import android.util.AttributeSet; import android.util.Log; import android.view.View; import android.widget.FrameLayout; import com.android.settingslib.Utils; import com.android.systemui.R; import com.android.systemui.qs.customize.QSCustomizer; import com.android.systemui.statusbar.ExpandableOutlineView; /** * Wrapper view with background which contains {@link QSPanel} and {@link BaseStatusBarHeader} Loading @@ -42,11 +44,7 @@ public class QSContainerImpl extends FrameLayout { protected float mQsExpansion; private QSCustomizer mQSCustomizer; private View mQSFooter; private View mBackground; private View mBackgroundGradient; private View mStatusBarBackground; private int mSideMargins; public QSContainerImpl(Context context, AttributeSet attrs) { Loading @@ -62,8 +60,6 @@ public class QSContainerImpl extends FrameLayout { mQSCustomizer = findViewById(R.id.qs_customize); mQSFooter = findViewById(R.id.qs_footer); mBackground = findViewById(R.id.quick_settings_background); mStatusBarBackground = findViewById(R.id.quick_settings_status_bar_background); mBackgroundGradient = findViewById(R.id.quick_settings_gradient_view); mSideMargins = getResources().getDimensionPixelSize(R.dimen.notification_side_paddings); setClickable(true); Loading @@ -71,22 +67,6 @@ public class QSContainerImpl extends FrameLayout { setMargins(); } @Override protected void onConfigurationChanged(Configuration newConfig) { super.onConfigurationChanged(newConfig); // Hide the backgrounds when in landscape mode. if (newConfig.orientation == Configuration.ORIENTATION_LANDSCAPE) { mBackgroundGradient.setVisibility(View.INVISIBLE); mStatusBarBackground.setVisibility(View.INVISIBLE); } else { mBackgroundGradient.setVisibility(View.VISIBLE); mStatusBarBackground.setVisibility(View.VISIBLE); } updateResources(); } @Override public boolean performClick() { // Want to receive clicks so missing QQS tiles doesn't cause collapse, but Loading Loading @@ -121,14 +101,6 @@ public class QSContainerImpl extends FrameLayout { updateExpansion(); } private void updateResources() { LayoutParams layoutParams = (LayoutParams) mQSPanel.getLayoutParams(); layoutParams.topMargin = mContext.getResources().getDimensionPixelSize( com.android.internal.R.dimen.quick_qs_offset_height); mQSPanel.setLayoutParams(layoutParams); } /** * Overrides the height of this view (post-layout), so that the content is clipped to that * height and the background is set to that height. Loading Loading
core/res/res/values-land/dimens.xml +1 −4 Original line number Diff line number Diff line Loading @@ -29,10 +29,7 @@ <!-- Height of the status bar --> <dimen name="status_bar_height">@dimen/status_bar_height_landscape</dimen> <!-- Height of area above QQS where battery/time go --> <dimen name="quick_qs_offset_height">@dimen/status_bar_height_landscape</dimen> <!-- Total height of QQS in landscape, this is effectively status_bar_height_landscape + 128 --> <dimen name="quick_qs_total_height">152dp</dimen> <!-- Default height of an action bar. --> <dimen name="action_bar_default_height">40dip</dimen> <!-- Vertical padding around action bar icons. --> Loading
core/res/res/values/symbols.xml +0 −1 Original line number Diff line number Diff line Loading @@ -1670,7 +1670,6 @@ <java-symbol type="dimen" name="navigation_bar_height_landscape_car_mode" /> <java-symbol type="dimen" name="navigation_bar_width_car_mode" /> <java-symbol type="dimen" name="status_bar_height" /> <java-symbol type="dimen" name="quick_qs_offset_height" /> <java-symbol type="dimen" name="quick_qs_total_height" /> <java-symbol type="drawable" name="ic_jog_dial_sound_off" /> <java-symbol type="drawable" name="ic_jog_dial_sound_on" /> Loading
packages/SystemUI/res/layout/quick_status_bar_header_system_icons.xml +12 −9 Original line number Diff line number Diff line Loading @@ -31,23 +31,25 @@ <com.android.systemui.statusbar.policy.Clock android:id="@+id/clock" android:textAppearance="@style/TextAppearance.StatusBar.Clock" android:layout_width="wrap_content" android:layout_height="match_parent" android:gravity="center_vertical|start" android:singleLine="true" android:paddingStart="@dimen/status_bar_left_clock_starting_padding" android:paddingEnd="@dimen/status_bar_left_clock_end_padding" android:singleLine="true" android:textAppearance="@style/TextAppearance.StatusBar.Clock" systemui:showDark="false" /> android:gravity="center_vertical|start" systemui:showDark="false" /> <com.android.systemui.statusbar.policy.DateView android:id="@+id/date" android:layout_width="wrap_content" android:layout_height="wrap_content" android:gravity="center_vertical" android:padding="4dp" android:singleLine="true" android:textAppearance="@style/TextAppearance.StatusBar.Expanded.Date" android:textSize="@dimen/qs_time_collapsed_size" android:gravity="center_vertical" systemui:datePattern="@string/abbrev_wday_month_day_no_year_alarm" /> <android.widget.Space Loading @@ -55,11 +57,12 @@ android:layout_width="0dp" android:layout_height="match_parent" android:layout_weight="1" android:gravity="center_vertical|center_horizontal" /> android:gravity="center_vertical|center_horizontal" /> <com.android.systemui.BatteryMeterView android:id="@+id/battery" <com.android.systemui.BatteryMeterView android:id="@+id/battery" android:layout_height="match_parent" android:layout_width="wrap_content" android:gravity="center_vertical|end" /> android:gravity="center_vertical|end" /> </LinearLayout>
packages/SystemUI/src/com/android/systemui/BatteryMeterView.java +10 −46 Original line number Diff line number Diff line Loading @@ -81,14 +81,6 @@ public class BatteryMeterView extends LinearLayout implements private float mDarkIntensity; private int mUser; /** * Whether we should use colors that adapt based on wallpaper/the scrim behind quick settings. */ private boolean mUseWallpaperTextColors; private int mNonAdaptedForegroundColor; private int mNonAdaptedBackgroundColor; public BatteryMeterView(Context context) { this(context, null, 0); } Loading Loading @@ -148,29 +140,6 @@ public class BatteryMeterView extends LinearLayout implements updateShowPercent(); } /** * Sets whether the battery meter view uses the wallpaperTextColor. If we're not using it, we'll * revert back to dark-mode-based/tinted colors. * * @param shouldUseWallpaperTextColor whether we should use wallpaperTextColor for all * components */ public void useWallpaperTextColor(boolean shouldUseWallpaperTextColor) { if (shouldUseWallpaperTextColor == mUseWallpaperTextColors) { return; } mUseWallpaperTextColors = shouldUseWallpaperTextColor; if (mUseWallpaperTextColors) { updateColors( Utils.getColorAttr(mContext, R.attr.wallpaperTextColor), Utils.getColorAttr(mContext, R.attr.wallpaperTextColorSecondary)); } else { updateColors(mNonAdaptedForegroundColor, mNonAdaptedBackgroundColor); } } public void setColorsFromContext(Context context) { if (context == null) { return; Loading Loading @@ -210,8 +179,7 @@ public class BatteryMeterView extends LinearLayout implements getContext().getContentResolver().registerContentObserver( Settings.System.getUriFor(SHOW_BATTERY_PERCENT), false, mSettingObserver, mUser); updateShowPercent(); Dependency.get(TunerService.class) .addTunable(this, StatusBarIconController.ICON_BLACKLIST); Dependency.get(TunerService.class).addTunable(this, StatusBarIconController.ICON_BLACKLIST); Dependency.get(ConfigurationController.class).addCallback(this); mUserTracker.startTracking(); } Loading Loading @@ -305,23 +273,19 @@ public class BatteryMeterView extends LinearLayout implements @Override public void onDarkChanged(Rect area, float darkIntensity, int tint) { mDarkIntensity = darkIntensity; float intensity = DarkIconDispatcher.isInArea(area, this) ? darkIntensity : 0; mNonAdaptedForegroundColor = getColorForDarkIntensity( intensity, mLightModeFillColor, mDarkModeFillColor); mNonAdaptedBackgroundColor = getColorForDarkIntensity( intensity, mLightModeBackgroundColor,mDarkModeBackgroundColor); if (!mUseWallpaperTextColors) { updateColors(mNonAdaptedForegroundColor, mNonAdaptedBackgroundColor); } int foreground = getColorForDarkIntensity(intensity, mLightModeFillColor, mDarkModeFillColor); int background = getColorForDarkIntensity(intensity, mLightModeBackgroundColor, mDarkModeBackgroundColor); mDrawable.setColors(foreground, background); setTextColor(foreground); } private void updateColors(int foregroundColor, int backgroundColor) { mDrawable.setColors(foregroundColor, backgroundColor); mTextColor = foregroundColor; public void setTextColor(int color) { mTextColor = color; if (mBatteryPercentView != null) { mBatteryPercentView.setTextColor(foregroundColor); mBatteryPercentView.setTextColor(color); } } Loading
packages/SystemUI/src/com/android/systemui/qs/QSContainerImpl.java +3 −31 Original line number Diff line number Diff line Loading @@ -18,15 +18,17 @@ package com.android.systemui.qs; import android.content.Context; import android.content.res.Configuration; import android.graphics.Canvas; import android.graphics.Path; import android.graphics.Point; import android.util.AttributeSet; import android.util.Log; import android.view.View; import android.widget.FrameLayout; import com.android.settingslib.Utils; import com.android.systemui.R; import com.android.systemui.qs.customize.QSCustomizer; import com.android.systemui.statusbar.ExpandableOutlineView; /** * Wrapper view with background which contains {@link QSPanel} and {@link BaseStatusBarHeader} Loading @@ -42,11 +44,7 @@ public class QSContainerImpl extends FrameLayout { protected float mQsExpansion; private QSCustomizer mQSCustomizer; private View mQSFooter; private View mBackground; private View mBackgroundGradient; private View mStatusBarBackground; private int mSideMargins; public QSContainerImpl(Context context, AttributeSet attrs) { Loading @@ -62,8 +60,6 @@ public class QSContainerImpl extends FrameLayout { mQSCustomizer = findViewById(R.id.qs_customize); mQSFooter = findViewById(R.id.qs_footer); mBackground = findViewById(R.id.quick_settings_background); mStatusBarBackground = findViewById(R.id.quick_settings_status_bar_background); mBackgroundGradient = findViewById(R.id.quick_settings_gradient_view); mSideMargins = getResources().getDimensionPixelSize(R.dimen.notification_side_paddings); setClickable(true); Loading @@ -71,22 +67,6 @@ public class QSContainerImpl extends FrameLayout { setMargins(); } @Override protected void onConfigurationChanged(Configuration newConfig) { super.onConfigurationChanged(newConfig); // Hide the backgrounds when in landscape mode. if (newConfig.orientation == Configuration.ORIENTATION_LANDSCAPE) { mBackgroundGradient.setVisibility(View.INVISIBLE); mStatusBarBackground.setVisibility(View.INVISIBLE); } else { mBackgroundGradient.setVisibility(View.VISIBLE); mStatusBarBackground.setVisibility(View.VISIBLE); } updateResources(); } @Override public boolean performClick() { // Want to receive clicks so missing QQS tiles doesn't cause collapse, but Loading Loading @@ -121,14 +101,6 @@ public class QSContainerImpl extends FrameLayout { updateExpansion(); } private void updateResources() { LayoutParams layoutParams = (LayoutParams) mQSPanel.getLayoutParams(); layoutParams.topMargin = mContext.getResources().getDimensionPixelSize( com.android.internal.R.dimen.quick_qs_offset_height); mQSPanel.setLayoutParams(layoutParams); } /** * Overrides the height of this view (post-layout), so that the content is clipped to that * height and the background is set to that height. Loading