本文整理汇总了Java中com.etsy.android.grid.StaggeredGridView类的典型用法代码示例。如果您正苦于以下问题:Java StaggeredGridView类的具体用法?Java StaggeredGridView怎么用?Java StaggeredGridView使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
StaggeredGridView类属于com.etsy.android.grid包,在下文中一共展示了StaggeredGridView类的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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: onCreate
import com.etsy.android.grid.StaggeredGridView; //导入依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_my_stories);
mActionBar = getSupportActionBar();
// Set the action Bar
mActionBar.setDisplayHomeAsUpEnabled(true);
mActionBar.setHomeButtonEnabled(true);
// Layouts
mStoriesGridView = (StaggeredGridView) findViewById(R.id.stories_grid_view);
mStoriesGridView.setEmptyView(findViewById(R.id.empty_view));
getSupportLoaderManager().initLoader(LOADER_ID, null, this);
}
示例3: onViewCreated
import com.etsy.android.grid.StaggeredGridView; //导入依赖的package包/类
@Override
public void onViewCreated(View view, Bundle savedInstanceState) {
mSwitcher.setOnItemSelectedListener(this);
mFall = (StaggeredGridView) view.findViewById(R.id.fall);
mFall.addHeaderView(mSwitcher);
mSwipeRefreshLayout = (SwipeRefreshLayout) view.findViewById(R.id.refresh);
ColorSwicher.injectColor(mSwipeRefreshLayout);
mSwipeRefreshLayout.setOnRefreshListener(this);
}
示例4: 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;
}
示例5: 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;
}
示例6: 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 );
}
示例7: 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);
}
示例8: onCreateView
import com.etsy.android.grid.StaggeredGridView; //导入依赖的package包/类
@Nullable
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
View view = inflater.inflate(R.layout.all_programs, container, false);
this.swipeRefreshLayout = (SwipeRefreshLayout)view.findViewById(R.id.swipe_container);
this.gridView = (StaggeredGridView) view.findViewById(R.id.grid_view);
swipeRefreshLayout.setOnRefreshListener(this);
swipeRefreshLayout.setColorSchemeResources(R.color.progress_color_1, R.color.progress_color_3, R.color.progress_color_4, R.color.progress_color_5);
return view;
}
示例9: 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;
}
示例10: 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;
}
示例11: onActivityCreated
import com.etsy.android.grid.StaggeredGridView; //导入依赖的package包/类
@Override
public void onActivityCreated(Bundle savedInstanceState) {
super.onActivityCreated(savedInstanceState);
IndirectInjector.inject(getActivity(), this);
mActionBarController.setTitle(R.string.menu_bazaar);
setContentView(R.layout.fragment_bazzar);
mStaggeredGridView = (StaggeredGridView) getView().findViewById(R.id.grid_view);
setContentShown(false);
if (savedInstanceState != null) {
mBazaarEntries = GsonParcer.unwrap(savedInstanceState
.getParcelable(STATE_KEY_BAZAAR_ENTRY),
new TypeToken<Collection<BazaarEntry>>() {
}
);
setupBazaarList(mBazaarEntries);
} else {
new BazaarEntryLoader(getActivity()).getEntries(new BazaarEntryLoader.Listener() {
@Override
public void onSuccess(List<BazaarEntry> entries) {
if (getActivity() != null) {
mBazaarEntries = entries;
setupBazaarList(entries);
}
}
@Override
public void onError(VolleyError error) {
setEmptyText(getString(R.string.network_error));
}
});
}
}
示例12: onLoadFinished
import com.etsy.android.grid.StaggeredGridView; //导入依赖的package包/类
@Override
public void onLoadFinished(Loader<FeedMeta> loader, FeedMeta data) {
// TO avoid getting called twice
getLoaderManager().destroyLoader(0);
final Activity parent = getActivity();
int count = (null != data) ? data.size() : 0;
d(TAG, "Load finished. Feed: " + mFeed.name() + " list size: " + count);
final boolean isFirstSyncCompleted = SyncAdapter.getLastSyncTime() > -1;
final boolean isNetworkAvailable = Config.isOnline(parent);
if ((count <= 0) &&
(mAdapter.getCount() == 0)) {
// Show error message if sync adapter finished it's fetch and
// if no data available. Else wait for the sync adapter to
// send the sync complete notification.
if (isFirstSyncCompleted || !isNetworkAvailable) {
showMessage(!isNetworkAvailable
? R.string.error_empty_feed_network
: R.string.error_empty_feed);
}
} else {
// TODO: Remove after testing
if (null != data) {
d(TAG, "Feed date: " + data.getPublishDate() + " (Now: " + System.currentTimeMillis() + ")");
}
// TODO: Check if the incoming data's publish date is latest than mData.
// If yes, show bubble, else ignore.
showFeeds();
// TODO: Only for phone, as of now
if (!isTablet && !(mList instanceof StaggeredGridView)) {
// Enable view animation if the view is not already animated
((FlyInListView)mList).enableAnimations(!mStopAnimation);
}
if (count > 0) {
mAdapter.update(mFeed, data, true);
// Disable future animations on receiving valid data
mStopAnimation = true;
// TODO: Show feed update notifier
mData = data;
}
if (!mListPositionRestored && (null != mListState)) {
d(TAG, "Restore list position");
mList.onRestoreInstanceState(mListState);
mListState = null;
}
}
mListPositionRestored = true;
}
示例13: onCreate
import com.etsy.android.grid.StaggeredGridView; //导入依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_uploaded_pics);
mProgressBar = (ProgressBar) findViewById(R.id.progressbar);
mPullToRefreshLayout = (PullToRefreshLayout) findViewById(R.id.ptr_layout);
mGridView = (StaggeredGridView) findViewById(R.id.grid_view);
mFooterView = (ProgressBar) getLayoutInflater()
.inflate(R.layout.progressbar_loading, null);
ActionBarPullToRefresh.from(this)
.allChildrenArePullable()
.listener(new OnRefreshListener() {
@Override
public void onRefreshStarted(View view) {
new GetUploadedPicsTask(true).execute(mUploadedUrl);
}
})
.setup(mPullToRefreshLayout);
mGridView.addFooterView(mFooterView);
mGridView.setOnScrollListener(this);
mGridView.setOnItemClickListener(this);
getSupportActionBar().setDisplayShowHomeEnabled(true);
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
mUploadedUrl = getIntent().getStringExtra(UPLOADED_URL);
setTitle(getString(R.string.action_uploaded) + ": " + getIntent()
.getStringExtra(BoardActivity.BOARD_TITLE));
BBSApplication.imgUrlList.clear();
BBSApplication.imgUrlMap.clear();
new GetUploadedPicsTask(true).execute(mUploadedUrl);
// SystemBarTintManager tintManager = new SystemBarTintManager(this);
// tintManager.setStatusBarTintEnabled(true);
// tintManager.setNavigationBarTintEnabled(true);
// tintManager.setTintColor(getResources().getColor(android.R.color.holo_blue_dark));
// tintManager.setTintAlpha(0.69f);
}