Skip to content

Commit 00200e0

Browse files
style(user-status): Optimize layout
Signed-off-by: Andy Scherzinger <info@andy-scherzinger.de>
1 parent b652f8a commit 00200e0

4 files changed

Lines changed: 31 additions & 28 deletions

File tree

app/src/main/java/com/nextcloud/talk/ui/dialog/ChooseAccountDialogFragment.java

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919
import android.view.ViewGroup;
2020

2121
import com.google.android.material.dialog.MaterialAlertDialogBuilder;
22-
import com.nextcloud.talk.R;
2322
import com.nextcloud.talk.account.ServerSelectionActivity;
2423
import com.nextcloud.talk.adapters.items.AdvancedUserItem;
2524
import com.nextcloud.talk.api.NcApi;
@@ -405,9 +404,6 @@ private void drawStatus() {
405404
viewThemeUtils.talk.themeStatusDrawable(binding.currentAccount.ticker.getContext(), drawable);
406405
binding.currentAccount.ticker.setImageDrawable(drawable);
407406
binding.currentAccount.ticker.setVisibility(View.VISIBLE);
408-
binding.onlineStatus.setText(R.string.online_status);
409-
binding.statusMessage.setText(R.string.status_message);
410-
411407

412408
if (status.getMessage() != null && !status.getMessage().isEmpty()) {
413409
binding.currentAccount.status.setText(status.getMessage());

app/src/main/res/layout/dialog_choose_account.xml

Lines changed: 16 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@
2727
android:layout_width="match_parent"
2828
android:layout_height="wrap_content"
2929
android:orientation="horizontal"
30+
android:paddingStart="@dimen/standard_half_padding"
31+
android:paddingEnd="@dimen/zero"
3032
android:visibility="gone"
3133
app:layout_constraintEnd_toEndOf="parent"
3234
app:layout_constraintStart_toStartOf="parent"
@@ -37,43 +39,40 @@
3739
android:id="@+id/online_status"
3840
style="@style/Nextcloud.Material.TextButton"
3941
android:layout_width="wrap_content"
40-
android:layout_height="50dp"
41-
android:layout_marginStart="12dp"
42-
android:layout_marginEnd="12dp"
43-
android:paddingStart="8dp"
44-
android:paddingEnd="8dp"
45-
android:text="@string/set_status"
42+
android:layout_height="60dp"
4643
android:layout_weight="1"
44+
android:enabled="false"
45+
android:padding="@dimen/zero"
46+
android:paddingStart="@dimen/standard_half_padding"
47+
android:paddingEnd="@dimen/standard_half_padding"
48+
android:text="@string/online_status"
4749
android:textAlignment="textStart"
4850
android:textAllCaps="false"
4951
android:textColor="@color/high_emphasis_text"
50-
android:enabled="false"
5152
app:icon="@drawable/ic_check_circle_outlined"
5253
app:iconGravity="start"
53-
app:iconPadding="12dp"
54+
app:iconPadding="@dimen/standard_half_padding"
5455
app:iconTint="@color/high_emphasis_text" />
5556

5657
<com.google.android.material.button.MaterialButton
5758
android:id="@+id/status_message"
5859
style="@style/Nextcloud.Material.TextButton"
5960
android:layout_width="wrap_content"
60-
android:layout_height="50dp"
61+
android:layout_height="60dp"
6162
android:layout_weight="1"
62-
android:layout_marginStart="8dp"
63-
android:layout_marginEnd="8dp"
64-
android:paddingStart="8dp"
65-
android:paddingEnd="8dp"
66-
android:text="@string/set_status"
63+
android:enabled="false"
64+
android:padding="@dimen/zero"
65+
android:paddingStart="@dimen/standard_half_padding"
66+
android:paddingEnd="@dimen/standard_half_padding"
67+
android:text="@string/status_message"
6768
android:textAlignment="textStart"
6869
android:textAllCaps="false"
6970
android:textColor="@color/high_emphasis_text"
70-
android:enabled="false"
7171
app:icon="@drawable/baseline_chat_bubble_outline_24"
7272
app:iconGravity="start"
73-
app:iconPadding="12dp"
73+
app:iconPadding="@dimen/standard_half_padding"
7474
app:iconTint="@color/high_emphasis_text" />
7575

76-
7776
</LinearLayout>
7877

7978
<View

app/src/main/res/layout/dialog_set_online_status.xml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,14 @@
88
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
99
xmlns:app="http://schemas.android.com/apk/res-auto"
1010
xmlns:tools="http://schemas.android.com/tools"
11+
style="@style/Widget.Material3.BottomSheet"
1112
android:layout_width="match_parent"
1213
android:layout_height="wrap_content"
1314
android:orientation="vertical"
14-
style="@style/Widget.Material3.BottomSheet"
15-
android:padding="@dimen/standard_padding">
15+
android:paddingStart="@dimen/standard_padding"
16+
android:paddingEnd="@dimen/standard_padding"
17+
android:paddingBottom="@dimen/standard_padding"
18+
app:layout_behavior="com.google.android.material.bottomsheet.BottomSheetBehavior">
1619

1720
<com.google.android.material.bottomsheet.BottomSheetDragHandleView
1821
android:id="@+id/dragHandle"
@@ -27,6 +30,7 @@
2730
android:text="@string/online_status"
2831
android:textColor="@color/high_emphasis_text"
2932
android:textSize="@dimen/activity_list_item_title_header_text_size"
33+
android:textStyle="bold"
3034
app:layout_constraintEnd_toEndOf="parent"
3135
app:layout_constraintStart_toStartOf="parent"
3236
app:layout_constraintTop_toTopOf="parent" />

app/src/main/res/layout/dialog_set_status_message.xml

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,17 @@
66
~ SPDX-FileCopyrightText: 2020 Tobias Kaminsky <tobias@kaminsky.me>
77
~ SPDX-License-Identifier: GPL-3.0-or-later
88
-->
9-
109
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
1110
xmlns:app="http://schemas.android.com/apk/res-auto"
1211
xmlns:tools="http://schemas.android.com/tools"
12+
style="@style/Widget.Material3.BottomSheet"
1313
android:layout_width="match_parent"
1414
android:layout_height="wrap_content"
1515
android:orientation="vertical"
16-
style="@style/Widget.Material3.BottomSheet"
17-
android:padding="@dimen/standard_padding">
16+
android:paddingStart="@dimen/standard_padding"
17+
android:paddingEnd="@dimen/standard_padding"
18+
android:paddingBottom="@dimen/standard_padding"
19+
app:layout_behavior="com.google.android.material.bottomsheet.BottomSheetBehavior">
1820

1921
<com.google.android.material.bottomsheet.BottomSheetDragHandleView
2022
android:id="@+id/dragHandle"
@@ -28,7 +30,8 @@
2830
android:layout_marginBottom="@dimen/standard_half_margin"
2931
android:text="@string/status_message"
3032
android:textColor="@color/high_emphasis_text"
31-
android:textSize="@dimen/activity_list_item_title_header_text_size" />
33+
android:textSize="@dimen/activity_list_item_title_header_text_size"
34+
android:textStyle="bold" />
3235

3336
<LinearLayout
3437
android:layout_width="match_parent"
@@ -98,13 +101,14 @@
98101
<LinearLayout
99102
android:layout_width="match_parent"
100103
android:layout_height="wrap_content"
101-
android:layout_marginTop="@dimen/standard_half_margin"
104+
android:layout_marginTop="@dimen/standard_margin"
102105
android:orientation="vertical">
103106

104107
<TextView
105108
android:id="@+id/clearStatusMessageTextView"
106109
android:layout_width="wrap_content"
107110
android:layout_height="wrap_content"
111+
android:layout_marginBottom="@dimen/standard_half_margin"
108112
android:text="@string/clear_status_message_after"
109113
android:textColor="@color/high_emphasis_text" />
110114

0 commit comments

Comments
 (0)