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

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

Merge "Add ripple effect to bottom nav and options" into ub-launcher3-qt-dev

parents 105edb78 89eef637
Loading
Loading
Loading
Loading
+15 −5
Original line number Original line Diff line number Diff line
@@ -13,8 +13,18 @@
     See the License for the specific language governing permissions and
     See the License for the specific language governing permissions and
     limitations under the License.
     limitations under the License.
-->
-->
<shape xmlns:android="http://schemas.android.com/apk/res/android"
<ripple xmlns:android="http://schemas.android.com/apk/res/android"
    android:shape="rectangle">
    android:color="?android:attr/colorControlHighlight">
    <item android:id="@android:id/mask">
        <shape android:shape="rectangle">
            <solid android:color="@android:color/white"/>
            <corners android:radius="4dp" />
        </shape>
    </item>
    <item>
        <shape android:shape="rectangle">
            <stroke android:color="@color/option_border_color" android:width="@dimen/option_border_width" />
            <stroke android:color="@color/option_border_color" android:width="@dimen/option_border_width" />
            <corners android:radius="4dp" />
            <corners android:radius="4dp" />
        </shape>
        </shape>
    </item>
</ripple>
+1 −0
Original line number Original line Diff line number Diff line
@@ -42,6 +42,7 @@
        <item name="itemTextColor">@color/bottom_nav_item_color</item>
        <item name="itemTextColor">@color/bottom_nav_item_color</item>
        <item name="itemTextAppearanceActive">@style/BottomNavTextAppearance</item>
        <item name="itemTextAppearanceActive">@style/BottomNavTextAppearance</item>
        <item name="itemTextAppearanceInactive">@style/BottomNavTextAppearance</item>
        <item name="itemTextAppearanceInactive">@style/BottomNavTextAppearance</item>
        <item name="itemBackground">?android:attr/selectableItemBackgroundBorderless</item>
        <item name="android:background">?android:colorPrimary</item>
        <item name="android:background">?android:colorPrimary</item>
    </style>
    </style>


+13 −1
Original line number Original line Diff line number Diff line
@@ -76,11 +76,23 @@ public class OptionSelectorController<T extends CustomizationOption<T>> {
        if (!mOptions.contains(option)) {
        if (!mOptions.contains(option)) {
            throw new IllegalArgumentException("Invalid option");
            throw new IllegalArgumentException("Invalid option");
        }
        }
        updateActivatedStatus(mSelectedOption, false);
        updateActivatedStatus(option, true);
        mSelectedOption = option;
        mSelectedOption = option;
        mAdapter.notifyDataSetChanged();
        notifyListeners();
        notifyListeners();
    }
    }


    private void updateActivatedStatus(CustomizationOption option, boolean isActivated) {
        int index = mOptions.indexOf(option);
        if (index < 0) {
            return;
        }
        RecyclerView.ViewHolder holder = mContainer.findViewHolderForAdapterPosition(index);
        if (holder != null && holder.itemView != null) {
            holder.itemView.setActivated(isActivated);
        }
    }

    /**
    /**
     * Initializes the UI for the options passed in the constructor of this class.
     * Initializes the UI for the options passed in the constructor of this class.
     */
     */