Search in sources :

Example 71 with GridView

use of android.widget.GridView in project Klyph by jonathangerbaud.

the class GridDialogFragment method onCreateView.

@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    View view = inflater.inflate(getCustomLayout(), container, false);
    gridView = (GridView) view.findViewById(R.id.grid);
    View emptyView = getEmptyView();
    if (emptyView != null) {
        emptyView.setId(android.R.id.empty);
        ((ViewGroup) gridView.getParent()).addView(emptyView);
        gridView.setEmptyView(emptyView);
    }
    return view;
}
Also used : ViewGroup(android.view.ViewGroup) IEmptyView(com.abewy.android.extended.fragment.GridFragment.IEmptyView) GridView(android.widget.GridView) View(android.view.View) AdapterView(android.widget.AdapterView)

Example 72 with GridView

use of android.widget.GridView in project Talon-for-Twitter by klinker24.

the class ProfilePicturesFragment method onCreateView.

@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    super.onCreateView(inflater, container, savedInstanceState);
    screenName = getArguments().getString("screen_name");
    settings = AppSettings.getInstance(context);
    sharedPrefs = context.getSharedPreferences("com.klinker.android.twitter_world_preferences", 0);
    inflater = LayoutInflater.from(context);
    layout = inflater.inflate(R.layout.pictures_fragment, null);
    listView = (GridView) layout.findViewById(R.id.listView);
    spinner = (LinearLayout) layout.findViewById(R.id.spinner);
    listView.setOnScrollListener(new AbsListView.OnScrollListener() {

        @Override
        public void onScrollStateChanged(AbsListView absListView, int i) {
        }

        @Override
        public void onScroll(AbsListView absListView, int firstVisibleItem, int visibleItemCount, int totalItemCount) {
            final int lastItem = firstVisibleItem + visibleItemCount;
            if (lastItem == totalItemCount && canRefresh) {
                getMore();
            }
        }
    });
    final LinearLayout getTweets = (LinearLayout) layout.findViewById(R.id.load_tweets);
    final Button getPics = (Button) layout.findViewById(R.id.get_pics);
    getPics.setOnClickListener(new View.OnClickListener() {

        @Override
        public void onClick(View view) {
            getTweets.setVisibility(View.GONE);
            spinner.setVisibility(View.VISIBLE);
            doSearch();
        }
    });
    return layout;
}
Also used : Button(android.widget.Button) AbsListView(android.widget.AbsListView) GridView(android.widget.GridView) View(android.view.View) AbsListView(android.widget.AbsListView) Point(android.graphics.Point) LinearLayout(android.widget.LinearLayout)

Example 73 with GridView

use of android.widget.GridView in project coursera-android by aporter.

the class GridFragment method onCreateView.

@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    View view = inflater.inflate(R.layout.grid_fragment, container, false);
    mGridview = (GridView) view.findViewById(R.id.gridview);
    return view;
}
Also used : GridView(android.widget.GridView) View(android.view.View) AdapterView(android.widget.AdapterView)

Example 74 with GridView

use of android.widget.GridView in project ActionBar-PullToRefresh by chrisbanes.

the class GridViewActivity method onCreate.

@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_gridview);
    GridView gridView = (GridView) findViewById(R.id.ptr_gridview);
    ListAdapter adapter = new ArrayAdapter<String>(this, android.R.layout.simple_list_item_1, ITEMS);
    gridView.setAdapter(adapter);
    // Now find the PullToRefreshLayout and set it up
    mPullToRefreshLayout = (PullToRefreshLayout) findViewById(R.id.ptr_layout);
    ActionBarPullToRefresh.from(this).options(Options.create().scrollDistance(.75f).headerLayout(R.layout.customised_header).headerTransformer(new CustomisedHeaderTransformer()).build()).allChildrenArePullable().listener(this).useViewDelegate(GridView.class, new AbsListViewDelegate()).setup(mPullToRefreshLayout);
}
Also used : AbsListViewDelegate(uk.co.senab.actionbarpulltorefresh.library.viewdelegates.AbsListViewDelegate) GridView(android.widget.GridView) ListAdapter(android.widget.ListAdapter) ArrayAdapter(android.widget.ArrayAdapter)

Example 75 with GridView

use of android.widget.GridView in project ActionBar-PullToRefresh by chrisbanes.

the class GridViewActivity method onCreate.

@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_gridview);
    GridView gridView = (GridView) findViewById(R.id.ptr_gridview);
    ListAdapter adapter = new ArrayAdapter<String>(this, android.R.layout.simple_list_item_1, ITEMS);
    gridView.setAdapter(adapter);
    // Now find the PullToRefreshLayout and set it up
    mPullToRefreshLayout = (PullToRefreshLayout) findViewById(R.id.ptr_layout);
    ActionBarPullToRefresh.from(this).options(Options.create().scrollDistance(.75f).headerLayout(R.layout.customised_header).headerTransformer(new CustomisedHeaderTransformer()).build()).allChildrenArePullable().listener(this).useViewDelegate(GridView.class, new AbsListViewDelegate()).setup(mPullToRefreshLayout);
}
Also used : AbsListViewDelegate(uk.co.senab.actionbarpulltorefresh.library.viewdelegates.AbsListViewDelegate) GridView(android.widget.GridView) ListAdapter(android.widget.ListAdapter) ArrayAdapter(android.widget.ArrayAdapter)

Aggregations

GridView (android.widget.GridView)142 View (android.view.View)86 AdapterView (android.widget.AdapterView)64 TextView (android.widget.TextView)42 ImageView (android.widget.ImageView)30 AbsListView (android.widget.AbsListView)20 Intent (android.content.Intent)15 ViewGroup (android.view.ViewGroup)14 OnItemClickListener (android.widget.AdapterView.OnItemClickListener)11 SuppressLint (android.annotation.SuppressLint)10 ArrayList (java.util.ArrayList)9 LayoutInflater (android.view.LayoutInflater)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