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

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

Merge "QS: Clean up dual target accessibility"

parents a9a28020 28df4ed8
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -14,7 +14,7 @@
    See the License for the specific language governing permissions and
    limitations under the License.
-->
<RelativeLayout
<com.android.systemui.qs.tileimpl.ButtonRelativeLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
@@ -88,4 +88,4 @@
        android:alpha="?android:attr/disabledAlpha"
        android:background="?android:attr/colorForeground"/>

</RelativeLayout>
</com.android.systemui.qs.tileimpl.ButtonRelativeLayout>
+32 −0
Original line number Diff line number Diff line
/*
 * Copyright (C) 2017 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.
 */

package com.android.systemui.qs.tileimpl;

import android.content.Context;
import android.util.AttributeSet;
import android.widget.Button;
import android.widget.RelativeLayout;

public class ButtonRelativeLayout extends RelativeLayout {

    public ButtonRelativeLayout(Context context, AttributeSet attrs) {
        super(context, attrs);
    }

    @Override
    public CharSequence getAccessibilityClassName() {
        return Button.class.getName();
    }
}
+2 −0
Original line number Diff line number Diff line
@@ -103,6 +103,8 @@ public class QSTileView extends QSTileBaseView {
        }
        mDivider.setVisibility(state.dualTarget ? View.VISIBLE : View.INVISIBLE);
        mExpandIndicator.setVisibility(state.dualTarget ? View.VISIBLE : View.GONE);
        mLabelContainer.setContentDescription(state.dualTarget ? state.dualLabelContentDescription
                : null);
        if (state.dualTarget != mLabelContainer.isClickable()) {
            mLabelContainer.setClickable(state.dualTarget);
            mLabelContainer.setLongClickable(state.dualTarget);
+1 −7
Original line number Diff line number Diff line
@@ -148,13 +148,7 @@ public class BluetoothTile extends QSTileImpl<BooleanState> {
            state.state = Tile.STATE_INACTIVE;
        }

        CharSequence bluetoothName = state.label;
        if (connected) {
            bluetoothName = state.dualLabelContentDescription = mContext.getString(
                    R.string.accessibility_bluetooth_name, state.label);
        }
        state.dualLabelContentDescription = bluetoothName;
        state.contentDescription = state.contentDescription + "," + mContext.getString(
        state.dualLabelContentDescription = mContext.getResources().getString(
                R.string.accessibility_quick_settings_open_settings, getTileLabel());
        state.expandedAccessibilityClassName = Switch.class.getName();
    }
+2 −0
Original line number Diff line number Diff line
@@ -198,6 +198,8 @@ public class DndTile extends QSTileImpl<BooleanState> {
        if (valueChanged) {
            fireToggleStateChanged(state.value);
        }
        state.dualLabelContentDescription = mContext.getResources().getString(
                R.string.accessibility_quick_settings_open_settings, getTileLabel());
        state.expandedAccessibilityClassName = Switch.class.getName();
    }

Loading