Search in sources :

Example 31 with GridView

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

Example 32 with GridView

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);
}
Also used : ImageButton(android.widget.ImageButton) Resources(android.content.res.Resources) GridView(android.widget.GridView) TextView(android.widget.TextView) View(android.view.View) AdapterView(android.widget.AdapterView)

Example 33 with GridView

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);
        }
    });
}
Also used : Cursor(android.database.Cursor) GridView(android.widget.GridView) ImageView(android.widget.ImageView) View(android.view.View) AdapterView(android.widget.AdapterView) AbsListView(android.widget.AbsListView) TextView(android.widget.TextView) CursorLoader(android.content.CursorLoader) AdapterView(android.widget.AdapterView)

Example 34 with GridView

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

Example 35 with GridView

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);
        }
    });
}
Also used : OnItemClickListener(android.widget.AdapterView.OnItemClickListener) Intent(android.content.Intent) GridView(android.widget.GridView) 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