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
a44dc8df
Commit
a44dc8df
authored
Jan 22, 2019
by
topjohnwu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Migrate to ConstraintLayout (WIP)
parent
abf19aad
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
199 additions
and
163 deletions
+199
-163
PolicyAdapter.java
...ull/java/com/topjohnwu/magisk/adapters/PolicyAdapter.java
+0
-3
ExpandableView.java
.../java/com/topjohnwu/magisk/components/ExpandableView.java
+1
-2
list_item_app.xml
app/src/full/res/layout/list_item_app.xml
+51
-47
list_item_policy.xml
app/src/full/res/layout/list_item_policy.xml
+147
-111
No files found.
app/src/full/java/com/topjohnwu/magisk/adapters/PolicyAdapter.java
View file @
a44dc8df
...
...
@@ -129,9 +129,6 @@ public class PolicyAdapter extends RecyclerView.Adapter<PolicyAdapter.ViewHolder
.
setNegativeButton
(
R
.
string
.
no_thanks
,
null
)
.
setCancelable
(
true
)
.
show
());
// Hide for now
holder
.
moreInfo
.
setVisibility
(
View
.
GONE
);
}
@Override
...
...
app/src/full/java/com/topjohnwu/magisk/components/ExpandableView.java
View file @
a44dc8df
...
...
@@ -19,6 +19,7 @@ public interface ExpandableView {
default
void
setupExpandable
()
{
Container
container
=
getContainer
();
setExpanded
(
false
);
container
.
expandLayout
.
getViewTreeObserver
().
addOnPreDrawListener
(
new
ViewTreeObserver
.
OnPreDrawListener
()
{
...
...
@@ -32,7 +33,6 @@ public interface ExpandableView {
}
container
.
expandLayout
.
getViewTreeObserver
().
removeOnPreDrawListener
(
this
);
container
.
expandLayout
.
setVisibility
(
View
.
GONE
);
container
.
expandAnimator
=
slideAnimator
(
0
,
container
.
expandHeight
);
container
.
collapseAnimator
=
slideAnimator
(
container
.
expandHeight
,
0
);
return
true
;
...
...
@@ -51,7 +51,6 @@ public interface ExpandableView {
ViewGroup
.
LayoutParams
layoutParams
=
container
.
expandLayout
.
getLayoutParams
();
layoutParams
.
height
=
expanded
?
container
.
expandHeight
:
0
;
container
.
expandLayout
.
setLayoutParams
(
layoutParams
);
container
.
expandLayout
.
setVisibility
(
expanded
?
View
.
VISIBLE
:
View
.
GONE
);
}
default
void
expand
()
{
...
...
app/src/full/res/layout/list_item_app.xml
View file @
a44dc8df
<?xml version="1.0" encoding="utf-8"?>
<androidx.cardview.widget.CardView
xmlns:android=
"http://schemas.android.com/apk/res/android"
xmlns:card_view=
"http://schemas.android.com/apk/res-auto"
<androidx.cardview.widget.CardView
xmlns:android=
"http://schemas.android.com/apk/res/android"
xmlns:app=
"http://schemas.android.com/apk/res-auto"
style=
"?attr/cardStyle"
android:layout_width=
"fill_parent"
android:layout_height=
"wrap_content"
android:layout_gravity=
"center"
android:layout_marginBottom=
"@dimen/card_vertical_margin"
android:layout_marginEnd=
"@dimen/card_horizontal_margin"
android:layout_marginStart=
"@dimen/card_horizontal_margin"
android:layout_marginTop=
"@dimen/card_vertical_margin"
style=
"?attr/cardStyle"
android:layout_marginEnd=
"@dimen/card_horizontal_margin"
android:layout_marginBottom=
"@dimen/card_vertical_margin"
android:minHeight=
"?android:attr/listPreferredItemHeight"
card_view
:cardCornerRadius=
"@dimen/card_corner_radius"
card_view
:cardElevation=
"@dimen/card_elevation"
>
app
:cardCornerRadius=
"@dimen/card_corner_radius"
app
:cardElevation=
"@dimen/card_elevation"
>
<LinearLayout
android:orientation=
"horizontal"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
<androidx.constraintlayout.widget.ConstraintLayout
android:id=
"@+id/info_layout"
android:paddingStart=
"10dp"
android:paddingEnd=
"10dp"
android:paddingTop=
"5dp"
android:paddingBottom=
"5dp"
>
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
>
<ImageView
android:id=
"@+id/app_icon"
android:layout_width=
"50dp"
android:layout_height=
"50dp"
android:layout_gravity=
"center_vertical"
android:gravity=
"end"
/>
android:layout_marginStart=
"8dp"
android:layout_marginTop=
"8dp"
android:layout_marginEnd=
"8dp"
android:layout_marginBottom=
"8dp"
android:gravity=
"end"
app:layout_constraintBottom_toBottomOf=
"parent"
app:layout_constraintEnd_toStartOf=
"@+id/app_name"
app:layout_constraintStart_toStartOf=
"parent"
app:layout_constraintTop_toTopOf=
"parent"
/>
<
LinearLayout
android:
orientation=
"vertical
"
<
TextView
android:
id=
"@+id/app_name
"
android:layout_width=
"0dp"
android:layout_height=
"wrap_content"
android:layout_weight=
"1"
android:layout_gravity=
"center_vertical"
android:layout_marginStart=
"5dp"
android:layout_marginEnd=
"5dp"
>
<TextView
android:id=
"@+id/app_name"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:maxLines=
"1"
android:ellipsize=
"end"
android:textAppearance=
"?android:attr/textAppearanceMedium"
android:textIsSelectable=
"false"
/>
android:ellipsize=
"end"
android:maxLines=
"1"
android:textAppearance=
"?android:attr/textAppearanceMedium"
android:textIsSelectable=
"false"
app:layout_constraintBottom_toTopOf=
"@+id/package_name"
app:layout_constraintEnd_toStartOf=
"@+id/checkbox"
app:layout_constraintStart_toEndOf=
"@+id/app_icon"
app:layout_constraintTop_toTopOf=
"parent"
/>
<TextView
android:id=
"@+id/package_name"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:maxLines=
"1"
android:ellipsize=
"end"
android:textAppearance=
"?android:attr/textAppearanceSmall"
android:textColor=
"@android:color/tertiary_text_dark"
android:textIsSelectable=
"false"
/>
<TextView
android:id=
"@+id/package_name"
android:layout_width=
"0dp"
android:layout_height=
"wrap_content"
android:ellipsize=
"end"
android:maxLines=
"1"
android:textAppearance=
"?android:attr/textAppearanceSmall"
android:textColor=
"@android:color/tertiary_text_dark"
android:textIsSelectable=
"false"
app:layout_constraintBottom_toBottomOf=
"parent"
app:layout_constraintEnd_toEndOf=
"@+id/app_name"
app:layout_constraintStart_toStartOf=
"@+id/app_name"
app:layout_constraintTop_toBottomOf=
"@+id/app_name"
/>
</LinearLayout>
<CheckBox
android:id=
"@+id/checkbox"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginStart=
"5dp"
android:layout_marginEnd=
"5dp"
android:checked=
"false"
android:focusable=
"false"
android:layout_gravity=
"center_vertical"
app:srcCompat=
"@drawable/ic_menu_overflow_material"
android:checked=
"false"
/>
app:layout_constraintBottom_toBottomOf=
"parent"
app:layout_constraintEnd_toEndOf=
"parent"
app:layout_constraintStart_toEndOf=
"@+id/app_name"
app:layout_constraintTop_toTopOf=
"parent"
app:srcCompat=
"@drawable/ic_menu_overflow_material"
/>
</
Linear
Layout>
</
androidx.constraintlayout.widget.Constraint
Layout>
</androidx.cardview.widget.CardView>
...
...
app/src/full/res/layout/list_item_policy.xml
View file @
a44dc8df
This diff is collapsed.
Click to expand it.
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