diff options
author | Stefan Niedermann <info@niedermann.it> | 2020-07-08 14:26:01 +0300 |
---|---|---|
committer | Niedermann IT-Dienstleistungen <stefan-niedermann@users.noreply.github.com> | 2020-07-08 15:21:08 +0300 |
commit | e008f7db066a70fdbed79705a0b8e40743d15d08 (patch) | |
tree | e0a93a23f6fc7df2c76fb85fb0acc3fb73ef24da /app/src/main/res | |
parent | b2d3e3ad177163a241e5398770c5f6acf4f5c39b (diff) |
#579 Compact mode
Diffstat (limited to 'app/src/main/res')
-rw-r--r-- | app/src/main/res/layout/item_card_compact.xml | 94 | ||||
-rw-r--r-- | app/src/main/res/values/dimens.xml | 2 | ||||
-rw-r--r-- | app/src/main/res/values/setup.xml | 1 | ||||
-rw-r--r-- | app/src/main/res/values/strings.xml | 1 | ||||
-rw-r--r-- | app/src/main/res/xml/settings.xml | 8 |
5 files changed, 105 insertions, 1 deletions
diff --git a/app/src/main/res/layout/item_card_compact.xml b/app/src/main/res/layout/item_card_compact.xml new file mode 100644 index 000000000..e7fdb9732 --- /dev/null +++ b/app/src/main/res/layout/item_card_compact.xml @@ -0,0 +1,94 @@ +<?xml version="1.0" encoding="utf-8"?> +<com.google.android.material.card.MaterialCardView xmlns:android="http://schemas.android.com/apk/res/android" + xmlns:app="http://schemas.android.com/apk/res-auto" + xmlns:tools="http://schemas.android.com/tools" + android:id="@+id/card" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:layout_marginStart="@dimen/spacer_2x" + android:layout_marginTop="@dimen/spacer_1x" + android:layout_marginEnd="@dimen/spacer_2x" + android:layout_marginBottom="@dimen/spacer_1x" + android:focusable="true" + app:cardBackgroundColor="@color/bg_card"> + + <LinearLayout + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:orientation="vertical" + android:paddingTop="@dimen/spacer_1x" + android:paddingBottom="@dimen/spacer_1x"> + + <LinearLayout + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:orientation="horizontal" + android:paddingStart="@dimen/spacer_2x" + android:paddingEnd="0dp"> + + <TextView + android:id="@+id/card_title" + android:layout_width="0dp" + android:layout_height="wrap_content" + android:layout_marginTop="4sp" + android:layout_weight="1" + android:textColor="?attr/colorAccent" + android:textSize="18sp" + tools:ignore="RtlSymmetry" + tools:text="Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut l" /> + + <ImageView + android:id="@+id/not_synced_yet" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_marginTop="8sp" + android:contentDescription="@string/not_synced_yet" + android:visibility="gone" + app:srcCompat="@drawable/ic_sync_blue_24dp" + tools:visibility="visible" /> + + <LinearLayout + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:orientation="horizontal" + android:paddingStart="@dimen/spacer_1hx" + tools:ignore="RtlSymmetry"> + + <androidx.appcompat.widget.AppCompatTextView + android:id="@+id/card_due_date" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:background="@drawable/due_tomorrow_background" + android:drawablePadding="@dimen/spacer_1hx" + android:gravity="center" + android:padding="@dimen/spacer_1hx" + android:textColor="@color/fg_secondary" + app:drawableStartCompat="@drawable/calendar_blank_grey600_24dp" + tools:text="tomorrow" /> + + </LinearLayout> + + <ImageView + android:id="@+id/card_menu" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:background="?attr/selectableItemBackgroundBorderless" + android:contentDescription="@string/label_menu" + android:padding="@dimen/spacer_1hx" + android:tint="?attr/colorAccent" + app:srcCompat="@drawable/ic_menu" /> + </LinearLayout> + + <it.niedermann.nextcloud.deck.ui.view.CompactLabelLayout + android:id="@+id/labels" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:layout_marginTop="@dimen/spacer_1x" + android:animateLayoutChanges="true" + android:paddingStart="@dimen/spacer_2x" + android:paddingEnd="@dimen/spacer_2x" + app:flexWrap="nowrap" + tools:layout_height="@dimen/avatar_size" /> + + </LinearLayout> +</com.google.android.material.card.MaterialCardView>
\ No newline at end of file diff --git a/app/src/main/res/values/dimens.xml b/app/src/main/res/values/dimens.xml index db8b51610..1a0cbca51 100644 --- a/app/src/main/res/values/dimens.xml +++ b/app/src/main/res/values/dimens.xml @@ -4,6 +4,8 @@ <dimen name="spacer_2x">16dp</dimen> <dimen name="spacer_3x">24dp</dimen> + <dimen name="compact_label_height">6dp</dimen> + <!-- Drawer header --> <dimen name="drawer_header_height">100dp</dimen> <dimen name="drawer_header_logo_size">42dp</dimen> diff --git a/app/src/main/res/values/setup.xml b/app/src/main/res/values/setup.xml index 247bb0697..c790a5868 100644 --- a/app/src/main/res/values/setup.xml +++ b/app/src/main/res/values/setup.xml @@ -8,6 +8,7 @@ <string name="pref_key_wifi_only" translatable="false">wifiOnly</string> <string name="pref_key_dark_theme" translatable="false">darkTheme</string> <string name="pref_key_branding" translatable="false">branding</string> + <string name="pref_key_compact" translatable="false">compact</string> <string name="pref_key_background_sync" translatable="false">backgroundSync</string> <string name="pref_value_background_sync_off">off</string> diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 208c8bdbb..ae74a0157 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -154,6 +154,7 @@ <string name="delete_board_message">This will permanently delete this board including all lists and cards.</string> <string name="settings_theme_title">Dark theme</string> <string name="settings_branding_title">Branding</string> + <string name="settings_compact_title">Compact mode</string> <string name="settings_background_sync">Background synchronization</string> <string name="pref_value_wifi_and_mobile">Sync on Wi-Fi and mobile data</string> <string name="pref_value_wifi_only">Sync only on Wi-Fi</string> diff --git a/app/src/main/res/xml/settings.xml b/app/src/main/res/xml/settings.xml index 14943fff6..587d0f633 100644 --- a/app/src/main/res/xml/settings.xml +++ b/app/src/main/res/xml/settings.xml @@ -29,6 +29,12 @@ android:icon="@drawable/ic_format_paint_grey600_24dp" android:key="@string/pref_key_branding" android:title="@string/settings_branding_title" - app:defaultValue="true" /> + app:defaultValue="false" /> + + <it.niedermann.nextcloud.deck.ui.branding.BrandedSwitchPreference + android:icon="@drawable/ic_format_paint_grey600_24dp" + android:key="@string/pref_key_compact" + android:title="@string/settings_compact_title" + app:defaultValue="false" /> </it.niedermann.nextcloud.deck.ui.branding.BrandedPreferenceCategory> </PreferenceScreen> |