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

Commit 8b6b35dc authored by Garfield, Tan's avatar Garfield, Tan
Browse files

Change the color of loading spinner to the color of selected roots.

Bug: 28334455
Change-Id: Id80cbfa557eb5e3914c216da2570ae105ec77c20
parent 8a15d327
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