Refactor layout files.

This commit is contained in:
Onuray Sahin 2022-08-26 12:57:20 +03:00
parent 01bce5658b
commit eb86a4f33c
5 changed files with 86 additions and 43 deletions

View File

@ -0,0 +1,10 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="25dp"
android:viewportWidth="24"
android:viewportHeight="25">
<path
android:pathData="M12,23.5C18.075,23.5 23,18.575 23,12.5C23,6.425 18.075,1.5 12,1.5C5.925,1.5 1,6.425 1,12.5C1,18.575 5.925,23.5 12,23.5ZM12,19.26C12.76,19.26 13.375,18.645 13.375,17.885C13.375,17.126 12.76,16.51 12,16.51C11.241,16.51 10.625,17.126 10.625,17.885C10.625,18.645 11.241,19.26 12,19.26ZM10.09,10.428C10.09,9.37 10.949,8.518 12,8.518C13.048,8.518 13.909,9.38 13.909,10.428C13.909,10.913 13.702,11.087 12.884,11.652C12.521,11.902 12.025,12.25 11.638,12.76C11.223,13.306 10.968,13.987 10.968,14.853H13.031C13.031,14.429 13.144,14.187 13.281,14.007C13.445,13.79 13.683,13.606 14.056,13.349C14.095,13.321 14.137,13.293 14.18,13.264C14.856,12.804 15.972,12.045 15.972,10.428C15.972,8.241 14.187,6.456 12,6.456C9.816,6.456 8.027,8.225 8.027,10.428H10.09Z"
android:fillColor="#737D8C"
android:fillType="evenOdd"/>
</vector>

View File

@ -1,9 +1,13 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" <ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent"> android:layout_height="match_parent">
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<im.vector.app.features.settings.devices.v2.list.DevicesListHeaderView <im.vector.app.features.settings.devices.v2.list.DevicesListHeaderView
android:id="@+id/deviceListHeaderSectionCurrent" android:id="@+id/deviceListHeaderSectionCurrent"
android:layout_width="0dp" android:layout_width="0dp"
@ -19,11 +23,21 @@
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginHorizontal="16dp" android:layout_marginHorizontal="16dp"
android:layout_marginVertical="24dp" android:layout_marginVertical="16dp"
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/deviceListHeaderSectionCurrent" /> app:layout_constraintTop_toBottomOf="@id/deviceListHeaderSectionCurrent" />
<View
android:id="@+id/deviceListCurrentSessionDivider"
android:layout_width="0dp"
android:layout_height="1dp"
android:layout_marginTop="24dp"
android:background="@drawable/divider_horizontal"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/deviceListCurrentSession" />
<im.vector.app.features.settings.devices.v2.list.DevicesListHeaderView <im.vector.app.features.settings.devices.v2.list.DevicesListHeaderView
android:id="@+id/deviceListHeaderSectionOther" android:id="@+id/deviceListHeaderSectionOther"
android:layout_width="0dp" android:layout_width="0dp"
@ -32,10 +46,24 @@
app:devicesListHeaderTitle="@string/settings_sessions_other_title" app:devicesListHeaderTitle="@string/settings_sessions_other_title"
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/deviceListCurrentSession" /> app:layout_constraintTop_toBottomOf="@id/deviceListCurrentSessionDivider" />
<im.vector.app.features.settings.devices.v2.list.OtherSessionsView
android:id="@+id/deviceListOtherSessions"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginTop="16dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/deviceListHeaderSectionOther" />
<include <include
android:id="@+id/waiting_view" android:id="@+id/waiting_view"
layout="@layout/merge_overlay_waiting_view" /> layout="@layout/merge_overlay_waiting_view"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout> </androidx.constraintlayout.widget.ConstraintLayout>
</ScrollView>

View File

