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

Commit b786d4ab authored by android-build-team Robot's avatar android-build-team Robot
Browse files

Snap for 4989423 from bda5932d to qt-release

Change-Id: Ia2d7ba47bfc95ffa666321badcef6c6b7c439b37
parents 65a50b56 bda5932d
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -27,4 +27,8 @@
        <attr name="textHandleColor" format="reference" />
        <attr name="textCursorColor" format="reference" />
    </declare-styleable>

    <declare-styleable name="SnackbarView">
        <attr name="android:textColor" format="reference" />
    </declare-styleable>
</resources>
+4 −0
Original line number Diff line number Diff line
@@ -58,4 +58,8 @@
        <item name="android:textSize">13sp</item>
        <item name="android:textColor">?android:attr/textColorSecondary</item>
    </style>

    <style name="SnackbarButtonStyle" parent="Widget.MaterialComponents.Button.TextButton">
        <item name="android:textColor">@color/g_light_grey</item>
    </style>
</resources>
+9 −0
Original line number Diff line number Diff line
@@ -103,6 +103,7 @@ import com.android.documentsui.sorting.SortModel;
import java.io.IOException;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.util.Iterator;
import java.util.List;

/**
@@ -1044,6 +1045,14 @@ public class DirectoryFragment extends Fragment implements SwipeRefreshLayout.On

            updateLayout(mState.derivedMode);

            // Update the selection to remove any disappeared IDs.
            Iterator<String> selectionIter = mSelectionMgr.getSelection().iterator();
            while (selectionIter.hasNext()) {
                if (!mAdapter.getStableIds().contains(selectionIter.next())) {
                    selectionIter.remove();
                }
            }

            mAdapter.notifyDataSetChanged();

            if (mRestoredState != null) {
+7 −0
Original line number Diff line number Diff line
@@ -18,6 +18,8 @@ package com.android.documentsui.ui;

import androidx.annotation.StringRes;
import android.app.Activity;
import android.content.res.TypedArray;
import android.graphics.Color;
import android.support.design.widget.Snackbar;
import android.view.Gravity;
import android.view.View;
@@ -101,8 +103,13 @@ public final class Snackbars {
    public static final Snackbar makeSnackbarWithAction(Activity activity, int docCount,
            CharSequence message, int duration, CharSequence actionText,
            Consumer<View> action, final Snackbar.Callback callback) {
        TypedArray ta = activity.obtainStyledAttributes(R.style.SnackbarButtonStyle,
                R.styleable.SnackbarView);
        int textColor = ta.getColor(R.styleable.SnackbarView_android_textColor, Color.WHITE);
        ta.recycle();
        return makeSnackbar(activity, message, duration)
                .setAction(actionText, action::accept)
                .setActionTextColor(textColor)
                .addCallback(callback);
    }

+7 −0
Original line number Diff line number Diff line
@@ -191,6 +191,13 @@ public class DirectoryListBot extends Bots.BaseBot {
        assertSelection(number);
    }

    public boolean isDocumentSelected(String label) throws UiObjectNotFoundException {
        waitForDocument(label);
        UiObject2 selectionHotspot = findSelectionHotspot(label);
        return selectionHotspot.getResourceName()
                .equals("com.android.documentsui:id/icon_check");
    }

    public UiObject2 findSelectionHotspot(String label) {
        final BySelector list = By.res(DIR_LIST_ID);

Loading