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

Commit 11ad7f2c authored by Jason Monk's avatar Jason Monk Committed by Android (Google) Code Review
Browse files

Merge "Add way to add to prototype QS editing"

parents 699ee64e 5db8a414
Loading
Loading
Loading
Loading
+43 −0
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<!--
     Copyright (C) 2015 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.
-->

<FrameLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_height="wrap_content"
    android:layout_width="wrap_content"
    android:paddingTop="20dp"
    android:paddingStart="7dp"
    android:paddingEnd="7dp">
    <LinearLayout
        android:layout_height="wrap_content"
        android:layout_width="80dp"
        android:orientation="vertical">
        <ImageView
            android:id="@+id/tile_icon"
            android:layout_gravity="center"
            android:layout_width="@dimen/qs_tile_icon_size"
            android:layout_height="@dimen/qs_tile_icon_size" />
        <TextView
            android:id="@+id/tile_label"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_gravity="center|bottom"
            android:paddingTop="10dp"
            android:gravity="center"
            android:textSize="@dimen/qs_tile_text_size" />
    </LinearLayout>
</FrameLayout>
+32 −0
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2015 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.
-->
<FrameLayout
        xmlns:android="http://schemas.android.com/apk/res/android"
        android:layout_width="match_parent"
        android:layout_height="wrap_content">
        <ListView
            android:id="@android:id/list"
            android:layout_width="match_parent"
            android:layout_height="wrap_content" />
        <TextView
            android:paddingTop="10dp"
            android:id="@+id/empty_text"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_gravity="center"
            android:textAppearance="?android:attr/textAppearanceMedium"
            android:text="@string/no_tiles_add" />
</FrameLayout>
+55 −0
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<!--
 ** Copyright 2015, 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.
 -->

 <LinearLayout
     xmlns:android="http://schemas.android.com/apk/res/android"
     android:layout_width="match_parent"
     android:layout_height="wrap_content"
     android:background="@drawable/qs_background_primary"
     android:paddingBottom="20dp"
     android:orientation="vertical">

     <LinearLayout
         android:layout_width="match_parent"
         android:layout_height="wrap_content"
         android:background="@drawable/notification_header_bg"
         android:paddingStart="?android:attr/listPreferredItemPaddingStart"
         android:paddingEnd="?android:attr/listPreferredItemPaddingEnd"
         android:paddingTop="10dp"
         android:paddingBottom="10dp"
         android:orientation="horizontal">
         <ImageView
             android:id="@android:id/icon"
             android:layout_width="36dp"
             android:layout_height="36dp" />
         <TextView
             android:id="@android:id/title"
             android:paddingStart="10dp"
             android:textColor="@android:color/white"
             android:textAppearance="?android:attr/textAppearanceSmall"
             android:layout_width="wrap_content"
             android:layout_height="wrap_content"
             android:layout_gravity="center_vertical" />
     </LinearLayout>

     <GridLayout
         android:id="@+id/tile_grid"
         android:layout_width="match_parent"
         android:layout_height="wrap_content"
         android:columnCount="4" />

 </LinearLayout>
+1 −0
Original line number Diff line number Diff line
@@ -1166,6 +1166,7 @@
    <string name="qs_customize" translatable="false">Allow long-press customize in Quick Settings</string>
    <string name="qs_customize_info" translatable="false">Info</string>
    <string name="qs_customize_remove" translatable="false">Remove</string>
    <string name="no_tiles_add" translatable="false">No tiles to add</string>

    <!-- Dialog title asking if Bluetooth should be enabled [CHAR LIMIT=NONE] -->
    <string name="enable_bluetooth_title">Turn on Bluetooth?</string>
+14 −1
Original line number Diff line number Diff line
@@ -137,7 +137,7 @@ public abstract class QSTile<TState extends State> implements Listenable {
        mHandler.obtainMessage(H.SHOW_DETAIL, show ? 1 : 0, 0).sendToTarget();
    }

    protected final void refreshState() {
    public final void refreshState() {
        refreshState(null);
    }

@@ -360,6 +360,19 @@ public abstract class QSTile<TState extends State> implements Listenable {
        }
    }

    public static class DrawableIcon extends Icon {
        protected final Drawable mDrawable;

        public DrawableIcon(Drawable drawable) {
            mDrawable = drawable;
        }

        @Override
        public Drawable getDrawable(Context context) {
            return mDrawable;
        }
    }

    public static class ResourceIcon extends Icon {
        private static final SparseArray<Icon> ICONS = new SparseArray<Icon>();

Loading