@ -3,17 +3,18 @@
xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools" xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content"> android:layout_height="wrap_content"
android:paddingTop="16dp">
<ImageView <ImageView
android:id="@+id/otherSessionDeviceTypeImageView" android:id="@+id/otherSessionDeviceTypeImageView"
android:layout_width="40dp" android:layout_width="40dp"
android:layout_height="40dp" android:layout_height="40dp"
android:background="@drawable/bg_device_type"
android:contentDescription="@string/a11y_device_manager_device_type_mobile" android:contentDescription="@string/a11y_device_manager_device_type_mobile"
android:padding="8dp" android:padding="8dp"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" app:layout_constraintTop_toTopOf="parent"
tools:background="@drawable/bg_device_type"
tools:src="@drawable/ic_device_type_mobile" /> tools:src="@drawable/ic_device_type_mobile" />
<im.vector.app.core.ui.views.ShieldImageView <im.vector.app.core.ui.views.ShieldImageView
@ -30,25 +31,27 @@
tools:src="@drawable/ic_shield_trusted" /> tools:src="@drawable/ic_shield_trusted" />
<TextView <TextView
android:id="@+id/otherSessionName" android:id="@+id/otherSessionNameTextView"
style="@style/TextAppearance.Vector.Headline.Medium" style="@style/TextAppearance.Vector.Subtitle.Medium.DevicesManagement"
android:layout_width="wrap_content" android:layout_width="0dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginStart="16dp" android:layout_marginStart="16dp"
android:layout_marginEnd="16dp"
android:ellipsize="end" android:ellipsize="end"
android:lines="1" android:lines="1"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@id/otherSessionDeviceTypeImageView" app:layout_constraintStart_toEndOf="@id/otherSessionDeviceTypeImageView"
app:layout_constraintTop_toTopOf="parent" app:layout_constraintTop_toTopOf="parent"
tools:text="Element Mobile: Android" /> tools:text="Element Mobile: Android" />
<TextView <TextView
android:id="@+id/otherSessionDescriptionTextView" android:id="@+id/otherSessionDescriptionTextView"
style="@style/TextAppearance.Vector.Subtitle" style="@style/TextAppearance.Vector.Body.DevicesManagement"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginTop="2dp" android:layout_marginTop="2dp"
app:layout_constraintStart_toStartOf="@id/otherSessionName" app:layout_constraintStart_toStartOf="@id/otherSessionNameTextView"
app:layout_constraintTop_toBottomOf="@id/otherSessionName" app:layout_constraintTop_toBottomOf="@id/otherSessionNameTextView"
tools:text="@string/device_manager_verification_status_verified" /> tools:text="@string/device_manager_verification_status_verified" />
<View <View
@ -57,7 +60,7 @@
android:layout_marginTop="16dp" android:layout_marginTop="16dp"
android:background="?vctr_content_quinary" android:background="?vctr_content_quinary"
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="@id/otherSessionName" app:layout_constraintStart_toStartOf="@id/otherSessionNameTextView"
app:layout_constraintTop_toBottomOf="@id/otherSessionDescriptionTextView" /> app:layout_constraintTop_toBottomOf="@id/otherSessionDescriptionTextView" />
</androidx.constraintlayout.widget.ConstraintLayout> </androidx.constraintlayout.widget.ConstraintLayout>

View File

@ -22,7 +22,7 @@
<TextView <TextView
android:id="@+id/currentSessionNameTextView" android:id="@+id/currentSessionNameTextView"
style="@style/TextAppearance.Vector.Headline.Medium" style="@style/TextAppearance.Vector.Subtitle.Medium.DevicesManagement"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginTop="4dp" android:layout_marginTop="4dp"

View File

@ -3216,6 +3216,8 @@
<string name="device_manager_verify_session">Verify Session</string> <string name="device_manager_verify_session">Verify Session</string>
<string name="device_manager_view_details">View Details</string> <string name="device_manager_view_details">View Details</string>
<string name="device_manager_header_section_current_session">Current Session</string> <string name="device_manager_header_section_current_session">Current Session</string>
<string name="device_manager_other_sessions_view_all">View All (%$1d)</string> <string name="device_manager_other_sessions_view_all">View All (%1$d)</string>
<string name="device_manager_other_sessions_description_verified">Verified · Last activity %1$s</string>
<string name="device_manager_other_sessions_description_unverified">Unverified · Last activity %1$s</string>
</resources> </resources>