Search in sources :

Example 61 with ImageButton

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();
        }
    });
}
Also used : AlertDialog(android.support.v7.app.AlertDialog) EditText(android.widget.EditText) InputMethodManager(android.view.inputmethod.InputMethodManager) LinearLayoutManager(android.support.v7.widget.LinearLayoutManager) RecyclerView(android.support.v7.widget.RecyclerView) TextView(android.widget.TextView) View(android.view.View) Toast(android.widget.Toast) ImageButton(android.widget.ImageButton) Button(android.widget.Button) CustomAdapter_CategoriasI(layout.CustomAdapter_CategoriasI) RecyclerView(android.support.v7.widget.RecyclerView)

Example 62 with ImageButton

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

Example 63 with ImageButton

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

Example 64 with ImageButton

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);
}
Also used : ImageButton(android.widget.ImageButton)

Example 65 with ImageButton

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);
}
Also used : ImageButton(android.widget.ImageButton) AutoCompleteTextView(android.widget.AutoCompleteTextView) TextView(android.widget.TextView)

Aggregations

ImageButton (android.widget.ImageButton)158 View (android.view.View)112 TextView (android.widget.TextView)87 ImageView (android.widget.ImageView)55 Button (android.widget.Button)27 ListView (android.widget.ListView)25 AdapterView (android.widget.AdapterView)24 OnClickListener (android.view.View.OnClickListener)21 LinearLayout (android.widget.LinearLayout)21 Intent (android.content.Intent)19 RelativeLayout (android.widget.RelativeLayout)13 DialogInterface (android.content.DialogInterface)12 Bundle (android.os.Bundle)11 LayoutInflater (android.view.LayoutInflater)11 EditText (android.widget.EditText)11 ViewGroup (android.view.ViewGroup)10 ArrayList (java.util.ArrayList)10 Builder (android.app.AlertDialog.Builder)7 Drawable (android.graphics.drawable.Drawable)7 RecyclerView (android.support.v7.widget.RecyclerView)7