当前位置: 首页>>代码示例>>Java>>正文


Java StaggeredGridView.setAdapter方法代码示例

本文整理汇总了Java中com.etsy.android.grid.StaggeredGridView.setAdapter方法的典型用法代码示例。如果您正苦于以下问题:Java StaggeredGridView.setAdapter方法的具体用法?Java StaggeredGridView.setAdapter怎么用?Java StaggeredGridView.setAdapter使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.etsy.android.grid.StaggeredGridView的用法示例。


在下文中一共展示了StaggeredGridView.setAdapter方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: onCreate

import com.etsy.android.grid.StaggeredGridView; //导入方法依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.day1_activity_main);

    mGridView = (StaggeredGridView) findViewById(R.id.grid_view);
    mAdapter = new CustomAdapter(this, R.id.image);

    mDataset = generateSampleData();
    for (String data : mDataset) {
        mAdapter.add(data);
    }

    mGridView.setAdapter(mAdapter);

}
 
开发者ID:Phonbopit,项目名称:30-android-libraries-in-30-days,代码行数:17,代码来源:MainActivity.java

示例2: onCreateView

import com.etsy.android.grid.StaggeredGridView; //导入方法依赖的package包/类
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    View v = inflater.inflate(R.layout.fragment_my_schedule, container, false);

    mPlaceholder = (TextView) v.findViewById(R.id.placeholder);
    mPlaceholderImg = (ImageView) v.findViewById(R.id.placeholderIcon);
    mGridView = (StaggeredGridView) v.findViewById(R.id.gridViewMySchedule);
    mGridView.setAdapter(mMyScheduleAdapter);
    mGridView.setOnItemClickListener(this);
    getLoaderManager().initLoader(MainActivity.LOADER_MY_SCHEDULE_TALK_ID + mPosition, null, this);
    return v;
}
 
开发者ID:SNiels,项目名称:Multi-Mania-app,代码行数:13,代码来源:MyScheduleFragment.java

示例3: onCreateView

import com.etsy.android.grid.StaggeredGridView; //导入方法依赖的package包/类
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    View v = inflater.inflate(R.layout.fragment_news,container,false);
    mGridView =(StaggeredGridView) v.findViewById(R.id.news_grid);
    mGridView.setOnItemClickListener(this);
    mGridView.setAdapter(mAdapter);
    mAdapter.swapCursor(mData);
    return v;
}
 
开发者ID:SNiels,项目名称:Multi-Mania-app,代码行数:10,代码来源:NewsFragment.java

示例4: onCreate

import com.etsy.android.grid.StaggeredGridView; //导入方法依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
	super.onCreate(savedInstanceState);
	setContentView(R.layout.activity_main);
	mGridView = (StaggeredGridView) findViewById( R.id.grid_view );
	StaggeredGridAdapter adapter = new StaggeredGridAdapter( this );

	for( int i = 0; i < 30; i++ ) {
		adapter.add( ItemGenerator.getItem(i) );
	}
	mGridView.setAdapter( adapter );
}
 
开发者ID:Lakkichand,项目名称:AndroidDemoProjects,代码行数:13,代码来源:MainActivity.java

示例5: onActivityCreated

import com.etsy.android.grid.StaggeredGridView; //导入方法依赖的package包/类
@Override
public void onActivityCreated(final Bundle savedInstanceState) {
	super.onActivityCreated(savedInstanceState);

	 mGridView = (StaggeredGridView)
	 getView().findViewById(R.id.grid_view);

	if (savedInstanceState == null) {

	}

	if (mAdapter == null) {
		mAdapter = new SampleAdapter(getActivity(), R.id.txt_line1);
	}

	if (mData == null) {
		mData = SampleData.generateSampleData();
	}

	for (String data : mData) {
		mAdapter.add(data);
	}

	mGridView.setAdapter(mAdapter);
	mGridView.setOnScrollListener(this);
	mGridView.setOnItemClickListener(this);
}
 
开发者ID:coffeearmy,项目名称:Colourio,代码行数:28,代码来源:StaggeredGridFragment.java

示例6: onCreateView

import com.etsy.android.grid.StaggeredGridView; //导入方法依赖的package包/类
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    View rootView = inflater.inflate(R.layout.fragment_all_node, container, false);
    mGridView = (StaggeredGridView) rootView.findViewById(R.id.grid_fragment_all_node);
    mEmptyView = rootView.findViewById(R.id.progress_fragment_all_node);
    mGridView.setEmptyView(mEmptyView);
    mGridView.setOnItemClickListener(this);
    mAllNodesDataHelper = new AllNodesDataHelper(getActivity());
    mAllNodesAdapter = new AllNodesAdapter(getActivity());
    mGridView.setAdapter(mAllNodesAdapter);
    getLoaderManager().initLoader(0, null, this);
    return rootView;
}
 
开发者ID:kyze8439690,项目名称:v2ex-daily-android,代码行数:14,代码来源:AllNodeFragment.java

示例7: onCreateView

import com.etsy.android.grid.StaggeredGridView; //导入方法依赖的package包/类
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    View rootView = inflater.inflate(R.layout.fragment_all_category, container, false);
    mGridView = (StaggeredGridView) rootView.findViewById(R.id.grid_fragment_all_node);
    mEmptyView = rootView.findViewById(R.id.progress_fragment_all_node);
    mGridView.setEmptyView(mEmptyView);
    mGridView.setOnItemClickListener(this);
    mAdapter = new AllCategorysAdapter(categories, getActivity());
    mGridView.setAdapter(mAdapter);
    executeRequest(new MyStringRequest(Api.HOSTS[Api.HOST_POSITION] + "/categories", myListener(), errorListener()));
    return rootView;
}
 
开发者ID:qiugang,项目名称:TianWen,代码行数:13,代码来源:AllCategoryFragment.java


注:本文中的com.etsy.android.grid.StaggeredGridView.setAdapter方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。