layout: update layouts with latest SDK

This commit is contained in:
PeratX 2019-10-23 13:34:21 +08:00
parent b5d1942368
commit c95b87b5a8
8 changed files with 58 additions and 78 deletions

View File

@ -25,7 +25,6 @@
android:layout_height="match_parent" android:layout_height="match_parent"
app:layout_behavior="@string/appbar_scrolling_view_behavior"> app:layout_behavior="@string/appbar_scrolling_view_behavior">
</androidx.recyclerview.widget.RecyclerView> </androidx.recyclerview.widget.RecyclerView>
</androidx.coordinatorlayout.widget.CoordinatorLayout> </androidx.coordinatorlayout.widget.CoordinatorLayout>

View File

@ -1,32 +1,28 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:gravity="center_vertical"> android:gravity="center_vertical">
<androidx.appcompat.widget.AppCompatImageView <androidx.appcompat.widget.AppCompatImageView
android:id="@+id/app_icon" android:id="@+id/app_icon"
android:layout_width="46dp" android:layout_width="46dp"
android:layout_height="46dp" android:layout_height="46dp"
android:paddingEnd="10dp" android:paddingEnd="10dp"
android:paddingLeft="14dp" android:paddingStart="14dp"/>
android:paddingRight="10dp"
android:paddingStart="14dp" />
<androidx.appcompat.widget.AppCompatTextView <androidx.appcompat.widget.AppCompatTextView
android:id="@+id/app_name" android:id="@+id/app_name"
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_weight="1.0" /> android:layout_weight="1.0"/>
<androidx.appcompat.widget.AppCompatCheckBox <androidx.appcompat.widget.AppCompatCheckBox
android:id="@+id/app_check" android:id="@+id/app_check"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:clickable="false" android:clickable="false"
android:paddingEnd="6dp" android:paddingEnd="6dp"
android:paddingLeft="2dp" android:paddingStart="2dp"/>
android:paddingRight="6dp"
android:paddingStart="2dp" />
</LinearLayout> </LinearLayout>

View File

@ -14,47 +14,39 @@
app:cardPreventCornerOverlap="true" app:cardPreventCornerOverlap="true"
android:id="@+id/cardView_indicator"> android:id="@+id/cardView_indicator">
<LinearLayout <RelativeLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:focusable="true" android:focusable="true"
android:orientation="vertical" android:orientation="vertical"
android:background="?android:attr/selectableItemBackground"> android:background="?android:attr/selectableItemBackground"
<RelativeLayout android:layout_marginStart="@dimen/margin_small">
<TextView
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginStart="@dimen/margin_small" android:padding="@dimen/margin_small"
android:layout_marginLeft="@dimen/margin_small"> android:id="@+id/textView_rule_name"
android:textAppearance="?android:attr/textAppearanceLarge"
<TextView android:layout_alignParentTop="true"
android:layout_width="match_parent" android:layout_alignParentStart="true"/>
android:layout_height="wrap_content" <TextView
android:padding="@dimen/margin_small" android:layout_width="match_parent"
android:id="@+id/textView_rule_name" android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceLarge" android:layout_below="@+id/textView_rule_name"
android:layout_alignParentTop="true" android:padding="@dimen/margin_small"
android:layout_alignParentLeft="true" android:id="@+id/textView_rule_detail"
android:layout_alignParentStart="true"/> android:textAppearance="?android:attr/textAppearanceSmall"
<TextView android:layout_alignParentBottom="true"
android:layout_width="match_parent" android:layout_alignParentStart="true"/>
android:layout_height="wrap_content" <TextView
android:layout_below="@+id/textView_rule_name" android:id="@+id/textView_rule_size"
android:padding="@dimen/margin_small" android:layout_width="wrap_content"
android:id="@+id/textView_rule_detail" android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceSmall" android:layout_gravity="bottom"
android:layout_alignParentBottom="true" android:padding="@dimen/margin_small"
android:layout_alignParentLeft="true" android:layout_alignParentEnd="true"
android:layout_alignParentStart="true"/> android:ellipsize="end"
<TextView android:id="@+id/textView_rule_size" android:textAppearance="?android:attr/textAppearanceSmall"/>
android:layout_width="wrap_content" </RelativeLayout>
android:layout_height="wrap_content"
android:layout_gravity="bottom"
android:padding="@dimen/margin_small"
android:layout_alignParentEnd="true"
android:layout_alignParentRight="true"
android:ellipsize="end"
android:textAppearance="?android:attr/textAppearanceSmall"/>
</RelativeLayout>
</LinearLayout>
</androidx.cardview.widget.CardView> </androidx.cardview.widget.CardView>
</FrameLayout> </FrameLayout>

View File

