Search in sources :

Example 6 with GridView

use of android.widget.GridView in project cw-omnibus by commonsguy.

the class GridDemo method onCreate.

@Override
public void onCreate(Bundle icicle) {
    super.onCreate(icicle);
    setContentView(R.layout.main);
    selection = (TextView) findViewById(R.id.selection);
    GridView g = (GridView) findViewById(R.id.grid);
    g.setAdapter(new ArrayAdapter<String>(this, R.layout.cell, items));
    g.setOnItemClickListener(this);
}
Also used : GridView(android.widget.GridView)

Example 7 with GridView

use of android.widget.GridView in project AndroidSwipeLayout by daimajia.

the class GridViewExample method onCreate.

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.gridview);
    final GridView gridView = (GridView) findViewById(R.id.gridview);
    final GridViewAdapter adapter = new GridViewAdapter(this);
    adapter.setMode(Attributes.Mode.Multiple);
    gridView.setAdapter(adapter);
    gridView.setSelected(false);
    gridView.setOnItemLongClickListener(new AdapterView.OnItemLongClickListener() {

        @Override
        public boolean onItemLongClick(AdapterView<?> parent, View view, int position, long id) {
            Log.e("onItemLongClick", "onItemLongClick:" + position);
            return false;
        }
    });
    gridView.setOnItemClickListener(new AdapterView.OnItemClickListener() {

        @Override
        public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
            Log.e("onItemClick", "onItemClick:" + position);
        }
    });
    gridView.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {

        @Override
        public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {
            Log.e("onItemSelected", "onItemSelected:" + position);
        }

        @Override
        public void onNothingSelected(AdapterView<?> parent) {
        }
    });
}
Also used : GridViewAdapter(com.daimajia.swipedemo.adapter.GridViewAdapter) AdapterView(android.widget.AdapterView) GridView(android.widget.GridView) GridView(android.widget.GridView) View(android.view.View) AdapterView(android.widget.AdapterView)

Example 8 with GridView

use of android.widget.GridView in project android_frameworks_base by ParanoidAndroid.

the class CharacterPickerDialog method onCreate.

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    WindowManager.LayoutParams params = getWindow().getAttributes();
    params.token = mView.getApplicationWindowToken();
    params.type = params.TYPE_APPLICATION_ATTACHED_DIALOG;
    params.flags = params.flags | Window.FEATURE_NO_TITLE;
    setContentView(R.layout.character_picker);
    GridView grid = (GridView) findViewById(R.id.characterPicker);
    grid.setAdapter(new OptionsAdapter(getContext()));
    grid.setOnItemClickListener(this);
    mCancelButton = (Button) findViewById(R.id.cancel);
    mCancelButton.setOnClickListener(this);
}
Also used : GridView(android.widget.GridView) WindowManager(android.view.WindowManager)

Example 9 with GridView

use of android.widget.GridView in project android_frameworks_base by ParanoidAndroid.

the class GridThrasher method onCreate.

@Override
public void onCreate(Bundle icicle) {
    super.onCreate(icicle);
    setContentView(R.layout.grid_thrasher);
    mText = (TextView) findViewById(R.id.text);
    mAdapter = new ThrashListAdapter(this);
    GridView g = (GridView) findViewById(R.id.grid);
    g.setAdapter(mAdapter);
    mHandler.postDelayed(mThrash, 5000);
    g.setOnItemSelectedListener(this);
}
Also used : GridView(android.widget.GridView)

Example 10 with GridView

use of android.widget.GridView in project StickerCamera by Skykai521.

the class AlbumFragment method onCreateView.

@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    super.onCreateView(inflater, container, savedInstanceState);
    View root = inflater.inflate(R.layout.fragment_album, null);
    photos = (ArrayList<PhotoItem>) getArguments().getSerializable("photos");
    albums = (GridView) root.findViewById(R.id.albums);
    albums.setOnItemClickListener(new OnItemClickListener() {

        @Override
        public void onItemClick(AdapterView<?> arg0, View arg1, int arg2, long arg3) {
            PhotoItem photo = photos.get(arg2);
            CameraManager.getInst().processPhotoItem(getActivity(), photo);
        }
    });
    return root;
}
Also used : PhotoItem(com.stickercamera.app.model.PhotoItem) OnItemClickListener(android.widget.AdapterView.OnItemClickListener) GridView(android.widget.GridView) View(android.view.View) AdapterView(android.widget.AdapterView)

Aggregations

GridView (android.widget.GridView)139 View (android.view.View)83 AdapterView (android.widget.AdapterView)61 TextView (android.widget.TextView)41 ImageView (android.widget.ImageView)28 AbsListView (android.widget.AbsListView)20 Intent (android.content.Intent)14 ViewGroup (android.view.ViewGroup)14 SuppressLint (android.annotation.SuppressLint)10 OnItemClickListener (android.widget.AdapterView.OnItemClickListener)10 LayoutInflater (android.view.LayoutInflater)8 ArrayList (java.util.ArrayList)8 WindowManager (android.view.WindowManager)7 Button (android.widget.Button)7 ColorDrawable (android.graphics.drawable.ColorDrawable)6 ListView (android.widget.ListView)6 LinearLayout (android.widget.LinearLayout)5 Bundle (android.os.Bundle)4 ViewTreeObserver (android.view.ViewTreeObserver)4 ArrayAdapter (android.widget.ArrayAdapter)4