Project Name | Stars | Downloads | Repos Using This | Packages Using This | Most Recent Commit | Total Releases | Latest Release | Open Issues | License | Language |
---|---|---|---|---|---|---|---|---|---|---|
Headerandfooterrecyclerview | 1,383 | 5 years ago | 27 | apache-2.0 | Java | |||||
A RecyclerView solution, support addHeaderView、addFooterView | ||||||||||
Windless | 944 | 1 | a year ago | 7 | January 26, 2018 | 9 | mit | Swift | ||
Windless makes it easy to implement invisible layout loading view. | ||||||||||
Statefullayout | 805 | 3 years ago | 1 | April 13, 2019 | 2 | apache-2.0 | Java | |||
Android layout to show template for loading, empty, error etc. states | ||||||||||
Stateview | 601 | a year ago | 1 | mit | Java | |||||
:sparkles: StateView is an invisible, zero-sized View that can be used to lazily inflate loadingView/emptyView/retryView/anyView at runtime. | ||||||||||
Dynamicbox | 458 | 19 | 5 years ago | 3 | September 11, 2015 | 5 | Java | |||
Android library to show Loading view when waiting for initial state | ||||||||||
React Native Skeleton Content | 452 | 3 | 2 months ago | 23 | December 08, 2021 | 8 | mit | TypeScript | ||
A customizable skeleton-like loading placeholder for react native projects using expo. | ||||||||||
Xamarin.forms.statesquid | 255 | 3 years ago | 14 | April 25, 2020 | 3 | mit | C# | |||
Spiritual successor to EasyLoading, turn any layout element into an individual state-aware element. | ||||||||||
React Native Skeleton Content Nonexpo | 253 | 4 | 2 months ago | 12 | May 22, 2021 | 4 | mit | TypeScript | ||
A customizable skeleton-like loading placeholder for react native projects not using expo. | ||||||||||
Nvbnbcollectionview | 248 | 7 years ago | 3 | February 01, 2016 | 2 | mit | Objective-C | |||
A Airbnb-inspired collection view | ||||||||||
Terminal_layout | 134 | 5 months ago | 14 | May 09, 2021 | 1 | gpl-3.0 | Python | |||
The project help you to quickly build layouts in terminal,cross-platform(一个跨平台的命令行ui布局工具) |
HeaderAndFooterRecyclerView is a RecyclerView solution that supports addHeaderView, addFooterView to a RecyclerView.
Through this library, you can implement RecyclerView's Page Loading by dynamically modify the FooterView's State, such as "loading", "loading error", "loading success", "slipping to the bottom".
mHeaderAndFooterRecyclerViewAdapter = new HeaderAndFooterRecyclerViewAdapter(mDataAdapter);
mRecyclerView.setAdapter(mHeaderAndFooterRecyclerViewAdapter);
mRecyclerView.setLayoutManager(new LinearLayoutManager(this));
//add a HeaderView
RecyclerViewUtils.setHeaderView(mRecyclerView, new SampleHeader(this));
//add a FooterView
RecyclerViewUtils.setFooterView(mRecyclerView, new SampleFooter(this));
mRecyclerView.addOnScrollListener(mOnScrollListener);
private EndlessRecyclerOnScrollListener mOnScrollListener = new EndlessRecyclerOnScrollListener() {
@Override
public void onLoadNextPage(View view) {
super.onLoadNextPage(view);
LoadingFooter.State state = RecyclerViewStateUtils.getFooterViewState(mRecyclerView);
if(state == LoadingFooter.State.Loading) {
Log.d("@Cundong", "the state is Loading, just wait..");
return;
}
mCurrentCounter = mDataList.size();
if (mCurrentCounter < TOTAL_COUNTER) {
// loading more
RecyclerViewStateUtils.setFooterViewState(EndlessLinearLayoutActivity.this, mRecyclerView, REQUEST_COUNT, LoadingFooter.State.Loading, null);
requestData();
} else {
//the end
RecyclerViewStateUtils.setFooterViewState(EndlessLinearLayoutActivity.this, mRecyclerView, REQUEST_COUNT, LoadingFooter.State.TheEnd, null);
}
}
};
If you have already added a HeaderView for RecyclerView by RecyclerViewUtils.setHeaderView(mRecyclerView, view);
, then call the ViewHolder 's getAdapterPosition()
、getLayoutPosition()
, ,the returned value will be affected by the addition of the HeaderView (the return position is the real position + headerCounter).
Therefore, in this case, please use: RecyclerViewUtils.getAdapterPosition(mRecyclerView, ViewHolder.this)
, RecyclerViewUtils.getLayoutPosition(mRecyclerView, ViewHolder.this)
.
Copyright 2015 Cundong
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.