Update background color for two-pane mode
Update background color for status bar and homepage background programically. Also, we update the backgroud color for highlight items. Test: Rebuilt apk and see the screen. Bug: 195293058 Change-Id: Id100f8c9c7fc02c43420afcca07a703a14ec2312
This commit is contained in:
File diff suppressed because it is too large
Load Diff
@@ -15,12 +15,11 @@
|
||||
limitations under the License.
|
||||
-->
|
||||
<inset xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:androidprv="http://schemas.android.com/apk/prv/res/android"
|
||||
android:insetLeft="@dimen/homepage_menu_entry_padding_horizontal"
|
||||
android:insetRight="@dimen/homepage_menu_entry_padding_horizontal">
|
||||
<shape android:shape="rectangle">
|
||||
<solid
|
||||
android:color="?androidprv:attr/colorAccentSecondaryVariant" />
|
||||
android:color="?android:attr/textColorPrimary" />
|
||||
<corners
|
||||
android:radius="@dimen/homepage_menu_entry_corner_radius" />
|
||||
</shape>
|
||||
|
@@ -46,8 +46,7 @@
|
||||
android:id="@+id/main_content"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:animateLayoutChanges="true"
|
||||
android:background="?android:attr/windowBackground"/>
|
||||
android:animateLayoutChanges="true"/>
|
||||
|
||||
</LinearLayout>
|
||||
</androidx.core.widget.NestedScrollView>
|
||||
|
@@ -32,6 +32,8 @@ import android.util.ArraySet;
|
||||
import android.util.FeatureFlagUtils;
|
||||
import android.util.Log;
|
||||
import android.view.View;
|
||||
import android.view.Window;
|
||||
import android.view.WindowManager;
|
||||
import android.widget.FrameLayout;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.Toolbar;
|
||||
@@ -53,6 +55,7 @@ import com.android.settings.core.CategoryMixin;
|
||||
import com.android.settings.core.FeatureFlags;
|
||||
import com.android.settings.homepage.contextualcards.ContextualCardsFragment;
|
||||
import com.android.settings.overlay.FeatureFactory;
|
||||
import com.android.settingslib.Utils;
|
||||
import com.android.settingslib.core.lifecycle.HideNonSystemOverlayMixin;
|
||||
|
||||
import java.net.URISyntaxException;
|
||||
@@ -151,6 +154,7 @@ public class SettingsHomepageActivity extends FragmentActivity implements
|
||||
appBar.setMinimumHeight(getSearchBoxHeight());
|
||||
initHomepageContainer();
|
||||
updateHomepageAppBar();
|
||||
updateHomepageBackground();
|
||||
mLoadedListeners = new ArraySet<>();
|
||||
|
||||
initSearchBarView();
|
||||
@@ -207,6 +211,7 @@ public class SettingsHomepageActivity extends FragmentActivity implements
|
||||
if (mIsTwoPaneLastTime != isTwoPane) {
|
||||
mIsTwoPaneLastTime = isTwoPane;
|
||||
updateHomepageAppBar();
|
||||
updateHomepageBackground();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -237,6 +242,23 @@ public class SettingsHomepageActivity extends FragmentActivity implements
|
||||
}
|
||||
}
|
||||
|
||||
private void updateHomepageBackground() {
|
||||
if (!mIsEmbeddingActivityEnabled) {
|
||||
return;
|
||||
}
|
||||
|
||||
final Window window = getWindow();
|
||||
final int color = ActivityEmbeddingUtils.isTwoPaneResolution(this)
|
||||
? Utils.getColorAttrDefaultColor(this, com.android.internal.R.attr.colorSurface)
|
||||
: Utils.getColorAttrDefaultColor(this, android.R.attr.colorBackground);
|
||||
|
||||
window.addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS);
|
||||
// Update status bar color
|
||||
window.setStatusBarColor(color);
|
||||
// Update content background.
|
||||
findViewById(R.id.settings_homepage_container).setBackgroundColor(color);
|
||||
}
|
||||
|
||||
private void showSuggestionFragment() {
|
||||
final Class<? extends Fragment> fragment = FeatureFactory.getFactory(this)
|
||||
.getSuggestionFeatureProvider(this).getContextualSuggestionFragment();
|
||||
|
Reference in New Issue
Block a user