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
7ae8c26e
Commit
7ae8c26e
authored
Aug 30, 2018
by
topjohnwu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Improve About and Donation page
parent
adfffe61
Hide whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
187 additions
and
54 deletions
+187
-54
AndroidManifest.xml
app/src/full/AndroidManifest.xml
+3
-0
AboutActivity.java
app/src/full/java/com/topjohnwu/magisk/AboutActivity.java
+4
-10
Const.java
app/src/full/java/com/topjohnwu/magisk/Const.java
+3
-1
DonationActivity.java
app/src/full/java/com/topjohnwu/magisk/DonationActivity.java
+45
-0
MainActivity.java
app/src/full/java/com/topjohnwu/magisk/MainActivity.java
+7
-0
AboutCardRow.java
...ll/java/com/topjohnwu/magisk/components/AboutCardRow.java
+12
-20
ic_patreon.xml
app/src/full/res/drawable/ic_patreon.xml
+9
-0
ic_paypal.xml
app/src/full/res/drawable/ic_paypal.xml
+9
-0
ic_twitter.xml
app/src/full/res/drawable/ic_twitter.xml
+9
-0
activity_about.xml
app/src/full/res/layout/activity_about.xml
+7
-23
info_item_row.xml
app/src/full/res/layout/info_item_row.xml
+1
-0
drawer.xml
app/src/full/res/menu/drawer.xml
+12
-0
strings.xml
app/src/full/res/values/strings.xml
+1
-0
activity_donation.xml
app/src/main/res/layout/activity_donation.xml
+65
-0
No files found.
app/src/full/AndroidManifest.xml
View file @
7ae8c26e
...
...
@@ -28,6 +28,9 @@
<activity
android:name=
".AboutActivity"
android:theme=
"@style/AppTheme.StatusBar"
/>
<activity
android:name=
".DonationActivity"
android:theme=
"@style/AppTheme.StatusBar"
/>
<activity
android:name=
".FlashActivity"
android:configChanges=
"keyboardHidden|orientation|screenSize"
...
...
app/src/full/java/com/topjohnwu/magisk/AboutActivity.java
View file @
7ae8c26e
...
...
@@ -26,7 +26,7 @@ public class AboutActivity extends BaseActivity {
@BindView
(
R
.
id
.
app_translators
)
AboutCardRow
appTranslators
;
@BindView
(
R
.
id
.
app_source_code
)
AboutCardRow
appSourceCode
;
@BindView
(
R
.
id
.
support_thread
)
AboutCardRow
supportThread
;
@BindView
(
R
.
id
.
donation
)
AboutCardRow
donation
;
@BindView
(
R
.
id
.
follow_twitter
)
AboutCardRow
twitter
;
@Override
public
int
getDarkTheme
()
{
...
...
@@ -51,7 +51,6 @@ public class AboutActivity extends BaseActivity {
appVersionInfo
.
setSummary
(
String
.
format
(
Locale
.
US
,
"%s (%d) (%s)"
,
BuildConfig
.
VERSION_NAME
,
BuildConfig
.
VERSION_CODE
,
getPackageName
()));
appChangelog
.
removeSummary
();
appChangelog
.
setOnClickListener
(
v
->
{
new
MarkDownWindow
(
this
,
getString
(
R
.
string
.
app_changelog
),
getResources
().
openRawResource
(
R
.
raw
.
changelog
)).
exec
();
...
...
@@ -64,14 +63,9 @@ public class AboutActivity extends BaseActivity {
appTranslators
.
setSummary
(
translators
);
}
appSourceCode
.
removeSummary
();
appSourceCode
.
setOnClickListener
(
view
->
Utils
.
openLink
(
this
,
Uri
.
parse
(
Const
.
Url
.
SOURCE_CODE_URL
)));
supportThread
.
removeSummary
();
supportThread
.
setOnClickListener
(
view
->
Utils
.
openLink
(
this
,
Uri
.
parse
(
Const
.
Url
.
XDA_THREAD
)));
donation
.
removeSummary
();
donation
.
setOnClickListener
(
view
->
Utils
.
openLink
(
this
,
Uri
.
parse
(
Const
.
Url
.
DONATION_URL
)));
appSourceCode
.
setOnClickListener
(
v
->
Utils
.
openLink
(
this
,
Uri
.
parse
(
Const
.
Url
.
SOURCE_CODE_URL
)));
supportThread
.
setOnClickListener
(
v
->
Utils
.
openLink
(
this
,
Uri
.
parse
(
Const
.
Url
.
XDA_THREAD
)));
twitter
.
setOnClickListener
(
v
->
Utils
.
openLink
(
this
,
Uri
.
parse
(
Const
.
Url
.
TWITTER_URL
)));
setFloating
();
}
...
...
app/src/full/java/com/topjohnwu/magisk/Const.java
View file @
7ae8c26e
...
...
@@ -78,7 +78,9 @@ public class Const {
public
static
final
String
REPO_URL
=
"https://api.github.com/users/Magisk-Modules-Repo/repos?per_page=100&sort=pushed&page=%d"
;
public
static
final
String
FILE_URL
=
"https://raw.githubusercontent.com/Magisk-Modules-Repo/%s/master/%s"
;
public
static
final
String
ZIP_URL
=
"https://github.com/Magisk-Modules-Repo/%s/archive/master.zip"
;
public
static
final
String
DONATION_URL
=
"https://www.paypal.me/topjohnwu"
;
public
static
final
String
PAYPAL_URL
=
"https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=CC7FZ7526MNGG"
;
public
static
final
String
PATREON_URL
=
"https://www.patreon.com/topjohnwu"
;
public
static
final
String
TWITTER_URL
=
"https://twitter.com/topjohnwu"
;
public
static
final
String
XDA_THREAD
=
"http://forum.xda-developers.com/showthread.php?t=3432382"
;
public
static
final
String
SOURCE_CODE_URL
=
"https://github.com/topjohnwu/Magisk"
;
}
...
...
app/src/full/java/com/topjohnwu/magisk/DonationActivity.java
0 → 100644
View file @
7ae8c26e
package
com
.
topjohnwu
.
magisk
;
import
android.net.Uri
;
import
android.os.Bundle
;
import
android.support.annotation.Nullable
;
import
android.support.v7.app.ActionBar
;
import
android.support.v7.widget.Toolbar
;
import
com.topjohnwu.magisk.components.AboutCardRow
;
import
com.topjohnwu.magisk.components.BaseActivity
;
import
com.topjohnwu.magisk.utils.Utils
;
import
butterknife.BindView
;
import
butterknife.ButterKnife
;
public
class
DonationActivity
extends
BaseActivity
{
@BindView
(
R
.
id
.
toolbar
)
Toolbar
toolbar
;
@BindView
(
R
.
id
.
paypal
)
AboutCardRow
paypal
;
@BindView
(
R
.
id
.
patreon
)
AboutCardRow
patreon
;
@Override
public
int
getDarkTheme
()
{
return
R
.
style
.
AppTheme_StatusBar_Dark
;
}
@Override
protected
void
onCreate
(
@Nullable
Bundle
savedInstanceState
)
{
super
.
onCreate
(
savedInstanceState
);
setContentView
(
R
.
layout
.
activity_donation
);
ButterKnife
.
bind
(
this
);
setSupportActionBar
(
toolbar
);
toolbar
.
setNavigationOnClickListener
(
view
->
finish
());
ActionBar
ab
=
getSupportActionBar
();
if
(
ab
!=
null
)
{
ab
.
setTitle
(
R
.
string
.
donation
);
ab
.
setDisplayHomeAsUpEnabled
(
true
);
}
paypal
.
setOnClickListener
(
v
->
Utils
.
openLink
(
this
,
Uri
.
parse
(
Const
.
Url
.
PAYPAL_URL
)));
patreon
.
setOnClickListener
(
v
->
Utils
.
openLink
(
this
,
Uri
.
parse
(
Const
.
Url
.
PATREON_URL
)));
}
}
app/src/full/java/com/topjohnwu/magisk/MainActivity.java
View file @
7ae8c26e
...
...
@@ -160,6 +160,9 @@ public class MainActivity extends BaseActivity
case
"about"
:
itemId
=
R
.
id
.
app_about
;
break
;
case
"donation"
:
itemId
=
R
.
id
.
donation
;
break
;
}
}
navigate
(
itemId
);
...
...
@@ -196,6 +199,10 @@ public class MainActivity extends BaseActivity
startActivity
(
new
Intent
(
this
,
AboutActivity
.
class
));
mDrawerItem
=
bak
;
break
;
case
R
.
id
.
donation
:
startActivity
(
new
Intent
(
this
,
DonationActivity
.
class
));
mDrawerItem
=
bak
;
break
;
}
}
...
...
app/src/full/java/com/topjohnwu/magisk/components/AboutCardRow.java
View file @
7ae8c26e
...
...
@@ -28,19 +28,18 @@ import android.widget.TextView;
import
com.topjohnwu.magisk.R
;
import
butterknife.BindView
;
import
butterknife.ButterKnife
;
/**
* @author dvdandroid
*/
public
class
AboutCardRow
extends
LinearLayout
{
private
final
String
title
;
private
final
Drawable
icon
;
private
final
TextView
mTitle
;
private
final
TextView
mSummary
;
private
final
ImageView
mIcon
;
private
final
View
mView
;
@BindView
(
android
.
R
.
id
.
title
)
TextView
mTitle
;
@BindView
(
android
.
R
.
id
.
summary
)
TextView
mSummary
;
@BindView
(
android
.
R
.
id
.
icon
)
ImageView
mIcon
;
@BindView
(
R
.
id
.
container
)
View
mView
;
public
AboutCardRow
(
Context
context
)
{
this
(
context
,
null
);
...
...
@@ -53,21 +52,17 @@ public class AboutCardRow extends LinearLayout {
public
AboutCardRow
(
Context
context
,
AttributeSet
attrs
,
int
defStyleAttr
)
{
super
(
context
,
attrs
,
defStyleAttr
);
LayoutInflater
.
from
(
context
).
inflate
(
R
.
layout
.
info_item_row
,
this
);
TypedArray
a
=
context
.
getTheme
().
obtainStyledAttributes
(
attrs
,
R
.
styleable
.
AboutCardRow
,
0
,
0
);
ButterKnife
.
bind
(
this
,
this
);
TypedArray
a
=
context
.
getTheme
().
obtainStyledAttributes
(
attrs
,
R
.
styleable
.
AboutCardRow
,
0
,
0
);
String
title
;
Drawable
icon
;
try
{
title
=
a
.
getString
(
R
.
styleable
.
AboutCardRow_text
);
icon
=
a
.
getDrawable
(
R
.
styleable
.
AboutCardRow_icon
);
}
finally
{
a
.
recycle
();
}
mView
=
findViewById
(
R
.
id
.
container
);
mTitle
=
(
TextView
)
findViewById
(
android
.
R
.
id
.
title
);
mSummary
=
(
TextView
)
findViewById
(
android
.
R
.
id
.
summary
);
mIcon
=
(
ImageView
)
findViewById
(
android
.
R
.
id
.
icon
);
mTitle
.
setText
(
title
);
mIcon
.
setImageDrawable
(
icon
);
}
...
...
@@ -80,10 +75,7 @@ public class AboutCardRow extends LinearLayout {
}
public
void
setSummary
(
String
s
)
{
mSummary
.
setVisibility
(
VISIBLE
);
mSummary
.
setText
(
s
);
}
public
void
removeSummary
()
{
mSummary
.
setVisibility
(
GONE
);
}
}
\ No newline at end of file
app/src/full/res/drawable/ic_patreon.xml
0 → 100644
View file @
7ae8c26e
<vector
xmlns:android=
"http://schemas.android.com/apk/res/android"
android:width=
"24dp"
android:height=
"24dp"
android:viewportWidth=
"24"
android:viewportHeight=
"24"
>
<path
android:fillColor=
"#FF000000"
android:pathData=
"M15.386,0.524c-4.764,0 -8.64,3.876 -8.64,8.64 0,4.75 3.876,8.613 8.64,8.613 4.75,0 8.614,-3.864 8.614,-8.613C24,4.4 20.136,0.524 15.386,0.524M0.003,23.537h4.22V0.524H0.003"
/>
</vector>
app/src/full/res/drawable/ic_paypal.xml
0 → 100644
View file @
7ae8c26e
<vector
xmlns:android=
"http://schemas.android.com/apk/res/android"
android:width=
"24dp"
android:height=
"24dp"
android:viewportWidth=
"24"
android:viewportHeight=
"24"
>
<path
android:fillColor=
"#FF000000"
android:pathData=
"M6.908,24L3.804,24c-0.664,0 -1.086,-0.529 -0.936,-1.18l0.149,-0.674h2.071c0.666,0 1.336,-0.533 1.482,-1.182l1.064,-4.592c0.15,-0.648 0.816,-1.18 1.48,-1.18h0.883c3.789,0 6.734,-0.779 8.84,-2.34s3.16,-3.6 3.16,-6.135c0,-1.125 -0.195,-2.055 -0.588,-2.789 0,-0.016 -0.016,-0.031 -0.016,-0.046l0.135,0.075c0.75,0.465 1.32,1.064 1.711,1.814 0.404,0.75 0.598,1.68 0.598,2.791 0,2.535 -1.049,4.574 -3.164,6.135 -2.1,1.545 -5.055,2.324 -8.834,2.324h-0.9c-0.66,0 -1.334,0.525 -1.484,1.186L8.39,22.812c-0.149,0.645 -0.81,1.17 -1.47,1.17L6.908,24zM4.231,21.305L1.126,21.305c-0.663,0 -1.084,-0.529 -0.936,-1.18L4.563,1.182C4.714,0.529 5.378,0 6.044,0h6.465c1.395,0 2.609,0.098 3.648,0.289 1.035,0.189 1.92,0.519 2.684,0.99 0.736,0.465 1.322,1.072 1.697,1.818 0.389,0.748 0.584,1.68 0.584,2.797 0,2.535 -1.051,4.574 -3.164,6.119 -2.1,1.561 -5.056,2.326 -8.836,2.326h-0.883c-0.66,0 -1.328,0.524 -1.478,1.169L5.7,20.097c-0.149,0.646 -0.817,1.172 -1.485,1.172l0.016,0.036zM11.677,3.936h-1.014c-0.666,0 -1.332,0.529 -1.48,1.178l-0.93,4.02c-0.15,0.648 0.27,1.179 0.93,1.179h0.766c1.664,0 2.97,-0.343 3.9,-1.021 0.929,-0.686 1.395,-1.654 1.395,-2.912 0,-0.83 -0.301,-1.445 -0.9,-1.84 -0.6,-0.404 -1.5,-0.605 -2.686,-0.605l0.019,0.001z"
/>
</vector>
app/src/full/res/drawable/ic_twitter.xml
0 → 100644
View file @
7ae8c26e
<vector
xmlns:android=
"http://schemas.android.com/apk/res/android"
android:width=
"24dp"
android:height=
"24dp"
android:viewportWidth=
"24"
android:viewportHeight=
"24"
>
<path
android:fillColor=
"#FF000000"
android:pathData=
"M23.954,4.569c-0.885,0.389 -1.83,0.654 -2.825,0.775 1.014,-0.611 1.794,-1.574 2.163,-2.723 -0.951,0.555 -2.005,0.959 -3.127,1.184 -0.896,-0.959 -2.173,-1.559 -3.591,-1.559 -2.717,0 -4.92,2.203 -4.92,4.917 0,0.39 0.045,0.765 0.127,1.124C7.691,8.094 4.066,6.13 1.64,3.161c-0.427,0.722 -0.666,1.561 -0.666,2.475 0,1.71 0.87,3.213 2.188,4.096 -0.807,-0.026 -1.566,-0.248 -2.228,-0.616v0.061c0,2.385 1.693,4.374 3.946,4.827 -0.413,0.111 -0.849,0.171 -1.296,0.171 -0.314,0 -0.615,-0.03 -0.916,-0.086 0.631,1.953 2.445,3.377 4.604,3.417 -1.68,1.319 -3.809,2.105 -6.102,2.105 -0.39,0 -0.779,-0.023 -1.17,-0.067 2.189,1.394 4.768,2.209 7.557,2.209 9.054,0 13.999,-7.496 13.999,-13.986 0,-0.209 0,-0.42 -0.015,-0.63 0.961,-0.689 1.8,-1.56 2.46,-2.548l-0.047,-0.02z"
/>
</vector>
app/src/full/res/layout/activity_about.xml
View file @
7ae8c26e
...
...
@@ -75,6 +75,13 @@
app:icon=
"@drawable/ic_language"
app:text=
"@string/app_translators"
/>
<com.topjohnwu.magisk.components.AboutCardRow
android:id=
"@+id/follow_twitter"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
app:icon=
"@drawable/ic_twitter"
app:text=
"@string/follow_twitter"
/>
<com.topjohnwu.magisk.components.AboutCardRow
android:id=
"@+id/app_source_code"
android:layout_width=
"match_parent"
...
...
@@ -82,22 +89,6 @@
app:icon=
"@drawable/ic_github"
app:text=
"@string/app_source_code"
/>
</LinearLayout>
</android.support.v7.widget.CardView>
<android.support.v7.widget.CardView
android:layout_width=
"fill_parent"
android:layout_height=
"wrap_content"
android:layout_gravity=
"center"
style=
"?attr/cardStyle"
app:cardUseCompatPadding=
"true"
>
<LinearLayout
android:layout_width=
"fill_parent"
android:layout_height=
"wrap_content"
android:orientation=
"vertical"
>
<com.topjohnwu.magisk.components.AboutCardRow
android:id=
"@+id/support_thread"
android:layout_width=
"match_parent"
...
...
@@ -105,13 +96,6 @@
app:icon=
"@drawable/ic_xda"
app:text=
"@string/support_thread"
/>
<com.topjohnwu.magisk.components.AboutCardRow
android:id=
"@+id/donation"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
app:icon=
"@drawable/ic_attach_money"
app:text=
"@string/donation"
/>
</LinearLayout>
</android.support.v7.widget.CardView>
...
...
app/src/full/res/layout/info_item_row.xml
View file @
7ae8c26e
...
...
@@ -49,6 +49,7 @@
<TextView
android:id=
"@android:id/summary"
android:visibility=
"gone"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:textAppearance=
"@style/TextAppearance.AppCompat.Caption"
/>
...
...
app/src/full/res/menu/drawer.xml
View file @
7ae8c26e
...
...
@@ -52,12 +52,24 @@
android:icon=
"@drawable/ic_settings"
android:title=
"@string/settings"
/>
</group>
<group
android:checkableBehavior=
"single"
android:id=
"@+id/forth_group"
>
<item
android:checkable=
"false"
android:id=
"@+id/app_about"
android:icon=
"@drawable/ic_info_outline"
android:title=
"@string/about"
/>
<item
android:checkable=
"false"
android:id=
"@+id/donation"
android:icon=
"@drawable/ic_attach_money"
android:title=
"@string/donation"
/>
</group>
</menu>
app/src/full/res/values/strings.xml
View file @
7ae8c26e
...
...
@@ -68,6 +68,7 @@
<string
name=
"donation"
>
Donation
</string>
<string
name=
"app_translators"
>
Translators
</string>
<string
name=
"support_thread"
>
Support thread
</string>
<string
name=
"follow_twitter"
>
Follow me on Twitter
</string>
<!--Toasts, Dialogs-->
<string
name=
"close"
>
Close
</string>
...
...
app/src/main/res/layout/activity_donation.xml
0 → 100644
View file @
7ae8c26e
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android=
"http://schemas.android.com/apk/res/android"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:orientation=
"vertical"
>
<include
layout=
"@layout/toolbar"
/>
<ScrollView
xmlns:app=
"http://schemas.android.com/apk/res-auto"
xmlns:tools=
"http://schemas.android.com/tools"
android:layout_width=
"fill_parent"
android:layout_height=
"wrap_content"
android:padding=
"8dp"
tools:ignore=
"UseCompoundDrawables,ContentDescription"
>
<LinearLayout
android:id=
"@android:id/content"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:orientation=
"vertical"
>
<android.support.v7.widget.CardView
android:layout_width=
"fill_parent"
android:layout_height=
"wrap_content"
android:layout_gravity=
"center"
style=
"?attr/cardStyle"
app:cardUseCompatPadding=
"true"
>
<LinearLayout
android:layout_width=
"fill_parent"
android:layout_height=
"wrap_content"
android:orientation=
"vertical"
>
<TextView
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_gravity=
"center"
android:padding=
"16dp"
android:text=
"@string/donation"
android:textAppearance=
"@style/TextAppearance.AppCompat.Headline"
/>
<com.topjohnwu.magisk.components.AboutCardRow
android:id=
"@+id/paypal"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
app:icon=
"@drawable/ic_paypal"
app:text=
"PayPal"
/>
<com.topjohnwu.magisk.components.AboutCardRow
android:id=
"@+id/patreon"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
app:icon=
"@drawable/ic_patreon"
app:text=
"Patreon"
/>
</LinearLayout>
</android.support.v7.widget.CardView>
</LinearLayout>
</ScrollView>
</LinearLayout>
\ 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