Loading core/java/android/widget/TimePickerSpinnerDelegate.java +7 −1 Original line number Original line Diff line number Diff line Loading @@ -93,6 +93,7 @@ class TimePickerSpinnerDelegate extends TimePicker.AbstractTimePickerDelegate im private Node mLegalTimesTree; private Node mLegalTimesTree; private int mAmKeyCode; private int mAmKeyCode; private int mPmKeyCode; private int mPmKeyCode; private int mHeaderTimeTextAppearance = 0; // Accessibility strings. // Accessibility strings. private String mHourPickerDescription; private String mHourPickerDescription; Loading Loading @@ -136,6 +137,7 @@ class TimePickerSpinnerDelegate extends TimePicker.AbstractTimePickerDelegate im final int headerTimeTextAppearance = a.getResourceId( final int headerTimeTextAppearance = a.getResourceId( R.styleable.TimePicker_headerTimeTextAppearance, 0); R.styleable.TimePicker_headerTimeTextAppearance, 0); if (headerTimeTextAppearance != 0) { if (headerTimeTextAppearance != 0) { mHeaderTimeTextAppearance = headerTimeTextAppearance; mHourView.setTextAppearance(context, headerTimeTextAppearance); mHourView.setTextAppearance(context, headerTimeTextAppearance); mSeparatorView.setTextAppearance(context, headerTimeTextAppearance); mSeparatorView.setTextAppearance(context, headerTimeTextAppearance); mMinuteView.setTextAppearance(context, headerTimeTextAppearance); mMinuteView.setTextAppearance(context, headerTimeTextAppearance); Loading Loading @@ -234,7 +236,11 @@ class TimePickerSpinnerDelegate extends TimePicker.AbstractTimePickerDelegate im private int computeMaxWidthOfNumbers(int max) { private int computeMaxWidthOfNumbers(int max) { TextView tempView = new TextView(mContext); TextView tempView = new TextView(mContext); if (mHeaderTimeTextAppearance != 0) { tempView.setTextAppearance(mContext, mHeaderTimeTextAppearance); } else { tempView.setTextAppearance(mContext, R.style.TextAppearance_Material_TimePicker_TimeLabel); tempView.setTextAppearance(mContext, R.style.TextAppearance_Material_TimePicker_TimeLabel); } ViewGroup.LayoutParams lp = new ViewGroup.LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams lp = new ViewGroup.LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT); ViewGroup.LayoutParams.WRAP_CONTENT); tempView.setLayoutParams(lp); tempView.setLayoutParams(lp); Loading Loading
core/java/android/widget/TimePickerSpinnerDelegate.java +7 −1 Original line number Original line Diff line number Diff line Loading @@ -93,6 +93,7 @@ class TimePickerSpinnerDelegate extends TimePicker.AbstractTimePickerDelegate im private Node mLegalTimesTree; private Node mLegalTimesTree; private int mAmKeyCode; private int mAmKeyCode; private int mPmKeyCode; private int mPmKeyCode; private int mHeaderTimeTextAppearance = 0; // Accessibility strings. // Accessibility strings. private String mHourPickerDescription; private String mHourPickerDescription; Loading Loading @@ -136,6 +137,7 @@ class TimePickerSpinnerDelegate extends TimePicker.AbstractTimePickerDelegate im final int headerTimeTextAppearance = a.getResourceId( final int headerTimeTextAppearance = a.getResourceId( R.styleable.TimePicker_headerTimeTextAppearance, 0); R.styleable.TimePicker_headerTimeTextAppearance, 0); if (headerTimeTextAppearance != 0) { if (headerTimeTextAppearance != 0) { mHeaderTimeTextAppearance = headerTimeTextAppearance; mHourView.setTextAppearance(context, headerTimeTextAppearance); mHourView.setTextAppearance(context, headerTimeTextAppearance); mSeparatorView.setTextAppearance(context, headerTimeTextAppearance); mSeparatorView.setTextAppearance(context, headerTimeTextAppearance); mMinuteView.setTextAppearance(context, headerTimeTextAppearance); mMinuteView.setTextAppearance(context, headerTimeTextAppearance); Loading Loading @@ -234,7 +236,11 @@ class TimePickerSpinnerDelegate extends TimePicker.AbstractTimePickerDelegate im private int computeMaxWidthOfNumbers(int max) { private int computeMaxWidthOfNumbers(int max) { TextView tempView = new TextView(mContext); TextView tempView = new TextView(mContext); if (mHeaderTimeTextAppearance != 0) { tempView.setTextAppearance(mContext, mHeaderTimeTextAppearance); } else { tempView.setTextAppearance(mContext, R.style.TextAppearance_Material_TimePicker_TimeLabel); tempView.setTextAppearance(mContext, R.style.TextAppearance_Material_TimePicker_TimeLabel); } ViewGroup.LayoutParams lp = new ViewGroup.LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams lp = new ViewGroup.LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT); ViewGroup.LayoutParams.WRAP_CONTENT); tempView.setLayoutParams(lp); tempView.setLayoutParams(lp); Loading