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

Commit 9896b639 authored by Chuck Liao's avatar Chuck Liao Committed by Android (Google) Code Review
Browse files

Merge "Update the order of the tabs." into ub-launcher3-master

parents 6bf1cf40 42ab1589
Loading
Loading
Loading
Loading
+7 −7
Original line number Diff line number Diff line
@@ -16,20 +16,20 @@
-->
<menu xmlns:android="http://schemas.android.com/apk/res/android">
    <!-- TODO (santie): replace icons with real ones when available -->
    <item
        android:id="@+id/nav_wallpaper"
        android:title="@string/wallpaper_title"
        android:icon="@drawable/ic_nav_wallpaper" />
    <item
        android:id="@+id/nav_theme"
        android:title="@string/theme_title"
        android:icon="@drawable/ic_nav_theme" />
    <item
        android:id="@+id/nav_clock"
        android:title="@string/clock_title"
        android:icon="@drawable/ic_nav_clock" />
    <item
        android:id="@+id/nav_grid"
        android:title="@string/grid_title"
        android:icon="@drawable/ic_nav_grid" />
    <item
        android:id="@+id/nav_wallpaper"
        android:title="@string/wallpaper_title"
        android:icon="@drawable/ic_nav_wallpaper" />
        android:id="@+id/nav_clock"
        android:title="@string/clock_title"
        android:icon="@drawable/ic_nav_clock" />
</menu>
 No newline at end of file
+8 −4
Original line number Diff line number Diff line
@@ -130,10 +130,9 @@ public class CustomizationPickerActivity extends FragmentActivity implements Wal

                // Navigate to the Wallpaper tab if we started directly from launcher, otherwise
                // start at the Styles tab
                int section = WALLPAPER_FOCUS.equals(getIntent()
                    .getStringExtra(WALLPAPER_FLAVOR_EXTRA))
                    ? mBottomNav.getMenu().size() - 1 : 0;
                navigateToSection(mBottomNav.getMenu().getItem(section).getItemId());
                navigateToSection(
                        WALLPAPER_FOCUS.equals(getIntent().getStringExtra(WALLPAPER_FLAVOR_EXTRA))
                                ? R.id.nav_wallpaper : R.id.nav_theme);
            }
        }
    }
@@ -306,6 +305,11 @@ public class CustomizationPickerActivity extends FragmentActivity implements Wal
    }

    private void navigateToSection(@IdRes int id) {
        // Navigate to the first section if the targeted section doesn't exist.
        if (!mSections.containsKey(id)) {
            id = mBottomNav.getMenu().getItem(0).getItemId();
        }

        mBottomNav.setSelectedItemId(id);
    }