use of android.view.View.OnClickListener in project platform_frameworks_base by android.
the class EffectsTest method onCreate.
@Override
public void onCreate(Bundle icicle) {
super.onCreate(icicle);
setContentView(R.layout.effectstest);
Button button = (Button) findViewById(R.id.env_reverb_actvity);
button.setOnClickListener(new OnClickListener() {
public void onClick(View v) {
startActivity(new Intent(EffectsTest.this, EnvReverbTest.class));
}
});
button = (Button) findViewById(R.id.preset_reverb_actvity);
button.setOnClickListener(new OnClickListener() {
public void onClick(View v) {
startActivity(new Intent(EffectsTest.this, PresetReverbTest.class));
}
});
button = (Button) findViewById(R.id.equalizer_actvity);
button.setOnClickListener(new OnClickListener() {
public void onClick(View v) {
startActivity(new Intent(EffectsTest.this, EqualizerTest.class));
}
});
button = (Button) findViewById(R.id.virtualizer_actvity);
button.setOnClickListener(new OnClickListener() {
public void onClick(View v) {
startActivity(new Intent(EffectsTest.this, VirtualizerTest.class));
}
});
button = (Button) findViewById(R.id.bassboost_actvity);
button.setOnClickListener(new OnClickListener() {
public void onClick(View v) {
startActivity(new Intent(EffectsTest.this, BassBoostTest.class));
}
});
button = (Button) findViewById(R.id.visualizer_actvity);
button.setOnClickListener(new OnClickListener() {
public void onClick(View v) {
startActivity(new Intent(EffectsTest.this, VisualizerTest.class));
}
});
AudioEffect.Descriptor[] descriptors = AudioEffect.queryEffects();
ListView list = (ListView) findViewById(R.id.effect_list);
list.setAdapter(new EffectListAdapter(this, descriptors));
}
use of android.view.View.OnClickListener in project httpclient by pixmob.
the class Issue331 method onCreate.
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
Button b = new Button(this);
b.setText("Click action item and then this button twice on pre-ICS");
b.setOnClickListener(new OnClickListener() {
public void onClick(View v) {
mShow = !mShow;
invalidateOptionsMenu();
}
});
setContentView(b);
}
use of android.view.View.OnClickListener in project httpclient by pixmob.
the class AstroboyMasterConsole method onCreate.
@Override
public void onCreate(Bundle savedInstanceState) {
// @Inject, @InjectResource, and @InjectExtra injection happens during super.onCreate()
super.onCreate(savedInstanceState);
sayText.setOnEditorActionListener(new OnEditorActionListener() {
public boolean onEditorAction(TextView textView, int i, KeyEvent keyEvent) {
// Have the remoteControl tell Astroboy to say something
remoteControl.say(textView.getText().toString());
textView.setText(null);
return true;
}
});
brushTeethButton.setOnClickListener(new OnClickListener() {
public void onClick(View view) {
remoteControl.brushTeeth();
}
});
selfDestructButton.setOnClickListener(new OnClickListener() {
public void onClick(View view) {
// Self destruct the remoteControl
vibrator.vibrate(2000);
remoteControl.selfDestruct();
}
});
// Fighting the forces of evil deserves its own activity
fightEvilButton.setOnClickListener(new OnClickListener() {
public void onClick(View view) {
startActivity(new Intent(AstroboyMasterConsole.this, FightForcesOfEvilActivity.class));
}
});
}
use of android.view.View.OnClickListener in project platform_frameworks_base by android.
the class ManualActivity method onCreate.
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.manual_layout);
onCreateCommon(mRunnable);
mSoftwareView = (MainView) findViewById(R.id.software_view);
mSoftwareView.setLayerType(View.LAYER_TYPE_SOFTWARE, null);
mSoftwareView.setBackgroundColor(Color.WHITE);
mSoftwareView.addDrawCallback(mDrawCallback);
mCompareImageView = (ImageView) findViewById(R.id.compare_image_view);
int width = getResources().getDimensionPixelSize(R.dimen.layer_width);
int height = getResources().getDimensionPixelSize(R.dimen.layer_height);
mCompareBitmap = Bitmap.createBitmap(width, height, Bitmap.Config.ARGB_8888);
mErrorTextView = (TextView) findViewById(R.id.current_error);
((ImageButton) findViewById(R.id.next)).setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
DisplayModifier.step();
updateSpinners();
redrawViews();
}
});
((ImageButton) findViewById(R.id.previous)).setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
DisplayModifier.stepBack();
updateSpinners();
redrawViews();
}
});
((Button) findViewById(R.id.show_hardware_version)).setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
mCompareImageViewState = COMPARE_VIEW_HARDWARE;
mHandler.post(mRunnable);
}
});
((Button) findViewById(R.id.show_software_version)).setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
mCompareImageViewState = COMPARE_VIEW_SOFTWARE;
mHandler.post(mRunnable);
}
});
((Button) findViewById(R.id.show_error_heatmap)).setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
mCompareImageViewState = COMPARE_VIEW_HEATMAP;
mHandler.post(mRunnable);
}
});
buildSpinnerLayout();
}
use of android.view.View.OnClickListener in project graphhopper by graphhopper.
the class MainActivity method chooseArea.
private void chooseArea(Button button, final Spinner spinner, List<String> nameList, final MySpinnerListener myListener) {
final Map<String, String> nameToFullName = new TreeMap<>();
for (String fullName : nameList) {
String tmp = Helper.pruneFileEnd(fullName);
if (tmp.endsWith("-gh"))
tmp = tmp.substring(0, tmp.length() - 3);
tmp = AndroidHelper.getFileName(tmp);
nameToFullName.put(tmp, fullName);
}
nameList.clear();
nameList.addAll(nameToFullName.keySet());
ArrayAdapter<String> spinnerArrayAdapter = new ArrayAdapter<>(this, android.R.layout.simple_spinner_dropdown_item, nameList);
spinner.setAdapter(spinnerArrayAdapter);
button.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
Object o = spinner.getSelectedItem();
if (o != null && o.toString().length() > 0 && !nameToFullName.isEmpty()) {
String area = o.toString();
myListener.onSelect(area, nameToFullName.get(area));
} else {
myListener.onSelect(null, null);
}
}
});
}
Aggregations