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

Commit 13ead1b4 authored by Jason Hsu's avatar Jason Hsu Committed by Automerger Merge Worker
Browse files

Merge "Avoid static import IntDef value to workaround for Java 8 javac issue"...

Merge "Avoid static import IntDef value to workaround for Java 8 javac issue" into sc-dev am: dc2a0a63

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/13958474

Change-Id: I8fc56b83b35ab0580bfb2af07f0ab4d20ddfee0f
parents c85389ac dc2a0a63
Loading
Loading
Loading
Loading
+13 −13
Original line number Original line Diff line number Diff line
@@ -43,16 +43,16 @@ public class AccessibilityTargetAdapter extends Adapter<ViewHolder> {
    private final List<AccessibilityTarget> mTargets;
    private final List<AccessibilityTarget> mTargets;


    @IntDef({
    @IntDef({
            AccessibilityTargetAdapter.FIRST_ITEM,
            ItemType.FIRST_ITEM,
            AccessibilityTargetAdapter.REGULAR_ITEM,
            ItemType.REGULAR_ITEM,
            AccessibilityTargetAdapter.LAST_ITEM
            ItemType.LAST_ITEM
    })
    })
    @Retention(RetentionPolicy.SOURCE)
    @Retention(RetentionPolicy.SOURCE)
    @interface ItemType {}
    @interface ItemType {

        int FIRST_ITEM = 0;
    private static final int FIRST_ITEM = 0;
        int REGULAR_ITEM = 1;
    private static final int REGULAR_ITEM = 1;
        int LAST_ITEM = 2;
    private static final int LAST_ITEM = 2;
    }


    public AccessibilityTargetAdapter(List<AccessibilityTarget> targets) {
    public AccessibilityTargetAdapter(List<AccessibilityTarget> targets) {
        mTargets = targets;
        mTargets = targets;
@@ -65,11 +65,11 @@ public class AccessibilityTargetAdapter extends Adapter<ViewHolder> {
                R.layout.accessibility_floating_menu_item, parent,
                R.layout.accessibility_floating_menu_item, parent,
                /* attachToRoot= */ false);
                /* attachToRoot= */ false);


        if (itemType == FIRST_ITEM) {
        if (itemType == ItemType.FIRST_ITEM) {
            return new TopViewHolder(root);
            return new TopViewHolder(root);
        }
        }


        if (itemType == LAST_ITEM) {
        if (itemType == ItemType.LAST_ITEM) {
            return new BottomViewHolder(root);
            return new BottomViewHolder(root);
        }
        }


@@ -87,14 +87,14 @@ public class AccessibilityTargetAdapter extends Adapter<ViewHolder> {
    @Override
    @Override
    public int getItemViewType(int position) {
    public int getItemViewType(int position) {
        if (position == 0) {
        if (position == 0) {
            return FIRST_ITEM;
            return ItemType.FIRST_ITEM;
        }
        }


        if (position == (getItemCount() - 1)) {
        if (position == (getItemCount() - 1)) {
            return LAST_ITEM;
            return ItemType.LAST_ITEM;
        }
        }


        return REGULAR_ITEM;
        return ItemType.REGULAR_ITEM;
    }
    }


    @Override
    @Override