diff options
author | Stefan Niedermann <info@niedermann.it> | 2020-06-07 11:32:29 +0300 |
---|---|---|
committer | Stefan Niedermann <info@niedermann.it> | 2020-06-07 11:32:29 +0300 |
commit | 2e8976f6f6c15aa76462e6c1f2f47d328c1388e8 (patch) | |
tree | d289953bcd074208ae807656c9cb22e162daa629 /app/src/main | |
parent | 0fa8261d6dc699e49621415aa4cf7d8080030062 (diff) |
- 🎨 Small design enhancements and theme fixes
Diffstat (limited to 'app/src/main')
-rw-r--r-- | app/src/main/java/it/niedermann/owncloud/notes/android/activity/NotesListViewActivity.java | 7 | ||||
-rw-r--r-- | app/src/main/res/layout/activity_edit.xml | 1 | ||||
-rw-r--r-- | app/src/main/res/layout/activity_note_list_configuration.xml | 1 | ||||
-rw-r--r-- | app/src/main/res/layout/activity_notes_list_view.xml | 4 | ||||
-rw-r--r-- | app/src/main/res/layout/dialog_exception.xml | 2 | ||||
-rw-r--r-- | app/src/main/res/layout/drawer_layout.xml | 14 | ||||
-rw-r--r-- | app/src/main/res/layout/fragment_note_edit.xml | 4 | ||||
-rw-r--r-- | app/src/main/res/layout/fragment_note_preview.xml | 5 | ||||
-rw-r--r-- | app/src/main/res/layout/item_category.xml | 10 | ||||
-rw-r--r-- | app/src/main/res/layout/item_navigation.xml | 33 | ||||
-rw-r--r-- | app/src/main/res/layout/item_notes_list_section_item.xml | 49 | ||||
-rw-r--r-- | app/src/main/res/layout/item_pref.xml | 1 | ||||
-rw-r--r-- | app/src/main/res/values/dimens.xml | 4 |
13 files changed, 68 insertions, 67 deletions
diff --git a/app/src/main/java/it/niedermann/owncloud/notes/android/activity/NotesListViewActivity.java b/app/src/main/java/it/niedermann/owncloud/notes/android/activity/NotesListViewActivity.java index e6964900..6efa0ce6 100644 --- a/app/src/main/java/it/niedermann/owncloud/notes/android/activity/NotesListViewActivity.java +++ b/app/src/main/java/it/niedermann/owncloud/notes/android/activity/NotesListViewActivity.java @@ -6,6 +6,7 @@ import android.app.SearchManager; import android.content.Intent; import android.database.sqlite.SQLiteException; import android.graphics.Color; +import android.graphics.PorterDuff; import android.net.Uri; import android.os.AsyncTask; import android.os.Build; @@ -21,6 +22,7 @@ import androidx.annotation.NonNull; import androidx.appcompat.view.ActionMode; import androidx.appcompat.widget.SearchView; import androidx.coordinatorlayout.widget.CoordinatorLayout; +import androidx.core.graphics.drawable.DrawableCompat; import androidx.core.view.GravityCompat; import androidx.core.view.ViewCompat; import androidx.recyclerview.widget.LinearLayoutManager; @@ -78,6 +80,7 @@ import it.niedermann.owncloud.notes.util.NoteUtil; import static android.view.View.GONE; import static android.view.View.VISIBLE; +import static it.niedermann.owncloud.notes.branding.BrandingUtil.getSecondaryForegroundColorDependingOnTheme; import static it.niedermann.owncloud.notes.util.ColorUtil.contrastRatioIsSufficient; import static it.niedermann.owncloud.notes.util.SSOUtil.askForNewAccount; @@ -442,10 +445,14 @@ public class NotesListViewActivity extends LockedActivity implements NoteClickLi binding.headerView.setBackgroundColor(mainColor); binding.appName.setTextColor(textColor); + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { + activityBinding.progressCircular.getIndeterminateDrawable().setColorFilter(getSecondaryForegroundColorDependingOnTheme(this, mainColor), PorterDuff.Mode.SRC_IN); + } // TODO We assume, that the background of the spinner is always white activityBinding.swiperefreshlayout.setColorSchemeColors(contrastRatioIsSufficient(Color.WHITE, mainColor) ? mainColor : Color.BLACK); binding.appName.setTextColor(textColor); + DrawableCompat.setTint(binding.logo.getDrawable(), textColor); adapter.applyBrand(mainColor, textColor); adapterCategories.applyBrand(mainColor, textColor); diff --git a/app/src/main/res/layout/activity_edit.xml b/app/src/main/res/layout/activity_edit.xml index 2c884af4..e7da04b0 100644 --- a/app/src/main/res/layout/activity_edit.xml +++ b/app/src/main/res/layout/activity_edit.xml @@ -24,6 +24,7 @@ <androidx.fragment.app.FragmentContainerView android:id="@+id/fragment_container_view" android:layout_width="match_parent" + android:background="?attr/colorPrimary" android:layout_height="match_parent" /> </LinearLayout>
\ No newline at end of file diff --git a/app/src/main/res/layout/activity_note_list_configuration.xml b/app/src/main/res/layout/activity_note_list_configuration.xml index bf14a9fe..061784e3 100644 --- a/app/src/main/res/layout/activity_note_list_configuration.xml +++ b/app/src/main/res/layout/activity_note_list_configuration.xml @@ -1,3 +1,4 @@ +<?xml version="1.0" encoding="utf-8"?> <androidx.recyclerview.widget.RecyclerView 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" diff --git a/app/src/main/res/layout/activity_notes_list_view.xml b/app/src/main/res/layout/activity_notes_list_view.xml index cd3d68e5..da127b07 100644 --- a/app/src/main/res/layout/activity_notes_list_view.xml +++ b/app/src/main/res/layout/activity_notes_list_view.xml @@ -99,7 +99,6 @@ android:id="@+id/swiperefreshlayout" android:layout_width="match_parent" android:layout_height="match_parent" - android:background="@color/bg_normal" tools:context="it.niedermann.owncloud.notes.android.activity.NotesListViewActivity"> <FrameLayout @@ -115,13 +114,14 @@ android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="center" + android:indeterminateTint="@color/defaultBrand" + tools:targetApi="lollipop" tools:visibility="gone" /> <androidx.recyclerview.widget.RecyclerView android:id="@+id/recycler_view" android:layout_width="match_parent" android:layout_height="wrap_content" - android:background="@color/bg_highlighted" android:scrollbars="vertical" tools:listitem="@layout/item_notes_list_note_item" /> </FrameLayout> diff --git a/app/src/main/res/layout/dialog_exception.xml b/app/src/main/res/layout/dialog_exception.xml index c5327464..875605ac 100644 --- a/app/src/main/res/layout/dialog_exception.xml +++ b/app/src/main/res/layout/dialog_exception.xml @@ -47,7 +47,7 @@ android:layout_marginBottom="@dimen/spacer_2x" android:layout_weight="1" android:background="@color/bg_highlighted" - android:padding="8dp" + android:padding="@dimen/spacer_1x" android:scrollbars="horizontal|vertical" android:textIsSelectable="true" android:typeface="monospace" diff --git a/app/src/main/res/layout/drawer_layout.xml b/app/src/main/res/layout/drawer_layout.xml index c033c62c..ec445d1c 100644 --- a/app/src/main/res/layout/drawer_layout.xml +++ b/app/src/main/res/layout/drawer_layout.xml @@ -33,13 +33,13 @@ <RelativeLayout android:id="@+id/header_view" android:layout_width="match_parent" - android:layout_height="100dp" + android:layout_height="@dimen/drawer_header_height" android:background="@color/defaultBrand"> <androidx.appcompat.widget.AppCompatImageView android:id="@+id/logo" - android:layout_width="42dp" - android:layout_height="42dp" + android:layout_width="@dimen/drawer_header_logo_size" + android:layout_height="@dimen/drawer_header_logo_size" android:layout_centerVertical="true" android:layout_margin="@dimen/spacer_2x" android:gravity="center" @@ -64,8 +64,8 @@ android:id="@+id/navigationList" android:layout_width="match_parent" android:layout_height="wrap_content" - android:paddingTop="8dp" - android:paddingBottom="8dp" + android:paddingTop="@dimen/spacer_1x" + android:paddingBottom="@dimen/spacer_1x" app:layoutManager="LinearLayoutManager" tools:itemCount="6" tools:listitem="@layout/item_navigation" /> @@ -74,8 +74,8 @@ android:id="@+id/navigationMenu" android:layout_width="match_parent" android:layout_height="wrap_content" - android:paddingTop="8dp" - android:paddingBottom="8dp" + android:paddingTop="@dimen/spacer_1x" + android:paddingBottom="@dimen/spacer_1x" app:layoutManager="LinearLayoutManager" tools:itemCount="3" tools:listitem="@layout/item_navigation" /> diff --git a/app/src/main/res/layout/fragment_note_edit.xml b/app/src/main/res/layout/fragment_note_edit.xml index 7c5d6bde..47dbb27c 100644 --- a/app/src/main/res/layout/fragment_note_edit.xml +++ b/app/src/main/res/layout/fragment_note_edit.xml @@ -3,7 +3,8 @@ xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" - android:layout_height="match_parent"> + android:layout_height="match_parent" + tools:background="?attr/colorPrimary"> <ScrollView android:id="@+id/scrollView" @@ -17,7 +18,6 @@ android:id="@+id/editContent" android:layout_width="match_parent" android:layout_height="wrap_content" - android:background="?attr/colorPrimary" android:ems="10" android:gravity="top" android:inputType="textMultiLine|textCapSentences" diff --git a/app/src/main/res/layout/fragment_note_preview.xml b/app/src/main/res/layout/fragment_note_preview.xml index 320f207e..f1f593df 100644 --- a/app/src/main/res/layout/fragment_note_preview.xml +++ b/app/src/main/res/layout/fragment_note_preview.xml @@ -3,13 +3,13 @@ xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" - android:layout_height="match_parent"> + android:layout_height="match_parent" + tools:background="?attr/colorPrimary"> <androidx.swiperefreshlayout.widget.SwipeRefreshLayout android:id="@+id/swiperefreshlayout" android:layout_width="match_parent" android:layout_height="match_parent" - android:background="@color/bg_normal" tools:context="it.niedermann.owncloud.notes.android.activity.NotesListViewActivity" tools:ignore="MergeRootFrame"> @@ -24,7 +24,6 @@ android:id="@+id/single_note_content" android:layout_width="match_parent" android:layout_height="wrap_content" - android:background="@color/bg_normal" android:padding="16dp" android:textAppearance="?android:attr/textAppearanceMedium" android:textColor="@color/fg_default" diff --git a/app/src/main/res/layout/item_category.xml b/app/src/main/res/layout/item_category.xml index 95c76732..b23a6e3f 100644 --- a/app/src/main/res/layout/item_category.xml +++ b/app/src/main/res/layout/item_category.xml @@ -7,14 +7,14 @@ android:background="?android:selectableItemBackground" android:clickable="true" android:focusable="true" - android:padding="16dp"> + android:padding="@dimen/spacer_2x"> <androidx.appcompat.widget.AppCompatImageView android:id="@+id/icon" android:layout_width="wrap_content" android:layout_height="wrap_content" - android:layout_marginEnd="16dp" - android:layout_marginRight="16dp" + android:layout_marginEnd="@dimen/spacer_2x" + android:layout_marginRight="@dimen/spacer_2x" android:contentDescription="@null" android:focusable="false" android:scaleType="center" @@ -36,8 +36,8 @@ android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="center_vertical|end" - android:layout_marginStart="16dp" - android:layout_marginLeft="16dp" + android:layout_marginStart="@dimen/spacer_2x" + android:layout_marginLeft="@dimen/spacer_2x" android:textColor="@color/fg_default" tools:text="23" /> </LinearLayout>
\ No newline at end of file diff --git a/app/src/main/res/layout/item_navigation.xml b/app/src/main/res/layout/item_navigation.xml index 6fd848e5..e1dc16e8 100644 --- a/app/src/main/res/layout/item_navigation.xml +++ b/app/src/main/res/layout/item_navigation.xml @@ -1,8 +1,9 @@ -<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" +<LinearLayout 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:layout_width="match_parent" android:layout_height="wrap_content" + android:gravity="center_vertical" android:paddingStart="@dimen/spacer_1x" android:paddingLeft="@dimen/spacer_1x" android:paddingEnd="@dimen/spacer_1x" @@ -18,28 +19,22 @@ app:srcCompat="@drawable/ic_folder_grey600_24dp" /> <TextView - android:id="@+id/navigationItemCount" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:layout_alignParentEnd="true" - android:layout_alignParentRight="true" - android:layout_centerVertical="true" - android:padding="8dp" - android:textColor="?android:textColorPrimary" - tools:text="37" /> - - <TextView android:id="@+id/navigationItemLabel" - android:layout_width="match_parent" + android:layout_width="0dp" android:layout_height="wrap_content" - android:layout_centerVertical="true" - android:layout_marginStart="52dp" - android:layout_marginLeft="52dp" - android:layout_toStartOf="@id/navigationItemCount" - android:layout_toLeftOf="@id/navigationItemCount" + android:layout_marginStart="@dimen/spacer_1x" + android:layout_marginLeft="@dimen/spacer_1x" + android:layout_weight="1" android:ellipsize="end" android:lines="1" android:textColor="?android:textColorSecondary" tools:text="@tools:sample/lorem/random" /> -</RelativeLayout>
\ No newline at end of file + <TextView + android:id="@+id/navigationItemCount" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:padding="@dimen/spacer_1x" + android:textColor="?android:textColorPrimary" + tools:text="37" /> +</LinearLayout>
\ No newline at end of file diff --git a/app/src/main/res/layout/item_notes_list_section_item.xml b/app/src/main/res/layout/item_notes_list_section_item.xml index 68af3740..e649617c 100644 --- a/app/src/main/res/layout/item_notes_list_section_item.xml +++ b/app/src/main/res/layout/item_notes_list_section_item.xml @@ -1,28 +1,23 @@ <?xml version="1.0" encoding="utf-8"?> -<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" - android:layout_width="fill_parent" - android:layout_height="wrap_content"> - - <TextView - android:id="@+id/sectionTitle" - android:layout_width="match_parent" - android:layout_height="wrap_content" - android:layout_alignParentEnd="false" - android:layout_alignParentRight="true" - android:layout_alignParentStart="true" - android:layout_alignParentLeft="true" - android:layout_alignParentTop="true" - android:layout_alignWithParentIfMissing="true" - android:background="@color/bg_normal" - android:ellipsize="end" - android:gravity="center_vertical" - android:paddingBottom="8dp" - android:paddingLeft="56dp" - android:paddingStart="56dp" - android:paddingRight="16dp" - android:paddingEnd="16dp" - android:paddingTop="48dp" - android:textColor="@color/fg_default_selection" - android:textSize="@dimen/secondary_font_size" - android:hint="@string/listview_updated_yesterday"/> -</RelativeLayout>
\ No newline at end of file +<TextView xmlns:android="http://schemas.android.com/apk/res/android" + android:id="@+id/sectionTitle" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:layout_alignWithParentIfMissing="true" + android:layout_alignParentStart="true" + android:layout_alignParentLeft="true" + android:layout_alignParentTop="true" + android:layout_alignParentEnd="false" + android:layout_alignParentRight="true" + android:background="@color/bg_normal" + android:ellipsize="end" + android:gravity="center_vertical" + android:hint="@string/listview_updated_yesterday" + android:paddingStart="56dp" + android:paddingLeft="56dp" + android:paddingTop="48dp" + android:paddingEnd="16dp" + android:paddingRight="16dp" + android:paddingBottom="8dp" + android:textColor="@color/fg_default_selection" + android:textSize="@dimen/secondary_font_size" />
\ No newline at end of file diff --git a/app/src/main/res/layout/item_pref.xml b/app/src/main/res/layout/item_pref.xml index 8237bdad..ad1d078b 100644 --- a/app/src/main/res/layout/item_pref.xml +++ b/app/src/main/res/layout/item_pref.xml @@ -22,7 +22,6 @@ android:orientation="vertical" tools:ignore="RtlSymmetry"> - <TextView android:id="@android:id/title" android:layout_width="wrap_content" diff --git a/app/src/main/res/values/dimens.xml b/app/src/main/res/values/dimens.xml index 24f9b81c..d5578788 100644 --- a/app/src/main/res/values/dimens.xml +++ b/app/src/main/res/values/dimens.xml @@ -7,6 +7,10 @@ <dimen name="spacer_2x">16dp</dimen> <dimen name="spacer_3x">24dp</dimen> + <!-- Drawer header --> + <dimen name="drawer_header_height">100dp</dimen> + <dimen name="drawer_header_logo_size">42dp</dimen> + <!-- Buttons --> <dimen name="button_padding">@dimen/spacer_2x</dimen> |