Search in sources :

Example 56 with OnClickListener

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));
}
Also used : ListView(android.widget.ListView) Button(android.widget.Button) OnClickListener(android.view.View.OnClickListener) Intent(android.content.Intent) TextView(android.widget.TextView) View(android.view.View) ListView(android.widget.ListView)

Example 57 with OnClickListener

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);
}
Also used : Button(android.widget.Button) OnClickListener(android.view.View.OnClickListener) ImageView(android.widget.ImageView) View(android.view.View)

Example 58 with OnClickListener

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));
        }
    });
}
Also used : KeyEvent(android.view.KeyEvent) OnClickListener(android.view.View.OnClickListener) OnEditorActionListener(android.widget.TextView.OnEditorActionListener) TextView(android.widget.TextView) Intent(android.content.Intent) ContentView(roboguice.inject.ContentView) InjectView(roboguice.inject.InjectView) TextView(android.widget.TextView) View(android.view.View)

Example 59 with OnClickListener

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();
}
Also used : ImageButton(android.widget.ImageButton) ImageButton(android.widget.ImageButton) Button(android.widget.Button) OnClickListener(android.view.View.OnClickListener) ImageView(android.widget.ImageView) TextView(android.widget.TextView) View(android.view.View) AdapterView(android.widget.AdapterView)

Example 60 with OnClickListener

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);
            }
        }
    });
}
Also used : OnClickListener(android.view.View.OnClickListener) TreeMap(java.util.TreeMap) View(android.view.View) TextView(android.widget.TextView) MapView(org.oscim.android.MapView) ArrayAdapter(android.widget.ArrayAdapter)

Aggregations

OnClickListener (android.view.View.OnClickListener)794 View (android.view.View)792 TextView (android.widget.TextView)492 Button (android.widget.Button)265 ImageView (android.widget.ImageView)256 Intent (android.content.Intent)183 ListView (android.widget.ListView)112 AdapterView (android.widget.AdapterView)91 ScrollView (android.widget.ScrollView)52 LinearLayout (android.widget.LinearLayout)49 Bundle (android.os.Bundle)43 LayoutInflater (android.view.LayoutInflater)35 ViewGroup (android.view.ViewGroup)30 ArrayList (java.util.ArrayList)30 BindView (butterknife.BindView)29 KeyEvent (android.view.KeyEvent)28 EditText (android.widget.EditText)28 DialogInterface (android.content.DialogInterface)27 OnItemClickListener (android.widget.AdapterView.OnItemClickListener)25 FragmentManager (android.support.v4.app.FragmentManager)23