Rewrite layout of EditEntryActivity to not use TableLayout

This prevents excessive overdraw and fixes the UI tests
This commit is contained in:
Alexander Bakker 2021-01-24 12:53:29 +01:00
parent 44ff321f8f
commit 68436fba9c
8 changed files with 130 additions and 135 deletions

View file

@ -68,28 +68,24 @@
android:layout_width="match_parent"
android:layout_height="1dp"
android:background="@color/divider" />
<TableLayout
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:stretchColumns="1"
android:layout_marginEnd="15dp">
<TableRow
android:layout_marginTop="10dp"
android:layout_marginBottom="5dp">
android:layout_margin="10dp">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<ImageView
android:layout_column="0"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/ic_person_black_24dp"
app:tint="?attr/iconColorPrimary"
android:layout_marginStart="15dp"
android:layout_marginStart="5dp"
android:layout_marginEnd="15dp"
android:layout_gravity="center_vertical"/>
<com.google.android.material.textfield.TextInputLayout
android:layout_column="1"
android:hint="@string/name"
android:layout_width="0dp"
android:layout_height="wrap_content"
@ -100,44 +96,40 @@
android:layout_height="wrap_content"
android:inputType="text"/>
</com.google.android.material.textfield.TextInputLayout>
</TableRow>
<TableRow
android:layout_marginTop="5dp"
android:layout_marginBottom="5dp">
<LinearLayout android:layout_column="1"
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:layout_marginTop="10dp"
android:layout_marginStart="44.5dp">
<com.google.android.material.textfield.TextInputLayout
android:hint="@string/issuer"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:orientation="horizontal"
android:gravity="center_vertical">
<com.google.android.material.textfield.TextInputLayout
android:hint="@string/issuer"
android:layout_width="0dp"
android:layout_marginEnd="5dp"
android:layout_weight="1">
<com.google.android.material.textfield.TextInputEditText
android:id="@+id/text_issuer"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginEnd="5dp"
android:layout_weight="1">
<com.google.android.material.textfield.TextInputEditText
android:id="@+id/text_issuer"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:inputType="text"/>
</com.google.android.material.textfield.TextInputLayout>
<com.google.android.material.textfield.TextInputLayout
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:hint="@string/group"
style="?attr/dropdownStyle">
<AutoCompleteTextView
android:id="@+id/dropdown_group"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:inputType="none"/>
</com.google.android.material.textfield.TextInputLayout>
</LinearLayout>
</TableRow>
</TableLayout>
android:inputType="text"/>
</com.google.android.material.textfield.TextInputLayout>
<com.google.android.material.textfield.TextInputLayout
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_marginStart="5dp"
android:layout_weight="1"
android:hint="@string/group"
style="?attr/dropdownStyle">
<AutoCompleteTextView
android:id="@+id/dropdown_group"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:inputType="none"/>
</com.google.android.material.textfield.TextInputLayout>
</LinearLayout>
</LinearLayout>
<RelativeLayout
android:foreground="?android:attr/selectableItemBackground"
@ -173,38 +165,35 @@
android:layout_width="match_parent"
android:layout_height="match_parent"
android:visibility="invisible">
<TableLayout
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:stretchColumns="1"
android:layout_marginEnd="15dp">
<TableRow
android:layout_marginTop="5dp"
android:layout_marginBottom="5dp">
<ImageView android:layout_column="0"
android:layout_marginHorizontal="10dp">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/ic_info_outline_black_24dp"
app:tint="?attr/iconColorPrimary"
android:layout_marginStart="15dp"
android:layout_marginStart="5dp"
android:layout_marginEnd="15dp"
android:layout_gravity="center_vertical"/>
<LinearLayout android:layout_column="1"
<LinearLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:orientation="horizontal"
android:gravity="center_vertical">
android:orientation="horizontal">
<com.google.android.material.textfield.TextInputLayout
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="4"
android:layout_height="wrap_content"
android:layout_marginEnd="5dp"
android:gravity="start"
android:layout_gravity="start"
android:layout_weight="2"
android:hint="@string/type"
style="?attr/dropdownStyle">
<AutoCompleteTextView
@ -215,8 +204,9 @@
</com.google.android.material.textfield.TextInputLayout>
<com.google.android.material.textfield.TextInputLayout
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="4"
android:layout_height="wrap_content"
android:layout_marginStart="5dp"
android:layout_weight="2"
android:hint="@string/algorithm_hint"
style="?attr/dropdownStyle">
<AutoCompleteTextView
@ -226,55 +216,50 @@
android:inputType="none" />
</com.google.android.material.textfield.TextInputLayout>
</LinearLayout>
</TableRow>
<TableRow
android:layout_marginTop="5dp"
android:layout_marginBottom="5dp">
<LinearLayout android:layout_column="1"
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:layout_marginTop="10dp"
android:layout_marginStart="44.5dp">
<com.google.android.material.textfield.TextInputLayout
android:id="@+id/text_period_counter_layout"
android:hint="@string/period_hint"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:orientation="horizontal"
android:gravity="center_vertical">
<com.google.android.material.textfield.TextInputLayout
android:id="@+id/text_period_counter_layout"
android:hint="@string/period_hint"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="4"
android:layout_marginEnd="5dp"
android:gravity="start"
android:layout_gravity="start">
<com.google.android.material.textfield.TextInputEditText
android:id="@+id/text_period_counter"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:inputType="text"/>
</com.google.android.material.textfield.TextInputLayout>
<com.google.android.material.textfield.TextInputLayout
android:hint="@string/digits"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="4">
<com.google.android.material.textfield.TextInputEditText
android:id="@+id/text_digits"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:inputType="text"/>
</com.google.android.material.textfield.TextInputLayout>
</LinearLayout>
</TableRow>
<TableRow
android:layout_marginTop="5dp"
android:layout_marginBottom="5dp">
<ImageView android:layout_column="0"
android:layout_marginEnd="5dp"
android:layout_weight="1">
<com.google.android.material.textfield.TextInputEditText
android:id="@+id/text_period_counter"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:inputType="text"/>
</com.google.android.material.textfield.TextInputLayout>
<com.google.android.material.textfield.TextInputLayout
android:hint="@string/digits"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_marginStart="5dp"
android:layout_weight="1">
<com.google.android.material.textfield.TextInputEditText
android:id="@+id/text_digits"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:inputType="text"/>
</com.google.android.material.textfield.TextInputLayout>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:orientation="horizontal">
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/ic_vpn_key_black_24dp"
app:tint="?attr/iconColorPrimary"
android:layout_marginStart="15dp"
android:layout_marginStart="5dp"
android:layout_marginEnd="15dp"
android:layout_gravity="center_vertical"/>
@ -292,10 +277,9 @@
android:hint="@string/secret"
android:inputType="textPassword"/>
</com.google.android.material.textfield.TextInputLayout>
</TableRow>
</TableLayout>
</LinearLayout>
</LinearLayout>
</RelativeLayout>
</LinearLayout>
</ScrollView>
</LinearLayout>