diff --git a/packages/SystemUI/res/layout/recents_empty.xml b/packages/SystemUI/res/layout/recents_empty.xml index 53d9cc53161d5..8048c6845c237 100644 --- a/packages/SystemUI/res/layout/recents_empty.xml +++ b/packages/SystemUI/res/layout/recents_empty.xml @@ -23,7 +23,8 @@ android:drawableTop="@drawable/recents_empty" android:drawablePadding="25dp" android:textSize="16sp" - android:textColor="#ffffffff" + android:drawableTint="?attr/bgProtectTextColor" + android:textColor="?attr/bgProtectTextColor" android:text="@string/recents_empty_message" android:fontFamily="sans-serif" android:visibility="gone" /> \ No newline at end of file diff --git a/packages/SystemUI/res/layout/recents_stack_action_button.xml b/packages/SystemUI/res/layout/recents_stack_action_button.xml index 34b4e1771af54..10b43163cd62f 100644 --- a/packages/SystemUI/res/layout/recents_stack_action_button.xml +++ b/packages/SystemUI/res/layout/recents_stack_action_button.xml @@ -24,7 +24,7 @@ android:paddingBottom="12dp" android:text="@string/recents_stack_action_button_label" android:textSize="14sp" - android:textColor="#FFFFFF" + android:textColor="?attr/bgProtectTextColor" android:textAllCaps="true" android:shadowColor="#99000000" android:shadowDx="0" diff --git a/packages/SystemUI/res/values/styles.xml b/packages/SystemUI/res/values/styles.xml index 5274b6476abaf..93a0742dd2d72 100644 --- a/packages/SystemUI/res/values/styles.xml +++ b/packages/SystemUI/res/values/styles.xml @@ -16,7 +16,7 @@ - + + @@ -290,7 +300,10 @@ - - @@ -459,7 +475,7 @@ 8dp - diff --git a/packages/SystemUI/src/com/android/systemui/qs/tileimpl/QSFactoryImpl.java b/packages/SystemUI/src/com/android/systemui/qs/tileimpl/QSFactoryImpl.java index 17a0d3302ee64..77c3bfab8de94 100644 --- a/packages/SystemUI/src/com/android/systemui/qs/tileimpl/QSFactoryImpl.java +++ b/packages/SystemUI/src/com/android/systemui/qs/tileimpl/QSFactoryImpl.java @@ -16,7 +16,9 @@ package com.android.systemui.qs.tileimpl; import android.content.Context; import android.util.Log; +import android.view.ContextThemeWrapper; +import com.android.systemui.R; import com.android.systemui.plugins.qs.*; import com.android.systemui.plugins.qs.QSTileView; import com.android.systemui.qs.external.CustomTile; @@ -78,7 +80,7 @@ public class QSFactoryImpl implements QSFactory { @Override public QSTileView createTileView(QSTile tile, boolean collapsedView) { - Context context = mHost.getContext(); + Context context = new ContextThemeWrapper(mHost.getContext(), R.style.qs_theme); QSIconView icon = tile.createTileView(context); if (collapsedView) { return new QSTileBaseView(context, icon, collapsedView); diff --git a/packages/SystemUI/src/com/android/systemui/recents/RecentsActivity.java b/packages/SystemUI/src/com/android/systemui/recents/RecentsActivity.java index 4de121488ecca..fa16f8e5bd0ec 100644 --- a/packages/SystemUI/src/com/android/systemui/recents/RecentsActivity.java +++ b/packages/SystemUI/src/com/android/systemui/recents/RecentsActivity.java @@ -24,6 +24,7 @@ import android.content.BroadcastReceiver; import android.content.Context; import android.content.Intent; import android.content.IntentFilter; +import android.content.pm.ActivityInfo; import android.content.res.Configuration; import android.net.Uri; import android.os.Bundle; @@ -42,9 +43,9 @@ import android.view.WindowManager.LayoutParams; import com.android.internal.logging.MetricsLogger; import com.android.internal.logging.nano.MetricsProto.MetricsEvent; +import com.android.keyguard.LatencyTracker; import com.android.systemui.DejankUtils; import com.android.systemui.Interpolators; -import com.android.keyguard.LatencyTracker; import com.android.systemui.R; import com.android.systemui.recents.events.EventBus; import com.android.systemui.recents.events.activity.CancelEnterRecentsWindowAnimationEvent; @@ -110,11 +111,10 @@ public class RecentsActivity extends Activity implements ViewTreeObserver.OnPreD private RecentsPackageMonitor mPackageMonitor; private Handler mHandler = new Handler(); private long mLastTabKeyEventTime; - private int mLastDeviceOrientation = Configuration.ORIENTATION_UNDEFINED; - private int mLastDisplayDensity; private boolean mFinishedOnStartup; private boolean mIgnoreAltTabRelease; private boolean mIsVisible; + private Configuration mLastConfig; // Top level views private RecentsView mRecentsView; @@ -333,16 +333,11 @@ public class RecentsActivity extends Activity implements ViewTreeObserver.OnPreD setContentView(R.layout.recents); takeKeyEvents(true); mRecentsView = findViewById(R.id.recents_view); - mRecentsView.setSystemUiVisibility(View.SYSTEM_UI_FLAG_LAYOUT_STABLE | - View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN | - View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION); mScrimViews = new SystemBarScrimViews(this); getWindow().getAttributes().privateFlags |= WindowManager.LayoutParams.PRIVATE_FLAG_FORCE_DECOR_VIEW_VISIBILITY; - Configuration appConfiguration = Utilities.getAppConfiguration(this); - mLastDeviceOrientation = appConfiguration.orientation; - mLastDisplayDensity = appConfiguration.densityDpi; + mLastConfig = Utilities.getAppConfiguration(this); mFocusTimerDuration = getResources().getInteger(R.integer.recents_auto_advance_duration); mIterateTrigger = new DozeTrigger(mFocusTimerDuration, new Runnable() { @Override @@ -485,10 +480,15 @@ public class RecentsActivity extends Activity implements ViewTreeObserver.OnPreD Configuration newDeviceConfiguration = Utilities.getAppConfiguration(this); int numStackTasks = mRecentsView.getStack().getStackTaskCount(); EventBus.getDefault().send(new ConfigurationChangedEvent(false /* fromMultiWindow */, - mLastDeviceOrientation != newDeviceConfiguration.orientation, - mLastDisplayDensity != newDeviceConfiguration.densityDpi, numStackTasks > 0)); - mLastDeviceOrientation = newDeviceConfiguration.orientation; - mLastDisplayDensity = newDeviceConfiguration.densityDpi; + mLastConfig.orientation != newDeviceConfiguration.orientation, + mLastConfig.densityDpi != newDeviceConfiguration.densityDpi, numStackTasks > 0)); + + int configDiff = mLastConfig.updateFrom(newDeviceConfiguration); + + // Recreate activity if an overlay was enabled/disabled + if ((configDiff & ActivityInfo.CONFIG_ASSETS_PATHS) != 0) { + recreate(); + } } @Override diff --git a/packages/SystemUI/src/com/android/systemui/recents/views/RecentsView.java b/packages/SystemUI/src/com/android/systemui/recents/views/RecentsView.java index 9ca756c5431f6..c1c41be07fc91 100644 --- a/packages/SystemUI/src/com/android/systemui/recents/views/RecentsView.java +++ b/packages/SystemUI/src/com/android/systemui/recents/views/RecentsView.java @@ -151,6 +151,12 @@ public class RecentsView extends FrameLayout implements ColorExtractor.OnColorsC mColorExtractor = Dependency.get(SysuiColorExtractor.class); LayoutInflater inflater = LayoutInflater.from(context); + + mEmptyView = (TextView) inflater.inflate(R.layout.recents_empty, this, false); + addView(mEmptyView); + + boolean usingDarkText = + Color.luminance(mEmptyView.getTextColors().getDefaultColor()) < 0.5f; if (RecentsDebugFlags.Static.EnableStackActionButton) { mStackActionButton = (TextView) inflater.inflate(R.layout.recents_stack_action_button, this, false); @@ -160,10 +166,21 @@ public class RecentsView extends FrameLayout implements ColorExtractor.OnColorsC EventBus.getDefault().send(new DismissAllTaskViewsEvent()); } }); + // Disable black shadow if text color is already dark. + if (usingDarkText) { + mStackActionButton.setShadowLayer(0, 0, 0, 0); + } addView(mStackActionButton); } - mEmptyView = (TextView) inflater.inflate(R.layout.recents_empty, this, false); - addView(mEmptyView); + + // Let's also require dark status and nav bars if the text is dark + int systemBarsStyle = usingDarkText ? View.SYSTEM_UI_FLAG_LIGHT_NAVIGATION_BAR | + View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR : 0; + + setSystemUiVisibility(View.SYSTEM_UI_FLAG_LAYOUT_STABLE | + View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN | + View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION | + systemBarsStyle); } /** diff --git a/packages/overlays/SysuiDarkThemeOverlay/AndroidManifest.xml b/packages/overlays/SysuiDarkThemeOverlay/AndroidManifest.xml index ba1c91cbdebe6..8b6ee2bb851cc 100644 --- a/packages/overlays/SysuiDarkThemeOverlay/AndroidManifest.xml +++ b/packages/overlays/SysuiDarkThemeOverlay/AndroidManifest.xml @@ -2,7 +2,7 @@ package="com.android.systemui.theme.dark" android:versionCode="1" android:versionName="1.0"> - + diff --git a/packages/overlays/SysuiDarkThemeOverlay/res/values/themes_device_defaults.xml b/packages/overlays/SysuiDarkThemeOverlay/res/values/styles.xml similarity index 52% rename from packages/overlays/SysuiDarkThemeOverlay/res/values/themes_device_defaults.xml rename to packages/overlays/SysuiDarkThemeOverlay/res/values/styles.xml index 7e2b955a8871a..0c1b0ef314340 100644 --- a/packages/overlays/SysuiDarkThemeOverlay/res/values/themes_device_defaults.xml +++ b/packages/overlays/SysuiDarkThemeOverlay/res/values/styles.xml @@ -1,13 +1,8 @@ - + + + \ No newline at end of file diff --git a/packages/overlays/SysuiLightWallpaperThemeOverlay/res/values/themes_device_defaults.xml b/packages/overlays/SysuiLightWallpaperThemeOverlay/res/values/themes_device_defaults.xml deleted file mode 100644 index 877ebf8c4e9dd..0000000000000 --- a/packages/overlays/SysuiLightWallpaperThemeOverlay/res/values/themes_device_defaults.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - - \ No newline at end of file