use of android.widget.GridView in project PullToRefresh-PinnedSection-ListView by tongcpp.
the class PullToRefreshGridView method createRefreshableView.
@Override
protected final GridView createRefreshableView(Context context, AttributeSet attrs) {
final GridView gv;
if (VERSION.SDK_INT >= VERSION_CODES.GINGERBREAD) {
gv = new InternalGridViewSDK9(context, attrs);
} else {
gv = new InternalGridView(context, attrs);
}
// Use Generated ID (from res/values/ids.xml)
gv.setId(R.id.gridview);
return gv;
}
use of android.widget.GridView in project ADWLauncher2 by boombuler.
the class AllApps2D method onFinishInflate.
@Override
protected void onFinishInflate() {
setBackgroundColor(Color.BLACK);
try {
mGrid = (GridView) findViewWithTag("all_apps_2d_grid");
if (mGrid == null)
throw new Resources.NotFoundException();
mGrid.setOnItemClickListener(this);
mGrid.setOnItemLongClickListener(this);
mGrid.setBackgroundColor(Color.BLACK);
mGrid.setCacheColorHint(Color.BLACK);
ImageButton homeButton = (ImageButton) findViewWithTag("all_apps_2d_home");
if (homeButton == null)
throw new Resources.NotFoundException();
homeButton.setOnClickListener(new View.OnClickListener() {
public void onClick(View v) {
mLauncher.closeAllApps(true);
}
});
} catch (Resources.NotFoundException e) {
Log.e(TAG, "Can't find necessary layout elements for AllApps2D");
}
setOnKeyListener(this);
}
use of android.widget.GridView in project glimmr by brk3.
the class LocalPhotosGridFragment method initGridView.
@Override
protected void initGridView() {
mGridView = (GridView) mLayout.findViewById(R.id.gridview);
mGridView.setVisibility(View.VISIBLE);
mGridView.setMultiChoiceModeListener(this);
mShowDetailsOverlay = false;
String[] from = { MediaStore.MediaColumns.TITLE };
int[] to = { android.R.id.text1 };
CursorLoader cursorLoader = new CursorLoader(getActivity(), SOURCE_URI, null, null, null, MediaStore.Audio.Media.TITLE);
Cursor cursor = cursorLoader.loadInBackground();
mAdapter = new MediaStoreImagesAdapter(getActivity(), R.layout.gridview_item, cursor, from, to);
mGridView.setAdapter(mAdapter);
mGridView.setChoiceMode(GridView.CHOICE_MODE_MULTIPLE_MODAL);
mGridView.setOnItemClickListener(new AdapterView.OnItemClickListener() {
final String usageTip = getString(R.string.upload_photos_tip);
@Override
public void onItemClick(AdapterView<?> adapterView, View view, int position, long l) {
UsageTips.getInstance().show(mActivity, usageTip, true);
}
});
}
use of android.widget.GridView in project glimmr by brk3.
the class PhotoGridFragment method onResume.
@Override
public void onResume() {
super.onResume();
if (BuildConfig.DEBUG) {
Log.d("(PhotoGridFragment)" + getLogTag(), "onResume");
}
if (!mPhotos.isEmpty()) {
GridView gridView = (GridView) mLayout.findViewById(R.id.gridview);
gridView.setVisibility(View.VISIBLE);
}
}
use of android.widget.GridView in project coursera-android by aporter.
the class GridLayoutActivity method onCreate.
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
GridView gridview = (GridView) findViewById(R.id.gridview);
// Create a new ImageAdapter and set it as the Adapter for this GridView
gridview.setAdapter(new ImageAdapter(this, mThumbIdsFlowers));
// Set an setOnItemClickListener on the GridView
gridview.setOnItemClickListener(new OnItemClickListener() {
public void onItemClick(AdapterView<?> parent, View v, int position, long id) {
//Create an Intent to start the ImageViewActivity
Intent intent = new Intent(GridLayoutActivity.this, ImageViewActivity.class);
// Add the ID of the thumbnail to display as an Intent Extra
intent.putExtra(EXTRA_RES_ID, (int) id);
// Start the ImageViewActivity
startActivity(intent);
}
});
}
Aggregations