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
5cb3e593
Commit
5cb3e593
authored
Jul 28, 2018
by
darken
Committed by
John Wu
Jul 30, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update policy list when resuming the superuser fragment.
Closes #414
parent
e0cd2248
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
14 deletions
+23
-14
SuperuserFragment.java
...src/full/java/com/topjohnwu/magisk/SuperuserFragment.java
+23
-14
No files found.
app/src/full/java/com/topjohnwu/magisk/SuperuserFragment.java
View file @
5cb3e593
...
...
@@ -22,6 +22,8 @@ import butterknife.Unbinder;
public
class
SuperuserFragment
extends
Fragment
{
private
Unbinder
unbinder
;
private
PackageManager
pm
;
private
MagiskManager
mm
;
@BindView
(
R
.
id
.
recyclerView
)
RecyclerView
recyclerView
;
@BindView
(
R
.
id
.
empty_rv
)
TextView
emptyRv
;
...
...
@@ -31,20 +33,8 @@ public class SuperuserFragment extends Fragment {
View
view
=
inflater
.
inflate
(
R
.
layout
.
fragment_superuser
,
container
,
false
);
unbinder
=
ButterKnife
.
bind
(
this
,
view
);
PackageManager
pm
=
getActivity
().
getPackageManager
();
MagiskManager
mm
=
getApplication
();
List
<
Policy
>
policyList
=
mm
.
mDB
.
getPolicyList
(
pm
);
if
(
policyList
.
size
()
==
0
)
{
emptyRv
.
setVisibility
(
View
.
VISIBLE
);
recyclerView
.
setVisibility
(
View
.
GONE
);
}
else
{
recyclerView
.
setAdapter
(
new
PolicyAdapter
(
policyList
,
mm
.
mDB
,
pm
));
emptyRv
.
setVisibility
(
View
.
GONE
);
recyclerView
.
setVisibility
(
View
.
VISIBLE
);
}
pm
=
getActivity
().
getPackageManager
();
mm
=
getApplication
();
return
view
;
}
...
...
@@ -54,10 +44,29 @@ public class SuperuserFragment extends Fragment {
getActivity
().
setTitle
(
getString
(
R
.
string
.
superuser
));
}
@Override
public
void
onResume
()
{
super
.
onResume
();
displayPolicyList
();
}
@Override
public
void
onDestroyView
()
{
super
.
onDestroyView
();
unbinder
.
unbind
();
}
private
void
displayPolicyList
()
{
List
<
Policy
>
policyList
=
mm
.
mDB
.
getPolicyList
(
pm
);
if
(
policyList
.
size
()
==
0
)
{
emptyRv
.
setVisibility
(
View
.
VISIBLE
);
recyclerView
.
setVisibility
(
View
.
GONE
);
}
else
{
recyclerView
.
setAdapter
(
new
PolicyAdapter
(
policyList
,
mm
.
mDB
,
pm
));
emptyRv
.
setVisibility
(
View
.
GONE
);
recyclerView
.
setVisibility
(
View
.
VISIBLE
);
}
}
}
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