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
9e723173
Commit
9e723173
authored
Aug 05, 2018
by
tonymanou
Committed by
John Wu
Aug 06, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Ensure intent are resolved when opening link
parent
d764c20c
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
4 deletions
+12
-4
AboutActivity.java
app/src/full/java/com/topjohnwu/magisk/AboutActivity.java
+4
-4
Utils.java
app/src/full/java/com/topjohnwu/magisk/utils/Utils.java
+8
-0
No files found.
app/src/full/java/com/topjohnwu/magisk/AboutActivity.java
View file @
9e723173
package
com
.
topjohnwu
.
magisk
;
import
android.content.Intent
;
import
android.net.Uri
;
import
android.os.Bundle
;
import
android.support.annotation.Nullable
;
...
...
@@ -12,6 +11,7 @@ import android.view.View;
import
com.topjohnwu.magisk.asyncs.MarkDownWindow
;
import
com.topjohnwu.magisk.components.AboutCardRow
;
import
com.topjohnwu.magisk.components.BaseActivity
;
import
com.topjohnwu.magisk.utils.Utils
;
import
java.util.Locale
;
...
...
@@ -65,13 +65,13 @@ public class AboutActivity extends BaseActivity {
}
appSourceCode
.
removeSummary
();
appSourceCode
.
setOnClickListener
(
view
->
startActivity
(
new
Intent
(
Intent
.
ACTION_VIEW
,
Uri
.
parse
(
Const
.
Url
.
SOURCE_CODE_URL
)
)));
appSourceCode
.
setOnClickListener
(
view
->
Utils
.
openLink
(
this
,
Uri
.
parse
(
Const
.
Url
.
SOURCE_CODE_URL
)));
supportThread
.
removeSummary
();
supportThread
.
setOnClickListener
(
view
->
startActivity
(
new
Intent
(
Intent
.
ACTION_VIEW
,
Uri
.
parse
(
Const
.
Url
.
XDA_THREAD
)
)));
supportThread
.
setOnClickListener
(
view
->
Utils
.
openLink
(
this
,
Uri
.
parse
(
Const
.
Url
.
XDA_THREAD
)));
donation
.
removeSummary
();
donation
.
setOnClickListener
(
view
->
startActivity
(
new
Intent
(
Intent
.
ACTION_VIEW
,
Uri
.
parse
(
Const
.
Url
.
DONATION_URL
)
)));
donation
.
setOnClickListener
(
view
->
Utils
.
openLink
(
this
,
Uri
.
parse
(
Const
.
Url
.
DONATION_URL
)));
setFloating
();
}
...
...
app/src/full/java/com/topjohnwu/magisk/utils/Utils.java
View file @
9e723173
...
...
@@ -4,6 +4,7 @@ import android.app.job.JobInfo;
import
android.app.job.JobScheduler
;
import
android.content.ComponentName
;
import
android.content.Context
;
import
android.content.Intent
;
import
android.content.SharedPreferences
;
import
android.database.Cursor
;
import
android.net.Uri
;
...
...
@@ -88,6 +89,13 @@ public class Utils {
}
}
public
static
void
openLink
(
Context
context
,
Uri
link
)
{
Intent
intent
=
new
Intent
(
Intent
.
ACTION_VIEW
,
link
);
if
(
intent
.
resolveActivity
(
context
.
getPackageManager
())
!=
null
)
{
context
.
startActivity
(
intent
);
}
}
public
static
void
toast
(
CharSequence
msg
,
int
duration
)
{
Data
.
mainHandler
.
post
(()
->
Toast
.
makeText
(
Data
.
MM
(),
msg
,
duration
).
show
());
}
...
...
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