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
63590d37
Commit
63590d37
authored
Feb 12, 2021
by
topjohnwu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update hide icon strategy
parent
5f63e889
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
20 additions
and
24 deletions
+20
-24
HomeFragment.kt
...rc/main/java/com/topjohnwu/magisk/ui/home/HomeFragment.kt
+16
-24
include_home_magisk.xml
app/src/main/res/layout/include_home_magisk.xml
+2
-0
include_home_manager.xml
app/src/main/res/layout/include_home_manager.xml
+2
-0
No files found.
app/src/main/java/com/topjohnwu/magisk/ui/home/HomeFragment.kt
View file @
63590d37
...
@@ -2,6 +2,8 @@ package com.topjohnwu.magisk.ui.home
...
@@ -2,6 +2,8 @@ package com.topjohnwu.magisk.ui.home
import
android.os.Bundle
import
android.os.Bundle
import
android.view.*
import
android.view.*
import
android.widget.ImageView
import
android.widget.TextView
import
com.topjohnwu.magisk.R
import
com.topjohnwu.magisk.R
import
com.topjohnwu.magisk.arch.BaseUIFragment
import
com.topjohnwu.magisk.arch.BaseUIFragment
import
com.topjohnwu.magisk.core.download.BaseDownloader
import
com.topjohnwu.magisk.core.download.BaseDownloader
...
@@ -22,6 +24,18 @@ class HomeFragment : BaseUIFragment<HomeViewModel, FragmentHomeMd2Binding>() {
...
@@ -22,6 +24,18 @@ class HomeFragment : BaseUIFragment<HomeViewModel, FragmentHomeMd2Binding>() {
BaseDownloader
.
observeProgress
(
this
,
viewModel
::
onProgressUpdate
)
BaseDownloader
.
observeProgress
(
this
,
viewModel
::
onProgressUpdate
)
}
}
private
fun
checkTitle
(
text
:
TextView
,
icon
:
ImageView
)
{
text
.
post
{
if
(
text
.
layout
.
getEllipsisCount
(
0
)
!=
0
)
{
with
(
icon
)
{
layoutParams
.
width
=
0
layoutParams
.
height
=
0
requestLayout
()
}
}
}
}
override
fun
onCreateView
(
override
fun
onCreateView
(
inflater
:
LayoutInflater
,
inflater
:
LayoutInflater
,
container
:
ViewGroup
?,
container
:
ViewGroup
?,
...
@@ -30,33 +44,11 @@ class HomeFragment : BaseUIFragment<HomeViewModel, FragmentHomeMd2Binding>() {
...
@@ -30,33 +44,11 @@ class HomeFragment : BaseUIFragment<HomeViewModel, FragmentHomeMd2Binding>() {
super
.
onCreateView
(
inflater
,
container
,
savedInstanceState
)
super
.
onCreateView
(
inflater
,
container
,
savedInstanceState
)
// If titles are squished, hide icons
// If titles are squished, hide icons
with
(
binding
.
homeMagiskWrapper
)
{
with
(
binding
.
homeMagiskWrapper
)
{
with
(
homeMagiskTitle
)
{
checkTitle
(
homeMagiskTitle
,
homeMagiskIcon
)
post
{
if
(
lineCount
!=
1
)
{
with
(
homeMagiskIcon
)
{
layoutParams
.
width
=
0
layoutParams
.
height
=
0
requestLayout
()
}
}
}
}
}
}
with
(
binding
.
homeManagerWrapper
)
{
with
(
binding
.
homeManagerWrapper
)
{
with
(
homeManagerTitle
)
{
checkTitle
(
homeManagerTitle
,
homeManagerIcon
)
post
{
if
(
lineCount
!=
1
)
{
with
(
homeManagerIcon
)
{
layoutParams
.
width
=
0
layoutParams
.
height
=
0
requestLayout
()
}
}
}
}
}
}
return
binding
.
root
return
binding
.
root
...
...
app/src/main/res/layout/include_home_magisk.xml
View file @
63590d37
...
@@ -46,6 +46,8 @@
...
@@ -46,6 +46,8 @@
android:text=
"@string/magisk"
android:text=
"@string/magisk"
android:textAppearance=
"@style/AppearanceFoundation.Title"
android:textAppearance=
"@style/AppearanceFoundation.Title"
android:textColor=
"?colorPrimary"
android:textColor=
"?colorPrimary"
android:maxLines=
"1"
android:ellipsize=
"end"
app:layout_constraintBottom_toBottomOf=
"@+id/home_magisk_icon"
app:layout_constraintBottom_toBottomOf=
"@+id/home_magisk_icon"
app:layout_constraintEnd_toStartOf=
"@+id/home_magisk_button"
app:layout_constraintEnd_toStartOf=
"@+id/home_magisk_button"
app:layout_constraintStart_toEndOf=
"@+id/home_magisk_icon"
app:layout_constraintStart_toEndOf=
"@+id/home_magisk_icon"
...
...
app/src/main/res/layout/include_home_manager.xml
View file @
63590d37
...
@@ -46,6 +46,8 @@
...
@@ -46,6 +46,8 @@
android:text=
"@string/home_app_title"
android:text=
"@string/home_app_title"
android:textAppearance=
"@style/AppearanceFoundation.Title"
android:textAppearance=
"@style/AppearanceFoundation.Title"
android:textColor=
"?colorPrimary"
android:textColor=
"?colorPrimary"
android:maxLines=
"1"
android:ellipsize=
"end"
app:layout_constraintBottom_toBottomOf=
"@+id/home_manager_icon"
app:layout_constraintBottom_toBottomOf=
"@+id/home_manager_icon"
app:layout_constraintEnd_toStartOf=
"@+id/home_manager_button"
app:layout_constraintEnd_toStartOf=
"@+id/home_manager_button"
app:layout_constraintStart_toEndOf=
"@+id/home_manager_icon"
app:layout_constraintStart_toEndOf=
"@+id/home_manager_icon"
...
...
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