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
c5385b5b
Commit
c5385b5b
authored
Nov 19, 2019
by
Viktor De Pasquale
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added custom markdown window for redesign
parent
35475e1d
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
32 additions
and
5 deletions
+32
-5
MarkDownWindow.kt
...src/main/java/com/topjohnwu/magisk/view/MarkDownWindow.kt
+17
-5
markdown_window_md2.xml
app/src/main/res/layout/markdown_window_md2.xml
+15
-0
No files found.
app/src/main/java/com/topjohnwu/magisk/view/MarkDownWindow.kt
View file @
c5385b5b
...
...
@@ -4,6 +4,7 @@ import android.content.Context
import
android.view.LayoutInflater
import
android.widget.TextView
import
androidx.appcompat.app.AlertDialog
import
com.topjohnwu.magisk.Config
import
com.topjohnwu.magisk.R
import
com.topjohnwu.magisk.data.repository.StringRepository
import
com.topjohnwu.magisk.extensions.subscribeK
...
...
@@ -34,7 +35,8 @@ object MarkDownWindow : KoinComponent {
}
fun
show
(
activity
:
Context
,
title
:
String
?,
content
:
Single
<
String
>)
{
val
mv
=
LayoutInflater
.
from
(
activity
).
inflate
(
R
.
layout
.
markdown_window
,
null
)
val
mdRes
=
if
(
Config
.
redesign
)
R
.
layout
.
markdown_window_md2
else
R
.
layout
.
markdown_window
val
mv
=
LayoutInflater
.
from
(
activity
).
inflate
(
mdRes
,
null
)
val
tv
=
mv
.
findViewById
<
TextView
>(
R
.
id
.
md_txt
)
content
.
map
{
...
...
@@ -45,11 +47,21 @@ object MarkDownWindow : KoinComponent {
tv
.
setText
(
R
.
string
.
download_file_error
)
Completable
.
complete
()
}.
subscribeK
{
if
(
Config
.
redesign
)
{
MagiskDialog
(
activity
)
.
applyTitle
(
title
?:
""
)
.
applyView
(
mv
)
.
applyButton
(
MagiskDialog
.
ButtonType
.
NEGATIVE
)
{
titleRes
=
android
.
R
.
string
.
cancel
}
.
reveal
()
return
@subscribeK
}
AlertDialog
.
Builder
(
activity
)
.
setTitle
(
title
)
.
setView
(
mv
)
.
setNegativeButton
(
android
.
R
.
string
.
cancel
)
{
dialog
,
_
->
dialog
.
dismiss
()
}
.
show
()
.
setTitle
(
title
)
.
setView
(
mv
)
.
setNegativeButton
(
android
.
R
.
string
.
cancel
)
{
dialog
,
_
->
dialog
.
dismiss
()
}
.
show
()
}
}
}
app/src/main/res/layout/markdown_window_md2.xml
0 → 100644
View file @
c5385b5b
<?xml version="1.0" encoding="utf-8"?>
<ScrollView
xmlns:android=
"http://schemas.android.com/apk/res/android"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
>
<TextView
android:id=
"@+id/md_txt"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_marginStart=
"15dp"
android:layout_marginEnd=
"15dp"
android:paddingTop=
"10dp"
android:textAppearance=
"?appearanceTextCaptionNormal"
/>
</ScrollView>
\ No newline at end of file
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