Set caption preview font size in dips
Change-Id: I9844b6f927b557b46f23c6211b5be47647002ab8
This commit is contained in:
@@ -34,7 +34,7 @@ public class EdgeTypePreference extends ListDialogPreference {
|
|||||||
private static final int DEFAULT_FOREGROUND_COLOR = Color.WHITE;
|
private static final int DEFAULT_FOREGROUND_COLOR = Color.WHITE;
|
||||||
private static final int DEFAULT_BACKGROUND_COLOR = Color.TRANSPARENT;
|
private static final int DEFAULT_BACKGROUND_COLOR = Color.TRANSPARENT;
|
||||||
private static final int DEFAULT_EDGE_COLOR = Color.BLACK;
|
private static final int DEFAULT_EDGE_COLOR = Color.BLACK;
|
||||||
private static final float DEFAULT_FONT_SIZE = 96f;
|
private static final float DEFAULT_FONT_SIZE = 32f;
|
||||||
|
|
||||||
public EdgeTypePreference(Context context, AttributeSet attrs) {
|
public EdgeTypePreference(Context context, AttributeSet attrs) {
|
||||||
super(context, attrs);
|
super(context, attrs);
|
||||||
@@ -57,7 +57,9 @@ public class EdgeTypePreference extends ListDialogPreference {
|
|||||||
|
|
||||||
preview.setForegroundColor(DEFAULT_FOREGROUND_COLOR);
|
preview.setForegroundColor(DEFAULT_FOREGROUND_COLOR);
|
||||||
preview.setBackgroundColor(DEFAULT_BACKGROUND_COLOR);
|
preview.setBackgroundColor(DEFAULT_BACKGROUND_COLOR);
|
||||||
preview.setTextSize(DEFAULT_FONT_SIZE);
|
|
||||||
|
final float density = getContext().getResources().getDisplayMetrics().density;
|
||||||
|
preview.setTextSize(DEFAULT_FONT_SIZE * density);
|
||||||
|
|
||||||
final int value = getValueAt(index);
|
final int value = getValueAt(index);
|
||||||
preview.setEdgeType(value);
|
preview.setEdgeType(value);
|
||||||
|
@@ -27,7 +27,7 @@ import com.android.internal.widget.SubtitleView;
|
|||||||
import com.android.settings.R;
|
import com.android.settings.R;
|
||||||
|
|
||||||
public class PresetPreference extends ListDialogPreference {
|
public class PresetPreference extends ListDialogPreference {
|
||||||
private static final float DEFAULT_FONT_SIZE = 96f;
|
private static final float DEFAULT_FONT_SIZE = 32f;
|
||||||
|
|
||||||
private final CaptioningManager mCaptioningManager;
|
private final CaptioningManager mCaptioningManager;
|
||||||
|
|
||||||
@@ -54,7 +54,8 @@ public class PresetPreference extends ListDialogPreference {
|
|||||||
CaptionPropertiesFragment.applyCaptionProperties(
|
CaptionPropertiesFragment.applyCaptionProperties(
|
||||||
mCaptioningManager, previewText, value);
|
mCaptioningManager, previewText, value);
|
||||||
|
|
||||||
previewText.setTextSize(DEFAULT_FONT_SIZE);
|
final float density = getContext().getResources().getDisplayMetrics().density;
|
||||||
|
previewText.setTextSize(DEFAULT_FONT_SIZE * density);
|
||||||
|
|
||||||
final CharSequence title = getTitleAt(index);
|
final CharSequence title = getTitleAt(index);
|
||||||
if (title != null) {
|
if (title != null) {
|
||||||
|
Reference in New Issue
Block a user