From d78aa5d0cf2bb279d374b7e025e95ff194d42f27 Mon Sep 17 00:00:00 2001 From: Lucas Dupin Date: Wed, 28 Jun 2017 16:00:26 -0700 Subject: [PATCH 1/2] Revert "Support dark text on Recents" This reverts commit 512ce6c9b75ce7d3f4f70280a414ab8fb994e809. --- .../SystemUI/res/layout/recents_empty.xml | 3 +-- .../layout/recents_stack_action_button.xml | 2 +- packages/SystemUI/res/values/styles.xml | 12 +-------- .../systemui/recents/RecentsActivity.java | 26 +++++++++---------- .../systemui/recents/views/RecentsView.java | 21 ++------------- .../res/values/styles.xml | 5 ---- 6 files changed, 18 insertions(+), 51 deletions(-) diff --git a/packages/SystemUI/res/layout/recents_empty.xml b/packages/SystemUI/res/layout/recents_empty.xml index 8048c6845c237..53d9cc53161d5 100644 --- a/packages/SystemUI/res/layout/recents_empty.xml +++ b/packages/SystemUI/res/layout/recents_empty.xml @@ -23,8 +23,7 @@ android:drawableTop="@drawable/recents_empty" android:drawablePadding="25dp" android:textSize="16sp" - android:drawableTint="?attr/bgProtectTextColor" - android:textColor="?attr/bgProtectTextColor" + android:textColor="#ffffffff" 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 10b43163cd62f..34b4e1771af54 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="?attr/bgProtectTextColor" + android:textColor="#FFFFFF" 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 c67e49ae11502..0b875eb05ea61 100644 --- a/packages/SystemUI/res/values/styles.xml +++ b/packages/SystemUI/res/values/styles.xml @@ -16,7 +16,7 @@ - - - diff --git a/packages/SystemUI/src/com/android/systemui/recents/RecentsActivity.java b/packages/SystemUI/src/com/android/systemui/recents/RecentsActivity.java index fa16f8e5bd0ec..4de121488ecca 100644 --- a/packages/SystemUI/src/com/android/systemui/recents/RecentsActivity.java +++ b/packages/SystemUI/src/com/android/systemui/recents/RecentsActivity.java @@ -24,7 +24,6 @@ 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; @@ -43,9 +42,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; @@ -111,10 +110,11 @@ 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,11 +333,16 @@ 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; - mLastConfig = Utilities.getAppConfiguration(this); + Configuration appConfiguration = Utilities.getAppConfiguration(this); + mLastDeviceOrientation = appConfiguration.orientation; + mLastDisplayDensity = appConfiguration.densityDpi; mFocusTimerDuration = getResources().getInteger(R.integer.recents_auto_advance_duration); mIterateTrigger = new DozeTrigger(mFocusTimerDuration, new Runnable() { @Override @@ -480,15 +485,10 @@ 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 */, - 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(); - } + mLastDeviceOrientation != newDeviceConfiguration.orientation, + mLastDisplayDensity != newDeviceConfiguration.densityDpi, numStackTasks > 0)); + mLastDeviceOrientation = newDeviceConfiguration.orientation; + mLastDisplayDensity = newDeviceConfiguration.densityDpi; } @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 c1c41be07fc91..9ca756c5431f6 100644 --- a/packages/SystemUI/src/com/android/systemui/recents/views/RecentsView.java +++ b/packages/SystemUI/src/com/android/systemui/recents/views/RecentsView.java @@ -151,12 +151,6 @@ 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); @@ -166,21 +160,10 @@ 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); } - - // 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); + mEmptyView = (TextView) inflater.inflate(R.layout.recents_empty, this, false); + addView(mEmptyView); } /** diff --git a/packages/overlays/SysuiLightWallpaperThemeOverlay/res/values/styles.xml b/packages/overlays/SysuiLightWallpaperThemeOverlay/res/values/styles.xml index 53912b50df005..b89b9b4623843 100644 --- a/packages/overlays/SysuiLightWallpaperThemeOverlay/res/values/styles.xml +++ b/packages/overlays/SysuiLightWallpaperThemeOverlay/res/values/styles.xml @@ -4,9 +4,4 @@ @*android:color/primary_text_material_light @*android:color/secondary_text_material_light - - \ No newline at end of file From 15a39b3afaf8ff1544b8d48bd4381221835703b0 Mon Sep 17 00:00:00 2001 From: Lucas Dupin Date: Wed, 28 Jun 2017 16:00:39 -0700 Subject: [PATCH 2/2] Revert "Replaced overlay target package" This reverts commit ae885416dddd684fab2369fde234dc9e48db5051. --- packages/SystemUI/res/values/styles.xml | 6 +----- packages/overlays/SysuiDarkThemeOverlay/AndroidManifest.xml | 2 +- .../res/values/{styles.xml => themes_device_defaults.xml} | 5 +---- .../SysuiLightWallpaperThemeOverlay/AndroidManifest.xml | 2 +- .../res/values/{styles.xml => themes_device_defaults.xml} | 2 +- 5 files changed, 5 insertions(+), 12 deletions(-) rename packages/overlays/SysuiDarkThemeOverlay/res/values/{styles.xml => themes_device_defaults.xml} (83%) rename packages/overlays/SysuiLightWallpaperThemeOverlay/res/values/{styles.xml => themes_device_defaults.xml} (71%) diff --git a/packages/SystemUI/res/values/styles.xml b/packages/SystemUI/res/values/styles.xml index 0b875eb05ea61..5274b6476abaf 100644 --- a/packages/SystemUI/res/values/styles.xml +++ b/packages/SystemUI/res/values/styles.xml @@ -290,11 +290,7 @@ - - - - - -