Multiline AccessibilityMenu settings page title

Bug: 276457729
Test: Install apk, change system language to Armenian, check settings page
Change-Id: I2c7ef65bbf4c2b3fb5d1156f6febf2cd259f314e
This commit is contained in:
Riley Jones
2023-04-04 18:31:35 +00:00
parent e183b209d4
commit 1a0ee758f5
2 changed files with 38 additions and 0 deletions

View File

@@ -0,0 +1,29 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
~ Copyright (C) 2023 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="match_parent">
<TextView
android:id="@+id/action_bar_title"
style="@style/TextAppearance.AppCompat.Title"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:gravity="center_vertical"
android:maxLines="5"/>
</LinearLayout>

View File

@@ -16,6 +16,7 @@
package com.android.systemui.accessibility.accessibilitymenu.activity;
import android.app.ActionBar;
import android.content.Context;
import android.content.Intent;
import android.content.SharedPreferences;
@@ -24,6 +25,7 @@ import android.net.Uri;
import android.os.Bundle;
import android.provider.Browser;
import android.provider.Settings;
import android.widget.TextView;
import android.view.View;
import androidx.annotation.Nullable;
@@ -46,6 +48,13 @@ public class A11yMenuSettingsActivity extends FragmentActivity {
.beginTransaction()
.replace(android.R.id.content, new A11yMenuPreferenceFragment())
.commit();
ActionBar actionBar = getActionBar();
actionBar.setDisplayShowCustomEnabled(true);
actionBar.setCustomView(R.layout.preferences_action_bar);
((TextView) findViewById(R.id.action_bar_title)).setText(
getResources().getString(R.string.accessibility_menu_settings_name)
);
}
/**