本文整理汇总了Java中xyz.danoz.recyclerviewfastscroller.vertical.VerticalRecyclerViewFastScroller.setRecyclerView方法的典型用法代码示例。如果您正苦于以下问题:Java VerticalRecyclerViewFastScroller.setRecyclerView方法的具体用法?Java VerticalRecyclerViewFastScroller.setRecyclerView怎么用?Java VerticalRecyclerViewFastScroller.setRecyclerView使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类xyz.danoz.recyclerviewfastscroller.vertical.VerticalRecyclerViewFastScroller
的用法示例。
在下文中一共展示了VerticalRecyclerViewFastScroller.setRecyclerView方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onCreateView
import xyz.danoz.recyclerviewfastscroller.vertical.VerticalRecyclerViewFastScroller; //导入方法依赖的package包/类
@Override
public final View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
mAdapter = new ContactAdapter(getContext(), null, mSortOrder, mPictureType, mDescription, mDescriptionType);
View rootLayout = super.createView(inflater, R.layout.cp_contact_list, mAdapter, mContacts);
// configure fast scroll
RecyclerView recyclerView = (RecyclerView) rootLayout.findViewById(android.R.id.list);
VerticalRecyclerViewFastScroller fastScroller = (VerticalRecyclerViewFastScroller) rootLayout.findViewById(R.id.fast_scroller);
fastScroller.setRecyclerView(recyclerView);
recyclerView.addOnScrollListener(fastScroller.getOnScrollListener());
// configure section indexer
SectionTitleIndicator sectionTitleIndicator = (SectionTitleIndicator) rootLayout.findViewById(R.id.fast_scroller_section_title_indicator);
fastScroller.setSectionIndicator(sectionTitleIndicator);
return rootLayout;
}
示例2: configurePoliticiansView
import xyz.danoz.recyclerviewfastscroller.vertical.VerticalRecyclerViewFastScroller; //导入方法依赖的package包/类
private void configurePoliticiansView() {
RecyclerView mPoliticiansView = (RecyclerView) findViewById(R.id.politician_grid);
VerticalRecyclerViewFastScroller fastScroller = (VerticalRecyclerViewFastScroller) findViewById(R.id.fast_scroller);
PoliticianSectionIndicator sectionIndicator = (PoliticianSectionIndicator) findViewById(R.id.fast_scroller_section_indicator);
fastScroller.setRecyclerView(mPoliticiansView);
fastScroller.setSectionIndicator(sectionIndicator);
mPoliticiansView.addOnScrollListener(fastScroller.getOnScrollListener());
mPoliticiansCardAdapter = new PoliticianCardAdapter(presenter.getCurrentNotebook());
//RecyclerView.LayoutManager mLayoutManager = new StaggeredGridLayoutManager(2, OrientationHelper.VERTICAL);
RecyclerView.LayoutManager mLayoutManager = new GridLayoutManager(this, 2);
mPoliticiansView.setLayoutManager(mLayoutManager);
mPoliticiansView.setItemAnimator(new DefaultItemAnimator());
mPoliticiansView.setAdapter(mPoliticiansCardAdapter);
}
示例3: onCreateView
import xyz.danoz.recyclerviewfastscroller.vertical.VerticalRecyclerViewFastScroller; //导入方法依赖的package包/类
@Override
public final View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
mAdapter = new ContactAdapter(getContext(), null, mSortOrder, mPictureType, mDescription, mDescriptionType);
View rootLayout = super.createView(inflater, R.layout.cp_contact_list, mAdapter, mContacts);
// configure fast scroll
RecyclerView recyclerView = (RecyclerView) rootLayout.findViewById(android.R.id.list);
VerticalRecyclerViewFastScroller fastScroller = (VerticalRecyclerViewFastScroller) rootLayout.findViewById(R.id.fast_scroller);
fastScroller.setRecyclerView(recyclerView);
recyclerView.addOnScrollListener(fastScroller.getOnScrollListener());
// configure section indexer
SectionTitleIndicator sectionTitleIndicator = (SectionTitleIndicator ) rootLayout.findViewById(R.id.fast_scroller_section_title_indicator);
fastScroller.setSectionIndicator(sectionTitleIndicator);
return rootLayout;
}
示例4: onCreateView
import xyz.danoz.recyclerviewfastscroller.vertical.VerticalRecyclerViewFastScroller; //导入方法依赖的package包/类
@Nullable
@Override
public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
View v = inflater.inflate(R.layout.fragment_index_list, container, false);
Context context = v.getContext();
mProgressBar = (MaterialProgressBar) v.findViewById(R.id.index_progress_bar);
mRecyclerView = (RecyclerView) v.findViewById(R.id.index_recycler_view);
mFastScroller = (VerticalRecyclerViewFastScroller) v.findViewById(R.id.index_fast_scroller);
mRecyclerView.setLayoutManager(new LinearLayoutManager(context));
mFastScroller.setRecyclerView(mRecyclerView);
mRecyclerView.setOnScrollListener(mFastScroller.getOnScrollListener());
mVaultIndexItems = EROWID_DB.getReportIndex();
mGetReportIndexTask = new GetReportIndexTask();
mGetReportIndexTask.execute();
return v;
}
示例5: onCreateView
import xyz.danoz.recyclerviewfastscroller.vertical.VerticalRecyclerViewFastScroller; //导入方法依赖的package包/类
@Nullable
@Override
public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
View v = inflater.inflate(R.layout.fragment_index_list, container, false);
Context context = v.getContext();
mProgressBar = (MaterialProgressBar) v.findViewById(R.id.index_progress_bar);
mRecyclerView = (RecyclerView) v.findViewById(R.id.index_recycler_view);
mFastScroller = (VerticalRecyclerViewFastScroller) v.findViewById(R.id.index_fast_scroller);
mRecyclerView.setLayoutManager(new LinearLayoutManager(context));
mFastScroller.setRecyclerView(mRecyclerView);
mRecyclerView.setOnScrollListener(mFastScroller.getOnScrollListener());
return v;
}
示例6: onCreateView
import xyz.danoz.recyclerviewfastscroller.vertical.VerticalRecyclerViewFastScroller; //导入方法依赖的package包/类
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
setupVariables();
View v = inflater.inflate(R.layout.recycler_layout, container, false);
rv = (RecyclerView) v.findViewById(R.id.rv);
rv.setLayoutManager(new LinearLayoutManager(getActivity()));
rv.setHasFixedSize(true);
rv.setVerticalScrollBarEnabled(false);
scroller = (VerticalRecyclerViewFastScroller) v.findViewById(R.id.fast_scroller);
if (!prefHelper.overviewFav())
scroller.setVisibility(View.VISIBLE);
scroller.setRecyclerView(rv);
rv.addOnScrollListener(scroller.getOnScrollListener());
if (savedInstanceState == null) {
databaseManager.new updateComicDatabase(null, this, prefHelper).execute();
} else {
super.setupAdapter();
rvAdapter = new CardsAdapter();
rv.setAdapter(rvAdapter);
}
return v;
}
示例7: onCreate
import xyz.danoz.recyclerviewfastscroller.vertical.VerticalRecyclerViewFastScroller; //导入方法依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
this.context = this;
this.appPreferences = MoticonsApplication.getAppPreferences();
initUI();
isFirstRun();
recyclerView = (RecyclerView) findViewById(R.id.moticonList);
fastScroller = (VerticalRecyclerViewFastScroller) findViewById(R.id.fast_scroller);
progressWheel = (ProgressWheel) findViewById(R.id.progress);
noResults = (LinearLayout) findViewById(R.id.noResults);
recyclerView.setHasFixedSize(true);
LinearLayoutManager linearLayoutManager = new LinearLayoutManager(context);
linearLayoutManager.setOrientation(LinearLayoutManager.VERTICAL);
recyclerView.setLayoutManager(linearLayoutManager);
fastScroller.setRecyclerView(recyclerView);
recyclerView.setOnScrollListener(fastScroller.getOnScrollListener());
progressWheel.setVisibility(View.VISIBLE);
new getMoticons().execute();
}
示例8: onCreate
import xyz.danoz.recyclerviewfastscroller.vertical.VerticalRecyclerViewFastScroller; //导入方法依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_images_selector);
// hide actionbar
ActionBar actionBar = getSupportActionBar();
if(actionBar != null) {
actionBar.hide();
}
// get parameters from bundle
Intent intent = getIntent();
SelectorSettings.mMaxImageNumber = intent.getIntExtra(SelectorSettings.SELECTOR_MAX_IMAGE_NUMBER, SelectorSettings.mMaxImageNumber);
SelectorSettings.isShowCamera = intent.getBooleanExtra(SelectorSettings.SELECTOR_SHOW_CAMERA, SelectorSettings.isShowCamera);
SelectorSettings.mMinImageSize = intent.getIntExtra(SelectorSettings.SELECTOR_MIN_IMAGE_SIZE, SelectorSettings.mMinImageSize);
ArrayList<String> selected = intent.getStringArrayListExtra(SelectorSettings.SELECTOR_INITIAL_SELECTED_LIST);
ImageListContent.SELECTED_IMAGES.clear();
if(selected != null && selected.size() > 0) {
ImageListContent.SELECTED_IMAGES.addAll(selected);
}
// initialize widgets in custom actionbar
mButtonBack = (ImageView) findViewById(R.id.selector_button_back);
mButtonBack.setOnClickListener(this);
mButtonConfirm = (Button) findViewById(R.id.selector_button_confirm);
mButtonConfirm.setOnClickListener(this);
// initialize recyclerview
View rview = findViewById(R.id.image_recycerview);
// Set the adapter
if (rview instanceof RecyclerView) {
Context context = rview.getContext();
recyclerView = (RecyclerView) rview;
if (mColumnCount <= 1) {
recyclerView.setLayoutManager(new LinearLayoutManager(context));
} else {
recyclerView.setLayoutManager(new GridLayoutManager(context, mColumnCount));
}
recyclerView.setAdapter(new ImageRecyclerViewAdapter(ImageListContent.IMAGES, this));
VerticalRecyclerViewFastScroller fastScroller = (VerticalRecyclerViewFastScroller) findViewById(R.id.recyclerview_fast_scroller);
// Connect the recycler to the scroller (to let the scroller scroll the list)
fastScroller.setRecyclerView(recyclerView);
// Connect the scroller to the recycler (to let the recycler scroll the scroller's handle)
recyclerView.addOnScrollListener(fastScroller.getOnScrollListener());
}
// popup windows will be anchored to this view
mPopupAnchorView = findViewById(R.id.selector_footer);
// initialize buttons in footer
mFolderSelectButton = (TextView) findViewById(R.id.selector_image_folder_button);
mFolderSelectButton.setText(R.string.selector_folder_all);
mFolderSelectButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(final View view) {
if (mFolderPopupWindow == null) {
mFolderPopupWindow = new FolderPopupWindow();
mFolderPopupWindow.initPopupWindow(ImagesSelectorActivity.this);
}
if (mFolderPopupWindow.isShowing()) {
mFolderPopupWindow.dismiss();
} else {
mFolderPopupWindow.showAtLocation(mPopupAnchorView, Gravity.BOTTOM, 10, 150);
}
}
});
currentFolderPath = "";
FolderListContent.clear();
ImageListContent.clear();
updateDoneButton();
requestReadStorageRuntimePermission();
}
示例9: onCreateView
import xyz.danoz.recyclerviewfastscroller.vertical.VerticalRecyclerViewFastScroller; //导入方法依赖的package包/类
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
View view = inflater.inflate(R.layout.fragment_ayah_word, container, false);
mRecyclerView = (RecyclerView) view.findViewById(R.id.recycler_ayah_word_view);
//for fast scroll
VerticalRecyclerViewFastScroller fastScroller = (VerticalRecyclerViewFastScroller) view.findViewById(R.id.fast_scroller);
// Connect the recycler to the scroller (to let the scroller scroll the list)
fastScroller.setRecyclerView(mRecyclerView);
// Connect the scroller to the recycler (to let the recycler scroll the scroller's handle)
mRecyclerView.setOnScrollListener(fastScroller.getOnScrollListener());
ayahWordAdapter = new AyahWordAdapter(ayahWordArrayList, getActivity(), surah_id);
return view;
}
示例10: onCreateView
import xyz.danoz.recyclerviewfastscroller.vertical.VerticalRecyclerViewFastScroller; //导入方法依赖的package包/类
@Nullable
@Override
public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
View v = inflater.inflate(R.layout.fragment_index_list, container, false);
Context context = v.getContext();
mProgressBar = (MaterialProgressBar) v.findViewById(R.id.index_progress_bar);
mRecyclerView = (RecyclerView) v.findViewById(R.id.index_recycler_view);
mFastScroller = (VerticalRecyclerViewFastScroller) v.findViewById(R.id.index_fast_scroller);
mRecyclerView.setLayoutManager(new LinearLayoutManager(context));
mFastScroller.setRecyclerView(mRecyclerView);
mRecyclerView.setOnScrollListener(mFastScroller.getOnScrollListener());
if (mIndexType.equals(ErowidDB.Index.CHEMICALS.getIndexName())) {
mIndexItems = EROWID_DB.getChemIndex();
if (EROWID_DB.isChemIndexLoaded()) {
hideProgressBar();
mRecyclerView.setAdapter(new IndexRecyclerViewAdapter(mIndexItems, mListener));
} else {
mLoadIndexTask.execute();
}
} else if (mIndexType.equals(ErowidDB.Index.PLANTS.getIndexName())) {
mIndexItems = EROWID_DB.getPlantIndex();
if (EROWID_DB.isPlantIndexLoaded()) {
hideProgressBar();
mRecyclerView.setAdapter(new IndexRecyclerViewAdapter(mIndexItems, mListener));
} else {
mLoadIndexTask.execute();
}
} else if (mIndexType.equals(ErowidDB.Index.HERBS.getIndexName())) {
mIndexItems = EROWID_DB.getHerbIndex();
if (EROWID_DB.isHerbIndexLoaded()) {
hideProgressBar();
mRecyclerView.setAdapter(new IndexRecyclerViewAdapter(mIndexItems, mListener));
} else {
mLoadIndexTask.execute();
}
} else if (mIndexType.equals(ErowidDB.Index.PHARMS.getIndexName())) {
mIndexItems = EROWID_DB.getPharmIndex();
if (EROWID_DB.isPharmIndexLoaded()) {
hideProgressBar();
mRecyclerView.setAdapter(new IndexRecyclerViewAdapter(mIndexItems, mListener));
} else {
mLoadIndexTask.execute();
}
} else if (mIndexType.equals(ErowidDB.Index.SMARTS.getIndexName())) {
mIndexItems = EROWID_DB.getSmartIndex();
if (EROWID_DB.isSmartIndexLoaded()) {
hideProgressBar();
mRecyclerView.setAdapter(new IndexRecyclerViewAdapter(mIndexItems, mListener));
} else {
mLoadIndexTask.execute();
}
} else if (mIndexType.equals(ErowidDB.Index.ANIMALS.getIndexName())) {
mIndexItems = EROWID_DB.getAnimalIndex();
if (EROWID_DB.isAnimalIndexLoaded()) {
hideProgressBar();
mRecyclerView.setAdapter(new IndexRecyclerViewAdapter(mIndexItems, mListener));
} else {
mLoadIndexTask.execute();
}
} else if (mIndexType.equals(ErowidDB.Index.VAULT.getIndexName())) {
mIndexItems = EROWID_DB.getVaultIndex();
if (EROWID_DB.isVaultIndexLoaded()) {
hideProgressBar();
mRecyclerView.setAdapter(new IndexRecyclerViewAdapter(mIndexItems, mListener));
} else {
mLoadIndexTask.execute();
}
} else {
Log.d(TAG, "IndexType could not be determined.");
}
return v;
}
示例11: setRecyclerViewLayoutManager
import xyz.danoz.recyclerviewfastscroller.vertical.VerticalRecyclerViewFastScroller; //导入方法依赖的package包/类
/**
* Set RecyclerView's LayoutManager
*/
public void setRecyclerViewLayoutManager(RecyclerView recyclerView, RecyclerView.Adapter adapter) {
// ---------- init recycler
LinearLayoutManager linearLayoutManager = new LinearLayoutManager(this);
recyclerView.setLayoutManager(linearLayoutManager);
recyclerView.setAdapter(adapter);
int scrollPosition = linearLayoutManager.findFirstCompletelyVisibleItemPosition();
recyclerView.scrollToPosition(scrollPosition);
// ---------- set index on the right
VerticalRecyclerViewFastScroller fastScroller = (VerticalRecyclerViewFastScroller) findViewById(R.id
.fast_scroller);
// Connect the recycler to the scroller (to let the scroller scroll the list)
fastScroller.setRecyclerView(recyclerView);
// Connect the scroller to the recycler (to let the recycler scroll the scroller's handle)
recyclerView.addOnScrollListener(fastScroller.getOnScrollListener());
// Connect the section indicator to the scroller
SectionIndicator sectionTitleIndicator = (SectionIndicator) findViewById(R.id
.fast_scroller_section_title_indicator);
fastScroller.setSectionIndicator(sectionTitleIndicator);
}