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

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

Merge "Tint thumbnails when selected." into nyc-andromeda-dev

parents 837b7ead 83ac678e
Loading
Loading
Loading
Loading
+24 −0
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2016 The Android Open Source Project

     Licensed under the Apache License, Version 2.0 (the "License");
     you may not use this file except in compliance with the License.
     You may obtain a copy of the License at

          http://www.apache.org/licenses/LICENSE-2.0

     Unless required by applicable law or agreed to in writing, software
     distributed under the License is distributed on an "AS IS" BASIS,
     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
     See the License for the specific language governing permissions and
     limitations under the License.
-->

<selector xmlns:android="http://schemas.android.com/apk/res/android">
    <item
        android:state_activated="true"
        android:color="?android:attr/colorAccent"
        android:alpha=".5" />
    <item
        android:color="@android:color/transparent" />
</selector>
+3 −1
Original line number Diff line number Diff line
@@ -36,7 +36,9 @@
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:scaleType="centerCrop"
            android:contentDescription="@null" />
            android:contentDescription="@null"
            android:tint="@color/item_doc_grid_tint"
            android:tintMode="src_over" />

        <com.android.documentsui.GridItemThumbnail
            android:id="@+id/icon_mime_lg"
+0 −1
Original line number Diff line number Diff line
@@ -27,5 +27,4 @@

    <!-- Indicates if search view is taking the whole toolbar space -->
    <bool name="full_bar_search_view">true</bool>

</resources>
+5 −0
Original line number Diff line number Diff line
@@ -114,6 +114,11 @@ public final class Shared {
     */
    public static final int MAX_DOCS_IN_INTENT = 500;

    /**
     * Animation duration of checkbox in directory list/grid in millis.
     */
    public static final int CHECK_ANIMATION_DURATION = 100;

    private static final Collator sCollator;

    static {
+7 −1
Original line number Diff line number Diff line
@@ -26,9 +26,12 @@ import android.view.KeyEvent;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.view.ViewPropertyAnimator;
import android.widget.ImageView;

import com.android.documentsui.Events.InputEvent;
import com.android.documentsui.R;
import com.android.documentsui.Shared;
import com.android.documentsui.State;

public abstract class DocumentHolder
@@ -48,7 +51,6 @@ public abstract class DocumentHolder

    private View mSelectionHotspot;


    public DocumentHolder(Context context, ViewGroup parent, int layout) {
        this(context, inflateLayout(context, parent, layout));
    }
@@ -159,6 +161,10 @@ public abstract class DocumentHolder
        return inflater.inflate(layout, parent, false);
    }

    static ViewPropertyAnimator fade(ImageView view, float alpha) {
        return view.animate().setDuration(Shared.CHECK_ANIMATION_DURATION).alpha(alpha);
    }

    /**
     * Implement this in order to be able to respond to events coming from DocumentHolders.
     * TODO: Make this bubble up logic events rather than having imperative commands.
Loading