Merge changes from topic 'fix_broken_overlay' into oc-dr1-dev
* changes: Revert "Replaced overlay target package" Revert "Support dark text on Recents"
This commit is contained in:
committed by
Android (Google) Code Review
commit
4b535d93f7
@@ -23,8 +23,7 @@
|
|||||||
android:drawableTop="@drawable/recents_empty"
|
android:drawableTop="@drawable/recents_empty"
|
||||||
android:drawablePadding="25dp"
|
android:drawablePadding="25dp"
|
||||||
android:textSize="16sp"
|
android:textSize="16sp"
|
||||||
android:drawableTint="?attr/bgProtectTextColor"
|
android:textColor="#ffffffff"
|
||||||
android:textColor="?attr/bgProtectTextColor"
|
|
||||||
android:text="@string/recents_empty_message"
|
android:text="@string/recents_empty_message"
|
||||||
android:fontFamily="sans-serif"
|
android:fontFamily="sans-serif"
|
||||||
android:visibility="gone" />
|
android:visibility="gone" />
|
||||||
@@ -24,7 +24,7 @@
|
|||||||
android:paddingBottom="12dp"
|
android:paddingBottom="12dp"
|
||||||
android:text="@string/recents_stack_action_button_label"
|
android:text="@string/recents_stack_action_button_label"
|
||||||
android:textSize="14sp"
|
android:textSize="14sp"
|
||||||
android:textColor="?attr/bgProtectTextColor"
|
android:textColor="#FFFFFF"
|
||||||
android:textAllCaps="true"
|
android:textAllCaps="true"
|
||||||
android:shadowColor="#99000000"
|
android:shadowColor="#99000000"
|
||||||
android:shadowDx="0"
|
android:shadowDx="0"
|
||||||
|
|||||||
@@ -16,7 +16,7 @@
|
|||||||
|
|
||||||
<resources xmlns:android="http://schemas.android.com/apk/res/android">
|
<resources xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
|
|
||||||
<style name="RecentsTheme" parent="RecentsBase">
|
<style name="RecentsTheme" parent="@android:style/Theme.Material">
|
||||||
<!-- NoTitle -->
|
<!-- NoTitle -->
|
||||||
<item name="android:windowNoTitle">true</item>
|
<item name="android:windowNoTitle">true</item>
|
||||||
<!-- Misc -->
|
<!-- Misc -->
|
||||||
@@ -27,12 +27,6 @@
|
|||||||
<item name="android:ambientShadowAlpha">0.35</item>
|
<item name="android:ambientShadowAlpha">0.35</item>
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
<!-- OverlayManager might replace this style entirely, use RecentsTheme to set a property
|
|
||||||
that should exist in both light and dark versions of Recents -->
|
|
||||||
<style name="RecentsBase" parent="@android:style/Theme.Material">
|
|
||||||
<item name="android:textColorPrimaryInverse">@*android:color/primary_text_material_dark</item>
|
|
||||||
<item name="android:textColorSecondaryInverse">@*android:color/secondary_text_material_dark</item>
|
|
||||||
</style>
|
|
||||||
|
|
||||||
<!-- Recents theme -->
|
<!-- Recents theme -->
|
||||||
<style name="RecentsTheme.Wallpaper">
|
<style name="RecentsTheme.Wallpaper">
|
||||||
@@ -41,8 +35,6 @@
|
|||||||
<item name="android:windowShowWallpaper">true</item>
|
<item name="android:windowShowWallpaper">true</item>
|
||||||
<item name="android:windowDisablePreview">true</item>
|
<item name="android:windowDisablePreview">true</item>
|
||||||
<item name="clearAllStyle">@style/ClearAllButtonDefaultMargins</item>
|
<item name="clearAllStyle">@style/ClearAllButtonDefaultMargins</item>
|
||||||
<item name="bgProtectTextColor">?android:attr/textColorPrimaryInverse</item>
|
|
||||||
<item name="bgProtectSecondaryTextColor">?android:attr/textColorSecondaryInverse</item>
|
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
<style name="ClearAllButtonDefaultMargins">
|
<style name="ClearAllButtonDefaultMargins">
|
||||||
@@ -55,8 +47,6 @@
|
|||||||
<!-- Performance optimized Recents theme (no wallpaper) -->
|
<!-- Performance optimized Recents theme (no wallpaper) -->
|
||||||
<style name="RecentsTheme.NoWallpaper">
|
<style name="RecentsTheme.NoWallpaper">
|
||||||
<item name="android:windowBackground">@android:color/black</item>
|
<item name="android:windowBackground">@android:color/black</item>
|
||||||
<item name="bgProtectTextColor">@android:color/white</item>
|
|
||||||
<item name="bgProtectSecondaryTextColor">@android:color/white</item>
|
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
<!-- Theme used for the activity that shows when the system forced an app to be resizable -->
|
<!-- Theme used for the activity that shows when the system forced an app to be resizable -->
|
||||||
@@ -300,11 +290,7 @@
|
|||||||
<style name="Animation.StatusBar">
|
<style name="Animation.StatusBar">
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
<!-- Overlay styles will replace this theme -->
|
<style name="systemui_theme" parent="@*android:style/Theme.DeviceDefault.QuickSettings">
|
||||||
<style name="systemui_base" parent="@*android:style/Theme.DeviceDefault.QuickSettings">
|
|
||||||
</style>
|
|
||||||
|
|
||||||
<style name="systemui_theme" parent="systemui_base">
|
|
||||||
<item name="lightIconTheme">@style/DualToneLightTheme</item>
|
<item name="lightIconTheme">@style/DualToneLightTheme</item>
|
||||||
<item name="darkIconTheme">@style/DualToneDarkTheme</item>
|
<item name="darkIconTheme">@style/DualToneDarkTheme</item>
|
||||||
<item name="bgProtectTextColor">?android:attr/textColorPrimaryInverse</item>
|
<item name="bgProtectTextColor">?android:attr/textColorPrimaryInverse</item>
|
||||||
|
|||||||
@@ -24,7 +24,6 @@ import android.content.BroadcastReceiver;
|
|||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
import android.content.IntentFilter;
|
import android.content.IntentFilter;
|
||||||
import android.content.pm.ActivityInfo;
|
|
||||||
import android.content.res.Configuration;
|
import android.content.res.Configuration;
|
||||||
import android.net.Uri;
|
import android.net.Uri;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
@@ -43,9 +42,9 @@ import android.view.WindowManager.LayoutParams;
|
|||||||
|
|
||||||
import com.android.internal.logging.MetricsLogger;
|
import com.android.internal.logging.MetricsLogger;
|
||||||
import com.android.internal.logging.nano.MetricsProto.MetricsEvent;
|
import com.android.internal.logging.nano.MetricsProto.MetricsEvent;
|
||||||
import com.android.keyguard.LatencyTracker;
|
|
||||||
import com.android.systemui.DejankUtils;
|
import com.android.systemui.DejankUtils;
|
||||||
import com.android.systemui.Interpolators;
|
import com.android.systemui.Interpolators;
|
||||||
|
import com.android.keyguard.LatencyTracker;
|
||||||
import com.android.systemui.R;
|
import com.android.systemui.R;
|
||||||
import com.android.systemui.recents.events.EventBus;
|
import com.android.systemui.recents.events.EventBus;
|
||||||
import com.android.systemui.recents.events.activity.CancelEnterRecentsWindowAnimationEvent;
|
import com.android.systemui.recents.events.activity.CancelEnterRecentsWindowAnimationEvent;
|
||||||
@@ -111,10 +110,11 @@ public class RecentsActivity extends Activity implements ViewTreeObserver.OnPreD
|
|||||||
private RecentsPackageMonitor mPackageMonitor;
|
private RecentsPackageMonitor mPackageMonitor;
|
||||||
private Handler mHandler = new Handler();
|
private Handler mHandler = new Handler();
|
||||||
private long mLastTabKeyEventTime;
|
private long mLastTabKeyEventTime;
|
||||||
|
private int mLastDeviceOrientation = Configuration.ORIENTATION_UNDEFINED;
|
||||||
|
private int mLastDisplayDensity;
|
||||||
private boolean mFinishedOnStartup;
|
private boolean mFinishedOnStartup;
|
||||||
private boolean mIgnoreAltTabRelease;
|
private boolean mIgnoreAltTabRelease;
|
||||||
private boolean mIsVisible;
|
private boolean mIsVisible;
|
||||||
private Configuration mLastConfig;
|
|
||||||
|
|
||||||
// Top level views
|
// Top level views
|
||||||
private RecentsView mRecentsView;
|
private RecentsView mRecentsView;
|
||||||
@@ -333,11 +333,16 @@ public class RecentsActivity extends Activity implements ViewTreeObserver.OnPreD
|
|||||||
setContentView(R.layout.recents);
|
setContentView(R.layout.recents);
|
||||||
takeKeyEvents(true);
|
takeKeyEvents(true);
|
||||||
mRecentsView = findViewById(R.id.recents_view);
|
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);
|
mScrimViews = new SystemBarScrimViews(this);
|
||||||
getWindow().getAttributes().privateFlags |=
|
getWindow().getAttributes().privateFlags |=
|
||||||
WindowManager.LayoutParams.PRIVATE_FLAG_FORCE_DECOR_VIEW_VISIBILITY;
|
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);
|
mFocusTimerDuration = getResources().getInteger(R.integer.recents_auto_advance_duration);
|
||||||
mIterateTrigger = new DozeTrigger(mFocusTimerDuration, new Runnable() {
|
mIterateTrigger = new DozeTrigger(mFocusTimerDuration, new Runnable() {
|
||||||
@Override
|
@Override
|
||||||
@@ -480,15 +485,10 @@ public class RecentsActivity extends Activity implements ViewTreeObserver.OnPreD
|
|||||||
Configuration newDeviceConfiguration = Utilities.getAppConfiguration(this);
|
Configuration newDeviceConfiguration = Utilities.getAppConfiguration(this);
|
||||||
int numStackTasks = mRecentsView.getStack().getStackTaskCount();
|
int numStackTasks = mRecentsView.getStack().getStackTaskCount();
|
||||||
EventBus.getDefault().send(new ConfigurationChangedEvent(false /* fromMultiWindow */,
|
EventBus.getDefault().send(new ConfigurationChangedEvent(false /* fromMultiWindow */,
|
||||||
mLastConfig.orientation != newDeviceConfiguration.orientation,
|
mLastDeviceOrientation != newDeviceConfiguration.orientation,
|
||||||
mLastConfig.densityDpi != newDeviceConfiguration.densityDpi, numStackTasks > 0));
|
mLastDisplayDensity != newDeviceConfiguration.densityDpi, numStackTasks > 0));
|
||||||
|
mLastDeviceOrientation = newDeviceConfiguration.orientation;
|
||||||
int configDiff = mLastConfig.updateFrom(newDeviceConfiguration);
|
mLastDisplayDensity = newDeviceConfiguration.densityDpi;
|
||||||
|
|
||||||
// Recreate activity if an overlay was enabled/disabled
|
|
||||||
if ((configDiff & ActivityInfo.CONFIG_ASSETS_PATHS) != 0) {
|
|
||||||
recreate();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -151,12 +151,6 @@ public class RecentsView extends FrameLayout implements ColorExtractor.OnColorsC
|
|||||||
mColorExtractor = Dependency.get(SysuiColorExtractor.class);
|
mColorExtractor = Dependency.get(SysuiColorExtractor.class);
|
||||||
|
|
||||||
LayoutInflater inflater = LayoutInflater.from(context);
|
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) {
|
if (RecentsDebugFlags.Static.EnableStackActionButton) {
|
||||||
mStackActionButton = (TextView) inflater.inflate(R.layout.recents_stack_action_button,
|
mStackActionButton = (TextView) inflater.inflate(R.layout.recents_stack_action_button,
|
||||||
this, false);
|
this, false);
|
||||||
@@ -166,21 +160,10 @@ public class RecentsView extends FrameLayout implements ColorExtractor.OnColorsC
|
|||||||
EventBus.getDefault().send(new DismissAllTaskViewsEvent());
|
EventBus.getDefault().send(new DismissAllTaskViewsEvent());
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
// Disable black shadow if text color is already dark.
|
|
||||||
if (usingDarkText) {
|
|
||||||
mStackActionButton.setShadowLayer(0, 0, 0, 0);
|
|
||||||
}
|
|
||||||
addView(mStackActionButton);
|
addView(mStackActionButton);
|
||||||
}
|
}
|
||||||
|
mEmptyView = (TextView) inflater.inflate(R.layout.recents_empty, this, false);
|
||||||
// Let's also require dark status and nav bars if the text is dark
|
addView(mEmptyView);
|
||||||
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);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
package="com.android.systemui.theme.dark"
|
package="com.android.systemui.theme.dark"
|
||||||
android:versionCode="1"
|
android:versionCode="1"
|
||||||
android:versionName="1.0">
|
android:versionName="1.0">
|
||||||
<overlay android:targetPackage="com.android.systemui" android:priority="1"/>
|
<overlay android:targetPackage="android" android:priority="1"/>
|
||||||
|
|
||||||
<application android:label="@string/sysui_overlay_dark" android:hasCode="false"/>
|
<application android:label="@string/sysui_overlay_dark" android:hasCode="false"/>
|
||||||
</manifest>
|
</manifest>
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<resources>
|
<resources>
|
||||||
<style name="DarkQuickSettings" parent="android:Theme.DeviceDefault">
|
<style name="Theme.DeviceDefault.QuickSettings" parent="android:Theme.DeviceDefault">
|
||||||
<item name="android:colorPrimary">@*android:color/primary_device_default_settings</item>
|
<item name="android:colorPrimary">@*android:color/primary_device_default_settings</item>
|
||||||
<item name="android:colorPrimaryDark">@*android:color/primary_dark_device_default_settings</item>
|
<item name="android:colorPrimaryDark">@*android:color/primary_dark_device_default_settings</item>
|
||||||
<!-- textColorPrimaryInverse is used on the lock screen and this means that we can't just
|
<!-- textColorPrimaryInverse is used on the lock screen and this means that we can't just
|
||||||
@@ -13,7 +13,4 @@
|
|||||||
<item name="android:colorControlNormal">?android:attr/textColorPrimary</item>
|
<item name="android:colorControlNormal">?android:attr/textColorPrimary</item>
|
||||||
<item name="android:colorBackgroundFloating">#000</item>
|
<item name="android:colorBackgroundFloating">#000</item>
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
<style name="systemui_base" parent="DarkQuickSettings" />
|
|
||||||
<style name="edit_theme" parent="DarkQuickSettings" />
|
|
||||||
</resources>
|
</resources>
|
||||||
@@ -2,7 +2,7 @@
|
|||||||
package="com.android.systemui.theme.lightwallpaper"
|
package="com.android.systemui.theme.lightwallpaper"
|
||||||
android:versionCode="1"
|
android:versionCode="1"
|
||||||
android:versionName="1.0">
|
android:versionName="1.0">
|
||||||
<overlay android:targetPackage="com.android.systemui" android:priority="2"/>
|
<overlay android:targetPackage="android" android:priority="2"/>
|
||||||
|
|
||||||
<application android:label="@string/sysui_overlay_light" android:hasCode="false"/>
|
<application android:label="@string/sysui_overlay_light" android:hasCode="false"/>
|
||||||
</manifest>
|
</manifest>
|
||||||
|
|||||||
@@ -1,12 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<resources>
|
|
||||||
<style name="systemui_base" parent="@*android:style/Theme.DeviceDefault.QuickSettings">
|
|
||||||
<item name="android:textColorPrimaryInverse">@*android:color/primary_text_material_light</item>
|
|
||||||
<item name="android:textColorSecondaryInverse">@*android:color/secondary_text_material_light</item>
|
|
||||||
</style>
|
|
||||||
|
|
||||||
<style name="RecentsBase" parent="@android:style/Theme.Material">
|
|
||||||
<item name="android:textColorPrimaryInverse">@*android:color/primary_text_material_light</item>
|
|
||||||
<item name="android:textColorSecondaryInverse">@*android:color/secondary_text_material_light</item>
|
|
||||||
</style>
|
|
||||||
</resources>
|
|
||||||
@@ -0,0 +1,7 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<resources>
|
||||||
|
<style name="Theme.DeviceDefault.QuickSettings" parent="android:Theme.DeviceDefault.Light">
|
||||||
|
<item name="android:textColorPrimaryInverse">@*android:color/primary_text_material_light</item>
|
||||||
|
<item name="android:textColorSecondaryInverse">@*android:color/secondary_text_material_light</item>
|
||||||
|
</style>
|
||||||
|
</resources>
|
||||||
Reference in New Issue
Block a user