sangcomz / Chameleon
Licence: apache-2.0
🦎Chameleoen deals with the Status of RecyclerView.
Stars: ✭ 52
Programming Languages
kotlin
9241 projects
Projects that are alternatives of or similar to Chameleon
Turn Layout Manager
A carousel layout manager for RecyclerView
Stars: ✭ 946 (+1719.23%)
Mutual labels: recyclerview
Grouprecyclerviewadapter
可增删改查、可动画展开收起、可吸附悬浮动态可配置的分组列表
Stars: ✭ 41 (-21.15%)
Mutual labels: recyclerview
Recyclerview Concatadapter
Sample to practice RecyclerView ConcatAdapter
Stars: ✭ 47 (-9.62%)
Mutual labels: recyclerview
Flagchatadapter
FlagChatAdapter is easy to implement enchanting recycler view adapter. Just extend your adapter with FlagChatAdapter, impliment some methods and voila! You have got the most beautiful looking chat on your phone. Zero boilerplate code, just put your variables in the right direction.
Stars: ✭ 39 (-25%)
Mutual labels: recyclerview
Swipeablerv
Library that makes it easy to implement swipe-to-dismiss in recycler view
Stars: ✭ 41 (-21.15%)
Mutual labels: recyclerview
Observableadapter
RecyclerView Adapter for RxJava, separates collection model from Android framework dependencies
Stars: ✭ 15 (-71.15%)
Mutual labels: recyclerview
Sharebox
家庭看片神器,可以用手机播放电脑里的视频,也可以用电脑播放手机里的视频,使用简单,能稳定运行在后台,目前支持的设备有Windows,Mac,Android。
Stars: ✭ 51 (-1.92%)
Mutual labels: recyclerview
Retrofit Recyclervew
An implementation of a RecyclerView using Retrofit and Glide to create a movie list
Stars: ✭ 40 (-23.08%)
Mutual labels: recyclerview
Focusresize
A custom animation with scroll listener to recycler views
Stars: ✭ 971 (+1767.31%)
Mutual labels: recyclerview
Google Books Android Viewer
Android library to bridge between RecyclerView and sources like web page or database. Includes demonstrator (Google Books viewer)
Stars: ✭ 37 (-28.85%)
Mutual labels: recyclerview
Heal O Chat
Heal-O-Chat is a Social Media Application for people who have been feeling less motivated in life or are losing hope. This platform allows users to chat with people and share their thoughts and feelings with each other and thereby let go of stress, anxiety, and depression that they've been feeling for long.
Stars: ✭ 42 (-19.23%)
Mutual labels: recyclerview
Simplerecyclerview
A RecyclerView extension for building list more easily.
Stars: ✭ 953 (+1732.69%)
Mutual labels: recyclerview
Multi type list view
A flutter customer ListView that displays multiple widget types.
Stars: ✭ 47 (-9.62%)
Mutual labels: recyclerview
Recyclerviewdemo
Android L 新增UI控件:RecyclerView CardView的简单使用
Stars: ✭ 15 (-71.15%)
Mutual labels: recyclerview
Commonitemdecoration
A custom ItemDecoration which appends dividers(with same thickness) between items(with same dimension) for RecyclerView
Stars: ✭ 41 (-21.15%)
Mutual labels: recyclerview
Rendererrecyclerviewadapter
A single adapter with multiple view types for the whole project
Stars: ✭ 1,061 (+1940.38%)
Mutual labels: recyclerview
Circulerautoscrollingrecyclerview
Sample code of infinite rotation using RecyclerView. Built with Kotlin
Stars: ✭ 48 (-7.69%)
Mutual labels: recyclerview
Firestorerecycleradaptersample
Sample Android project using FirestoreRecyclerAdapter
Stars: ✭ 43 (-17.31%)
Mutual labels: recyclerview
Chameleon
Chameleon deals with the Status of RecyclerView.
What's New in 0.2.0? 🎉
- [Improvement] Modify MainActivity, ChameleonAdapter in Sample App (#19) by @LeeOhHyung
- [Feature] Can set top margin and bottom margin (#18)
- [Feature] Can set fontFamily (#18)
- [Feature] Support All View (#20)
How to Use
Gradle
repositories {
maven { url 'https://jitpack.io' }
}
dependencies {
compile 'com.github.sangcomz:Chameleon:v0.2.0'
}
Usage
<xyz.sangcomz.chameleon.Chameleon xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/root"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:emptyButtonBackgroundColor="@color/colorPrimary"
app:emptyButtonText="+Add Chameleon"
app:emptyButtonTextColor="#ffffff"
app:emptyButtonTextSize="12sp"
app:emptyDrawable="@drawable/ic_empty"
app:emptySubText="@string/sub_empty"
app:emptyText="@string/empty"
app:errorButtonBackgroundColor="@color/colorPrimary"
app:errorButtonText="Retry"
app:errorButtonTextColor="#ffffff"
app:errorButtonTextSize="12sp"
app:errorDrawable="@drawable/ic_error"
app:errorSubText="@string/sub_error"
app:errorText="@string/error"
app:isLargeProgress="true"
app:progressDrawable="@drawable/drawable_progress"
app:useEmptyButton="true"
app:useErrorButton="true"
app:defaultState="LOADING"
tools:context="xyz.sangcomz.chameleonsample.MainActivity">
<android.support.v7.widget.RecyclerView
android:id="@+id/rv_main_list"
android:layout_width="match_parent"
android:layout_height="match_parent" />
</xyz.sangcomz.chameleon.Chameleon>
STATUS
Status | Description |
---|---|
CONTENT | show content |
LOADING | show progress |
EMPTY | show empty view |
ERROR | show error view |
NONE | show RecyclerView |
usage
// Set state using showState
chameleon.showState(Chameleon.STATE.CONTENT)
chameleon.showState(Chameleon.STATE.LOADING)
chameleon.showState(Chameleon.STATE.EMPTY)
chameleon.showState(Chameleon.STATE.ERROR)
chameleon.showState(Chameleon.STATE.NONE)
// Or use the extension functions
chameleon.setContent()
chameleon.setLoading()
chameleon.setEmpty()
chameleon.setError()
chameleon.setNone()
// As well as toggling between states with a boolean
viewModel.isLoading.observe(this, Observer {
chameleon.loadingOrContent(it) // true = LOADING, false = CONTENT
})
chameleon.contentOrEmpty(true) // CONTENT
chameleon.contentOrEmpty(false) // EMPTY
chameleon.setEmptyButtonClickListener { Toast.makeText(this, "Empty Button!", Toast.LENGTH_LONG).show() }
chameleon.setErrorButtonClickListener { Toast.makeText(this, "Error Button!", Toast.LENGTH_LONG).show() }
chameleon.setStateChangeListener { newState, oldState -> Log.d("Main", "Was $oldState is now $newState") }
attribute
Attribute Name | Description | Default Value |
---|---|---|
emptyText | empty view Change text | "empty" |
emptyTextColor | empty view Change text color | #808080 |
emptyTextSize | empty view Change text size | 24sp |
emptyTextGravity | empty view Change text gravity | 0 |
emptySubText | empty view Change sub text | "empty content" |
emptySubTextColor | empty view Change sub text color | #b7b7b7 |
emptySubTextSize | empty view Change sub text size | 16sp |
emptySubTextGravity | empty view Change sub text gravity | 0 |
emptyDrawable | empty view Change drawable | R.drawable.ic_empty |
emptyButtonText | empty view Change button text | "retry" |
emptyButtonTextColor | empty view Change button text color | #808080 |
emptyButtonTextSize | empty view Change button text size | 24sp |
emptyButtonBackgroundColor | empty view Change button background color | #b7b7b7 |
useEmptyButton | Change whether to use empty view Button | false |
errorText | error view Change text | "error" |
errorTextColor | error view Change text color | #808080 |
errorTextSize | error view Change text size | 24sp |
errorTextGravity | empty view Change text gravity | 0 |
errorSubText | error view Change sub text | "error content" |
errorSubTextColor | error view Change sub text color | #b7b7b7 |
errorSubTextSize | error view Change sub text size | 16sp |
errorSubTextGravity | error view Change sub text gravity | 0 |
errorDrawable | error view Change drawable | R.drawable.ic_error |
errorButtonText | error view Change button text | "retry" |
errorButtonTextColor | error view Change button text color | #808080 |
errorButtonTextSize | error view Change button text size | 24sp |
errorButtonBackgroundColor | error view Change button background color | #808080 |
useErrorButton | Change whether to use error view Button | false |
progressDrawable | progress drawable setting | - |
isLargeProgress | Whether to use large progress | false |
stateImageBottomMargin | state image bottom margin | 4dp |
subTitleTextTopMargin | sub title top margin | 4dp |
buttonTopMargin | button top margin | 16dp |
titleFontFamily | title font family | system default |
subTitleFontFamily | sub title font family | system default |
buttonFontFamily | button font family | system default |
defaultChameleonState | Sets the initial state for Chameleon | NONE |
Note - A state of NONE
means Chameleon won't do anything, and will just show the RecyclerView.
Result Screen
Project Name | Result Screen |
---|---|
Sample |
Contribute
We welcome any contributions.
Inspired by
- Kennyc1012/MultiStateView, I was inspired by his code.
License
Copyright 2018 Jeong Seok-Won
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.
Note that the project description data, including the texts, logos, images, and/or trademarks,
for each open source project belongs to its rightful owner.
If you wish to add or remove any projects, please contact us at [email protected].