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());
}
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));
}
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;
}
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);
}
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 }));
}
Aggregations