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

Commit 9a888b9b authored by John Spurlock's avatar John Spurlock Committed by Android (Google) Code Review
Browse files

Merge "QS: Add scanning progress state indication." into lmp-dev

parents 03861d07 465cefa1
Loading
Loading
Loading
Loading
+45 −0
Original line number Diff line number Diff line
<!--
 Copyright (C) 2014 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.
-->
<vector xmlns:android="http://schemas.android.com/apk/res/android"
    android:height="2dp"
    android:viewportHeight="1"
    android:viewportWidth="360"
    android:width="360dp" >

    <group
        android:name="linear_indeterminate"
        android:translateX="180.0"
        android:translateY="0.0" >
        <group
            android:name="path1"
            android:scaleX="0.1"
            android:translateX="-522.59" >
            <path
                android:name="rect1"
                android:fillColor="?android:attr/colorControlActivated"
                android:pathData="m 0 0 l 288 0 l 0 1 l -288 0 z" />
        </group>
        <group
            android:name="path2"
            android:scaleX="0.1"
            android:translateX="-197.6" >
            <path
                android:name="rect2"
                android:fillColor="?android:attr/colorControlActivated"
                android:pathData="m 0 0 l 288 0 l 0 1 l -288 0 z" />
        </group>
    </group>
</vector>
 No newline at end of file
+32 −0
Original line number Diff line number Diff line
<!--
 Copyright (C) 2014 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.
-->
<animated-vector xmlns:android="http://schemas.android.com/apk/res/android"
    android:drawable="@drawable/indeterminate" >

    <target
        android:name="path1"
        android:animation="@*android:anim/progress_indeterminate_horizontal_rect1_translate" />
    <target
        android:name="path1"
        android:animation="@*android:anim/progress_indeterminate_horizontal_rect1_scale" />

    <target
        android:name="path2"
        android:animation="@*android:anim/progress_indeterminate_horizontal_rect2_translate" />
    <target
        android:name="path2"
        android:animation="@*android:anim/progress_indeterminate_horizontal_rect2_scale" />
</animated-vector>
+10 −0
Original line number Diff line number Diff line
@@ -148,6 +148,16 @@
        android:layout_alignParentBottom="true"
        />

    <ImageView
        android:id="@+id/qs_detail_header_progress"
        android:src="@drawable/indeterminate_anim"
        android:alpha="0"
        android:background="@color/qs_detail_progress_track"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_alignParentBottom="true"
        />

    <TextView
        android:id="@+id/header_debug_info"
        android:visibility="invisible"
+1 −0
Original line number Diff line number Diff line
@@ -45,6 +45,7 @@
    <color name="qs_subhead">#99FFFFFF</color><!-- 60% white -->
    <color name="qs_detail_empty">#24B0BEC5</color><!-- 14% blue grey 200-->
    <color name="qs_detail_transition">#66FFFFFF</color>
    <color name="qs_detail_progress_track">#99009688</color><!-- 60% deep teal 500 -->
    <color name="data_usage_secondary">#99FFFFFF</color><!-- 60% white -->
    <color name="data_usage_graph_track">#33FFFFFF</color><!-- 20% white -->
    <color name="data_usage_graph_warning">#FFFFFFFF</color>
+14 −3
Original line number Diff line number Diff line
@@ -234,8 +234,9 @@ public class QSPanel extends ViewGroup {
            }
            @Override
            public void onScanStateChanged(boolean state) {
                r.scanState = state;
                if (mDetailRecord == r) {
                    fireScanStateChanged(state);
                    fireScanStateChanged(r.scanState);
                }
            }
        };
@@ -310,9 +311,10 @@ public class QSPanel extends ViewGroup {
            mDetailContent.removeAllViews();
            mDetail.bringToFront();
            mDetailContent.addView(r.detailView);
            mDetailRecord = r;
            setDetailRecord(r);
        } else {
            listener = mTeardownDetailWhenDone;
            fireScanStateChanged(false);
        }
        fireShowingDetail(show ? detailAdapter : null);
        mClipper.animateCircularClip(x, y, show, listener);
@@ -425,6 +427,14 @@ public class QSPanel extends ViewGroup {
        }
    }

    private void setDetailRecord(Record r) {
        if (r == mDetailRecord) return;
        mDetailRecord = r;
        final boolean scanState = mDetailRecord instanceof TileRecord
                && ((TileRecord) mDetailRecord).scanState;
        fireScanStateChanged(scanState);
    }

    private class H extends Handler {
        private static final int SHOW_DETAIL = 1;
        private static final int SET_TILE_VISIBILITY = 2;
@@ -448,12 +458,13 @@ public class QSPanel extends ViewGroup {
        QSTileView tileView;
        int row;
        int col;
        boolean scanState;
    }

    private final AnimatorListenerAdapter mTeardownDetailWhenDone = new AnimatorListenerAdapter() {
        public void onAnimationEnd(Animator animation) {
            mDetailContent.removeAllViews();
            mDetailRecord = null;
            setDetailRecord(null);
        };
    };

Loading