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
82c7c03e
"...org/futo/inputmethod/latin/ContactsBinaryDictionary.java" did not exist on "ea89cb40b7641764d385bbc200c5910e08a29c1a"
Commit
82c7c03e
authored
1 year ago
by
Taras
Browse files
Options
Downloads
Patches
Plain Diff
Handle ui updates for validation
parent
dfd8da64
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
auth/src/main/java/org/futo/circles/auth/feature/workspace/ConfigureWorkspaceFragment.kt
+32
-2
32 additions, 2 deletions
...cles/auth/feature/workspace/ConfigureWorkspaceFragment.kt
with
32 additions
and
2 deletions
auth/src/main/java/org/futo/circles/auth/feature/workspace/ConfigureWorkspaceFragment.kt
+
32
−
2
View file @
82c7c03e
package
org.futo.circles.auth.feature.workspace
import
android.content.Context
import
android.os.Bundle
import
android.view.View
import
androidx.core.os.bundleOf
import
androidx.fragment.app.Fragment
import
androidx.fragment.app.viewModels
import
androidx.navigation.fragment.findNavController
...
...
@@ -30,6 +32,13 @@ class ConfigureWorkspaceFragment : Fragment(R.layout.fragment_configure_workspac
WorkspaceTasksListAdapter
{
viewModel
.
onOptionalTaskSelectionChanged
(
it
)
}
}
private
var
configureWorkspaceListener
:
ConfigureWorkspaceListener
?
=
null
override
fun
onAttach
(
context
:
Context
)
{
super
.
onAttach
(
context
)
configureWorkspaceListener
=
(
parentFragment
as
?
ConfigureWorkspaceListener
)
}
override
fun
onViewCreated
(
view
:
View
,
savedInstanceState
:
Bundle
?)
{
super
.
onViewCreated
(
view
,
savedInstanceState
)
setupViews
()
...
...
@@ -38,6 +47,12 @@ class ConfigureWorkspaceFragment : Fragment(R.layout.fragment_configure_workspac
private
fun
setupViews
()
{
with
(
binding
)
{
val
shouldValidate
=
arguments
?.
getBoolean
(
SHOULD_VALIDATE
)
?:
false
toolbar
.
title
=
getString
(
if
(
shouldValidate
)
R
.
string
.
validating_workspace
else
R
.
string
.
configure_workspace
)
if
(
shouldValidate
)
startLoading
(
btbCreate
)
rvWorkspaceTasks
.
apply
{
adapter
=
tasksAdapter
addItemDecoration
(
DividerItemDecoration
(
context
,
DividerItemDecoration
.
VERTICAL
))
...
...
@@ -55,12 +70,27 @@ class ConfigureWorkspaceFragment : Fragment(R.layout.fragment_configure_workspac
}
viewModel
.
workspaceResultLiveData
.
observeResponse
(
this
,
success
=
{
findNavController
()
.
navigateSafe
(
ConfigureWorkspaceFragmentDirections
.
toSetupProfileFragment
())
configureWorkspaceListener
?.
onWorkspaceConfigured
()
?:
kotlin
.
run
{
findNavController
()
.
navigateSafe
(
ConfigureWorkspaceFragmentDirections
.
toSetupProfileFragment
())
}
},
error
=
{
showError
(
it
)
binding
.
btbCreate
.
setText
(
getString
(
R
.
string
.
retry
))
})
viewModel
.
validateWorkspaceResultLiveData
.
observeResponse
(
this
,
success
=
{
configureWorkspaceListener
?.
onWorkspaceConfigured
()
},
error
=
{
binding
.
toolbar
.
title
=
getString
(
R
.
string
.
configure_workspace
)
}
)
}
companion
object
{
const
val
SHOULD_VALIDATE
=
"should_validate"
fun
create
(
shouldValidate
:
Boolean
)
=
ConfigureWorkspaceFragment
().
apply
{
arguments
=
bundleOf
(
SHOULD_VALIDATE
to
shouldValidate
)
}
}
}
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