Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e6a79f06 authored by Tsung-Mao Fang's avatar Tsung-Mao Fang Committed by Automerger Merge Worker
Browse files

Update background color for two-pane mode am: 395ea90b

Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Settings/+/16282524

Change-Id: I2b4fffda97aaec53945c4de4cf6248fb81163e64
parents 4aef8765 395ea90b
Loading
Loading
Loading
Loading
+161 −273

File changed.

Preview size limit exceeded, changes collapsed.

+1 −2
Original line number Diff line number Diff line
@@ -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>
+1 −2
Original line number Diff line number Diff line
@@ -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>
+22 −0
Original line number Diff line number Diff line
@@ -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();