Skip to content

Commit

Permalink
feat(Chamelon) : change defaultState -> defaultChameleonState
Browse files Browse the repository at this point in the history
  • Loading branch information
sangcomz committed Aug 4, 2019
1 parent cc7c783 commit 578f3f0
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ chameleon.setStateChangeListener { newState, oldState -> Log.d("Main", "Was $old
| useErrorButton | Change whether to use error view Button | false |
| progressDrawable | progress drawable setting | - |
| isLargeProgress | Whether to use large progress | false |
| defaultState | Sets the initial state for Chameleon | NONE |
| 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.

Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/layout/activity_main.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
android:id="@+id/root"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:defaultState="LOADING"
app:defaultChameleonState="LOADING"
app:emptyButtonBackgroundColor="@color/colorPrimary"
app:emptyButtonText="+Add Chameleon"
app:emptyButtonTextColor="#ffffff"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ open class Chameleon(context: Context?, attrs: AttributeSet?) : ConstraintLayout
it.getColor(R.styleable.Chameleon_progressBackgroundColor, ContextCompat.getColor(context, R.color.colorLoadingBackground)),
it.getBoolean(R.styleable.Chameleon_isShowContentWhenLoadingState, false),
it.getBoolean(R.styleable.Chameleon_isLargeProgress, false),
stateFromInt(it.getInt(R.styleable.Chameleon_defaultState, -1))
stateFromInt(it.getInt(R.styleable.Chameleon_defaultChameleonState, -1))
)
}

Expand Down
2 changes: 1 addition & 1 deletion chameleon/src/main/res/values/attrs.xml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
<attr name="isShowContentWhenLoadingState" format="boolean" />
<attr name="isLargeProgress" format="boolean" />

<attr name="defaultState" format="enum">
<attr name="defaultChameleonState" format="enum">
<enum name="LOADING" value="1" />
<enum name="ERROR" value="2" />
<enum name="EMPTY" value="3" />
Expand Down

0 comments on commit 578f3f0

Please sign in to comment.