diff options
author | Christian Lohmaier <lohmaier+LibreOffice@googlemail.com> | 2017-09-06 23:40:11 +0200 |
---|---|---|
committer | Christian Lohmaier <lohmaier+LibreOffice@googlemail.com> | 2018-01-18 11:15:31 +0100 |
commit | 64619789a45babbaa3071951e3502927f191e459 (patch) | |
tree | 6d2becf15831823018f37b8f7972e6136327948d /android/source/res/layout | |
parent | cd581e18d6e334cc393c7bb497e07871bb962cde (diff) |
android: fix some layout issues with new-document buttons
functionality to create new documents was added for tdf#106325 with
commit 1503769fe15c122ff2bb8f6f7e7b4ab72656ddc2
However the commit had some issues, most notably clipping of the shadow
effect and alignment issues to to scaling down (via the animation
effect, took me quite a while until I looked at that) with having a
centered pivot. I think it was due to those alignment issues that the
label was set to a fixed with - which is a problem for future
translation.
This commit:
* changes the animation to not scale down the initial views
* changes the FABs' setting to use compatPadding - this not only ensures
enough room for the shadow, but also allows for consistent look across
android versions. Side effect is that it needs more height, so
* the effect was adjusted accordingly, to shrink to/expand from the
lower-right corner of the parent view, instead of "mid-air"
* the labels were given a proper background drawable with rounded
corners and some padding for a (much more9 polished look
* formatting of the labels was split out to a style, for ease of
tweaking the looks
* add tools:visibility statement to see the elements in layout editor
* fixed the strings for the labels (and ID) to some less awkward ones
Change-Id: Ifd2d90ec8d23e40603edff19c9af9e0b32090c9f
Reviewed-on: https://gerrit.libreoffice.org/42033
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Christian Lohmaier <lohmaier+LibreOffice@googlemail.com>
Diffstat (limited to 'android/source/res/layout')
-rw-r--r-- | android/source/res/layout/activity_document_browser.xml | 113 |
1 files changed, 48 insertions, 65 deletions
diff --git a/android/source/res/layout/activity_document_browser.xml b/android/source/res/layout/activity_document_browser.xml index 9f62f5f22a3e..1f26195c2025 100644 --- a/android/source/res/layout/activity_document_browser.xml +++ b/android/source/res/layout/activity_document_browser.xml @@ -124,15 +124,13 @@ android:id="@+id/editFAB" android:layout_width="wrap_content" android:layout_height="wrap_content" - android:layout_marginBottom="16dp" - android:layout_marginEnd="16dp" - android:layout_marginRight="16dp" android:clickable="true" + app:backgroundTint="@color/background_normal" app:fabSize="normal" app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintRight_toRightOf="parent" - app:backgroundTint="@color/background_normal" - app:srcCompat="@drawable/ic_add_black_24dp" /> + app:srcCompat="@drawable/ic_add_black_24dp" + app:useCompatPadding="true" /> <LinearLayout android:id="@+id/writerLayout" @@ -141,31 +139,28 @@ android:gravity="center_vertical" android:orientation="horizontal" android:visibility="invisible" - app:layout_constraintBottom_toTopOf="@+id/editFAB" - app:layout_constraintRight_toRightOf="parent"> + app:layout_constraintBottom_toTopOf="@id/editFAB" + app:layout_constraintRight_toRightOf="@id/editFAB" + tools:visibility="visible"> <TextView android:id="@+id/newWriterTextView" - android:layout_width="120dp" - android:layout_height="wrap_content" - android:layout_marginEnd="8dp" - android:layout_marginRight="8dp" - android:elevation="2dp" - android:gravity="center_horizontal" - android:text="@string/new_write" - android:textSize="18sp" - android:textStyle="bold" - android:background="@color/background_normal" - android:typeface="normal" /> + style="@style/NewDocumentTextView" + android:layout_marginBottom="@dimen/new_doc_fab_tweak_bottom" + android:layout_marginTop="@dimen/new_doc_fab_tweak_top" + android:text="@string/new_textdocument" /> <android.support.design.widget.FloatingActionButton android:id="@+id/newWriterFAB" android:layout_width="wrap_content" android:layout_height="wrap_content" + android:layout_marginBottom="@dimen/new_doc_fab_tweak_bottom" + android:layout_marginTop="@dimen/new_doc_fab_tweak_top" android:clickable="true" - app:fabSize="normal" app:backgroundTint="@color/background_normal" - app:srcCompat="@drawable/writer" /> + app:fabSize="mini" + app:srcCompat="@drawable/writer" + app:useCompatPadding="true" /> </LinearLayout> @@ -177,31 +172,27 @@ android:orientation="horizontal" android:visibility="invisible" app:layout_constraintBottom_toTopOf="@+id/writerLayout" - app:layout_constraintLeft_toLeftOf="@+id/writerLayout" - app:layout_constraintRight_toRightOf="parent"> + app:layout_constraintRight_toRightOf="@id/editFAB" + tools:visibility="visible"> <TextView android:id="@+id/newImpressTextView" - android:layout_width="120dp" - android:layout_height="wrap_content" - android:layout_marginEnd="8dp" - android:layout_marginRight="8dp" - android:elevation="2dp" - android:gravity="center_horizontal" - android:text="@string/new_impress" - android:textSize="18sp" - android:textStyle="bold" - android:background="@color/background_normal" - android:typeface="normal" /> + style="@style/NewDocumentTextView" + android:layout_marginBottom="@dimen/new_doc_fab_tweak_bottom" + android:layout_marginTop="@dimen/new_doc_fab_tweak_top" + android:text="@string/new_presentation" /> <android.support.design.widget.FloatingActionButton android:id="@+id/newImpressFAB" android:layout_width="wrap_content" android:layout_height="wrap_content" + android:layout_marginBottom="@dimen/new_doc_fab_tweak_bottom" + android:layout_marginTop="@dimen/new_doc_fab_tweak_top" android:clickable="true" - app:fabSize="normal" app:backgroundTint="@color/background_normal" - app:srcCompat="@drawable/impress" /> + app:fabSize="mini" + app:srcCompat="@drawable/impress" + app:useCompatPadding="true" /> </LinearLayout> @@ -212,32 +203,28 @@ android:gravity="center_vertical" android:orientation="horizontal" android:visibility="invisible" + tools:visibility="visible" app:layout_constraintBottom_toTopOf="@+id/impressLayout" - app:layout_constraintLeft_toLeftOf="@+id/impressLayout" - app:layout_constraintRight_toRightOf="parent"> + app:layout_constraintRight_toRightOf="@id/editFAB"> <TextView android:id="@+id/newCalcTextView" - android:layout_width="120dp" - android:layout_height="wrap_content" - android:layout_marginEnd="8dp" - android:layout_marginRight="8dp" - android:elevation="2dp" - android:gravity="center_horizontal" - android:text="@string/new_spreadsheet" - android:background="@color/background_normal" - android:textSize="18sp" - android:textStyle="bold" - android:typeface="normal" /> + style="@style/NewDocumentTextView" + android:layout_marginBottom="@dimen/new_doc_fab_tweak_bottom" + android:layout_marginTop="@dimen/new_doc_fab_tweak_top" + android:text="@string/new_spreadsheet" /> <android.support.design.widget.FloatingActionButton android:id="@+id/newCalcFAB" android:layout_width="wrap_content" android:layout_height="wrap_content" + android:layout_marginBottom="@dimen/new_doc_fab_tweak_bottom" + android:layout_marginTop="@dimen/new_doc_fab_tweak_top" android:clickable="true" - app:fabSize="normal" app:backgroundTint="@color/background_normal" - app:srcCompat="@drawable/calc" /> + app:fabSize="mini" + app:srcCompat="@drawable/calc" + app:useCompatPadding="true" /> </LinearLayout> @@ -248,32 +235,28 @@ android:gravity="center_vertical" android:orientation="horizontal" android:visibility="invisible" + tools:visibility="visible" app:layout_constraintBottom_toTopOf="@+id/calcLayout" - app:layout_constraintLeft_toLeftOf="@+id/calcLayout" - app:layout_constraintRight_toRightOf="parent"> + app:layout_constraintRight_toRightOf="@id/editFAB"> <TextView android:id="@+id/newDrawTextView" - android:layout_width="120dp" - android:layout_height="wrap_content" - android:layout_marginEnd="8dp" - android:layout_marginRight="8dp" - android:elevation="2dp" - android:gravity="center_horizontal" - android:text="@string/new_draw" - android:background="@color/background_normal" - android:textSize="18sp" - android:textStyle="bold" - android:typeface="normal" /> + style="@style/NewDocumentTextView" + android:layout_marginBottom="@dimen/new_doc_fab_tweak_bottom" + android:layout_marginTop="@dimen/new_doc_fab_tweak_top" + android:text="@string/new_drawing" /> <android.support.design.widget.FloatingActionButton android:id="@+id/newDrawFAB" android:layout_width="wrap_content" android:layout_height="wrap_content" + android:layout_marginBottom="@dimen/new_doc_fab_tweak_bottom" + android:layout_marginTop="@dimen/new_doc_fab_tweak_top" android:clickable="true" - app:fabSize="normal" app:backgroundTint="@color/background_normal" - app:srcCompat="@drawable/draw" /> + app:fabSize="mini" + app:srcCompat="@drawable/draw" + app:useCompatPadding="true" /> </LinearLayout> |