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


Java StaggeredGridView类代码示例

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

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

示例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);
}
 
开发者ID:jiahaoliuliu,项目名称:StoryTeller,代码行数:17,代码来源:MyStoriesActivity.java

示例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);
}
 
开发者ID:missmisslonely,项目名称:fakeweibo,代码行数:10,代码来源:FantasyFallFragment.java

示例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;
}
 
开发者ID:SNiels,项目名称:Multi-Mania-app,代码行数:13,代码来源:MyScheduleFragment.java

示例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;
}
 
开发者ID:SNiels,项目名称:Multi-Mania-app,代码行数:10,代码来源:NewsFragment.java

示例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 );
}
 
开发者ID:Lakkichand,项目名称:AndroidDemoProjects,代码行数:13,代码来源:MainActivity.java

示例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);
}
 
开发者ID:coffeearmy,项目名称:Colourio,代码行数:28,代码来源:StaggeredGridFragment.java

示例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;
}
 
开发者ID:macbury,项目名称:EnklawaPlayer,代码行数:12,代码来源:AllProgramsFragment.java

示例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;
}
 
开发者ID:kyze8439690,项目名称:v2ex-daily-android,代码行数:14,代码来源:AllNodeFragment.java

示例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;
}
 
开发者ID:qiugang,项目名称:TianWen,代码行数:13,代码来源:AllCategoryFragment.java

示例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));
            }
        });
    }
}
 
开发者ID:mhidaka,项目名称:EventApp,代码行数:37,代码来源:BazaarListFragment.java

示例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;
}
 
开发者ID:subinkrishna,项目名称:open-curah,代码行数:57,代码来源:FeedListFragment.java

示例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);
    }
 
开发者ID:jewelzqiu,项目名称:sjtubbs,代码行数:43,代码来源:UploadedPicsActivity.java


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