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
e3948d29
Commit
e3948d29
authored
Mar 17, 2018
by
topjohnwu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update fragment transaction
parent
5f2c742a
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
17 deletions
+18
-17
build.gradle
build.gradle
+5
-5
MainActivity.java
src/main/java/com/topjohnwu/magisk/MainActivity.java
+13
-12
No files found.
build.gradle
View file @
e3948d29
...
...
@@ -7,7 +7,7 @@ android {
applicationId
"com.topjohnwu.magisk"
minSdkVersion
21
targetSdkVersion
27
versionCode
10
8
versionCode
10
9
versionName
"5.6.2"
javaCompileOptions
{
annotationProcessorOptions
{
...
...
@@ -46,10 +46,10 @@ dependencies {
implementation
fileTree
(
include:
[
'*.jar'
],
dir:
'libs'
)
implementation
project
(
':utils'
)
implementation
'com.github.topjohnwu:libsu:1.1.1'
implementation
'com.android.support:recyclerview-v7:27.
0.2
'
implementation
'com.android.support:cardview-v7:27.
0.2
'
implementation
'com.android.support:design:27.
0.2
'
implementation
'com.android.support:support-v4:27.
0.2
'
implementation
'com.android.support:recyclerview-v7:27.
1.0
'
implementation
'com.android.support:cardview-v7:27.
1.0
'
implementation
'com.android.support:design:27.
1.0
'
implementation
'com.android.support:support-v4:27.
1.0
'
implementation
'com.jakewharton:butterknife:8.8.1'
implementation
'com.atlassian.commonmark:commonmark:0.10.0'
implementation
'org.kamranzafar:jtar:2.3'
...
...
src/main/java/com/topjohnwu/magisk/MainActivity.java
View file @
e3948d29
...
...
@@ -190,22 +190,22 @@ public class MainActivity extends Activity
navigationView
.
setCheckedItem
(
itemId
);
switch
(
itemId
)
{
case
R
.
id
.
magisk
:
displayFragment
(
new
MagiskFragment
(),
"magisk"
,
true
);
displayFragment
(
new
MagiskFragment
(),
true
);
break
;
case
R
.
id
.
superuser
:
displayFragment
(
new
SuperuserFragment
(),
"superuser"
,
true
);
displayFragment
(
new
SuperuserFragment
(),
true
);
break
;
case
R
.
id
.
modules
:
displayFragment
(
new
ModulesFragment
(),
"modules"
,
true
);
displayFragment
(
new
ModulesFragment
(),
true
);
break
;
case
R
.
id
.
downloads
:
displayFragment
(
new
ReposFragment
(),
"downloads"
,
true
);
displayFragment
(
new
ReposFragment
(),
true
);
break
;
case
R
.
id
.
magiskhide
:
displayFragment
(
new
MagiskHideFragment
(),
Const
.
Key
.
MAGISKHIDE
,
true
);
displayFragment
(
new
MagiskHideFragment
(),
true
);
break
;
case
R
.
id
.
log
:
displayFragment
(
new
LogFragment
(),
"log"
,
false
);
displayFragment
(
new
LogFragment
(),
false
);
break
;
case
R
.
id
.
settings
:
startActivity
(
new
Intent
(
this
,
SettingsActivity
.
class
));
...
...
@@ -218,12 +218,13 @@ public class MainActivity extends Activity
}
}
private
void
displayFragment
(
@NonNull
Fragment
navFragment
,
String
tag
,
boolean
setElevation
)
{
FragmentTransaction
transaction
=
getSupportFragmentManager
().
beginTransaction
();
private
void
displayFragment
(
@NonNull
Fragment
navFragment
,
boolean
setElevation
)
{
supportInvalidateOptionsMenu
();
transaction
.
setCustomAnimations
(
android
.
R
.
anim
.
fade_in
,
android
.
R
.
anim
.
fade_out
);
transaction
.
replace
(
R
.
id
.
content_frame
,
navFragment
,
tag
).
commitNow
();
if
(
setElevation
)
toolbar
.
setElevation
(
toolbarElevation
);
else
toolbar
.
setElevation
(
0
);
getSupportFragmentManager
()
.
beginTransaction
()
.
setTransition
(
FragmentTransaction
.
TRANSIT_FRAGMENT_OPEN
)
.
replace
(
R
.
id
.
content_frame
,
navFragment
)
.
commitNow
();
toolbar
.
setElevation
(
setElevation
?
toolbarElevation
:
0
);
}
}
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