use of android.widget.Button in project cw-advandroid by commonsguy.
the class ContactsInserter method onCreate.
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
Button btn = (Button) findViewById(R.id.insert);
btn.setOnClickListener(onInsert);
}
use of android.widget.Button in project cw-advandroid by commonsguy.
the class PickDemo method onCreate.
@Override
public void onCreate(Bundle icicle) {
super.onCreate(icicle);
if (CONTENT_URI == null) {
Toast.makeText(this, "We are experiencing technical difficulties...", Toast.LENGTH_LONG).show();
finish();
return;
}
setContentView(R.layout.main);
Button btn = (Button) findViewById(R.id.pick);
btn.setOnClickListener(new View.OnClickListener() {
public void onClick(View view) {
Intent i = new Intent(Intent.ACTION_PICK, CONTENT_URI);
startActivityForResult(i, PICK_REQUEST);
}
});
}
use of android.widget.Button in project cw-omnibus by commonsguy.
the class FlipperDemo2 method onCreate.
@Override
public void onCreate(Bundle icicle) {
super.onCreate(icicle);
setContentView(R.layout.main);
flipper = (ViewFlipper) findViewById(R.id.details);
for (String item : items) {
Button btn = new Button(this);
btn.setText(item);
flipper.addView(btn, new ViewGroup.LayoutParams(ViewGroup.LayoutParams.FILL_PARENT, ViewGroup.LayoutParams.FILL_PARENT));
}
flipper.setFlipInterval(2000);
flipper.startFlipping();
}
use of android.widget.Button in project android-betterpickers by code-troopers.
the class SampleNumberMultipleReferences method onDialogNumberSet.
@Override
public void onDialogNumberSet(int reference, BigInteger number, double decimal, boolean isNegative, BigDecimal fullNumber) {
Button buttonToSet;
switch(reference) {
case BUTTON_ONE_REFERENCE:
buttonToSet = buttonOne;
break;
case BUTTON_TWO_REFERENCE:
buttonToSet = buttonTwo;
break;
case BUTTON_THREE_REFERENCE:
buttonToSet = buttonThree;
break;
case BUTTON_FOUR_REFERENCE:
buttonToSet = buttonFour;
break;
default:
buttonToSet = buttonOne;
}
buttonToSet.setText(getString(R.string.number_picker_result_value, number, decimal, isNegative, fullNumber));
}
use of android.widget.Button in project android-betterpickers by code-troopers.
the class SampleNumberWithOptions method onCreate.
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.text_and_three_buttons);
mResultTextView = (TextView) findViewById(R.id.text);
Button buttonOne = (Button) findViewById(R.id.button_one);
mButtonSetMin = (Button) findViewById(R.id.button_two);
mButtonSetMax = (Button) findViewById(R.id.button_three);
mResultTextView.setText(R.string.no_value);
buttonOne.setText(R.string.number_picker_set);
buttonOne.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
NumberPickerBuilder npb = new NumberPickerBuilder().setFragmentManager(getSupportFragmentManager()).setStyleResId(R.style.BetterPickersDialogFragment_Light).setPlusMinusVisibility(View.INVISIBLE).setDecimalVisibility(View.INVISIBLE).setReference(BUTTON_ONE_REFERENCE).setLabelText("LBS.");
if (mMin != null) {
npb.setMinNumber(mMin);
}
if (mMax != null) {
npb.setMaxNumber(mMax);
}
npb.show();
}
});
mButtonSetMin.setText("Set Min Number");
mButtonSetMin.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
NumberPickerBuilder npb = new NumberPickerBuilder().setFragmentManager(getSupportFragmentManager()).setStyleResId(R.style.BetterPickersDialogFragment_Light).setDecimalVisibility(View.INVISIBLE).setReference(BUTTON_TWO_REFERENCE).setLabelText("MIN NUMBER");
npb.show();
}
});
mButtonSetMax.setText("Set Max Number");
mButtonSetMax.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
NumberPickerBuilder npb = new NumberPickerBuilder().setFragmentManager(getSupportFragmentManager()).setStyleResId(R.style.BetterPickersDialogFragment_Light).setDecimalVisibility(View.INVISIBLE).setReference(BUTTON_THREE_REFERENCE).setLabelText("MAX NUMBER");
npb.show();
}
});
}
Aggregations