@ -5,6 +5,7 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_width="match_parent" android:layout_width="match_parent"
android:clickable="true" android:clickable="true"
android:focusable="true"
android:foreground="?attr/selectableItemBackground" android:foreground="?attr/selectableItemBackground"
app:cardCornerRadius="10dp" app:cardCornerRadius="10dp"
app:cardPreventCornerOverlap="true" app:cardPreventCornerOverlap="true"
@ -23,7 +24,6 @@
android:id="@+id/textView_custom_dns_name" android:id="@+id/textView_custom_dns_name"
android:textAppearance="?android:attr/textAppearanceLarge" android:textAppearance="?android:attr/textAppearanceLarge"
android:layout_alignParentTop="true" android:layout_alignParentTop="true"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"/> android:layout_alignParentStart="true"/>
<TextView <TextView
android:layout_width="match_parent" android:layout_width="match_parent"
@ -34,8 +34,7 @@
android:id="@+id/textView_custom_dns_address" android:id="@+id/textView_custom_dns_address"
android:textAppearance="?android:attr/textAppearanceSmall" android:textAppearance="?android:attr/textAppearanceSmall"
android:layout_alignParentBottom="true" android:layout_alignParentBottom="true"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"/> android:layout_alignParentStart="true"/>
</RelativeLayout> </RelativeLayout>
</androidx.cardview.widget.CardView> </androidx.cardview.widget.CardView>

View File

@ -11,7 +11,6 @@
android:layout_height="match_parent" android:layout_height="match_parent"
android:scrollbars="horizontal" android:scrollbars="horizontal"
android:layout_alignParentTop="true" android:layout_alignParentTop="true"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"/> android:layout_alignParentStart="true"/>
<com.google.android.material.floatingactionbutton.FloatingActionButton <com.google.android.material.floatingactionbutton.FloatingActionButton
@ -23,4 +22,4 @@
android:src="@drawable/ic_note_add" android:src="@drawable/ic_note_add"
android:tint="#FFFFFF"/> android:tint="#FFFFFF"/>
</androidx.coordinatorlayout.widget.CoordinatorLayout> </androidx.coordinatorlayout.widget.CoordinatorLayout>

View File

@ -41,18 +41,15 @@
android:layout_alignParentStart="true" android:layout_alignParentStart="true"
android:layout_marginTop="10dp" android:layout_marginTop="10dp"
android:id="@+id/button_start_test" android:id="@+id/button_start_test"
android:layout_alignParentEnd="true" android:layout_alignParentEnd="true"/>
android:layout_alignParentRight="true"
android:layout_alignParentLeft="true"/>
<TextView <TextView
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_below="@+id/button_start_test" android:layout_below="@+id/button_start_test"
android:layout_alignParentStart="true" android:layout_alignParentStart="true"
android:layout_alignParentLeft="true"
android:layout_marginTop="10dp" android:layout_marginTop="10dp"
android:id="@+id/textView_test_info" android:id="@+id/textView_test_info"
android:textIsSelectable="true" android:textIsSelectable="true"
android:textSize="18sp"/> android:textSize="18sp"/>
</RelativeLayout> </RelativeLayout>
</ScrollView> </ScrollView>

View File

@ -13,7 +13,6 @@
app:layout_behavior="@string/appbar_scrolling_view_behavior" app:layout_behavior="@string/appbar_scrolling_view_behavior"
tools:context="org.itxtech.daedalus.fragment.HomeFragment"> tools:context="org.itxtech.daedalus.fragment.HomeFragment">
<ImageView <ImageView
android:contentDescription="icon"
android:id="@+id/imageView_icon" android:id="@+id/imageView_icon"
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="0dp" android:layout_height="0dp"
@ -21,7 +20,7 @@
app:srcCompat="@mipmap/ic_launcher" app:srcCompat="@mipmap/ic_launcher"
app:layout_widthPercent="40%" app:layout_widthPercent="40%"
app:layout_heightPercent="20%" app:layout_heightPercent="20%"
app:layout_marginTopPercent="5%" app:layout_marginTopPercent="10%"
android:layout_alignParentTop="true" android:layout_centerHorizontal="true"/> android:layout_alignParentTop="true" android:layout_centerHorizontal="true"/>
<TextView <TextView
android:text="@string/app_name" android:text="@string/app_name"
@ -39,6 +38,6 @@
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:id="@+id/button_activate" android:id="@+id/button_activate"
app:layout_marginTopPercent="10%" app:layout_marginTopPercent="15%"
android:layout_alignTop="@+id/textView_notice" android:layout_centerHorizontal="true"/> android:layout_alignTop="@+id/textView_app_name" android:layout_centerHorizontal="true"/>
</androidx.percentlayout.widget.PercentRelativeLayout> </androidx.percentlayout.widget.PercentRelativeLayout>

View File

@ -11,7 +11,6 @@
android:layout_height="match_parent" android:layout_height="match_parent"
android:scrollbars="horizontal" android:scrollbars="horizontal"
android:layout_alignParentTop="true" android:layout_alignParentTop="true"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"/> android:layout_alignParentStart="true"/>
<com.google.android.material.floatingactionbutton.FloatingActionButton <com.google.android.material.floatingactionbutton.FloatingActionButton
@ -23,4 +22,4 @@
android:src="@drawable/ic_note_add" android:src="@drawable/ic_note_add"
android:tint="#FFFFFF"/> android:tint="#FFFFFF"/>
</androidx.coordinatorlayout.widget.CoordinatorLayout> </androidx.coordinatorlayout.widget.CoordinatorLayout>