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);
}
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) {
}
});
}
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);
}
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);
}
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;
}
Aggregations