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

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

Merge "Change the color of loading spinner to the color of selected roots." into nyc-andromeda-dev

parents 1981ad85 8b6b35dc
Loading
Loading
Loading
Loading
+10 −0
Original line number Diff line number Diff line
@@ -17,6 +17,8 @@
package com.android.documentsui.dirlist;

import android.content.Context;
import android.content.res.TypedArray;
import android.support.annotation.ColorRes;
import android.support.v4.widget.SwipeRefreshLayout;
import android.util.AttributeSet;
import android.view.MotionEvent;
@@ -28,12 +30,20 @@ import com.android.documentsui.Events;
 */
public class TouchSwipeRefreshLayout extends SwipeRefreshLayout {

    private static final int[] COLOR_RES = new int[] { android.R.attr.colorAccent };
    private static int COLOR_ACCENT_INDEX = 0;

    public TouchSwipeRefreshLayout(Context context) {
        this(context, null);
    }

    public TouchSwipeRefreshLayout(Context context, AttributeSet attrs) {
        super(context, attrs);

        TypedArray a = context.obtainStyledAttributes(COLOR_RES);
        @ColorRes int colorId = a.getResourceId(COLOR_ACCENT_INDEX, -1);
        a.recycle();
        setColorSchemeResources(colorId);
    }

    @Override