Search in sources :

Example 41 with ImageButton

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

Example 42 with ImageButton

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

Example 43 with ImageButton

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

Example 44 with ImageButton

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

Example 45 with ImageButton

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

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