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
7b8237af
Commit
7b8237af
authored
Sep 25, 2016
by
d8ahazard
Committed by
topjohnwu
Sep 25, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add theming for AlertDialogBuilder
parent
859a984e
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
117 additions
and
20 deletions
+117
-20
AboutActivity.java
app/src/main/java/com/topjohnwu/magisk/AboutActivity.java
+31
-8
MagiskFragment.java
app/src/main/java/com/topjohnwu/magisk/MagiskFragment.java
+10
-2
ModulesAdapter.java
app/src/main/java/com/topjohnwu/magisk/ModulesAdapter.java
+7
-2
ReposFragment.java
app/src/main/java/com/topjohnwu/magisk/ReposFragment.java
+14
-4
Async.java
app/src/main/java/com/topjohnwu/magisk/utils/Async.java
+9
-1
WebWindow.java
app/src/main/java/com/topjohnwu/magisk/utils/WebWindow.java
+9
-1
activity_about.xml
app/src/main/res/layout/activity_about.xml
+2
-0
styles.xml
app/src/main/res/values/styles.xml
+35
-2
No files found.
app/src/main/java/com/topjohnwu/magisk/AboutActivity.java
View file @
7b8237af
...
@@ -4,18 +4,21 @@ import android.content.Intent;
...
@@ -4,18 +4,21 @@ import android.content.Intent;
import
android.net.Uri
;
import
android.net.Uri
;
import
android.os.Build
;
import
android.os.Build
;
import
android.os.Bundle
;
import
android.os.Bundle
;
import
android.preference.PreferenceManager
;
import
android.support.annotation.Nullable
;
import
android.support.annotation.Nullable
;
import
android.support.v7.app.ActionBar
;
import
android.support.v7.app.ActionBar
;
import
android.support.v7.app.AlertDialog
;
import
android.support.v7.app.AlertDialog
;
import
android.support.v7.app.AppCompatActivity
;
import
android.support.v7.app.AppCompatActivity
;
import
android.support.v7.widget.Toolbar
;
import
android.support.v7.widget.Toolbar
;
import
android.text.Html
;
import
android.text.Html
;
import
android.text.Spanned
;
import
android.text.TextUtils
;
import
android.text.TextUtils
;
import
android.text.method.LinkMovementMethod
;
import
android.text.method.LinkMovementMethod
;
import
android.view.View
;
import
android.view.View
;
import
android.view.WindowManager
;
import
android.view.WindowManager
;
import
android.widget.TextView
;
import
android.widget.TextView
;
import
com.topjohnwu.magisk.utils.Logger
;
import
com.topjohnwu.magisk.utils.RowItem
;
import
com.topjohnwu.magisk.utils.RowItem
;
import
java.io.IOException
;
import
java.io.IOException
;
...
@@ -28,7 +31,7 @@ public class AboutActivity extends AppCompatActivity {
...
@@ -28,7 +31,7 @@ public class AboutActivity extends AppCompatActivity {
private
static
final
String
SOURCE_CODE_URL
=
"https://github.com/topjohnwu/MagiskManager"
;
private
static
final
String
SOURCE_CODE_URL
=
"https://github.com/topjohnwu/MagiskManager"
;
private
static
final
String
XDA_THREAD
=
"http://forum.xda-developers.com/android/software/mod-magisk-v1-universal-systemless-t3432382"
;
private
static
final
String
XDA_THREAD
=
"http://forum.xda-developers.com/android/software/mod-magisk-v1-universal-systemless-t3432382"
;
private
AlertDialog
.
Builder
builder
;
@BindView
(
R
.
id
.
toolbar
)
Toolbar
toolbar
;
@BindView
(
R
.
id
.
toolbar
)
Toolbar
toolbar
;
@BindView
(
R
.
id
.
app_version_info
)
RowItem
appVersionInfo
;
@BindView
(
R
.
id
.
app_version_info
)
RowItem
appVersionInfo
;
...
@@ -41,6 +44,11 @@ public class AboutActivity extends AppCompatActivity {
...
@@ -41,6 +44,11 @@ public class AboutActivity extends AppCompatActivity {
@Override
@Override
protected
void
onCreate
(
@Nullable
Bundle
savedInstanceState
)
{
protected
void
onCreate
(
@Nullable
Bundle
savedInstanceState
)
{
super
.
onCreate
(
savedInstanceState
);
super
.
onCreate
(
savedInstanceState
);
String
theme
=
PreferenceManager
.
getDefaultSharedPreferences
(
getApplicationContext
()).
getString
(
"theme"
,
""
);
Logger
.
dh
(
"AboutActivity: Theme is "
+
theme
);
if
(
theme
.
equals
(
"Dark"
))
{
setTheme
(
R
.
style
.
AppTheme_dh
);
}
setContentView
(
R
.
layout
.
activity_about
);
setContentView
(
R
.
layout
.
activity_about
);
if
(
Build
.
VERSION
.
SDK_INT
>=
Build
.
VERSION_CODES
.
M
)
{
if
(
Build
.
VERSION
.
SDK_INT
>=
Build
.
VERSION_CODES
.
M
)
{
getWindow
().
getDecorView
().
setSystemUiVisibility
(
View
.
SYSTEM_UI_FLAG_LIGHT_STATUS_BAR
);
getWindow
().
getDecorView
().
setSystemUiVisibility
(
View
.
SYSTEM_UI_FLAG_LIGHT_STATUS_BAR
);
...
@@ -72,14 +80,24 @@ public class AboutActivity extends AppCompatActivity {
...
@@ -72,14 +80,24 @@ public class AboutActivity extends AppCompatActivity {
}
}
appChangelog
.
removeSummary
();
appChangelog
.
removeSummary
();
if
(
theme
.
equals
(
"Dark"
))
{
builder
=
new
AlertDialog
.
Builder
(
this
,
R
.
style
.
AlertDialog_dh
);
}
else
{
builder
=
new
AlertDialog
.
Builder
(
this
);
}
if
(
changes
==
null
)
{
if
(
changes
==
null
)
{
appChangelog
.
setVisibility
(
View
.
GONE
);
appChangelog
.
setVisibility
(
View
.
GONE
);
}
else
{
}
else
{
final
String
finalChanges
=
changes
;
Spanned
result
;
if
(
android
.
os
.
Build
.
VERSION
.
SDK_INT
>=
android
.
os
.
Build
.
VERSION_CODES
.
N
)
{
result
=
Html
.
fromHtml
(
changes
,
Html
.
TO_HTML_PARAGRAPH_LINES_CONSECUTIVE
);
}
else
{
result
=
Html
.
fromHtml
(
changes
);
}
appChangelog
.
setOnClickListener
(
v
->
{
appChangelog
.
setOnClickListener
(
v
->
{
AlertDialog
d
=
new
AlertDialog
.
Builder
(
AboutActivity
.
this
)
AlertDialog
d
=
builder
.
setTitle
(
R
.
string
.
app_changelog
)
.
setTitle
(
R
.
string
.
app_changelog
)
.
setMessage
(
Html
.
fromHtml
(
finalChanges
)
)
.
setMessage
(
result
)
.
setPositiveButton
(
android
.
R
.
string
.
ok
,
null
)
.
setPositiveButton
(
android
.
R
.
string
.
ok
,
null
)
.
create
();
.
create
();
...
@@ -92,9 +110,15 @@ public class AboutActivity extends AppCompatActivity {
...
@@ -92,9 +110,15 @@ public class AboutActivity extends AppCompatActivity {
appDevelopers
.
removeSummary
();
appDevelopers
.
removeSummary
();
appDevelopers
.
setOnClickListener
(
view
->
{
appDevelopers
.
setOnClickListener
(
view
->
{
AlertDialog
d
=
new
AlertDialog
.
Builder
(
AboutActivity
.
this
)
Spanned
result
;
if
(
android
.
os
.
Build
.
VERSION
.
SDK_INT
>=
android
.
os
.
Build
.
VERSION_CODES
.
N
)
{
result
=
Html
.
fromHtml
(
getString
(
R
.
string
.
app_developers_
),
Html
.
TO_HTML_PARAGRAPH_LINES_CONSECUTIVE
);
}
else
{
result
=
Html
.
fromHtml
(
getString
(
R
.
string
.
app_developers_
));
}
AlertDialog
d
=
builder
.
setTitle
(
R
.
string
.
app_developers
)
.
setTitle
(
R
.
string
.
app_developers
)
.
setMessage
(
Html
.
fromHtml
(
getString
(
R
.
string
.
app_developers_
))
)
.
setMessage
(
result
)
.
setPositiveButton
(
android
.
R
.
string
.
ok
,
null
)
.
setPositiveButton
(
android
.
R
.
string
.
ok
,
null
)
.
create
();
.
create
();
...
@@ -142,6 +166,5 @@ public class AboutActivity extends AppCompatActivity {
...
@@ -142,6 +166,5 @@ public class AboutActivity extends AppCompatActivity {
setTitle
(
"About"
);
setTitle
(
"About"
);
getWindow
().
setStatusBarColor
(
getResources
().
getColor
(
R
.
color
.
primary_dark
));
}
}
}
}
app/src/main/java/com/topjohnwu/magisk/MagiskFragment.java
View file @
7b8237af
...
@@ -6,6 +6,7 @@ import android.content.res.TypedArray;
...
@@ -6,6 +6,7 @@ import android.content.res.TypedArray;
import
android.graphics.Color
;
import
android.graphics.Color
;
import
android.os.AsyncTask
;
import
android.os.AsyncTask
;
import
android.os.Bundle
;
import
android.os.Bundle
;
import
android.preference.PreferenceManager
;
import
android.support.annotation.Nullable
;
import
android.support.annotation.Nullable
;
import
android.support.v4.content.FileProvider
;
import
android.support.v4.content.FileProvider
;
...
@@ -52,6 +53,7 @@ public class MagiskFragment extends Fragment {
...
@@ -52,6 +53,7 @@ public class MagiskFragment extends Fragment {
private
int
colorOK
,
colorWarn
,
colorNeutral
;
private
int
colorOK
,
colorWarn
,
colorNeutral
;
int
statusOK
=
R
.
drawable
.
ic_check_circle
;
int
statusOK
=
R
.
drawable
.
ic_check_circle
;
int
statusUnknown
=
R
.
drawable
.
ic_help
;
int
statusUnknown
=
R
.
drawable
.
ic_help
;
private
AlertDialog
.
Builder
builder
;
@Nullable
@Nullable
@Override
@Override
...
@@ -91,6 +93,12 @@ public class MagiskFragment extends Fragment {
...
@@ -91,6 +93,12 @@ public class MagiskFragment extends Fragment {
@Override
@Override
protected
void
onPostExecute
(
Void
v
)
{
protected
void
onPostExecute
(
Void
v
)
{
super
.
onPostExecute
(
v
);
super
.
onPostExecute
(
v
);
String
theme
=
PreferenceManager
.
getDefaultSharedPreferences
(
getActivity
()).
getString
(
"theme"
,
""
);
if
(
theme
.
equals
(
"Dark"
))
{
builder
=
new
AlertDialog
.
Builder
(
getActivity
(),
R
.
style
.
AlertDialog_dh
);
}
else
{
builder
=
new
AlertDialog
.
Builder
(
getActivity
());
}
if
(
Utils
.
magiskVersion
==
-
1
)
{
if
(
Utils
.
magiskVersion
==
-
1
)
{
magiskStatusContainer
.
setBackgroundColor
(
grey500
);
magiskStatusContainer
.
setBackgroundColor
(
grey500
);
...
@@ -123,7 +131,7 @@ public class MagiskFragment extends Fragment {
...
@@ -123,7 +131,7 @@ public class MagiskFragment extends Fragment {
magiskCheckUpdatesIcon
.
setImageResource
(
R
.
drawable
.
ic_file_download
);
magiskCheckUpdatesIcon
.
setImageResource
(
R
.
drawable
.
ic_file_download
);
magiskCheckUpdatesStatus
.
setText
(
getString
(
R
.
string
.
magisk_update_available
,
String
.
valueOf
(
Utils
.
remoteMagiskVersion
)));
magiskCheckUpdatesStatus
.
setText
(
getString
(
R
.
string
.
magisk_update_available
,
String
.
valueOf
(
Utils
.
remoteMagiskVersion
)));
magiskCheckUpdatesStatus
.
setTextColor
(
colorNeutral
);
magiskCheckUpdatesStatus
.
setTextColor
(
colorNeutral
);
magiskUpdateView
.
setOnClickListener
(
view
->
new
AlertDialog
.
Builder
(
getActivity
())
magiskUpdateView
.
setOnClickListener
(
view
->
builder
.
setTitle
(
getString
(
R
.
string
.
update_title
,
getString
(
R
.
string
.
magisk
)))
.
setTitle
(
getString
(
R
.
string
.
update_title
,
getString
(
R
.
string
.
magisk
)))
.
setMessage
(
getString
(
R
.
string
.
update_msg
,
getString
(
R
.
string
.
magisk
),
String
.
valueOf
(
Utils
.
remoteMagiskVersion
),
Utils
.
magiskChangelog
))
.
setMessage
(
getString
(
R
.
string
.
update_msg
,
getString
(
R
.
string
.
magisk
),
String
.
valueOf
(
Utils
.
remoteMagiskVersion
),
Utils
.
magiskChangelog
))
.
setCancelable
(
true
)
.
setCancelable
(
true
)
...
@@ -150,7 +158,7 @@ public class MagiskFragment extends Fragment {
...
@@ -150,7 +158,7 @@ public class MagiskFragment extends Fragment {
appCheckUpdatesIcon
.
setImageResource
(
R
.
drawable
.
ic_file_download
);
appCheckUpdatesIcon
.
setImageResource
(
R
.
drawable
.
ic_file_download
);
appCheckUpdatesStatus
.
setText
(
getString
(
R
.
string
.
app_update_available
,
String
.
valueOf
(
Utils
.
remoteAppVersion
)));
appCheckUpdatesStatus
.
setText
(
getString
(
R
.
string
.
app_update_available
,
String
.
valueOf
(
Utils
.
remoteAppVersion
)));
appCheckUpdatesStatus
.
setTextColor
(
colorNeutral
);
appCheckUpdatesStatus
.
setTextColor
(
colorNeutral
);
appUpdateView
.
setOnClickListener
(
view
->
new
AlertDialog
.
Builder
(
getActivity
())
appUpdateView
.
setOnClickListener
(
view
->
builder
.
setTitle
(
getString
(
R
.
string
.
update_title
,
getString
(
R
.
string
.
app_name
)))
.
setTitle
(
getString
(
R
.
string
.
update_title
,
getString
(
R
.
string
.
app_name
)))
.
setMessage
(
getString
(
R
.
string
.
update_msg
,
getString
(
R
.
string
.
app_name
),
String
.
valueOf
(
Utils
.
remoteAppVersion
),
Utils
.
appChangelog
))
.
setMessage
(
getString
(
R
.
string
.
update_msg
,
getString
(
R
.
string
.
app_name
),
String
.
valueOf
(
Utils
.
remoteAppVersion
),
Utils
.
appChangelog
))
.
setCancelable
(
true
)
.
setCancelable
(
true
)
...
...
app/src/main/java/com/topjohnwu/magisk/ModulesAdapter.java
View file @
7b8237af
...
@@ -127,8 +127,13 @@ public class ModulesAdapter extends RecyclerView.Adapter<ModulesAdapter.ViewHold
...
@@ -127,8 +127,13 @@ public class ModulesAdapter extends RecyclerView.Adapter<ModulesAdapter.ViewHold
break
;
break
;
}
}
};
};
AlertDialog
.
Builder
builder
;
AlertDialog
.
Builder
builder
=
new
AlertDialog
.
Builder
(
context
);
String
theme
=
PreferenceManager
.
getDefaultSharedPreferences
(
context
).
getString
(
"theme"
,
""
);
if
(
theme
.
equals
(
"Dark"
))
{
builder
=
new
AlertDialog
.
Builder
(
context
,
R
.
style
.
AlertDialog_dh
);
}
else
{
builder
=
new
AlertDialog
.
Builder
(
context
);
}
builder
.
setMessage
(
"An update is available for "
+
mModule
.
getName
()
+
". Would you like to install it?"
).
setPositiveButton
(
"Yes"
,
dialogClickListener
)
builder
.
setMessage
(
"An update is available for "
+
mModule
.
getName
()
+
". Would you like to install it?"
).
setPositiveButton
(
"Yes"
,
dialogClickListener
)
.
setNegativeButton
(
"No"
,
dialogClickListener
).
show
();
.
setNegativeButton
(
"No"
,
dialogClickListener
).
show
();
mListToUpdate
.
remove
(
mModule
);
mListToUpdate
.
remove
(
mModule
);
...
...
app/src/main/java/com/topjohnwu/magisk/ReposFragment.java
View file @
7b8237af
...
@@ -4,6 +4,7 @@ import android.app.Fragment;
...
@@ -4,6 +4,7 @@ import android.app.Fragment;
import
android.content.DialogInterface
;
import
android.content.DialogInterface
;
import
android.os.AsyncTask
;
import
android.os.AsyncTask
;
import
android.os.Bundle
;
import
android.os.Bundle
;
import
android.preference.PreferenceManager
;
import
android.support.annotation.Nullable
;
import
android.support.annotation.Nullable
;
import
android.support.v4.widget.SwipeRefreshLayout
;
import
android.support.v4.widget.SwipeRefreshLayout
;
import
android.support.v7.app.AlertDialog
;
import
android.support.v7.app.AlertDialog
;
...
@@ -17,6 +18,7 @@ import android.widget.TextView;
...
@@ -17,6 +18,7 @@ import android.widget.TextView;
import
com.topjohnwu.magisk.module.Repo
;
import
com.topjohnwu.magisk.module.Repo
;
import
com.topjohnwu.magisk.module.RepoHelper
;
import
com.topjohnwu.magisk.module.RepoHelper
;
import
com.topjohnwu.magisk.utils.Async
;
import
com.topjohnwu.magisk.utils.Async
;
import
com.topjohnwu.magisk.utils.Logger
;
import
com.topjohnwu.magisk.utils.Utils
;
import
com.topjohnwu.magisk.utils.Utils
;
import
java.io.File
;
import
java.io.File
;
...
@@ -42,6 +44,7 @@ public class ReposFragment extends Fragment {
...
@@ -42,6 +44,7 @@ public class ReposFragment extends Fragment {
private
boolean
alertUpdate
;
private
boolean
alertUpdate
;
private
boolean
ignoreAlertUpdate
;
private
boolean
ignoreAlertUpdate
;
private
String
alertPackage
;
private
String
alertPackage
;
private
AlertDialog
.
Builder
builder
;
// private SharedPreferences prefs;
// private SharedPreferences prefs;
@Nullable
@Nullable
...
@@ -132,10 +135,17 @@ public class ReposFragment extends Fragment {
...
@@ -132,10 +135,17 @@ public class ReposFragment extends Fragment {
}
}
};
};
AlertDialog
.
Builder
builder
=
new
AlertDialog
.
Builder
(
getActivity
());
String
theme
=
PreferenceManager
.
getDefaultSharedPreferences
(
getActivity
()).
getString
(
"theme"
,
""
);
builder
.
setMessage
(
"An update is available for "
+
repo
.
getName
()
+
". Would you like to install it?"
).
setPositiveButton
(
"Yes"
,
dialogClickListener
)
Logger
.
dh
(
"ReposFragment: Theme is "
+
theme
);
.
setNegativeButton
(
"No"
,
dialogClickListener
).
show
();
if
(
theme
.
equals
(
"Dark"
))
{
iterRepo
.
remove
();
builder
=
new
AlertDialog
.
Builder
(
getActivity
(),
R
.
style
.
AlertDialog_dh
);
}
else
{
builder
=
new
AlertDialog
.
Builder
(
getActivity
());
}
builder
.
setMessage
(
"An update is available for "
+
repo
.
getName
()
+
". Would you like to install it?"
).
setPositiveButton
(
"Yes"
,
dialogClickListener
)
.
setNegativeButton
(
"No"
,
dialogClickListener
).
show
();
iterRepo
.
remove
();
}
}
}
}
...
...
app/src/main/java/com/topjohnwu/magisk/utils/Async.java
View file @
7b8237af
...
@@ -5,6 +5,7 @@ import android.content.ContentResolver;
...
@@ -5,6 +5,7 @@ import android.content.ContentResolver;
import
android.content.Context
;
import
android.content.Context
;
import
android.net.Uri
;
import
android.net.Uri
;
import
android.os.AsyncTask
;
import
android.os.AsyncTask
;
import
android.preference.PreferenceManager
;
import
android.support.v7.app.AlertDialog
;
import
android.support.v7.app.AlertDialog
;
import
android.util.Log
;
import
android.util.Log
;
import
android.widget.Toast
;
import
android.widget.Toast
;
...
@@ -388,7 +389,14 @@ public class Async {
...
@@ -388,7 +389,14 @@ public class Async {
}
}
protected
void
done
()
{
protected
void
done
()
{
new
AlertDialog
.
Builder
(
mContext
)
AlertDialog
.
Builder
builder
;
String
theme
=
PreferenceManager
.
getDefaultSharedPreferences
(
mContext
).
getString
(
"theme"
,
""
);
if
(
theme
.
equals
(
"Dark"
))
{
builder
=
new
AlertDialog
.
Builder
(
mContext
,
R
.
style
.
AlertDialog_dh
);
}
else
{
builder
=
new
AlertDialog
.
Builder
(
mContext
);
}
builder
.
setTitle
(
R
.
string
.
reboot_title
)
.
setTitle
(
R
.
string
.
reboot_title
)
.
setMessage
(
R
.
string
.
reboot_msg
)
.
setMessage
(
R
.
string
.
reboot_msg
)
.
setPositiveButton
(
R
.
string
.
reboot
,
(
dialogInterface1
,
i
)
->
Shell
.
su
(
"reboot"
))
.
setPositiveButton
(
R
.
string
.
reboot
,
(
dialogInterface1
,
i
)
->
Shell
.
su
(
"reboot"
))
...
...
app/src/main/java/com/topjohnwu/magisk/utils/WebWindow.java
View file @
7b8237af
package
com
.
topjohnwu
.
magisk
.
utils
;
package
com
.
topjohnwu
.
magisk
.
utils
;
import
android.content.Context
;
import
android.content.Context
;
import
android.preference.PreferenceManager
;
import
android.support.v7.app.AlertDialog
;
import
android.support.v7.app.AlertDialog
;
import
android.webkit.WebResourceRequest
;
import
android.webkit.WebResourceRequest
;
import
android.webkit.WebView
;
import
android.webkit.WebView
;
import
android.webkit.WebViewClient
;
import
android.webkit.WebViewClient
;
import
com.topjohnwu.magisk.R
;
public
class
WebWindow
{
public
class
WebWindow
{
public
WebWindow
(
String
title
,
String
url
,
Context
context
)
{
public
WebWindow
(
String
title
,
String
url
,
Context
context
)
{
AlertDialog
.
Builder
alert
=
new
AlertDialog
.
Builder
(
context
);
AlertDialog
.
Builder
alert
;
String
theme
=
PreferenceManager
.
getDefaultSharedPreferences
(
context
).
getString
(
"theme"
,
""
);
if
(
theme
.
equals
(
"Dark"
))
{
alert
=
new
AlertDialog
.
Builder
(
context
,
R
.
style
.
AlertDialog_dh
);
}
else
{
alert
=
new
AlertDialog
.
Builder
(
context
);
}
alert
.
setTitle
(
title
);
alert
.
setTitle
(
title
);
WebView
wv
=
new
WebView
(
context
);
WebView
wv
=
new
WebView
(
context
);
...
...
app/src/main/res/layout/activity_about.xml
View file @
7b8237af
...
@@ -26,6 +26,7 @@
...
@@ -26,6 +26,7 @@
android:layout_height=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_gravity=
"center"
android:layout_gravity=
"center"
android:layout_marginBottom=
"8dp"
android:layout_marginBottom=
"8dp"
style=
"?attr/cardStyle"
app:cardUseCompatPadding=
"true"
>
app:cardUseCompatPadding=
"true"
>
<LinearLayout
<LinearLayout
...
@@ -100,6 +101,7 @@
...
@@ -100,6 +101,7 @@
android:layout_height=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_gravity=
"center"
android:layout_gravity=
"center"
android:layout_marginBottom=
"8dp"
android:layout_marginBottom=
"8dp"
style=
"?attr/cardStyle"
app:cardUseCompatPadding=
"true"
>
app:cardUseCompatPadding=
"true"
>
<com.topjohnwu.magisk.utils.RowItem
<com.topjohnwu.magisk.utils.RowItem
...
...
app/src/main/res/values/styles.xml
View file @
7b8237af
...
@@ -38,7 +38,8 @@
...
@@ -38,7 +38,8 @@
<item
name=
"android:statusBarColor"
>
@android:color/transparent
</item>
<item
name=
"android:statusBarColor"
>
@android:color/transparent
</item>
<item
name=
"android:textColorPrimary"
>
@color/dh_primary_text
</item>
<item
name=
"android:textColorPrimary"
>
@color/dh_primary_text
</item>
<item
name=
"android:textColorSecondary"
>
@color/dh_primary_text
</item>
<item
name=
"android:textColorSecondary"
>
@color/dh_primary_text
</item>
<item
name=
"android:alertDialogTheme"
>
@style/YourAlertDialogTheme
</item>
<item
name=
"android:alertDialogTheme"
>
@style/AlertDialog.dh
</item>
<item
name=
"android:dialogTheme"
>
@style/AlertDialog.dh
</item>
<item
name=
"ColorOK"
>
@color/dh_alertOk
</item>
<item
name=
"ColorOK"
>
@color/dh_alertOk
</item>
<item
name=
"ColorWarn"
>
@color/dh_alertWarn
</item>
<item
name=
"ColorWarn"
>
@color/dh_alertWarn
</item>
<item
name=
"ColorFail"
>
@color/dh_alertFail
</item>
<item
name=
"ColorFail"
>
@color/dh_alertFail
</item>
...
@@ -60,18 +61,50 @@
...
@@ -60,18 +61,50 @@
</style>
</style>
<style
name=
"
YourAlertDialogTheme
"
>
<style
name=
"
AlertDialog.dh"
parent=
"ThemeOverlay.AppCompat.Dark
"
>
<item
name=
"android:textColor"
>
@color/dh_primary_text
</item>
<item
name=
"android:textColor"
>
@color/dh_primary_text
</item>
<item
name=
"android:textColorSecondary"
>
@color/dh_primary_text
</item>
<item
name=
"android:textColorSecondary"
>
@color/dh_primary_text
</item>
<item
name=
"colorAccent"
>
@color/dh_accent
</item>
<item
name=
"android:textColorPrimary"
>
@color/dh_primary_text
</item>
<item
name=
"android:background"
>
@android:color/background_dark
</item>
<item
name=
"android:textColorAlertDialogListItem"
>
@color/dh_primary_text
</item>
<item
name=
"android:windowContentOverlay"
>
@null
</item>
<item
name=
"android:windowContentOverlay"
>
@null
</item>
<item
name=
"android:windowIsFloating"
>
true
</item>
<item
name=
"android:windowIsFloating"
>
true
</item>
<item
name=
"android:windowAnimationStyle"
>
@android:style/Animation.Dialog
</item>
<item
name=
"android:windowAnimationStyle"
>
@android:style/Animation.Dialog
</item>
<item
name=
"android:windowMinWidthMajor"
>
@android:dimen/dialog_min_width_major
</item>
<item
name=
"android:windowMinWidthMajor"
>
@android:dimen/dialog_min_width_major
</item>
<item
name=
"android:windowTitleStyle"
>
@style/MyTitleTextStyle
</item>
<item
name=
"android:windowMinWidthMinor"
>
@android:dimen/dialog_min_width_minor
</item>
<item
name=
"android:windowMinWidthMinor"
>
@android:dimen/dialog_min_width_minor
</item>
<item
name=
"android:alertDialogStyle"
>
@style/ListPrefAlertDialogStyle
</item>
<item
name=
"android:windowBackground"
>
@android:color/transparent
</item>
<item
name=
"android:textAppearanceMedium"
>
@style/MyAlertTextAppearance
</item>
</style>
<style
name=
"MyAlertTextAppearance"
>
<!-- Set text size and color of title and message here -->
<item
name=
"android:textColor"
>
@color/dh_primary_text
</item>
</style>
</style>
<style
name=
"ListPrefAlertDialogStyle"
>
<item
name=
"android:fullDark"
>
@android:color/transparent
</item>
<item
name=
"android:topDark"
>
@android:color/transparent
</item>
<item
name=
"android:centerDark"
>
@android:color/transparent
</item>
<item
name=
"android:bottomDark"
>
@android:color/transparent
</item>
<item
name=
"android:fullBright"
>
@android:color/transparent
</item>
<item
name=
"android:topBright"
>
@android:color/transparent
</item>
<item
name=
"android:centerBright"
>
@android:color/transparent
</item>
<item
name=
"android:bottomBright"
>
@android:color/transparent
</item>
<item
name=
"android:bottomMedium"
>
@android:color/transparent
</item>
<item
name=
"android:centerMedium"
>
@android:color/transparent
</item>
</style>
<style
name=
"MyTitleTextStyle"
>
<item
name=
"android:textColor"
>
@color/dh_primary_text
</item>
<item
name=
"android:textAppearance"
>
@style/TextAppearance.AppCompat.Title
</item>
</style>
<style
name=
"CardViewStyle.Light"
parent=
"CardView"
>
<style
name=
"CardViewStyle.Light"
parent=
"CardView"
>
<item
name=
"cardBackgroundColor"
>
@android:color/background_light
</item>
<item
name=
"cardBackgroundColor"
>
@android:color/background_light
</item>
</style>
</style>
...
...
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