Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
circles-android
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package Registry
Model registry
Operate
Terraform modules
Analyze
Contributor analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Circles
circles-android
Commits
6c4be8d8
Commit
6c4be8d8
authored
1 year ago
by
Taras
Browse files
Options
Downloads
Patches
Plain Diff
Save loading button enabled state
parent
4a47c3da
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
core/src/main/java/org/futo/circles/core/view/LoadingButton.kt
+4
-2
4 additions, 2 deletions
...src/main/java/org/futo/circles/core/view/LoadingButton.kt
with
4 additions
and
2 deletions
core/src/main/java/org/futo/circles/core/view/LoadingButton.kt
+
4
−
2
View file @
6c4be8d8
...
...
@@ -17,7 +17,8 @@ import org.futo.circles.core.extensions.setIsVisible
class
LoadingButtonState
(
val
superSavedState
:
Parcelable
?,
val
isLoading
:
Boolean
,
val
text
:
String
val
text
:
String
,
val
isEnabled
:
Boolean
)
:
View
.
BaseSavedState
(
superSavedState
),
Parcelable
...
...
@@ -53,7 +54,7 @@ class LoadingButton(
override
fun
onSaveInstanceState
():
Parcelable
{
val
superState
=
super
.
onSaveInstanceState
()
return
LoadingButtonState
(
superState
,
isLoading
,
buttonText
)
return
LoadingButtonState
(
superState
,
isLoading
,
buttonText
,
isEnabled
)
}
override
fun
onRestoreInstanceState
(
state
:
Parcelable
?)
{
...
...
@@ -62,6 +63,7 @@ class LoadingButton(
doOnLayout
{
setText
(
loadingButtonState
?.
text
?:
""
)
setIsLoading
(
loadingButtonState
?.
isLoading
?:
false
)
isEnabled
=
loadingButtonState
?.
isEnabled
?:
true
}
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment