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

Commit dcfb96ac authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Add RecyclerView for contextual settings homepage."

parents c748fee5 150b2ba7
Loading
Loading
Loading
Loading
+9 −8
Original line number Diff line number Diff line
@@ -21,10 +21,11 @@
    android:layout_width="match_parent"
    android:layout_height="match_parent">

    <FrameLayout
        android:id="@id/main_content"
        android:layout_height="match_parent"
        android:layout_width="match_parent" />
    <androidx.recyclerview.widget.RecyclerView
        android:id="@+id/card_container"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"/>

    <RelativeLayout
        android:id="@+id/bottom_sheet"
        android:layout_width="match_parent"
+22 −0
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<!--
     Copyright (C) 2018 The Android Open Source Project

     Licensed under the Apache License, Version 2.0 (the "License");
     you may not use this file except in compliance with the License.
     You may obtain a copy of the License at

          http://www.apache.org/licenses/LICENSE-2.0

     Unless required by applicable law or agreed to in writing, software
     distributed under the License is distributed on an "AS IS" BASIS,
     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
     See the License for the specific language governing permissions and
     limitations under the License.
-->

<FrameLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@id/main_content"
    android:layout_height="match_parent"
    android:layout_width="match_parent"/>
 No newline at end of file
+5 −5
Original line number Diff line number Diff line
@@ -21,14 +21,14 @@ import android.content.Intent;
import android.os.Bundle;
import android.util.FeatureFlagUtils;

import com.android.settings.core.FeatureFlags;
import com.android.settings.core.SettingsBaseActivity;
import com.android.settings.homepage.HomepageFragment;

import androidx.fragment.app.Fragment;
import androidx.fragment.app.FragmentActivity;
import androidx.fragment.app.FragmentManager;

import com.android.settings.core.FeatureFlags;
import com.android.settings.core.SettingsBaseActivity;
import com.android.settings.homepage.HomepageFragment;

public class SettingsHomepageActivity extends SettingsBaseActivity {

    @Override
@@ -42,7 +42,7 @@ public class SettingsHomepageActivity extends SettingsBaseActivity {
            finish();
            return;
        }
        setContentView(R.layout.settings_homepage);
        setContentView(R.layout.settings_homepage_container);
        if (savedInstanceState == null) {
            switchToFragment(this, R.id.main_content, HomepageFragment.class.getName());
        }
+12 −1
Original line number Diff line number Diff line
@@ -26,6 +26,8 @@ import android.view.ViewGroup;
import android.widget.Toolbar;

import androidx.annotation.NonNull;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;

import com.android.internal.logging.nano.MetricsProto.MetricsEvent;
import com.android.settings.R;
@@ -45,6 +47,9 @@ public class HomepageFragment extends InstrumentedFragment {
    private static final String SAVE_BOTTOMBAR_STATE = "bottombar_state";
    private static final String SAVE_BOTTOM_FRAGMENT_LOADED = "bottom_fragment_loaded";

    private RecyclerView mCardsContainer;
    private LinearLayoutManager mLayoutManager;

    private FloatingActionButton mSearchButton;
    private BottomSheetBehavior mBottomSheetBehavior;
    private View mBottomBar;
@@ -54,7 +59,13 @@ public class HomepageFragment extends InstrumentedFragment {
    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container,
            Bundle savedInstanceState) {
        final View rootView = inflater.inflate(R.layout.dashboard, container, false);
        final View rootView = inflater.inflate(R.layout.settings_homepage,
                container, false);
        mCardsContainer = (RecyclerView) rootView.findViewById(R.id.card_container);
        //TODO(b/111822407): May have to swap to GridLayoutManager
        mLayoutManager = new LinearLayoutManager(getActivity());
        mCardsContainer.setLayoutManager(mLayoutManager);

        return rootView;
    }