Bug 1048418 - Paint flashing localizations need more space for text, gets cropped/truncated. r=liuche

This commit is contained in:
dominique vincent 2014-08-19 08:35:20 +02:00
parent 63297666e6
commit 598a38f956
3 changed files with 47 additions and 1 deletions

View File

@ -336,6 +336,7 @@ gbjar.sources += [
'preferences/AndroidImport.java',
'preferences/AndroidImportPreference.java',
'preferences/ClearOnShutdownPref.java',
'preferences/CustomCheckBoxPreference.java',
'preferences/CustomListCategory.java',
'preferences/CustomListPreference.java',
'preferences/FontSizePreference.java',

View File

@ -0,0 +1,44 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
package org.mozilla.gecko.preferences;
import android.content.Context;
import android.preference.CheckBoxPreference;
import android.util.AttributeSet;
import android.view.View;
import android.widget.TextView;
/**
* Represents a Checkbox element in a preference menu.
* The title of the Checkbox can be larger than the view.
* In this case, it will be displayed in 2 or more lines.
* The default behavior of the class CheckBoxPreference
* doesn't wrap the title.
*/
public class CustomCheckBoxPreference extends CheckBoxPreference {
public CustomCheckBoxPreference(Context context) {
super(context);
}
public CustomCheckBoxPreference(Context context, AttributeSet attrs) {
super(context, attrs);
}
public CustomCheckBoxPreference(Context context, AttributeSet attrs, int defStyle) {
super(context, attrs, defStyle);
}
@Override
protected void onBindView(View view) {
super.onBindView(view);
final TextView title = (TextView) view.findViewById(android.R.id.title);
if (title != null) {
title.setSingleLine(false);
title.setEllipsize(null);
}
}
}

View File

@ -8,7 +8,8 @@
android:title="@string/pref_category_devtools"
android:enabled="false">
<CheckBoxPreference android:key="nglayout.debug.paint_flashing"
<org.mozilla.gecko.preferences.CustomCheckBoxPreference
android:key="nglayout.debug.paint_flashing"
android:title="@string/pref_developer_paint_flashing" />
<CheckBoxPreference android:key="devtools.debugger.remote-enabled"