本文整理汇总了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);
}
示例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;
}
示例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;
}
示例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 );
}
示例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);
}
示例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;
}
示例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;
}