Merge "Unify the caption preference class naming"
This commit is contained in:
@@ -2110,7 +2110,7 @@
|
||||
<category android:name="android.intent.category.DEFAULT" />
|
||||
</intent-filter>
|
||||
<meta-data android:name="com.android.settings.FRAGMENT_CLASS"
|
||||
android:value="com.android.settings.accessibility.CaptionPropertiesFragment" />
|
||||
android:value="com.android.settings.accessibility.CaptioningPropertiesFragment" />
|
||||
<meta-data android:name="com.android.settings.HIGHLIGHT_MENU_KEY"
|
||||
android:value="@string/menu_key_accessibility"/>
|
||||
<meta-data android:name="com.android.settings.PRIMARY_PROFILE_CONTROLLED"
|
||||
|
@@ -97,8 +97,8 @@
|
||||
|
||||
<dimen name="rect_button_radius">8dp</dimen>
|
||||
|
||||
<!-- Default text size for caption preview samples. Uses dp rather than sp because captions are not scaled. -->
|
||||
<dimen name="caption_preview_text_size">48dp</dimen>
|
||||
<!-- Default text size for captioning preview samples. Uses dp rather than sp because captions are not scaled. -->
|
||||
<dimen name="captioning_preview_text_size">48dp</dimen>
|
||||
|
||||
<!-- ActionBar height -->
|
||||
<dimen name="actionbar_size">56dip</dimen>
|
||||
|
@@ -5599,20 +5599,20 @@
|
||||
<string name="accessibility_color_inversion_about_title">About color inversion</string>
|
||||
<!-- Color correction footer link content description [CHAR LIMIT=NONE] -->
|
||||
<string name="accessibility_color_inversion_footer_learn_more_content_description">Learn more about color inversion</string>
|
||||
<!-- Title for Captions settings screen to control turning on/off the feature entirely [CHAR LIMIT=60] -->
|
||||
<string name="accessibility_caption_primary_switch_title">Show captions</string>
|
||||
<!-- Summary for Captions settings screen to control turning on/off the feature entirely [CHAR LIMIT=NONE] -->
|
||||
<string name="accessibility_caption_primary_switch_summary">For supported app only</string>
|
||||
<!-- Title for Caption preference settings screen for configuring font style. [CHAR LIMIT=NONE] -->
|
||||
<string name="captioning_caption_appearance_title">Caption size and style</string>
|
||||
<!-- Summary for Captions settings, explaining important settings under it. [CHAR LIMIT=NONE] -->
|
||||
<string name="captioning_caption_appearance_summary"><xliff:g id="accessibility_font_size" example="Large">%1$s</xliff:g> text size</string>
|
||||
<!-- Title for Caption preference settings screen for configuring language. [CHAR LIMIT=NONE] -->
|
||||
<!-- Title for captioning settings screen to control turning on/off the feature entirely [CHAR LIMIT=60] -->
|
||||
<string name="accessibility_captioning_primary_switch_title">Show captions</string>
|
||||
<!-- Summary for captioning settings screen to control turning on/off the feature entirely [CHAR LIMIT=NONE] -->
|
||||
<string name="accessibility_captioning_primary_switch_summary">For supported app only</string>
|
||||
<!-- Title for captioning preference settings screen for configuring font style. [CHAR LIMIT=NONE] -->
|
||||
<string name="captioning_appearance_title">Caption size and style</string>
|
||||
<!-- Summary for captioning settings, explaining important settings under it. [CHAR LIMIT=NONE] -->
|
||||
<string name="captioning_appearance_summary"><xliff:g id="accessibility_font_size" example="Large">%1$s</xliff:g> text size</string>
|
||||
<!-- Title for captioning preference settings screen for configuring language. [CHAR LIMIT=NONE] -->
|
||||
<string name="captioning_more_options_title">More options</string>
|
||||
<!-- Introduction for the captions preference page. [CHAR LIMIT=NONE] -->
|
||||
<string name="accessibility_caption_preference_intro">Customize caption size and style to make them easier to read</string>
|
||||
<!-- Summary for the captions preference page. [CHAR LIMIT=NONE] -->
|
||||
<string name="accessibility_caption_preference_summary">These caption preferences aren\u2019t supported by all media apps</string>
|
||||
<!-- Introduction for the captioning preference page. [CHAR LIMIT=NONE] -->
|
||||
<string name="accessibility_captioning_preference_intro">Customize caption size and style to make them easier to read</string>
|
||||
<!-- Summary for the captioning preference page. [CHAR LIMIT=NONE] -->
|
||||
<string name="accessibility_captioning_preference_summary">These caption preferences aren\u2019t supported by all media apps</string>
|
||||
<!-- Summary for accessibility shortcut preference for software shortcut type. [CHAR LIMIT=NONE] -->
|
||||
<string name="accessibility_shortcut_type_software">Accessibility button</string>
|
||||
<!-- Summary for accessibility shortcut preference for software shortcut type when gesture mode is on. [CHAR LIMIT=NONE] -->
|
||||
@@ -5793,7 +5793,7 @@
|
||||
<string name="captioning_edge_type">Edge type</string>
|
||||
<!-- Title for the preference to change video caption font family (ex. monospace, sans-serif). [CHAR LIMIT=35] -->
|
||||
<string name="captioning_typeface">Font family</string>
|
||||
<!-- Sample text for previewing video caption preferences. [CHAR LIMIT=NONE] -->
|
||||
<!-- Sample text for previewing video captioning preferences. [CHAR LIMIT=NONE] -->
|
||||
<string name="captioning_preview_text">Captions will look like this</string>
|
||||
<!-- Sample characters for previewing video caption preferences. [CHAR LIMIT=2] -->
|
||||
<string name="captioning_preview_characters">Aa</string>
|
||||
|
@@ -119,10 +119,9 @@
|
||||
settings:controller="com.android.settings.accessibility.LiveCaptionPreferenceController"/>
|
||||
|
||||
<Preference
|
||||
android:fragment="com.android.settings.accessibility.CaptionPropertiesFragment"
|
||||
android:fragment="com.android.settings.accessibility.CaptioningPropertiesFragment"
|
||||
android:key="captioning_preference_screen"
|
||||
android:icon="@drawable/ic_captioning"
|
||||
android:persistent="false"
|
||||
android:title="@string/accessibility_captioning_title"
|
||||
settings:controller="com.android.settings.accessibility.CaptioningPreferenceController"/>
|
||||
|
||||
|
@@ -18,15 +18,15 @@
|
||||
<PreferenceScreen
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:settings="http://schemas.android.com/apk/res-auto"
|
||||
android:title="@string/captioning_caption_appearance_title">
|
||||
android:title="@string/captioning_appearance_title">
|
||||
|
||||
<com.android.settingslib.widget.LayoutPreference
|
||||
android:key="caption_preview"
|
||||
android:key="captioning_preview"
|
||||
android:title="@string/summary_placeholder"
|
||||
android:layout="@layout/captioning_preview"
|
||||
android:selectable="false"
|
||||
settings:searchable="false"
|
||||
settings:controller="com.android.settings.accessibility.CaptionPreviewPreferenceController"/>
|
||||
settings:controller="com.android.settings.accessibility.CaptioningPreviewPreferenceController"/>
|
||||
|
||||
<ListPreference
|
||||
android:entries="@array/captioning_font_size_selector_titles"
|
||||
@@ -34,17 +34,17 @@
|
||||
android:key="captioning_font_size"
|
||||
android:summary="%s"
|
||||
android:title="@string/captioning_text_size"
|
||||
settings:controller="com.android.settings.accessibility.CaptionFontSizeController"/>
|
||||
settings:controller="com.android.settings.accessibility.CaptioningFontSizeController"/>
|
||||
|
||||
<com.android.settings.accessibility.PresetPreference
|
||||
android:key="captioning_preset"
|
||||
android:title="@string/captioning_preset"
|
||||
settings:controller="com.android.settings.accessibility.CaptionPresetController"/>
|
||||
settings:controller="com.android.settings.accessibility.CaptioningPresetController"/>
|
||||
|
||||
<PreferenceCategory
|
||||
android:key="custom"
|
||||
android:title="@string/captioning_custom_options_title"
|
||||
settings:controller="com.android.settings.accessibility.CaptionCustomController">
|
||||
settings:controller="com.android.settings.accessibility.CaptioningCustomController">
|
||||
|
||||
<ListPreference
|
||||
android:entries="@array/captioning_typeface_selector_titles"
|
||||
@@ -52,58 +52,57 @@
|
||||
android:key="captioning_typeface"
|
||||
android:summary="%s"
|
||||
android:title="@string/captioning_typeface"
|
||||
settings:controller="com.android.settings.accessibility.CaptionTypefaceController"/>
|
||||
settings:controller="com.android.settings.accessibility.CaptioningTypefaceController"/>
|
||||
|
||||
<com.android.settings.accessibility.ColorPreference
|
||||
android:key="captioning_foreground_color"
|
||||
android:title="@string/captioning_foreground_color"
|
||||
settings:controller="com.android.settings.accessibility.CaptionForegroundColorController"/>
|
||||
settings:controller="com.android.settings.accessibility.CaptioningForegroundColorController"/>
|
||||
|
||||
<com.android.settings.accessibility.ColorPreference
|
||||
android:dependency="captioning_foreground_color"
|
||||
android:key="captioning_foreground_opacity"
|
||||
android:title="@string/captioning_foreground_opacity"
|
||||
settings:controller="com.android.settings.accessibility.CaptionForegroundOpacityController"/>
|
||||
settings:controller="com.android.settings.accessibility.CaptioningForegroundOpacityController"/>
|
||||
|
||||
<com.android.settings.accessibility.EdgeTypePreference
|
||||
android:key="captioning_edge_type"
|
||||
android:title="@string/captioning_edge_type"
|
||||
settings:controller="com.android.settings.accessibility.CaptionEdgeTypeController"/>
|
||||
settings:controller="com.android.settings.accessibility.CaptioningEdgeTypeController"/>
|
||||
|
||||
<com.android.settings.accessibility.ColorPreference
|
||||
android:dependency="captioning_edge_type"
|
||||
android:key="captioning_edge_color"
|
||||
android:title="@string/captioning_edge_color"
|
||||
settings:controller="com.android.settings.accessibility.CaptionEdgeColorController"/>
|
||||
settings:controller="com.android.settings.accessibility.CaptioningEdgeColorController"/>
|
||||
|
||||
<com.android.settings.accessibility.ColorPreference
|
||||
android:key="captioning_background_color"
|
||||
android:title="@string/captioning_background_color"
|
||||
settings:controller="com.android.settings.accessibility.CaptionBackgroundColorController"/>
|
||||
settings:controller="com.android.settings.accessibility.CaptioningBackgroundColorController"/>
|
||||
|
||||
<com.android.settings.accessibility.ColorPreference
|
||||
android:dependency="captioning_background_color"
|
||||
android:key="captioning_background_opacity"
|
||||
android:title="@string/captioning_background_opacity"
|
||||
settings:controller="com.android.settings.accessibility.CaptionBackgroundOpacityController"/>
|
||||
settings:controller="com.android.settings.accessibility.CaptioningBackgroundOpacityController"/>
|
||||
|
||||
<com.android.settings.accessibility.ColorPreference
|
||||
android:key="captioning_window_color"
|
||||
android:title="@string/captioning_window_color"
|
||||
settings:controller="com.android.settings.accessibility.CaptionWindowColorController"/>
|
||||
settings:controller="com.android.settings.accessibility.CaptioningWindowColorController"/>
|
||||
|
||||
<com.android.settings.accessibility.ColorPreference
|
||||
android:dependency="captioning_window_color"
|
||||
android:key="captioning_window_opacity"
|
||||
android:title="@string/captioning_window_opacity"
|
||||
settings:controller="com.android.settings.accessibility.CaptionWindowOpacityController"/>
|
||||
settings:controller="com.android.settings.accessibility.CaptioningWindowOpacityController"/>
|
||||
</PreferenceCategory>
|
||||
|
||||
<com.android.settings.accessibility.AccessibilityFooterPreference
|
||||
android:key="captioning_appearance_footer"
|
||||
android:title="@string/accessibility_caption_preference_summary"
|
||||
android:persistent="false"
|
||||
android:title="@string/accessibility_captioning_preference_summary"
|
||||
android:selectable="false"
|
||||
settings:searchable="false"
|
||||
settings:controller="com.android.settings.accessibility.CaptionFooterPreferenceController"/>
|
||||
settings:controller="com.android.settings.accessibility.CaptioningFooterPreferenceController"/>
|
||||
</PreferenceScreen>
|
||||
|
@@ -24,14 +24,13 @@
|
||||
android:key="captioning_locale"
|
||||
android:summary="%s"
|
||||
android:title="@string/captioning_locale"
|
||||
settings:controller="com.android.settings.accessibility.CaptionLocalePreferenceController"/>
|
||||
settings:controller="com.android.settings.accessibility.CaptioningLocalePreferenceController"/>
|
||||
|
||||
<com.android.settings.accessibility.AccessibilityFooterPreference
|
||||
android:key="captioning_more_options_footer"
|
||||
android:title="@string/accessibility_caption_preference_summary"
|
||||
android:persistent="false"
|
||||
android:title="@string/accessibility_captioning_preference_summary"
|
||||
android:selectable="false"
|
||||
settings:searchable="false"
|
||||
settings:controller="com.android.settings.accessibility.CaptionFooterPreferenceController"/>
|
||||
settings:controller="com.android.settings.accessibility.CaptioningFooterPreferenceController"/>
|
||||
|
||||
</PreferenceScreen>
|
||||
|
@@ -18,46 +18,39 @@
|
||||
<PreferenceScreen
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:settings="http://schemas.android.com/apk/res-auto"
|
||||
android:persistent="false"
|
||||
android:title="@string/accessibility_captioning_title">
|
||||
|
||||
<com.android.settingslib.widget.TopIntroPreference
|
||||
android:key="captions_intro"
|
||||
android:persistent="false"
|
||||
android:title="@string/accessibility_caption_preference_intro"/>
|
||||
android:key="captioning_intro"
|
||||
android:title="@string/accessibility_captioning_preference_intro"/>
|
||||
|
||||
<com.android.settingslib.widget.IllustrationPreference
|
||||
android:key="captions_preview"
|
||||
android:persistent="false"
|
||||
android:key="captioning_preview"
|
||||
android:selectable="false"
|
||||
settings:lottie_rawRes="@drawable/accessibility_captions_banner"
|
||||
settings:lottie_rawRes="@drawable/accessibility_captioning_banner"
|
||||
settings:searchable="false" />
|
||||
|
||||
<com.android.settings.widget.SettingsMainSwitchPreference
|
||||
android:key="captioning_preference_switch"
|
||||
android:persistent="false"
|
||||
android:title="@string/accessibility_caption_primary_switch_title"
|
||||
settings:controller="com.android.settings.accessibility.CaptionTogglePreferenceController"/>
|
||||
android:title="@string/accessibility_captioning_primary_switch_title"
|
||||
settings:controller="com.android.settings.accessibility.CaptioningTogglePreferenceController"/>
|
||||
|
||||
<Preference
|
||||
android:fragment="com.android.settings.accessibility.CaptionAppearanceFragment"
|
||||
android:key="captioning_caption_appearance"
|
||||
android:persistent="false"
|
||||
android:title="@string/captioning_caption_appearance_title"
|
||||
settings:controller="com.android.settings.accessibility.CaptionAppearancePreferenceController" />
|
||||
android:fragment="com.android.settings.accessibility.CaptioningAppearanceFragment"
|
||||
android:key="captioning_appearance"
|
||||
android:title="@string/captioning_appearance_title"
|
||||
settings:controller="com.android.settings.accessibility.CaptioningAppearancePreferenceController" />
|
||||
|
||||
<Preference
|
||||
android:fragment="com.android.settings.accessibility.CaptionMoreOptionsFragment"
|
||||
android:fragment="com.android.settings.accessibility.CaptioningMoreOptionsFragment"
|
||||
android:key="captioning_more_options"
|
||||
android:persistent="false"
|
||||
android:title="@string/captioning_more_options_title" />
|
||||
|
||||
<com.android.settings.accessibility.AccessibilityFooterPreference
|
||||
android:key="captioning_settings_footer"
|
||||
android:title="@string/accessibility_caption_preference_summary"
|
||||
android:persistent="false"
|
||||
android:title="@string/accessibility_captioning_preference_summary"
|
||||
android:selectable="false"
|
||||
settings:searchable="false"
|
||||
settings:controller="com.android.settings.accessibility.CaptionFooterPreferenceController"/>
|
||||
settings:controller="com.android.settings.accessibility.CaptioningFooterPreferenceController"/>
|
||||
|
||||
</PreferenceScreen>
|
||||
|
@@ -93,7 +93,7 @@ public class CaptionHelper {
|
||||
previewText.setTextSize(virtualHeight * LINE_HEIGHT_RATIO * fontScale);
|
||||
} else {
|
||||
final float textSize = mContext.getResources().getDimension(
|
||||
R.dimen.caption_preview_text_size);
|
||||
R.dimen.captioning_preview_text_size);
|
||||
previewText.setTextSize(textSize * fontScale);
|
||||
}
|
||||
|
||||
|
@@ -25,9 +25,9 @@ import com.android.settingslib.search.SearchIndexable;
|
||||
|
||||
/** Settings fragment containing font style of captioning properties. */
|
||||
@SearchIndexable(forTarget = SearchIndexable.ALL & ~SearchIndexable.ARC)
|
||||
public class CaptionAppearanceFragment extends DashboardFragment {
|
||||
public class CaptioningAppearanceFragment extends DashboardFragment {
|
||||
|
||||
private static final String TAG = "CaptionAppearanceFragment";
|
||||
private static final String TAG = "CaptioningAppearanceFragment";
|
||||
|
||||
@Override
|
||||
public int getMetricsCategory() {
|
@@ -25,12 +25,12 @@ import com.android.settings.core.BasePreferenceController;
|
||||
import com.google.common.primitives.Floats;
|
||||
import com.google.common.primitives.Ints;
|
||||
|
||||
/** Controller that shows the caption scale and style summary. */
|
||||
public class CaptionAppearancePreferenceController extends BasePreferenceController {
|
||||
/** Controller that shows the captioning scale and style summary. */
|
||||
public class CaptioningAppearancePreferenceController extends BasePreferenceController {
|
||||
|
||||
private final CaptioningManager mCaptioningManager;
|
||||
|
||||
public CaptionAppearancePreferenceController(Context context, String preferenceKey) {
|
||||
public CaptioningAppearancePreferenceController(Context context, String preferenceKey) {
|
||||
super(context, preferenceKey);
|
||||
mCaptioningManager = context.getSystemService(CaptioningManager.class);
|
||||
}
|
@@ -26,13 +26,13 @@ import com.android.settings.R;
|
||||
import com.android.settings.accessibility.ListDialogPreference.OnValueChangedListener;
|
||||
import com.android.settings.core.BasePreferenceController;
|
||||
|
||||
/** Preference controller for caption background color. */
|
||||
public class CaptionBackgroundColorController extends BasePreferenceController
|
||||
/** Preference controller for captioning background color. */
|
||||
public class CaptioningBackgroundColorController extends BasePreferenceController
|
||||
implements OnValueChangedListener {
|
||||
|
||||
private final CaptionHelper mCaptionHelper;
|
||||
|
||||
public CaptionBackgroundColorController(Context context, String preferenceKey) {
|
||||
public CaptioningBackgroundColorController(Context context, String preferenceKey) {
|
||||
super(context, preferenceKey);
|
||||
mCaptionHelper = new CaptionHelper(context);
|
||||
}
|
@@ -25,13 +25,13 @@ import com.android.settings.R;
|
||||
import com.android.settings.accessibility.ListDialogPreference.OnValueChangedListener;
|
||||
import com.android.settings.core.BasePreferenceController;
|
||||
|
||||
/** Preference controller for caption background opacity. */
|
||||
public class CaptionBackgroundOpacityController extends BasePreferenceController
|
||||
/** Preference controller for captioning background opacity. */
|
||||
public class CaptioningBackgroundOpacityController extends BasePreferenceController
|
||||
implements OnValueChangedListener {
|
||||
|
||||
private final CaptionHelper mCaptionHelper;
|
||||
|
||||
public CaptionBackgroundOpacityController(Context context, String preferenceKey) {
|
||||
public CaptioningBackgroundOpacityController(Context context, String preferenceKey) {
|
||||
super(context, preferenceKey);
|
||||
mCaptionHelper = new CaptionHelper(context);
|
||||
}
|
@@ -35,8 +35,8 @@ import com.android.settingslib.core.lifecycle.events.OnStop;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
/** Preference controller for caption custom visibility. */
|
||||
public class CaptionCustomController extends BasePreferenceController
|
||||
/** Preference controller for captioning custom visibility. */
|
||||
public class CaptioningCustomController extends BasePreferenceController
|
||||
implements LifecycleObserver, OnStart, OnStop {
|
||||
|
||||
private Preference mCustom;
|
||||
@@ -49,7 +49,7 @@ public class CaptionCustomController extends BasePreferenceController
|
||||
Settings.Secure.ACCESSIBILITY_CAPTIONING_PRESET
|
||||
);
|
||||
|
||||
public CaptionCustomController(Context context, String preferenceKey) {
|
||||
public CaptioningCustomController(Context context, String preferenceKey) {
|
||||
super(context, preferenceKey);
|
||||
mCaptionHelper = new CaptionHelper(context);
|
||||
mContentResolver = context.getContentResolver();
|
||||
@@ -60,7 +60,7 @@ public class CaptionCustomController extends BasePreferenceController
|
||||
}
|
||||
|
||||
@VisibleForTesting
|
||||
CaptionCustomController(Context context, String preferenceKey,
|
||||
CaptioningCustomController(Context context, String preferenceKey,
|
||||
AccessibilitySettingsContentObserver contentObserver) {
|
||||
this(context, preferenceKey);
|
||||
mSettingsContentObserver = contentObserver;
|
@@ -25,13 +25,13 @@ import com.android.settings.R;
|
||||
import com.android.settings.accessibility.ListDialogPreference.OnValueChangedListener;
|
||||
import com.android.settings.core.BasePreferenceController;
|
||||
|
||||
/** Preference controller for caption edge color. */
|
||||
public class CaptionEdgeColorController extends BasePreferenceController
|
||||
/** Preference controller for captioning edge color. */
|
||||
public class CaptioningEdgeColorController extends BasePreferenceController
|
||||
implements OnValueChangedListener {
|
||||
|
||||
private final CaptionHelper mCaptionHelper;
|
||||
|
||||
public CaptionEdgeColorController(Context context, String preferenceKey) {
|
||||
public CaptioningEdgeColorController(Context context, String preferenceKey) {
|
||||
super(context, preferenceKey);
|
||||
mCaptionHelper = new CaptionHelper(context);
|
||||
}
|
@@ -23,13 +23,13 @@ import androidx.preference.PreferenceScreen;
|
||||
import com.android.settings.accessibility.ListDialogPreference.OnValueChangedListener;
|
||||
import com.android.settings.core.BasePreferenceController;
|
||||
|
||||
/** Preference controller for caption edge type. */
|
||||
public class CaptionEdgeTypeController extends BasePreferenceController
|
||||
/** Preference controller for captioning edge type. */
|
||||
public class CaptioningEdgeTypeController extends BasePreferenceController
|
||||
implements OnValueChangedListener {
|
||||
|
||||
private final CaptionHelper mCaptionHelper;
|
||||
|
||||
public CaptionEdgeTypeController(Context context, String preferenceKey) {
|
||||
public CaptioningEdgeTypeController(Context context, String preferenceKey) {
|
||||
super(context, preferenceKey);
|
||||
mCaptionHelper = new CaptionHelper(context);
|
||||
}
|
@@ -27,14 +27,14 @@ import androidx.preference.PreferenceScreen;
|
||||
|
||||
import com.android.settings.core.BasePreferenceController;
|
||||
|
||||
/** Preference controller for caption font size. */
|
||||
public class CaptionFontSizeController extends BasePreferenceController
|
||||
/** Preference controller for captioning font size. */
|
||||
public class CaptioningFontSizeController extends BasePreferenceController
|
||||
implements Preference.OnPreferenceChangeListener {
|
||||
|
||||
private final CaptioningManager mCaptioningManager;
|
||||
private final CaptionHelper mCaptionHelper;
|
||||
|
||||
public CaptionFontSizeController(Context context, String preferenceKey) {
|
||||
public CaptioningFontSizeController(Context context, String preferenceKey) {
|
||||
super(context, preferenceKey);
|
||||
mCaptioningManager = context.getSystemService(CaptioningManager.class);
|
||||
mCaptionHelper = new CaptionHelper(context);
|
@@ -20,12 +20,10 @@ import android.content.Context;
|
||||
|
||||
import com.android.settings.R;
|
||||
|
||||
/**
|
||||
* Preference controller for caption footer.
|
||||
*/
|
||||
public class CaptionFooterPreferenceController extends AccessibilityFooterPreferenceController {
|
||||
/** Preference controller for captioning footer. */
|
||||
public class CaptioningFooterPreferenceController extends AccessibilityFooterPreferenceController {
|
||||
|
||||
public CaptionFooterPreferenceController(Context context, String key) {
|
||||
public CaptioningFooterPreferenceController(Context context, String key) {
|
||||
super(context, key);
|
||||
}
|
||||
|
@@ -25,13 +25,13 @@ import com.android.settings.R;
|
||||
import com.android.settings.accessibility.ListDialogPreference.OnValueChangedListener;
|
||||
import com.android.settings.core.BasePreferenceController;
|
||||
|
||||
/** Preference controller for caption foreground color. */
|
||||
public class CaptionForegroundColorController extends BasePreferenceController
|
||||
/** Preference controller for captioning foreground color. */
|
||||
public class CaptioningForegroundColorController extends BasePreferenceController
|
||||
implements OnValueChangedListener {
|
||||
|
||||
private final CaptionHelper mCaptionHelper;
|
||||
|
||||
public CaptionForegroundColorController(Context context, String preferenceKey) {
|
||||
public CaptioningForegroundColorController(Context context, String preferenceKey) {
|
||||
super(context, preferenceKey);
|
||||
mCaptionHelper = new CaptionHelper(context);
|
||||
}
|
@@ -25,13 +25,13 @@ import com.android.settings.R;
|
||||
import com.android.settings.accessibility.ListDialogPreference.OnValueChangedListener;
|
||||
import com.android.settings.core.BasePreferenceController;
|
||||
|
||||
/** Preference controller for caption foreground opacity. */
|
||||
public class CaptionForegroundOpacityController extends BasePreferenceController
|
||||
/** Preference controller for captioning foreground opacity. */
|
||||
public class CaptioningForegroundOpacityController extends BasePreferenceController
|
||||
implements OnValueChangedListener {
|
||||
|
||||
private final CaptionHelper mCaptionHelper;
|
||||
|
||||
public CaptionForegroundOpacityController(Context context, String preferenceKey) {
|
||||
public CaptioningForegroundOpacityController(Context context, String preferenceKey) {
|
||||
super(context, preferenceKey);
|
||||
mCaptionHelper = new CaptionHelper(context);
|
||||
}
|
@@ -25,13 +25,13 @@ import androidx.preference.PreferenceScreen;
|
||||
|
||||
import com.android.settings.core.BasePreferenceController;
|
||||
|
||||
/** Controller that shows the caption locale summary. */
|
||||
public class CaptionLocalePreferenceController extends BasePreferenceController
|
||||
/** Controller that shows the captioning locale summary. */
|
||||
public class CaptioningLocalePreferenceController extends BasePreferenceController
|
||||
implements Preference.OnPreferenceChangeListener {
|
||||
|
||||
private final CaptioningManager mCaptioningManager;
|
||||
|
||||
public CaptionLocalePreferenceController(Context context, String preferenceKey) {
|
||||
public CaptioningLocalePreferenceController(Context context, String preferenceKey) {
|
||||
super(context, preferenceKey);
|
||||
mCaptioningManager = context.getSystemService(CaptioningManager.class);
|
||||
}
|
@@ -25,9 +25,9 @@ import com.android.settingslib.search.SearchIndexable;
|
||||
|
||||
/** Settings fragment containing more options of captioning properties. */
|
||||
@SearchIndexable(forTarget = SearchIndexable.ALL & ~SearchIndexable.ARC)
|
||||
public class CaptionMoreOptionsFragment extends DashboardFragment {
|
||||
public class CaptioningMoreOptionsFragment extends DashboardFragment {
|
||||
|
||||
private static final String TAG = "CaptionMoreOptionsFragment";
|
||||
private static final String TAG = "CaptioningMoreOptionsFragment";
|
||||
|
||||
@Override
|
||||
public int getMetricsCategory() {
|
@@ -24,13 +24,13 @@ import androidx.preference.PreferenceScreen;
|
||||
import com.android.settings.R;
|
||||
import com.android.settings.core.BasePreferenceController;
|
||||
|
||||
/** Preference controller for caption preset. */
|
||||
public class CaptionPresetController extends BasePreferenceController
|
||||
/** Preference controller for captioning preset. */
|
||||
public class CaptioningPresetController extends BasePreferenceController
|
||||
implements ListDialogPreference.OnValueChangedListener {
|
||||
|
||||
private final CaptionHelper mCaptionHelper;
|
||||
|
||||
public CaptionPresetController(Context context, String preferenceKey) {
|
||||
public CaptioningPresetController(Context context, String preferenceKey) {
|
||||
super(context, preferenceKey);
|
||||
mCaptionHelper = new CaptionHelper(context);
|
||||
}
|
@@ -39,8 +39,8 @@ import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
|
||||
/** Controller that shows the caption locale summary. */
|
||||
public class CaptionPreviewPreferenceController extends BasePreferenceController
|
||||
/** Controller that shows the captioning locale summary. */
|
||||
public class CaptioningPreviewPreferenceController extends BasePreferenceController
|
||||
implements LifecycleObserver, OnStart, OnStop {
|
||||
|
||||
@VisibleForTesting
|
||||
@@ -60,7 +60,7 @@ public class CaptionPreviewPreferenceController extends BasePreferenceController
|
||||
private CaptionHelper mCaptionHelper;
|
||||
private LayoutPreference mPreference;
|
||||
|
||||
public CaptionPreviewPreferenceController(Context context, String preferenceKey) {
|
||||
public CaptioningPreviewPreferenceController(Context context, String preferenceKey) {
|
||||
super(context, preferenceKey);
|
||||
mCaptionHelper = new CaptionHelper(context);
|
||||
mSettingsContentObserver = new AccessibilitySettingsContentObserver(mHandler);
|
@@ -25,9 +25,9 @@ import com.android.settingslib.search.SearchIndexable;
|
||||
|
||||
/** Settings fragment containing captioning properties. */
|
||||
@SearchIndexable(forTarget = SearchIndexable.ALL & ~SearchIndexable.ARC)
|
||||
public class CaptionPropertiesFragment extends DashboardFragment {
|
||||
public class CaptioningPropertiesFragment extends DashboardFragment {
|
||||
|
||||
private static final String TAG = "CaptionPropertiesFragment";
|
||||
private static final String TAG = "CaptioningPropertiesFragment";
|
||||
|
||||
@Override
|
||||
public int getMetricsCategory() {
|
@@ -26,13 +26,13 @@ import com.android.settings.core.TogglePreferenceController;
|
||||
import com.android.settings.widget.SettingsMainSwitchPreference;
|
||||
import com.android.settingslib.widget.OnMainSwitchChangeListener;
|
||||
|
||||
/** Preference controller for caption more options. */
|
||||
public class CaptionTogglePreferenceController extends TogglePreferenceController
|
||||
/** Preference controller for captioning more options. */
|
||||
public class CaptioningTogglePreferenceController extends TogglePreferenceController
|
||||
implements OnMainSwitchChangeListener {
|
||||
|
||||
private final CaptionHelper mCaptionHelper;
|
||||
|
||||
public CaptionTogglePreferenceController(Context context, String preferenceKey) {
|
||||
public CaptioningTogglePreferenceController(Context context, String preferenceKey) {
|
||||
super(context, preferenceKey);
|
||||
mCaptionHelper = new CaptionHelper(context);
|
||||
}
|
@@ -27,13 +27,13 @@ import androidx.preference.PreferenceScreen;
|
||||
|
||||
import com.android.settings.core.BasePreferenceController;
|
||||
|
||||
/** Preference controller for caption type face. */
|
||||
public class CaptionTypefaceController extends BasePreferenceController
|
||||
/** Preference controller for captioning type face. */
|
||||
public class CaptioningTypefaceController extends BasePreferenceController
|
||||
implements Preference.OnPreferenceChangeListener {
|
||||
|
||||
private final CaptionHelper mCaptionHelper;
|
||||
|
||||
public CaptionTypefaceController(Context context, String preferenceKey) {
|
||||
public CaptioningTypefaceController(Context context, String preferenceKey) {
|
||||
super(context, preferenceKey);
|
||||
mCaptionHelper = new CaptionHelper(context);
|
||||
}
|
@@ -26,13 +26,13 @@ import com.android.settings.R;
|
||||
import com.android.settings.accessibility.ListDialogPreference.OnValueChangedListener;
|
||||
import com.android.settings.core.BasePreferenceController;
|
||||
|
||||
/** Preference controller for caption window color. */
|
||||
public class CaptionWindowColorController extends BasePreferenceController
|
||||
/** Preference controller for captioning window color. */
|
||||
public class CaptioningWindowColorController extends BasePreferenceController
|
||||
implements OnValueChangedListener {
|
||||
|
||||
private final CaptionHelper mCaptionHelper;
|
||||
|
||||
public CaptionWindowColorController(Context context, String preferenceKey) {
|
||||
public CaptioningWindowColorController(Context context, String preferenceKey) {
|
||||
super(context, preferenceKey);
|
||||
mCaptionHelper = new CaptionHelper(context);
|
||||
}
|
@@ -25,13 +25,13 @@ import com.android.settings.R;
|
||||
import com.android.settings.accessibility.ListDialogPreference.OnValueChangedListener;
|
||||
import com.android.settings.core.BasePreferenceController;
|
||||
|
||||
/** Preference controller for caption window opacity. */
|
||||
public class CaptionWindowOpacityController extends BasePreferenceController
|
||||
/** Preference controller for captioning window opacity. */
|
||||
public class CaptioningWindowOpacityController extends BasePreferenceController
|
||||
implements OnValueChangedListener {
|
||||
|
||||
private final CaptionHelper mCaptionHelper;
|
||||
|
||||
public CaptionWindowOpacityController(Context context, String preferenceKey) {
|
||||
public CaptioningWindowOpacityController(Context context, String preferenceKey) {
|
||||
super(context, preferenceKey);
|
||||
mCaptionHelper = new CaptionHelper(context);
|
||||
}
|
@@ -28,7 +28,7 @@ import com.android.settings.TrustedCredentialsSettings;
|
||||
import com.android.settings.accessibility.AccessibilityDetailsSettingsFragment;
|
||||
import com.android.settings.accessibility.AccessibilitySettings;
|
||||
import com.android.settings.accessibility.AccessibilitySettingsForSetupWizard;
|
||||
import com.android.settings.accessibility.CaptionPropertiesFragment;
|
||||
import com.android.settings.accessibility.CaptioningPropertiesFragment;
|
||||
import com.android.settings.accessibility.TextReadingPreferenceFragmentForSetupWizard;
|
||||
import com.android.settings.accessibility.ToggleColorInversionPreferenceFragment;
|
||||
import com.android.settings.accessibility.ToggleDaltonizerPreferenceFragment;
|
||||
@@ -230,7 +230,7 @@ public class SettingsGateway {
|
||||
AccessibilitySettings.class.getName(),
|
||||
AccessibilitySettingsForSetupWizard.class.getName(),
|
||||
TextReadingPreferenceFragmentForSetupWizard.class.getName(),
|
||||
CaptionPropertiesFragment.class.getName(),
|
||||
CaptioningPropertiesFragment.class.getName(),
|
||||
ToggleDaltonizerPreferenceFragment.class.getName(),
|
||||
ToggleColorInversionPreferenceFragment.class.getName(),
|
||||
ToggleReduceBrightColorsPreferenceFragment.class.getName(),
|
||||
|
@@ -92,7 +92,7 @@ public class CaptionHelperTest {
|
||||
final float fontScale = 1.0f;
|
||||
when(mCaptioningManager.getFontScale()).thenReturn(fontScale);
|
||||
final float textSize = mContext.getResources().getDimension(
|
||||
R.dimen.caption_preview_text_size) * fontScale;
|
||||
R.dimen.captioning_preview_text_size) * fontScale;
|
||||
|
||||
mCaptionHelper.applyCaptionProperties(mSubtitleView, /* PreviewWindow= */ null,
|
||||
/* styleId= */ 0);
|
||||
|
@@ -33,16 +33,16 @@ import org.robolectric.RobolectricTestRunner;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/** Tests for {@link CaptionAppearanceFragment}. */
|
||||
/** Tests for {@link CaptioningAppearanceFragment}. */
|
||||
@RunWith(RobolectricTestRunner.class)
|
||||
public class CaptionAppearanceFragmentTest {
|
||||
public class CaptioningAppearanceFragmentTest {
|
||||
|
||||
private final Context mContext = ApplicationProvider.getApplicationContext();
|
||||
private CaptionAppearanceFragment mFragment;
|
||||
private CaptioningAppearanceFragment mFragment;
|
||||
|
||||
@Before
|
||||
public void setUp() {
|
||||
mFragment = new CaptionAppearanceFragment();
|
||||
mFragment = new CaptioningAppearanceFragment();
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -58,7 +58,7 @@ public class CaptionAppearanceFragmentTest {
|
||||
|
||||
@Test
|
||||
public void getLogTag_returnsCorrectTag() {
|
||||
assertThat(mFragment.getLogTag()).isEqualTo("CaptionAppearanceFragment");
|
||||
assertThat(mFragment.getLogTag()).isEqualTo("CaptioningAppearanceFragment");
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -68,7 +68,7 @@ public class CaptionAppearanceFragmentTest {
|
||||
|
||||
@Test
|
||||
public void getNonIndexableKeys_existInXmlLayout() {
|
||||
final List<String> niks = CaptionAppearanceFragment.SEARCH_INDEX_DATA_PROVIDER
|
||||
final List<String> niks = CaptioningAppearanceFragment.SEARCH_INDEX_DATA_PROVIDER
|
||||
.getNonIndexableKeys(mContext);
|
||||
final List<String> keys = XmlTestUtils.getKeysFromPreferenceXml(mContext,
|
||||
R.xml.captioning_appearance);
|
@@ -34,23 +34,23 @@ import org.robolectric.RobolectricTestRunner;
|
||||
import org.robolectric.shadow.api.Shadow;
|
||||
import org.robolectric.shadows.ShadowCaptioningManager;
|
||||
|
||||
/** Tests for {@link CaptionAppearancePreferenceController}. */
|
||||
/** Tests for {@link CaptioningAppearancePreferenceController}. */
|
||||
@RunWith(RobolectricTestRunner.class)
|
||||
public class CaptionAppearancePreferenceControllerTest {
|
||||
public class CaptioningAppearancePreferenceControllerTest {
|
||||
|
||||
private static final String TEST_KEY = "test_key";
|
||||
private static final int DEFAULT_PRESET_INDEX = 1;
|
||||
private static final int DEFAULT_FONT_SCALE_INDEX = 2;
|
||||
|
||||
private final Context mContext = ApplicationProvider.getApplicationContext();
|
||||
private CaptionAppearancePreferenceController mController;
|
||||
private CaptioningAppearancePreferenceController mController;
|
||||
private ShadowCaptioningManager mShadowCaptioningManager;
|
||||
|
||||
@Before
|
||||
public void setUp() {
|
||||
CaptioningManager captioningManager = mContext.getSystemService(CaptioningManager.class);
|
||||
mShadowCaptioningManager = Shadow.extract(captioningManager);
|
||||
mController = new CaptionAppearancePreferenceController(mContext, TEST_KEY);
|
||||
mController = new CaptioningAppearancePreferenceController(mContext, TEST_KEY);
|
||||
}
|
||||
|
||||
@Test
|
@@ -45,22 +45,23 @@ import org.robolectric.RobolectricTestRunner;
|
||||
import org.robolectric.shadow.api.Shadow;
|
||||
import org.robolectric.shadows.ShadowCaptioningManager;
|
||||
|
||||
/** Tests for {@link CaptionBackgroundColorController}. */
|
||||
/** Tests for {@link CaptioningBackgroundColorController}. */
|
||||
@RunWith(RobolectricTestRunner.class)
|
||||
public class CaptionBackgroundColorControllerTest {
|
||||
public class CaptioningBackgroundColorControllerTest {
|
||||
|
||||
@Rule
|
||||
public final MockitoRule mMockitoRule = MockitoJUnit.rule();
|
||||
@Mock
|
||||
private PreferenceScreen mScreen;
|
||||
private final Context mContext = ApplicationProvider.getApplicationContext();
|
||||
private CaptionBackgroundColorController mController;
|
||||
private CaptioningBackgroundColorController mController;
|
||||
private ColorPreference mPreference;
|
||||
private ShadowCaptioningManager mShadowCaptioningManager;
|
||||
|
||||
@Before
|
||||
public void setUp() {
|
||||
mController = new CaptionBackgroundColorController(mContext, "captioning_background_color");
|
||||
mController = new CaptioningBackgroundColorController(mContext,
|
||||
"captioning_background_color");
|
||||
final AttributeSet attributeSet = Robolectric.buildAttributeSet().build();
|
||||
mPreference = new ColorPreference(mContext, attributeSet);
|
||||
when(mScreen.findPreference(mController.getPreferenceKey())).thenReturn(mPreference);
|
@@ -47,21 +47,21 @@ import org.robolectric.shadows.ShadowCaptioningManager;
|
||||
|
||||
/** Tests for {@link CaptionBackgroundOpacityController}. */
|
||||
@RunWith(RobolectricTestRunner.class)
|
||||
public class CaptionBackgroundOpacityControllerTest {
|
||||
public class CaptioningBackgroundOpacityControllerTest {
|
||||
|
||||
@Rule
|
||||
public final MockitoRule mMockitoRule = MockitoJUnit.rule();
|
||||
@Mock
|
||||
private PreferenceScreen mScreen;
|
||||
private final Context mContext = ApplicationProvider.getApplicationContext();
|
||||
private CaptionBackgroundOpacityController mController;
|
||||
private CaptioningBackgroundOpacityController mController;
|
||||
private ColorPreference mPreference;
|
||||
private ShadowCaptioningManager mShadowCaptioningManager;
|
||||
|
||||
@Before
|
||||
public void setUp() {
|
||||
mController =
|
||||
new CaptionBackgroundOpacityController(mContext, "captioning_background_opacity");
|
||||
mController = new CaptioningBackgroundOpacityController(mContext,
|
||||
"captioning_background_opacity");
|
||||
final AttributeSet attributeSet = Robolectric.buildAttributeSet().build();
|
||||
mPreference = new ColorPreference(mContext, attributeSet);
|
||||
when(mScreen.findPreference(mController.getPreferenceKey())).thenReturn(mPreference);
|
@@ -41,9 +41,9 @@ import org.mockito.junit.MockitoJUnit;
|
||||
import org.mockito.junit.MockitoRule;
|
||||
import org.robolectric.RobolectricTestRunner;
|
||||
|
||||
/** Tests for {@link CaptionCustomController}. */
|
||||
/** Tests for {@link CaptioningCustomController}. */
|
||||
@RunWith(RobolectricTestRunner.class)
|
||||
public class CaptionCustomControllerTest {
|
||||
public class CaptioningCustomControllerTest {
|
||||
|
||||
private static final String PREF_KEY = "custom";
|
||||
|
||||
@@ -55,13 +55,13 @@ public class CaptionCustomControllerTest {
|
||||
private AccessibilitySettingsContentObserver mAccessibilitySettingsContentObserver;
|
||||
private final Context mContext = ApplicationProvider.getApplicationContext();
|
||||
private ContentResolver mContentResolver;
|
||||
private CaptionCustomController mController;
|
||||
private CaptioningCustomController mController;
|
||||
private Preference mPreference;
|
||||
|
||||
@Before
|
||||
public void setUp() {
|
||||
mContentResolver = mContext.getContentResolver();
|
||||
mController = new CaptionCustomController(mContext, PREF_KEY,
|
||||
mController = new CaptioningCustomController(mContext, PREF_KEY,
|
||||
mAccessibilitySettingsContentObserver);
|
||||
mPreference = new Preference(mContext);
|
||||
when(mScreen.findPreference(mController.getPreferenceKey())).thenReturn(mPreference);
|
@@ -45,21 +45,21 @@ import org.robolectric.RobolectricTestRunner;
|
||||
import org.robolectric.shadow.api.Shadow;
|
||||
import org.robolectric.shadows.ShadowCaptioningManager;
|
||||
|
||||
/** Tests for {@link CaptionEdgeColorController}. */
|
||||
/** Tests for {@link CaptioningEdgeColorController}. */
|
||||
@RunWith(RobolectricTestRunner.class)
|
||||
public class CaptionEdgeColorControllerTest {
|
||||
public class CaptioningEdgeColorControllerTest {
|
||||
@Rule
|
||||
public final MockitoRule mMockitoRule = MockitoJUnit.rule();
|
||||
@Mock
|
||||
private PreferenceScreen mScreen;
|
||||
private final Context mContext = ApplicationProvider.getApplicationContext();
|
||||
private CaptionEdgeColorController mController;
|
||||
private CaptioningEdgeColorController mController;
|
||||
private ColorPreference mPreference;
|
||||
private ShadowCaptioningManager mShadowCaptioningManager;
|
||||
|
||||
@Before
|
||||
public void setUp() {
|
||||
mController = new CaptionEdgeColorController(mContext, "captioning_edge_color");
|
||||
mController = new CaptioningEdgeColorController(mContext, "captioning_edge_color");
|
||||
final AttributeSet attributeSet = Robolectric.buildAttributeSet().build();
|
||||
mPreference = new ColorPreference(mContext, attributeSet);
|
||||
when(mScreen.findPreference(mController.getPreferenceKey())).thenReturn(mPreference);
|
@@ -46,22 +46,22 @@ import org.robolectric.RobolectricTestRunner;
|
||||
import org.robolectric.shadow.api.Shadow;
|
||||
import org.robolectric.shadows.ShadowCaptioningManager;
|
||||
|
||||
/** Tests for {@link CaptionEdgeTypeController}. */
|
||||
/** Tests for {@link CaptioningEdgeTypeController}. */
|
||||
@RunWith(RobolectricTestRunner.class)
|
||||
public class CaptionEdgeTypeControllerTest {
|
||||
public class CaptioningEdgeTypeControllerTest {
|
||||
|
||||
@Rule
|
||||
public final MockitoRule mMockitoRule = MockitoJUnit.rule();
|
||||
@Mock
|
||||
private PreferenceScreen mScreen;
|
||||
private final Context mContext = ApplicationProvider.getApplicationContext();
|
||||
private CaptionEdgeTypeController mController;
|
||||
private CaptioningEdgeTypeController mController;
|
||||
private EdgeTypePreference mPreference;
|
||||
private ShadowCaptioningManager mShadowCaptioningManager;
|
||||
|
||||
@Before
|
||||
public void setUp() {
|
||||
mController = new CaptionEdgeTypeController(mContext, "captioning_edge_type");
|
||||
mController = new CaptioningEdgeTypeController(mContext, "captioning_edge_type");
|
||||
final AttributeSet attributeSet = Robolectric.buildAttributeSet().build();
|
||||
mPreference = new EdgeTypePreference(mContext, attributeSet);
|
||||
when(mScreen.findPreference(mController.getPreferenceKey())).thenReturn(mPreference);
|
@@ -45,22 +45,22 @@ import org.robolectric.RobolectricTestRunner;
|
||||
import org.robolectric.shadow.api.Shadow;
|
||||
import org.robolectric.shadows.ShadowCaptioningManager;
|
||||
|
||||
/** Tests for {@link CaptionFontSizeController}. */
|
||||
/** Tests for {@link CaptioningFontSizeController}. */
|
||||
@RunWith(RobolectricTestRunner.class)
|
||||
public class CaptionFontSizeControllerTest {
|
||||
public class CaptioningFontSizeControllerTest {
|
||||
|
||||
@Rule
|
||||
public final MockitoRule mMockitoRule = MockitoJUnit.rule();
|
||||
@Mock
|
||||
private PreferenceScreen mScreen;
|
||||
private final Context mContext = ApplicationProvider.getApplicationContext();
|
||||
private CaptionFontSizeController mController;
|
||||
private CaptioningFontSizeController mController;
|
||||
private ListPreference mPreference;
|
||||
private ShadowCaptioningManager mShadowCaptioningManager;
|
||||
|
||||
@Before
|
||||
public void setUp() {
|
||||
mController = new CaptionFontSizeController(mContext, "captioning_font_size");
|
||||
mController = new CaptioningFontSizeController(mContext, "captioning_font_size");
|
||||
mPreference = new ListPreference(mContext);
|
||||
mPreference.setEntries(R.array.captioning_font_size_selector_titles);
|
||||
mPreference.setEntryValues(R.array.captioning_font_size_selector_values);
|
@@ -45,22 +45,23 @@ import org.robolectric.RobolectricTestRunner;
|
||||
import org.robolectric.shadow.api.Shadow;
|
||||
import org.robolectric.shadows.ShadowCaptioningManager;
|
||||
|
||||
/** Tests for {@link CaptionForegroundColorController}. */
|
||||
/** Tests for {@link CaptioningForegroundColorController}. */
|
||||
@RunWith(RobolectricTestRunner.class)
|
||||
public class CaptionForegroundColorControllerTest {
|
||||
public class CaptioningForegroundColorControllerTest {
|
||||
|
||||
@Rule
|
||||
public final MockitoRule mMockitoRule = MockitoJUnit.rule();
|
||||
@Mock
|
||||
private PreferenceScreen mScreen;
|
||||
private final Context mContext = ApplicationProvider.getApplicationContext();
|
||||
private CaptionForegroundColorController mController;
|
||||
private CaptioningForegroundColorController mController;
|
||||
private ColorPreference mPreference;
|
||||
private ShadowCaptioningManager mShadowCaptioningManager;
|
||||
|
||||
@Before
|
||||
public void setUp() {
|
||||
mController = new CaptionForegroundColorController(mContext, "captioning_foreground_color");
|
||||
mController = new CaptioningForegroundColorController(mContext,
|
||||
"captioning_foreground_color");
|
||||
final AttributeSet attributeSet = Robolectric.buildAttributeSet().build();
|
||||
mPreference = new ColorPreference(mContext, attributeSet);
|
||||
when(mScreen.findPreference(mController.getPreferenceKey())).thenReturn(mPreference);
|
@@ -45,23 +45,23 @@ import org.robolectric.RobolectricTestRunner;
|
||||
import org.robolectric.shadow.api.Shadow;
|
||||
import org.robolectric.shadows.ShadowCaptioningManager;
|
||||
|
||||
/** Tests for {@link CaptionForegroundOpacityController}. */
|
||||
/** Tests for {@link CaptioningForegroundOpacityController}. */
|
||||
@RunWith(RobolectricTestRunner.class)
|
||||
public class CaptionForegroundOpacityControllerTest {
|
||||
public class CaptioningForegroundOpacityControllerTest {
|
||||
|
||||
@Rule
|
||||
public final MockitoRule mMockitoRule = MockitoJUnit.rule();
|
||||
@Mock
|
||||
private PreferenceScreen mScreen;
|
||||
private final Context mContext = ApplicationProvider.getApplicationContext();
|
||||
private CaptionForegroundOpacityController mController;
|
||||
private CaptioningForegroundOpacityController mController;
|
||||
private ColorPreference mPreference;
|
||||
private ShadowCaptioningManager mShadowCaptioningManager;
|
||||
|
||||
@Before
|
||||
public void setUp() {
|
||||
mController =
|
||||
new CaptionForegroundOpacityController(mContext, "captioning_foreground_opacity");
|
||||
mController = new CaptioningForegroundOpacityController(mContext,
|
||||
"captioning_foreground_opacity");
|
||||
final AttributeSet attributeSet = Robolectric.buildAttributeSet().build();
|
||||
mPreference = new ColorPreference(mContext, attributeSet);
|
||||
when(mScreen.findPreference(mController.getPreferenceKey())).thenReturn(mPreference);
|
@@ -38,21 +38,21 @@ import org.mockito.junit.MockitoJUnit;
|
||||
import org.mockito.junit.MockitoRule;
|
||||
import org.robolectric.RobolectricTestRunner;
|
||||
|
||||
/** Tests for {@link CaptionLocalePreferenceController}. */
|
||||
/** Tests for {@link CaptioningLocalePreferenceController}. */
|
||||
@RunWith(RobolectricTestRunner.class)
|
||||
public class CaptionLocalePreferenceControllerTest {
|
||||
public class CaptioningLocalePreferenceControllerTest {
|
||||
|
||||
@Rule
|
||||
public final MockitoRule mMockitoRule = MockitoJUnit.rule();
|
||||
@Mock
|
||||
private PreferenceScreen mScreen;
|
||||
private final Context mContext = ApplicationProvider.getApplicationContext();
|
||||
private CaptionLocalePreferenceController mController;
|
||||
private CaptioningLocalePreferenceController mController;
|
||||
private LocalePreference mPreference;
|
||||
|
||||
@Before
|
||||
public void setUp() {
|
||||
mController = new CaptionLocalePreferenceController(mContext, "captioning_local_pref");
|
||||
mController = new CaptioningLocalePreferenceController(mContext, "captioning_local_pref");
|
||||
mPreference = new LocalePreference(mContext);
|
||||
when(mScreen.findPreference(mController.getPreferenceKey())).thenReturn(mPreference);
|
||||
}
|
@@ -33,16 +33,16 @@ import org.robolectric.RobolectricTestRunner;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/** Tests for {@link CaptionMoreOptionsFragment}. */
|
||||
/** Tests for {@link CaptioningMoreOptionsFragment}. */
|
||||
@RunWith(RobolectricTestRunner.class)
|
||||
public class CaptionMoreOptionsFragmentTest {
|
||||
public class CaptioningMoreOptionsFragmentTest {
|
||||
|
||||
private final Context mContext = ApplicationProvider.getApplicationContext();
|
||||
private CaptionMoreOptionsFragment mFragment;
|
||||
private CaptioningMoreOptionsFragment mFragment;
|
||||
|
||||
@Before
|
||||
public void setUp() {
|
||||
mFragment = new CaptionMoreOptionsFragment();
|
||||
mFragment = new CaptioningMoreOptionsFragment();
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -59,12 +59,12 @@ public class CaptionMoreOptionsFragmentTest {
|
||||
|
||||
@Test
|
||||
public void getLogTag_returnsCorrectTag() {
|
||||
assertThat(mFragment.getLogTag()).isEqualTo("CaptionMoreOptionsFragment");
|
||||
assertThat(mFragment.getLogTag()).isEqualTo("CaptioningMoreOptionsFragment");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void getNonIndexableKeys_existInXmlLayout() {
|
||||
final List<String> niks = CaptionMoreOptionsFragment.SEARCH_INDEX_DATA_PROVIDER
|
||||
final List<String> niks = CaptioningMoreOptionsFragment.SEARCH_INDEX_DATA_PROVIDER
|
||||
.getNonIndexableKeys(mContext);
|
||||
final List<String> keys =
|
||||
XmlTestUtils.getKeysFromPreferenceXml(mContext,
|
@@ -16,6 +16,9 @@
|
||||
|
||||
package com.android.settings.accessibility;
|
||||
|
||||
import static com.android.settings.accessibility.AccessibilityUtil.State.OFF;
|
||||
import static com.android.settings.accessibility.AccessibilityUtil.State.ON;
|
||||
|
||||
import static com.google.common.truth.Truth.assertThat;
|
||||
|
||||
import android.content.Context;
|
||||
@@ -30,10 +33,9 @@ import org.junit.runner.RunWith;
|
||||
import org.robolectric.RobolectricTestRunner;
|
||||
import org.robolectric.RuntimeEnvironment;
|
||||
|
||||
/** Tests for {@link CaptioningPreferenceController}. */
|
||||
@RunWith(RobolectricTestRunner.class)
|
||||
public class CaptioningPreferenceControllerTest {
|
||||
private static final int ON = 1;
|
||||
private static final int OFF = 0;
|
||||
|
||||
private Context mContext;
|
||||
private CaptioningPreferenceController mController;
|
||||
|
@@ -46,22 +46,22 @@ import org.robolectric.RobolectricTestRunner;
|
||||
import org.robolectric.shadow.api.Shadow;
|
||||
import org.robolectric.shadows.ShadowCaptioningManager;
|
||||
|
||||
/** Tests for {@link CaptionPresetController}. */
|
||||
/** Tests for {@link CaptioningPresetController}. */
|
||||
@RunWith(RobolectricTestRunner.class)
|
||||
public class CaptionPresetControllerTest {
|
||||
public class CaptioningPresetControllerTest {
|
||||
|
||||
@Rule
|
||||
public final MockitoRule mMockitoRule = MockitoJUnit.rule();
|
||||
@Mock
|
||||
private PreferenceScreen mScreen;
|
||||
private final Context mContext = ApplicationProvider.getApplicationContext();
|
||||
private CaptionPresetController mController;
|
||||
private CaptioningPresetController mController;
|
||||
private PresetPreference mPreference;
|
||||
private ShadowCaptioningManager mShadowCaptioningManager;
|
||||
|
||||
@Before
|
||||
public void setUp() {
|
||||
mController = new CaptionPresetController(mContext, "captioning_preset");
|
||||
mController = new CaptioningPresetController(mContext, "captioning_preset");
|
||||
final AttributeSet attributeSet = Robolectric.buildAttributeSet().build();
|
||||
mPreference = new PresetPreference(mContext, attributeSet);
|
||||
when(mScreen.findPreference(mController.getPreferenceKey())).thenReturn(mPreference);
|
@@ -42,9 +42,9 @@ import org.mockito.junit.MockitoJUnit;
|
||||
import org.mockito.junit.MockitoRule;
|
||||
import org.robolectric.RobolectricTestRunner;
|
||||
|
||||
/** Tests for {@link CaptionPreviewPreferenceController}. */
|
||||
/** Tests for {@link CaptioningPreviewPreferenceController}. */
|
||||
@RunWith(RobolectricTestRunner.class)
|
||||
public class CaptionPreviewPreferenceControllerTest {
|
||||
public class CaptioningPreviewPreferenceControllerTest {
|
||||
|
||||
@Rule
|
||||
public final MockitoRule mMockitoRule = MockitoJUnit.rule();
|
||||
@@ -54,13 +54,13 @@ public class CaptionPreviewPreferenceControllerTest {
|
||||
private ContentResolver mContentResolver;
|
||||
@Spy
|
||||
private final Context mContext = ApplicationProvider.getApplicationContext();
|
||||
private CaptionPreviewPreferenceController mController;
|
||||
private CaptioningPreviewPreferenceController mController;
|
||||
private LayoutPreference mLayoutPreference;
|
||||
|
||||
@Before
|
||||
public void setUp() {
|
||||
when(mContext.getContentResolver()).thenReturn(mContentResolver);
|
||||
mController = new CaptionPreviewPreferenceController(mContext,
|
||||
mController = new CaptioningPreviewPreferenceController(mContext,
|
||||
"captioning_preference_switch");
|
||||
final View view = new View(mContext);
|
||||
mLayoutPreference = new LayoutPreference(mContext, view);
|
@@ -33,16 +33,16 @@ import org.robolectric.RobolectricTestRunner;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/** Tests for {@link CaptionPropertiesFragment}. */
|
||||
/** Tests for {@link CaptioningPropertiesFragment}. */
|
||||
@RunWith(RobolectricTestRunner.class)
|
||||
public class CaptionPropertiesFragmentTest {
|
||||
public class CaptioningPropertiesFragmentTest {
|
||||
|
||||
private final Context mContext = ApplicationProvider.getApplicationContext();
|
||||
private CaptionPropertiesFragment mFragment;
|
||||
private CaptioningPropertiesFragment mFragment;
|
||||
|
||||
@Before
|
||||
public void setUp() {
|
||||
mFragment = new CaptionPropertiesFragment();
|
||||
mFragment = new CaptioningPropertiesFragment();
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -59,12 +59,12 @@ public class CaptionPropertiesFragmentTest {
|
||||
|
||||
@Test
|
||||
public void getLogTag_returnsCorrectTag() {
|
||||
assertThat(mFragment.getLogTag()).isEqualTo("CaptionPropertiesFragment");
|
||||
assertThat(mFragment.getLogTag()).isEqualTo("CaptioningPropertiesFragment");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void getNonIndexableKeys_existInXmlLayout() {
|
||||
final List<String> niks = CaptionPropertiesFragment.SEARCH_INDEX_DATA_PROVIDER
|
||||
final List<String> niks = CaptioningPropertiesFragment.SEARCH_INDEX_DATA_PROVIDER
|
||||
.getNonIndexableKeys(mContext);
|
||||
final List<String> keys =
|
||||
XmlTestUtils.getKeysFromPreferenceXml(mContext,
|
@@ -45,22 +45,22 @@ import org.robolectric.RobolectricTestRunner;
|
||||
import org.robolectric.shadow.api.Shadow;
|
||||
import org.robolectric.shadows.ShadowCaptioningManager;
|
||||
|
||||
/** Tests for {@link CaptionTogglePreferenceController}. */
|
||||
/** Tests for {@link CaptioningTogglePreferenceController}. */
|
||||
@RunWith(RobolectricTestRunner.class)
|
||||
public class CaptionTogglePreferenceControllerTest {
|
||||
public class CaptioningTogglePreferenceControllerTest {
|
||||
|
||||
@Rule
|
||||
public final MockitoRule mMockitoRule = MockitoJUnit.rule();
|
||||
@Mock
|
||||
private PreferenceScreen mScreen;
|
||||
private final Context mContext = ApplicationProvider.getApplicationContext();
|
||||
private CaptionTogglePreferenceController mController;
|
||||
private CaptioningTogglePreferenceController mController;
|
||||
private SettingsMainSwitchPreference mSwitchPreference;
|
||||
private ShadowCaptioningManager mShadowCaptioningManager;
|
||||
|
||||
@Before
|
||||
public void setUp() {
|
||||
mController = new CaptionTogglePreferenceController(mContext,
|
||||
mController = new CaptioningTogglePreferenceController(mContext,
|
||||
"captioning_preference_switch");
|
||||
mSwitchPreference = new SettingsMainSwitchPreference(mContext);
|
||||
when(mScreen.findPreference(mController.getPreferenceKey())).thenReturn(mSwitchPreference);
|
@@ -45,22 +45,22 @@ import org.robolectric.RobolectricTestRunner;
|
||||
import org.robolectric.shadow.api.Shadow;
|
||||
import org.robolectric.shadows.ShadowCaptioningManager;
|
||||
|
||||
/** Tests for {@link CaptionTypefaceController}. */
|
||||
/** Tests for {@link CaptioningTypefaceController}. */
|
||||
@RunWith(RobolectricTestRunner.class)
|
||||
public class CaptionTypefaceControllerTest {
|
||||
public class CaptioningTypefaceControllerTest {
|
||||
|
||||
@Rule
|
||||
public final MockitoRule mMockitoRule = MockitoJUnit.rule();
|
||||
@Mock
|
||||
private PreferenceScreen mScreen;
|
||||
private final Context mContext = ApplicationProvider.getApplicationContext();
|
||||
private CaptionTypefaceController mController;
|
||||
private CaptioningTypefaceController mController;
|
||||
private ListPreference mPreference;
|
||||
private ShadowCaptioningManager mShadowCaptioningManager;
|
||||
|
||||
@Before
|
||||
public void setUp() {
|
||||
mController = new CaptionTypefaceController(mContext, "captioning_typeface");
|
||||
mController = new CaptioningTypefaceController(mContext, "captioning_typeface");
|
||||
mPreference = new ListPreference(mContext);
|
||||
mPreference.setEntries(R.array.captioning_typeface_selector_titles);
|
||||
mPreference.setEntryValues(R.array.captioning_typeface_selector_values);
|
@@ -46,22 +46,22 @@ import org.robolectric.RobolectricTestRunner;
|
||||
import org.robolectric.shadow.api.Shadow;
|
||||
import org.robolectric.shadows.ShadowCaptioningManager;
|
||||
|
||||
/** Tests for {@link CaptionWindowColorController}. */
|
||||
/** Tests for {@link CaptioningWindowColorController}. */
|
||||
@RunWith(RobolectricTestRunner.class)
|
||||
public class CaptionWindowColorControllerTest {
|
||||
public class CaptioningWindowColorControllerTest {
|
||||
|
||||
@Rule
|
||||
public final MockitoRule mMockitoRule = MockitoJUnit.rule();
|
||||
@Mock
|
||||
private PreferenceScreen mScreen;
|
||||
private final Context mContext = ApplicationProvider.getApplicationContext();
|
||||
private CaptionWindowColorController mController;
|
||||
private CaptioningWindowColorController mController;
|
||||
private ColorPreference mPreference;
|
||||
private ShadowCaptioningManager mShadowCaptioningManager;
|
||||
|
||||
@Before
|
||||
public void setUp() {
|
||||
mController = new CaptionWindowColorController(mContext, "captioning_window_color");
|
||||
mController = new CaptioningWindowColorController(mContext, "captioning_window_color");
|
||||
final AttributeSet attributeSet = Robolectric.buildAttributeSet().build();
|
||||
mPreference = new ColorPreference(mContext, attributeSet);
|
||||
when(mScreen.findPreference(mController.getPreferenceKey())).thenReturn(mPreference);
|
@@ -45,22 +45,22 @@ import org.robolectric.RobolectricTestRunner;
|
||||
import org.robolectric.shadow.api.Shadow;
|
||||
import org.robolectric.shadows.ShadowCaptioningManager;
|
||||
|
||||
/** Tests for {@link CaptionWindowOpacityController}. */
|
||||
/** Tests for {@link CaptioningWindowOpacityController}. */
|
||||
@RunWith(RobolectricTestRunner.class)
|
||||
public class CaptionWindowOpacityControllerTest {
|
||||
public class CaptioningWindowOpacityControllerTest {
|
||||
|
||||
@Rule
|
||||
public final MockitoRule mMockitoRule = MockitoJUnit.rule();
|
||||
@Mock
|
||||
private PreferenceScreen mScreen;
|
||||
private final Context mContext = ApplicationProvider.getApplicationContext();
|
||||
private CaptionWindowOpacityController mController;
|
||||
private CaptioningWindowOpacityController mController;
|
||||
private ColorPreference mPreference;
|
||||
private ShadowCaptioningManager mShadowCaptioningManager;
|
||||
|
||||
@Before
|
||||
public void setUp() {
|
||||
mController = new CaptionWindowOpacityController(mContext, "captioning_window_opacity");
|
||||
mController = new CaptioningWindowOpacityController(mContext, "captioning_window_opacity");
|
||||
final AttributeSet attributeSet = Robolectric.buildAttributeSet().build();
|
||||
mPreference = new ColorPreference(mContext, attributeSet);
|
||||
when(mScreen.findPreference(mController.getPreferenceKey())).thenReturn(mPreference);
|
Reference in New Issue
Block a user