use of android.widget.TextView in project android-betterpickers by code-troopers.
the class RadialTimePickerDialogFragment method setCurrentItemShowing.
// Show either Hours or Minutes.
private void setCurrentItemShowing(int index, boolean animateCircle, boolean delayLabelAnimate, boolean announce) {
mTimePicker.setCurrentItemShowing(index, animateCircle);
TextView labelToAnimate;
if (index == HOUR_INDEX) {
int hours = mTimePicker.getHours();
if (!mIs24HourMode) {
hours = hours % 12;
}
mTimePicker.setContentDescription(mHourPickerDescription + ": " + hours);
if (announce) {
Utils.tryAccessibilityAnnounce(mTimePicker, mSelectHours);
}
labelToAnimate = mHourView;
} else {
int minutes = mTimePicker.getMinutes();
mTimePicker.setContentDescription(mMinutePickerDescription + ": " + minutes);
if (announce) {
Utils.tryAccessibilityAnnounce(mTimePicker, mSelectMinutes);
}
labelToAnimate = mMinuteView;
}
int hourColor = (index == HOUR_INDEX) ? mSelectedColor : mUnselectedColor;
int minuteColor = (index == MINUTE_INDEX) ? mSelectedColor : mUnselectedColor;
mHourView.setTextColor(hourColor);
mMinuteView.setTextColor(minuteColor);
ObjectAnimator pulseAnimator = Utils.getPulseAnimator(labelToAnimate, 0.85f, 1.1f);
if (delayLabelAnimate) {
pulseAnimator.setStartDelay(PULSE_ANIMATOR_DELAY);
}
pulseAnimator.start();
}
use of android.widget.TextView in project android-betterpickers by code-troopers.
the class SampleHmsThemeLight method onCreate.
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.text_and_button);
mResultTextView = (TextView) findViewById(R.id.text);
Button button = (Button) findViewById(R.id.button);
mResultTextView.setText(R.string.no_value);
button.setText(R.string.hms_picker_set);
button.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
HmsPickerBuilder hpb = new HmsPickerBuilder().setFragmentManager(getSupportFragmentManager()).setStyleResId(R.style.BetterPickersDialogFragment_Light);
hpb.show();
}
});
}
use of android.widget.TextView in project android-betterpickers by code-troopers.
the class SampleNumberBasicUsage method onCreate.
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.text_and_button);
mResultTextView = (TextView) findViewById(R.id.text);
Button button = (Button) findViewById(R.id.button);
mResultTextView.setText(R.string.no_value);
button.setText(R.string.number_picker_set);
button.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
NumberPickerBuilder npb = new NumberPickerBuilder().setFragmentManager(getSupportFragmentManager()).setStyleResId(R.style.BetterPickersDialogFragment);
npb.show();
}
});
}
use of android.widget.TextView in project android-betterpickers by code-troopers.
the class SampleNumberMaxValue method onCreate.
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.text_and_button);
mResultTextView = (TextView) findViewById(R.id.text);
Button button = (Button) findViewById(R.id.button);
final BigDecimal maxNumberAllowed = new BigDecimal("1227");
mResultTextView.setText(R.string.no_value);
button.setText("Set Number below " + maxNumberAllowed);
button.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
NumberPickerBuilder npb = new NumberPickerBuilder().setFragmentManager(getSupportFragmentManager()).setStyleResId(R.style.BetterPickersDialogFragment).setMaxNumber(maxNumberAllowed);
npb.show();
}
});
}
use of android.widget.TextView in project android-betterpickers by code-troopers.
the class SampleNumberMinValue method onCreate.
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.text_and_button);
mResultTextView = (TextView) findViewById(R.id.text);
Button button = (Button) findViewById(R.id.button);
final BigDecimal minNumberAllowed = new BigDecimal("1227");
mResultTextView.setText(R.string.no_value);
button.setText("Set Number above " + minNumberAllowed);
button.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
NumberPickerBuilder npb = new NumberPickerBuilder().setFragmentManager(getSupportFragmentManager()).setStyleResId(R.style.BetterPickersDialogFragment).setMinNumber(minNumberAllowed);
npb.show();
}
});
}
Aggregations