Search in sources :

Example 66 with Button

use of android.widget.Button in project platform_frameworks_base by android.

the class ShortButtonsTest method testScrollDownToBottomThroughButtons.

@LargeTest
public void testScrollDownToBottomThroughButtons() throws Exception {
    final int numButtons = getActivity().getNumButtons();
    for (int i = 0; i < numButtons; i++) {
        String prefix = "after " + i + " downs expected button " + i;
        final Button button = getActivity().getButtonAt(i);
        assertTrue(prefix + "  to have focus", button.isFocused());
        assertTrue(prefix + " to be on screen", isButtonOnScreen(button));
        sendKeys(KeyEvent.KEYCODE_DPAD_DOWN);
    }
    assertEquals("should be fully scrolled to bottom", getActivity().getLinearLayout().getHeight() - mScrollView.getHeight(), mScrollView.getScrollY());
}
Also used : Button(android.widget.Button) LargeTest(android.test.suitebuilder.annotation.LargeTest)

Example 67 with Button

use of android.widget.Button 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 68 with Button

use of android.widget.Button in project platform_frameworks_base by android.

the class MessageBar method onCreateView.

@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    mView = inflater.inflate(R.layout.fragment_message_bar, container, false);
    ImageView infoIcon = (ImageView) mView.findViewById(R.id.icon_info);
    infoIcon.setImageResource(R.drawable.ic_dialog_info);
    ImageView errorIcon = (ImageView) mView.findViewById(R.id.icon_error);
    errorIcon.setImageResource(R.drawable.ic_dialog_alert);
    Button dismiss = (Button) mView.findViewById(R.id.button_dismiss);
    dismiss.setOnClickListener(new View.OnClickListener() {

        @Override
        public void onClick(View v) {
            hide();
        }
    });
    mContainer = container;
    return mView;
}
Also used : Button(android.widget.Button) ImageView(android.widget.ImageView) TextView(android.widget.TextView) ImageView(android.widget.ImageView) View(android.view.View)

Example 69 with Button

use of android.widget.Button 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 70 with Button

use of android.widget.Button in project httpclient by pixmob.

the class Issue435 method onCreate.

@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    LinearLayout layout = new LinearLayout(this);
    layout.setOrientation(LinearLayout.VERTICAL);
    TextView t = new TextView(this);
    t.setText("Must be on a portrait device where the tabs are stacked. Stacked background will disappear when action mode is triggered.");
    layout.addView(t);
    Button b = new Button(this);
    b.setText("Start ActionMode");
    b.setOnClickListener(this);
    layout.addView(b);
    setContentView(layout);
    ActionBar ab = getSupportActionBar();
    ab.setNavigationMode(ActionBar.NAVIGATION_MODE_TABS);
    ab.addTab(ab.newTab().setText("One").setTabListener(this));
    ab.addTab(ab.newTab().setText("One").setTabListener(this));
    ab.addTab(ab.newTab().setText("One").setTabListener(this));
    ab.setBackgroundDrawable(new GradientDrawable(TOP_BOTTOM, new int[] { 0xFF004400, 0xFF002200 }));
    ab.setStackedBackgroundDrawable(new GradientDrawable(TOP_BOTTOM, new int[] { 0xFF440000, 0xFF220000 }));
}
Also used : Button(android.widget.Button) TextView(android.widget.TextView) LinearLayout(android.widget.LinearLayout) ActionBar(com.actionbarsherlock.app.ActionBar) GradientDrawable(android.graphics.drawable.GradientDrawable)

Aggregations

Button (android.widget.Button)1477 View (android.view.View)909 TextView (android.widget.TextView)609 OnClickListener (android.view.View.OnClickListener)275 Intent (android.content.Intent)200 LinearLayout (android.widget.LinearLayout)189 ImageView (android.widget.ImageView)146 EditText (android.widget.EditText)126 ListView (android.widget.ListView)112 AdapterView (android.widget.AdapterView)76 ViewGroup (android.view.ViewGroup)65 LayoutInflater (android.view.LayoutInflater)56 CompoundButton (android.widget.CompoundButton)53 ScrollView (android.widget.ScrollView)53 Test (org.junit.Test)51 Bundle (android.os.Bundle)49 CheckBox (android.widget.CheckBox)48 FrameLayout (android.widget.FrameLayout)47 AlertDialog (android.app.AlertDialog)45 ImageButton (android.widget.ImageButton)45