Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
M
Magisk
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
Magisk
Commits
b90e0430
Commit
b90e0430
authored
Feb 27, 2020
by
topjohnwu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Don't do layered cards
parent
0ce7da1b
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
183 additions
and
236 deletions
+183
-236
HomeFragment.kt
...rc/main/java/com/topjohnwu/magisk/ui/home/HomeFragment.kt
+2
-0
HomeViewModel.kt
...c/main/java/com/topjohnwu/magisk/ui/home/HomeViewModel.kt
+0
-4
include_home_magisk.xml
app/src/main/res/layout/include_home_magisk.xml
+100
-137
include_home_manager.xml
app/src/main/res/layout/include_home_manager.xml
+81
-95
No files found.
app/src/main/java/com/topjohnwu/magisk/ui/home/HomeFragment.kt
View file @
b90e0430
...
@@ -31,6 +31,8 @@ class HomeFragment : BaseUIFragment<HomeViewModel, FragmentHomeMd2Binding>() {
...
@@ -31,6 +31,8 @@ class HomeFragment : BaseUIFragment<HomeViewModel, FragmentHomeMd2Binding>() {
// Set barrier reference IDs in code, since resource IDs will be stripped in release mode
// Set barrier reference IDs in code, since resource IDs will be stripped in release mode
binding
.
homeMagiskWrapper
.
homeMagiskTitleBarrier
.
referencedIds
=
binding
.
homeMagiskWrapper
.
homeMagiskTitleBarrier
.
referencedIds
=
intArrayOf
(
R
.
id
.
home_magisk_action
,
R
.
id
.
home_magisk_title
,
R
.
id
.
home_magisk_icon
)
intArrayOf
(
R
.
id
.
home_magisk_action
,
R
.
id
.
home_magisk_title
,
R
.
id
.
home_magisk_icon
)
binding
.
homeMagiskWrapper
.
homeMagiskBarrier
.
referencedIds
=
intArrayOf
(
R
.
id
.
home_magisk_latest_version
,
R
.
id
.
home_magisk_installed_version
,
R
.
id
.
home_magisk_mode
)
binding
.
homeManagerWrapper
.
homeManagerTitleBarrier
.
referencedIds
=
binding
.
homeManagerWrapper
.
homeManagerTitleBarrier
.
referencedIds
=
intArrayOf
(
R
.
id
.
home_manager_action
,
R
.
id
.
home_manager_title
,
R
.
id
.
home_manager_icon
)
intArrayOf
(
R
.
id
.
home_manager_action
,
R
.
id
.
home_manager_title
,
R
.
id
.
home_manager_icon
)
...
...
app/src/main/java/com/topjohnwu/magisk/ui/home/HomeViewModel.kt
View file @
b90e0430
...
@@ -13,7 +13,6 @@ import com.topjohnwu.magisk.core.model.ManagerJson
...
@@ -13,7 +13,6 @@ import com.topjohnwu.magisk.core.model.ManagerJson
import
com.topjohnwu.magisk.core.model.UpdateInfo
import
com.topjohnwu.magisk.core.model.UpdateInfo
import
com.topjohnwu.magisk.data.repository.MagiskRepository
import
com.topjohnwu.magisk.data.repository.MagiskRepository
import
com.topjohnwu.magisk.extensions.*
import
com.topjohnwu.magisk.extensions.*
import
com.topjohnwu.magisk.model.entity.internal.DownloadSubject.Magisk
import
com.topjohnwu.magisk.model.entity.internal.DownloadSubject.Manager
import
com.topjohnwu.magisk.model.entity.internal.DownloadSubject.Manager
import
com.topjohnwu.magisk.model.entity.recycler.DeveloperItem
import
com.topjohnwu.magisk.model.entity.recycler.DeveloperItem
import
com.topjohnwu.magisk.model.entity.recycler.HomeItem
import
com.topjohnwu.magisk.model.entity.recycler.HomeItem
...
@@ -48,7 +47,6 @@ class HomeViewModel(
...
@@ -48,7 +47,6 @@ class HomeViewModel(
val
stateMagiskInstalledVersion
get
()
=
val
stateMagiskInstalledVersion
get
()
=
"${Info.env.magiskVersionString} (${Info.env.magiskVersionCode})"
"${Info.env.magiskVersionString} (${Info.env.magiskVersionCode})"
val
stateMagiskMode
get
()
=
(
if
(
Config
.
coreOnly
)
R
.
string
.
home_status_safe
else
R
.
string
.
home_status_normal
).
res
()
val
stateMagiskMode
get
()
=
(
if
(
Config
.
coreOnly
)
R
.
string
.
home_status_safe
else
R
.
string
.
home_status_normal
).
res
()
val
stateMagiskProgress
=
KObservableField
(
0
)
val
stateManagerRemoteVersion
=
KObservableField
(
R
.
string
.
loading
.
res
())
val
stateManagerRemoteVersion
=
KObservableField
(
R
.
string
.
loading
.
res
())
val
stateManagerInstalledVersion
=
Info
.
stub
?.
let
{
val
stateManagerInstalledVersion
=
Info
.
stub
?.
let
{
...
@@ -70,8 +68,6 @@ class HomeViewModel(
...
@@ -70,8 +68,6 @@ class HomeViewModel(
init
{
init
{
RemoteFileService
.
progressBroadcast
.
observeForever
{
RemoteFileService
.
progressBroadcast
.
observeForever
{
when
(
it
?.
second
)
{
when
(
it
?.
second
)
{
is
Magisk
.
Download
,
is
Magisk
.
Flash
->
stateMagiskProgress
.
value
=
it
.
first
.
times
(
100f
).
roundToInt
()
is
Manager
->
stateManagerProgress
.
value
=
it
.
first
.
times
(
100f
).
roundToInt
()
is
Manager
->
stateManagerProgress
.
value
=
it
.
first
.
times
(
100f
).
roundToInt
()
}
}
}
}
...
...
app/src/main/res/layout/include_home_magisk.xml
View file @
b90e0430
This diff is collapsed.
Click to expand it.
app/src/main/res/layout/include_home_manager.xml
View file @
b90e0430
...
@@ -89,7 +89,7 @@
...
@@ -89,7 +89,7 @@
android:layout_width=
"wrap_content"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_height=
"wrap_content"
app:barrierDirection=
"bottom"
app:barrierDirection=
"bottom"
app
:constraint_referenced_ids=
"home_manager_action,home_manager_title,home_manager_icon"
/>
tools
:constraint_referenced_ids=
"home_manager_action,home_manager_title,home_manager_icon"
/>
<HorizontalScrollView
<HorizontalScrollView
android:layout_width=
"match_parent"
android:layout_width=
"match_parent"
...
@@ -103,104 +103,90 @@
...
@@ -103,104 +103,90 @@
<LinearLayout
<LinearLayout
android:layout_width=
"wrap_content"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_height=
"wrap_content"
android:orientation=
"
horizont
al"
>
android:orientation=
"
vertic
al"
>
<com.google.android.material.card.MaterialCardView
<androidx.constraintlayout.widget.ConstraintLayout
style=
"@style/W.Home.Card.First"
android:layout_width=
"wrap_content"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
>
android:layout_height=
"wrap_content"
>
<androidx.constraintlayout.widget.ConstraintLayout
<LinearLayout
android:layout_width=
"wrap_content"
android:id=
"@+id/home_manager_latest_version"
android:layout_height=
"wrap_content"
>
style=
"@style/W.Home.Item.Top"
app:layout_constraintStart_toStartOf=
"parent"
<View
app:layout_constraintTop_toTopOf=
"parent"
>
style=
"@style/W.Home.Section"
app:layout_constraintBottom_toBottomOf=
"parent"
<TextView
app:layout_constraintEnd_toEndOf=
"parent"
style=
"@style/W.Home.ItemContent"
app:layout_constraintStart_toStartOf=
"parent"
android:text=
"@string/module_section_remote"
/>
app:layout_constraintTop_toTopOf=
"parent"
/>
<TextView
<LinearLayout
style=
"@style/W.Home.ItemContent.Right"
android:id=
"@+id/home_manager_latest_version"
android:text=
"@{viewModel.isConnected ? viewModel.stateManagerRemoteVersion : @string/not_available}"
style=
"@style/W.Home.Item.Top"
tools:text=
"8.0.0 (123) (10)"
/>
app:layout_constraintStart_toStartOf=
"parent"
app:layout_constraintTop_toTopOf=
"parent"
>
</LinearLayout>
<TextView
<LinearLayout
style=
"@style/W.Home.ItemContent"
android:id=
"@+id/home_manager_installed_version"
android:text=
"@string/module_section_remote"
/>
style=
"@style/W.Home.Item"
app:layout_constraintStart_toStartOf=
"parent"
<TextView
app:layout_constraintTop_toBottomOf=
"@+id/home_manager_latest_version"
>
style=
"@style/W.Home.ItemContent.Right"
android:text=
"@{viewModel.isConnected ? viewModel.stateManagerRemoteVersion : @string/not_available}"
<TextView
tools:text=
"8.0.0 (123) (10)"
/>
style=
"@style/W.Home.ItemContent"
android:text=
"@string/installed"
/>
</LinearLayout>
<TextView
<LinearLayout
style=
"@style/W.Home.ItemContent.Right"
android:id=
"@+id/home_manager_installed_version"
android:text=
"@{viewModel.stateManagerInstalledVersion}"
style=
"@style/W.Home.Item"
tools:text=
"8.0.0 (123) (10)"
/>
app:layout_constraintStart_toStartOf=
"parent"
app:layout_constraintTop_toBottomOf=
"@+id/home_manager_latest_version"
>
</LinearLayout>
<TextView
<LinearLayout
style=
"@style/W.Home.ItemContent"
android:id=
"@+id/home_manager_internal_mode"
android:text=
"@string/installed"
/>
style=
"@style/W.Home.Item"
app:layout_constraintStart_toStartOf=
"parent"
<TextView
app:layout_constraintTop_toBottomOf=
"@+id/home_manager_installed_version"
>
style=
"@style/W.Home.ItemContent.Right"
android:text=
"@{viewModel.stateManagerInstalledVersion}"
<TextView
tools:text=
"8.0.0 (123) (10)"
/>
style=
"@style/W.Home.ItemContent"
android:text=
"@string/status"
/>
</LinearLayout>
<TextView
<LinearLayout
style=
"@style/W.Home.ItemContent.Right"
android:id=
"@+id/home_manager_internal_mode"
android:text=
"@{InfoKt.isRunningAsStub ? @string/home_status_stub : @string/home_status_normal}"
style=
"@style/W.Home.Item"
tools:text=
"Normal"
/>
app:layout_constraintStart_toStartOf=
"parent"
app:layout_constraintTop_toBottomOf=
"@+id/home_manager_installed_version"
>
</LinearLayout>
<TextView
<LinearLayout
style=
"@style/W.Home.ItemContent"
android:id=
"@+id/home_manager_internal_connection"
android:text=
"@string/status"
/>
style=
"@style/W.Home.Item.Bottom"
app:layout_constraintStart_toStartOf=
"parent"
<TextView
app:layout_constraintTop_toBottomOf=
"@+id/home_manager_internal_mode"
>
style=
"@style/W.Home.ItemContent.Right"
android:text=
"@{InfoKt.isRunningAsStub ? @string/home_status_stub : @string/home_status_normal}"
<TextView
tools:text=
"Normal"
/>
style=
"@style/W.Home.ItemContent"
android:text=
"@string/home_package"
/>
</LinearLayout>
<TextView
<LinearLayout
android:id=
"@+id/home_manager_extra_connection_value"
android:id=
"@+id/home_manager_internal_connection"
style=
"@style/W.Home.ItemContent.Right"
style=
"@style/W.Home.Item.Bottom"
android:text=
"@{viewModel.statePackageName}"
app:layout_constraintStart_toStartOf=
"parent"
tools:text=
"com.topjohnwu.magisk"
/>
app:layout_constraintTop_toBottomOf=
"@+id/home_manager_internal_mode"
>
</LinearLayout>
<TextView
style=
"@style/W.Home.ItemContent"
</androidx.constraintlayout.widget.ConstraintLayout>
android:text=
"@string/home_package"
/>
<ProgressBar
<TextView
style=
"@style/WidgetFoundation.ProgressBar"
android:id=
"@+id/home_manager_extra_connection_value"
gone=
"@{viewModel.stateManagerProgress == 0 || viewModel.stateManagerProgress == 100}"
style=
"@style/W.Home.ItemContent.Right"
android:layout_width=
"match_parent"
android:text=
"@{viewModel.statePackageName}"
android:layout_gravity=
"bottom"
tools:text=
"com.topjohnwu.magisk"
/>
android:max=
"100"
android:progress=
"@{viewModel.stateManagerProgress}"
/>
</LinearLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
<ProgressBar
style=
"@style/WidgetFoundation.ProgressBar"
gone=
"@{viewModel.stateManagerProgress == 0 || viewModel.stateManagerProgress == 100}"
android:layout_width=
"match_parent"
android:layout_gravity=
"bottom"
android:max=
"100"
android:progress=
"@{viewModel.stateManagerProgress}"
/>
</com.google.android.material.card.MaterialCardView>
</LinearLayout>
</LinearLayout>
...
...
Write
Preview
Markdown
is supported
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