use of android.widget.TextView in project android-betterpickers by code-troopers.
the class TimePicker method onFinishInflate.
@Override
protected void onFinishInflate() {
super.onFinishInflate();
View v1 = findViewById(R.id.first);
View v2 = findViewById(R.id.second);
View v3 = findViewById(R.id.third);
View v4 = findViewById(R.id.fourth);
mEnteredTime = (TimerView) findViewById(R.id.timer_time_text);
mDelete = (ImageButton) findViewById(R.id.delete);
mDelete.setOnClickListener(this);
mDelete.setOnLongClickListener(this);
mNumbers[1] = (Button) v1.findViewById(R.id.key_left);
mNumbers[2] = (Button) v1.findViewById(R.id.key_middle);
mNumbers[3] = (Button) v1.findViewById(R.id.key_right);
mNumbers[4] = (Button) v2.findViewById(R.id.key_left);
mNumbers[5] = (Button) v2.findViewById(R.id.key_middle);
mNumbers[6] = (Button) v2.findViewById(R.id.key_right);
mNumbers[7] = (Button) v3.findViewById(R.id.key_left);
mNumbers[8] = (Button) v3.findViewById(R.id.key_middle);
mNumbers[9] = (Button) v3.findViewById(R.id.key_right);
mLeft = (Button) v4.findViewById(R.id.key_left);
mNumbers[0] = (Button) v4.findViewById(R.id.key_middle);
mRight = (Button) v4.findViewById(R.id.key_right);
setLeftRightEnabled(false);
for (int i = 0; i < 10; i++) {
mNumbers[i].setOnClickListener(this);
mNumbers[i].setText(String.format("%d", i));
mNumbers[i].setTag(R.id.numbers_key, new Integer(i));
}
updateTime();
Resources res = mContext.getResources();
mAmpm = new DateFormatSymbols().getAmPmStrings();
if (mIs24HoursMode) {
mLeft.setText(res.getString(R.string.time_picker_00_label));
mRight.setText(res.getString(R.string.time_picker_30_label));
} else {
mLeft.setText(mAmpm[0]);
mRight.setText(mAmpm[1]);
}
mLeft.setOnClickListener(this);
mRight.setOnClickListener(this);
mAmPmLabel = (TextView) findViewById(R.id.ampm_label);
mAmPmState = AMPM_NOT_SELECTED;
mDivider = findViewById(R.id.divider);
restyleViews();
updateKeypad();
}
use of android.widget.TextView in project android-betterpickers by code-troopers.
the class SampleDateThemeCustom 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.date_picker_set);
button.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
DatePickerBuilder dpb = new DatePickerBuilder().setFragmentManager(getSupportFragmentManager()).setStyleResId(R.style.MyCustomBetterPickerTheme);
dpb.show();
}
});
}
use of android.widget.TextView in project android-betterpickers by code-troopers.
the class SampleDateThemeLight 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.date_picker_set);
button.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
DatePickerBuilder dpb = new DatePickerBuilder().setFragmentManager(getSupportFragmentManager()).setStyleResId(R.style.BetterPickersDialogFragment_Light);
dpb.show();
}
});
}
use of android.widget.TextView in project android-betterpickers by code-troopers.
the class SampleDateYearOptional 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.date_picker_set);
button.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
DatePickerBuilder dpb = new DatePickerBuilder().setFragmentManager(getSupportFragmentManager()).setStyleResId(R.style.BetterPickersDialogFragment).setYearOptional(true);
dpb.show();
}
});
}
use of android.widget.TextView in project android-betterpickers by code-troopers.
the class SampleExpirationDismissListener 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.expiration_picker_set);
button.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
ExpirationPickerBuilder epb = new ExpirationPickerBuilder().setFragmentManager(getSupportFragmentManager()).setStyleResId(R.style.BetterPickersDialogFragment).setOnDismissListener(SampleExpirationDismissListener.this);
epb.show();
}
});
}
Aggregations