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

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

Merge "UI updates to dual target tiles"

parents 4fd6eb61 f12710a5
Loading
Loading
Loading
Loading
+41 −14
Original line number Diff line number Diff line
@@ -14,23 +14,37 @@
    See the License for the specific language governing permissions and
    limitations under the License.
-->
<LinearLayout
<RelativeLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="48dp"
    android:paddingTop="8dp">
    <LinearLayout
        android:id="@+id/label_group"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:orientation="horizontal"
        android:gravity="center_horizontal"
        android:paddingTop="8dp"
        android:paddingBottom="8dp">
     <TextView android:id="@+id/tile_label"
        android:layout_alignParentTop="true"
        android:layout_centerHorizontal="true"
        android:orientation="horizontal">

        <TextView
            android:id="@+id/tile_label"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:textColor="?android:attr/textColorPrimary"
            android:gravity="center_horizontal"
            android:minLines="2"
            android:clickable="false"
            android:maxLines="2"
            android:padding="0dp"
            android:textAppearance="@style/TextAppearance.QS.TileLabel"
            android:clickable="false" />
            android:textColor="?android:attr/textColorPrimary"/>

        <ImageView
            android:id="@+id/expand_indicator"
            android:layout_marginStart="4dp"
            android:layout_width="12dp"
            android:layout_height="match_parent"
            android:src="@drawable/qs_dual_tile_caret"
            android:tint="?android:attr/textColorPrimary" />

        <ImageView android:id="@+id/restricted_padlock"
            android:layout_width="@dimen/qs_tile_text_size"
            android:layout_height="match_parent"
@@ -40,3 +54,16 @@
            android:scaleType="centerInside"
            android:visibility="gone" />
    </LinearLayout>

    <View
        android:id="@+id/underline"
        android:layout_width="30dp"
        android:layout_height="1dp"
        android:layout_marginTop="2dp"
        android:layout_alignStart="@id/label_group"
        android:layout_alignEnd="@id/label_group"
        android:layout_below="@id/label_group"
        android:alpha="?android:attr/disabledAlpha"
        android:background="?android:attr/colorForeground"/>

</RelativeLayout>
+7 −5
Original line number Diff line number Diff line
@@ -36,11 +36,12 @@ import libcore.util.Objects;
/** View that represents a standard quick settings tile. **/
public class QSTileView extends QSTileBaseView {

    private final View mDivider;
    private View mDivider;
    protected TextView mLabel;
    private ImageView mPadLock;
    private int mState;
    private ViewGroup mLabelContainer;
    private View mExpandIndicator;

    public QSTileView(Context context, QSIconView icon) {
        this(context, icon, false);
@@ -54,8 +55,6 @@ public class QSTileView extends QSTileBaseView {

        setClickable(true);
        setId(View.generateViewId());
        mDivider = LayoutInflater.from(context).inflate(R.layout.divider, this, false);
        addView(mDivider);
        createLabel();
        setOrientation(VERTICAL);
        setGravity(Gravity.CENTER);
@@ -81,8 +80,10 @@ public class QSTileView extends QSTileBaseView {
                .inflate(R.layout.qs_tile_label, this, false);
        mLabelContainer.setClipChildren(false);
        mLabelContainer.setClipToPadding(false);
        mLabel = (TextView) mLabelContainer.findViewById(R.id.tile_label);
        mPadLock = (ImageView) mLabelContainer.findViewById(R.id.restricted_padlock);
        mLabel = mLabelContainer.findViewById(R.id.tile_label);
        mPadLock = mLabelContainer.findViewById(R.id.restricted_padlock);
        mDivider = mLabelContainer.findViewById(R.id.underline);
        mExpandIndicator = mLabelContainer.findViewById(R.id.expand_indicator);

        addView(mLabelContainer);
    }
@@ -101,6 +102,7 @@ public class QSTileView extends QSTileBaseView {
            mLabel.setText(state.label);
        }
        mDivider.setVisibility(state.dualTarget ? View.VISIBLE : View.INVISIBLE);
        mExpandIndicator.setVisibility(state.dualTarget ? View.VISIBLE : View.GONE);
        if (state.dualTarget != mLabelContainer.isClickable()) {
            mLabelContainer.setClickable(state.dualTarget);
            mLabelContainer.setLongClickable(state.dualTarget);