Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
e
os
App Lounge
Commits
ba04ac16
Commit
ba04ac16
authored
Apr 22, 2021
by
Aayush Gupta
Browse files
updates: UpdatesFragment: Merge progressBar variables into one
Signed-off-by:
Aayush Gupta
<
theimpulson@e.email
>
parent
a6787fd9
Changes
1
Hide whitespace changes
Inline
Side-by-side
app/src/main/java/foundation/e/apps/updates/UpdatesFragment.kt
View file @
ba04ac16
...
...
@@ -48,7 +48,7 @@ class UpdatesFragment() : Fragment() {
private
lateinit
var
recyclerView
:
RecyclerView
private
var
applicationList
=
ArrayList
<
Application
>()
var
accentColorOS
=
0
;
lateinit
var
p
rogressBar
2
:
ProgressBar
lateinit
var
reloadP
rogressBar
:
ProgressBar
fun
initialise
(
applicationManager
:
ApplicationManager
,
accentColorOS
:
Int
)
{
this
.
applicationManager
=
applicationManager
...
...
@@ -64,13 +64,12 @@ class UpdatesFragment() : Fragment() {
updatesViewModel
=
ViewModelProvider
(
this
).
get
(
UpdatesViewModel
::
class
.
java
)
recyclerView
=
view
.
findViewById
(
R
.
id
.
app_list
)
progressBar2
=
view
.
findViewById
<
ProgressBar
>(
R
.
id
.
progress_bar2
)
val
updateAll
=
view
.
findViewById
<
Button
>(
R
.
id
.
update_all
)
updateAll
.
setTextColor
(
accentColorOS
)
val
splashContainer
=
view
.
findViewById
<
LinearLayout
>(
R
.
id
.
splash_container
)
val
progressBar
=
view
.
findViewById
<
ProgressBar
>(
R
.
id
.
progress_bar
)
progressBar
.
indeterminateDrawable
.
colorFilter
=
PorterDuffColorFilter
(
accentColorOS
,
PorterDuff
.
Mode
.
MULTIPLY
)
val
reloadProgressBar
=
view
.
findViewById
<
ProgressBar
>(
R
.
id
.
progress_bar2
)
reloadProgressBar
=
view
.
findViewById
<
ProgressBar
>(
R
.
id
.
progress_bar2
)
reloadProgressBar
.
indeterminateDrawable
.
colorFilter
=
PorterDuffColorFilter
(
accentColorOS
,
PorterDuff
.
Mode
.
MULTIPLY
)
val
errorContainer
=
view
.
findViewById
<
LinearLayout
>(
R
.
id
.
error_container
)
...
...
@@ -156,12 +155,12 @@ class UpdatesFragment() : Fragment() {
if
(
::
updatesViewModel
.
isInitialized
)
{
updatesViewModel
.
getApplications
().
value
?.
let
{
it
.
forEach
{
application
->
p
rogressBar
2
.
visibility
=
View
.
VISIBLE
reloadP
rogressBar
.
visibility
=
View
.
VISIBLE
application
.
checkForStateUpdate
(
requireContext
())
}
val
handler
=
Handler
()
handler
.
postDelayed
({
p
rogressBar
2
.
visibility
=
View
.
GONE
reloadP
rogressBar
.
visibility
=
View
.
GONE
},
10000
)
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment