use of android.widget.ImageButton in project AdMoney by ErnestoGonAr.
the class CategoriasIngreso method onCreate.
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_categorias_ingreso);
aceptar = (Button) findViewById(R.id.aceptarin);
agregar = (ImageButton) findViewById(R.id.agregar_ci);
bd = new BDHandlerAM(this);
bandera = false;
a = bd.spinneringresos();
RecyclerView rv = (RecyclerView) findViewById(R.id.recycler_ci);
try {
String[][] dataSet = bd.obtenerCategoriasi();
LinearLayoutManager ln = new LinearLayoutManager(this);
ln.setOrientation(LinearLayoutManager.VERTICAL);
CustomAdapter_CategoriasI adapter = new CustomAdapter_CategoriasI(dataSet);
rv.setLayoutManager(ln);
rv.setAdapter(adapter);
} catch (ArrayIndexOutOfBoundsException e) {
Toast toast = Toast.makeText(this, "No hay categorias de Ingresos", Toast.LENGTH_SHORT);
toast.setGravity(Gravity.CENTER_VERTICAL, 0, 0);
toast.show();
return;
}
agregar.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
AlertDialog.Builder mBuilder = new AlertDialog.Builder(CategoriasIngreso.this);
View mView = getLayoutInflater().inflate(R.layout.insertar_categoriase, null);
final EditText insertar = (EditText) mView.findViewById(R.id.insertb);
final Button iguardar = (Button) mView.findViewById(R.id.insertarguardar);
final Button icancelar = (Button) mView.findViewById(R.id.insertarcancelar);
mBuilder.setView(mView);
AlertDialog dialog = mBuilder.create();
dialog.show();
insertar.requestFocus();
InputMethodManager imm = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE);
imm.showSoftInput(insertar, InputMethodManager.SHOW_IMPLICIT);
iguardar.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
validartexto = insertar.getText().toString();
insertar();
if (bandera) {
bd.insertarCI(primeroMayuscula(insertar.getText().toString()), 7);
}
onBackPressed2();
}
});
icancelar.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
onBackPressed2();
}
});
}
});
aceptar.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
onBackPressed();
}
});
}
use of android.widget.ImageButton in project android_frameworks_base by DirtyUnicorns.
the class ListRecyclerProfiling method onCreate.
@Override
public void onCreate(Bundle icicle) {
super.onCreate(icicle);
setContentView(R.layout.list_recycler_profiling);
String[] values = new String[1000];
for (int i = 0; i < 1000; i++) {
values[i] = ((Integer) i).toString();
}
ListView listView = (ListView) findViewById(R.id.list);
ViewDebug.startRecyclerTracing("SimpleList", listView);
listView.setAdapter(new ArrayAdapter<String>(this, android.R.layout.simple_list_item_1, values));
ImageButton stopProfiling = (ImageButton) findViewById(R.id.pause);
stopProfiling.setOnClickListener(new View.OnClickListener() {
public void onClick(View v) {
ViewDebug.stopRecyclerTracing();
}
});
}
use of android.widget.ImageButton in project android_frameworks_base by AOSPA.
the class FloatingToolbar method createMenuItemButton.
/**
* Creates and returns a menu button for the specified menu item.
*/
private static View createMenuItemButton(Context context, MenuItem menuItem) {
if (isIconOnlyMenuItem(menuItem)) {
View imageMenuItemButton = LayoutInflater.from(context).inflate(R.layout.floating_popup_menu_image_button, null);
((ImageButton) imageMenuItemButton.findViewById(R.id.floating_toolbar_menu_item_image_button)).setImageDrawable(menuItem.getIcon());
return imageMenuItemButton;
}
Button menuItemButton = (Button) LayoutInflater.from(context).inflate(R.layout.floating_popup_menu_button, null);
menuItemButton.setText(menuItem.getTitle());
menuItemButton.setContentDescription(menuItem.getTitle());
return menuItemButton;
}
use of android.widget.ImageButton in project SublimePicker by vikramkakkar.
the class DayPickerView method onLayout.
@Override
protected void onLayout(boolean changed, int left, int top, int right, int bottom) {
final ImageButton leftButton;
final ImageButton rightButton;
if (SUtils.isLayoutRtlCompat(this)) {
leftButton = mNextButton;
rightButton = mPrevButton;
} else {
leftButton = mPrevButton;
rightButton = mNextButton;
}
final int width = right - left;
final int height = bottom - top;
mViewPager.layout(0, 0, width, height);
final SimpleMonthView monthView = (SimpleMonthView) mViewPager.getChildAt(0).findViewById(R.id.month_view);
final int monthHeight = monthView.getMonthHeight();
final int cellWidth = monthView.getCellWidth();
// Vertically center the previous/next buttons within the month
// header, horizontally center within the day cell.
final int leftDW = leftButton.getMeasuredWidth();
final int leftDH = leftButton.getMeasuredHeight();
final int leftIconTop = monthView.getPaddingTop() + (monthHeight - leftDH) / 2;
final int leftIconLeft = monthView.getPaddingLeft() + (cellWidth - leftDW) / 2;
leftButton.layout(leftIconLeft, leftIconTop, leftIconLeft + leftDW, leftIconTop + leftDH);
final int rightDW = rightButton.getMeasuredWidth();
final int rightDH = rightButton.getMeasuredHeight();
final int rightIconTop = monthView.getPaddingTop() + (monthHeight - rightDH) / 2;
final int rightIconRight = width - monthView.getPaddingRight() - (cellWidth - rightDW) / 2;
rightButton.layout(rightIconRight - rightDW, rightIconTop, rightIconRight, rightIconTop + rightDH);
}
use of android.widget.ImageButton in project Lightning-Browser by anthonycr.
the class BrowserActivity method showFindInPageControls.
private void showFindInPageControls(@NonNull String text) {
mSearchBar.setVisibility(View.VISIBLE);
TextView tw = (TextView) findViewById(R.id.search_query);
tw.setText('\'' + text + '\'');
ImageButton up = (ImageButton) findViewById(R.id.button_next);
up.setOnClickListener(this);
ImageButton down = (ImageButton) findViewById(R.id.button_back);
down.setOnClickListener(this);
ImageButton quit = (ImageButton) findViewById(R.id.button_quit);
quit.setOnClickListener(this);
}
Aggregations