use of android.widget.ImageButton in project android-demos by novoda.
the class DynamicListItems method onCreate.
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.dynamic_list);
newValue = (EditText) findViewById(R.id.new_value_field);
setListAdapter(new SimpleAdapter(this, list, R.layout.row, new String[] { ITEM_KEY }, new int[] { R.id.list_value }));
((ImageButton) findViewById(R.id.button)).setOnClickListener(getBtnClickListener());
}
use of android.widget.ImageButton in project Knife by mthli.
the class MainActivity method setupStrikethrough.
private void setupStrikethrough() {
ImageButton strikethrough = (ImageButton) findViewById(R.id.strikethrough);
strikethrough.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
knife.strikethrough(!knife.contains(KnifeText.FORMAT_STRIKETHROUGH));
}
});
strikethrough.setOnLongClickListener(new View.OnLongClickListener() {
@Override
public boolean onLongClick(View v) {
Toast.makeText(MainActivity.this, R.string.toast_strikethrough, Toast.LENGTH_SHORT).show();
return true;
}
});
}
use of android.widget.ImageButton in project Knife by mthli.
the class MainActivity method setupLink.
private void setupLink() {
ImageButton link = (ImageButton) findViewById(R.id.link);
link.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
showLinkDialog();
}
});
link.setOnLongClickListener(new View.OnLongClickListener() {
@Override
public boolean onLongClick(View v) {
Toast.makeText(MainActivity.this, R.string.toast_insert_link, Toast.LENGTH_SHORT).show();
return true;
}
});
}
use of android.widget.ImageButton in project Knife by mthli.
the class MainActivity method setupBullet.
private void setupBullet() {
ImageButton bullet = (ImageButton) findViewById(R.id.bullet);
bullet.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
knife.bullet(!knife.contains(KnifeText.FORMAT_BULLET));
}
});
bullet.setOnLongClickListener(new View.OnLongClickListener() {
@Override
public boolean onLongClick(View v) {
Toast.makeText(MainActivity.this, R.string.toast_bullet, Toast.LENGTH_SHORT).show();
return true;
}
});
}
use of android.widget.ImageButton in project Knife by mthli.
the class MainActivity method setupItalic.
private void setupItalic() {
ImageButton italic = (ImageButton) findViewById(R.id.italic);
italic.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
knife.italic(!knife.contains(KnifeText.FORMAT_ITALIC));
}
});
italic.setOnLongClickListener(new View.OnLongClickListener() {
@Override
public boolean onLongClick(View v) {
Toast.makeText(MainActivity.this, R.string.toast_italic, Toast.LENGTH_SHORT).show();
return true;
}
});
}
Aggregations