From ba6b88b5a92f5618da744ec8a4dd227dd1ae5b00 Mon Sep 17 00:00:00 2001 From: AndyScherzinger Date: Tue, 24 Oct 2017 21:22:01 +0200 Subject: [PATCH 01/10] list item styling Signed-off-by: Andy Scherzinger --- app/src/main/res/layout/rv_item_call.xml | 51 +++++++++++---------- app/src/main/res/layout/rv_item_contact.xml | 21 ++++----- app/src/main/res/values/dimens.xml | 5 ++ 3 files changed, 41 insertions(+), 36 deletions(-) diff --git a/app/src/main/res/layout/rv_item_call.xml b/app/src/main/res/layout/rv_item_call.xml index e7db1307f..2a0527ddf 100644 --- a/app/src/main/res/layout/rv_item_call.xml +++ b/app/src/main/res/layout/rv_item_call.xml @@ -22,17 +22,16 @@ + android:layout_height="@dimen/item_height"> - - - + android:orientation="vertical"> + + + + + + \ No newline at end of file diff --git a/app/src/main/res/layout/rv_item_contact.xml b/app/src/main/res/layout/rv_item_contact.xml index 3e928f0bf..67c1e7cb9 100644 --- a/app/src/main/res/layout/rv_item_contact.xml +++ b/app/src/main/res/layout/rv_item_contact.xml @@ -22,18 +22,17 @@ - \ 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 57b70e274..ddcf3af8b 100644 --- a/app/src/main/res/values/dimens.xml +++ b/app/src/main/res/values/dimens.xml @@ -3,11 +3,16 @@ 16dp 16dp + 72dp + 200dp 24dp 16dp + 16dp 8dp + 8dp + 40dp From 761bfb9c169f4c0671efa0b225fc4d2829a8b028 Mon Sep 17 00:00:00 2001 From: AndyScherzinger Date: Tue, 24 Oct 2017 21:37:04 +0200 Subject: [PATCH 02/10] add preview texts for Android Studio Signed-off-by: Andy Scherzinger --- app/src/main/res/layout/controller_generic_rv.xml | 5 +++-- app/src/main/res/layout/rv_item_call.xml | 9 +++++++-- app/src/main/res/layout/rv_item_contact.xml | 6 +++++- 3 files changed, 15 insertions(+), 5 deletions(-) diff --git a/app/src/main/res/layout/controller_generic_rv.xml b/app/src/main/res/layout/controller_generic_rv.xml index 11a67ce51..063b26d94 100644 --- a/app/src/main/res/layout/controller_generic_rv.xml +++ b/app/src/main/res/layout/controller_generic_rv.xml @@ -20,6 +20,7 @@ --> - + android:layout_height="match_parent" + tools:listitem="@layout/rv_item_call"/> \ No newline at end of file diff --git a/app/src/main/res/layout/rv_item_call.xml b/app/src/main/res/layout/rv_item_call.xml index 2a0527ddf..e25072d81 100644 --- a/app/src/main/res/layout/rv_item_call.xml +++ b/app/src/main/res/layout/rv_item_call.xml @@ -3,7 +3,9 @@ ~ Nextcloud Talk application ~ ~ @author Mario Danic + ~ @author Andy Scherzinger ~ Copyright (C) 2017 Mario Danic + ~ Copyright (C) 2017 Andy Scherzinger ~ ~ This program is free software: you can redistribute it and/or modify ~ it under the terms of the GNU General Public License as published by @@ -21,6 +23,7 @@ @@ -63,14 +66,16 @@ android:layout_height="wrap_content" android:ellipsize="middle" android:singleLine="true" - android:textAppearance="?android:attr/textAppearanceListItem"/> + android:textAppearance="?android:attr/textAppearanceListItem" + tools:text="Call item text"/> + android:textColor="?android:attr/textColorSecondary" + tools:text="30/12/2017 12:30am"/> diff --git a/app/src/main/res/layout/rv_item_contact.xml b/app/src/main/res/layout/rv_item_contact.xml index 67c1e7cb9..71433a8ac 100644 --- a/app/src/main/res/layout/rv_item_contact.xml +++ b/app/src/main/res/layout/rv_item_contact.xml @@ -3,7 +3,9 @@ ~ Nextcloud Talk application ~ ~ @author Mario Danic + ~ @author Andy Scherzinger ~ Copyright (C) 2017 Mario Danic + ~ Copyright (C) 2017 Andy Scherzinger ~ ~ This program is free software: you can redistribute it and/or modify ~ it under the terms of the GNU General Public License as published by @@ -21,6 +23,7 @@ @@ -58,6 +61,7 @@ android:ellipsize="end" android:layout_marginEnd="@dimen/activity_horizontal_margin" android:textAppearance="?android:attr/textAppearanceListItem" - android:layout_toEndOf="@id/avatar_image"/> + android:layout_toEndOf="@id/avatar_image" + tools:text="Contact item text"/> \ No newline at end of file From 951947f9f0dbd3f8b4b1033be65561259dd15115 Mon Sep 17 00:00:00 2001 From: AndyScherzinger Date: Tue, 24 Oct 2017 22:02:36 +0200 Subject: [PATCH 03/10] theming of swipe layout and list item decoration Signed-off-by: Andy Scherzinger --- .../talk/controllers/CallsListController.java | 14 ++++++--- .../talk/controllers/ContactsController.java | 15 ++++++--- app/src/main/res/drawable/divider.xml | 31 ------------------- 3 files changed, 20 insertions(+), 40 deletions(-) delete mode 100644 app/src/main/res/drawable/divider.xml diff --git a/app/src/main/java/com/nextcloud/talk/controllers/CallsListController.java b/app/src/main/java/com/nextcloud/talk/controllers/CallsListController.java index 072cef066..01d63d564 100644 --- a/app/src/main/java/com/nextcloud/talk/controllers/CallsListController.java +++ b/app/src/main/java/com/nextcloud/talk/controllers/CallsListController.java @@ -29,6 +29,8 @@ import android.support.annotation.Nullable; import android.support.design.widget.BottomNavigationView; import android.support.v4.view.MenuItemCompat; import android.support.v4.widget.SwipeRefreshLayout; +import android.support.v7.widget.DividerItemDecoration; +import android.support.v7.widget.LinearLayoutManager; import android.support.v7.widget.RecyclerView; import android.support.v7.widget.SearchView; import android.text.InputType; @@ -279,16 +281,20 @@ public class CallsListController extends BaseController implements SearchView.On } private void prepareViews() { - recyclerView.setLayoutManager(new SmoothScrollLinearLayoutManager(getActivity())); + LinearLayoutManager layoutManager = new SmoothScrollLinearLayoutManager(getActivity()); + recyclerView.setLayoutManager(layoutManager); recyclerView.setHasFixedSize(true); recyclerView.setAdapter(adapter); - recyclerView.addItemDecoration(new FlexibleItemDecoration(getActivity()) - .withDivider(R.drawable.divider)); + RecyclerView.ItemDecoration dividerItemDecoration = new DividerItemDecoration( + recyclerView.getContext(), + layoutManager.getOrientation() + ); + recyclerView.addItemDecoration(dividerItemDecoration); swipeRefreshLayout.setOnRefreshListener(() -> fetchData(true)); - swipeRefreshLayout.setProgressBackgroundColorSchemeColor(getResources().getColor(R.color.colorPrimary)); + swipeRefreshLayout.setColorSchemeResources(R.color.colorPrimary); } private void dispose(@Nullable Disposable disposable) { diff --git a/app/src/main/java/com/nextcloud/talk/controllers/ContactsController.java b/app/src/main/java/com/nextcloud/talk/controllers/ContactsController.java index 8ce1a5c38..a96e04046 100644 --- a/app/src/main/java/com/nextcloud/talk/controllers/ContactsController.java +++ b/app/src/main/java/com/nextcloud/talk/controllers/ContactsController.java @@ -29,6 +29,8 @@ import android.support.annotation.Nullable; import android.support.design.widget.BottomNavigationView; import android.support.v4.view.MenuItemCompat; import android.support.v4.widget.SwipeRefreshLayout; +import android.support.v7.widget.DividerItemDecoration; +import android.support.v7.widget.LinearLayoutManager; import android.support.v7.widget.RecyclerView; import android.support.v7.widget.SearchView; import android.text.InputType; @@ -69,7 +71,6 @@ import javax.inject.Inject; import autodagger.AutoInjector; import butterknife.BindView; import eu.davidea.flexibleadapter.FlexibleAdapter; -import eu.davidea.flexibleadapter.common.FlexibleItemDecoration; import eu.davidea.flexibleadapter.common.SmoothScrollLinearLayoutManager; import io.reactivex.android.schedulers.AndroidSchedulers; import io.reactivex.disposables.Disposable; @@ -327,15 +328,19 @@ public class ContactsController extends BaseController implements SearchView.OnQ } private void prepareViews() { - recyclerView.setLayoutManager(new SmoothScrollLinearLayoutManager(getActivity())); + LinearLayoutManager layoutManager = new SmoothScrollLinearLayoutManager(getActivity()); + recyclerView.setLayoutManager(layoutManager); recyclerView.setHasFixedSize(true); recyclerView.setAdapter(adapter); - recyclerView.addItemDecoration(new FlexibleItemDecoration(getActivity()) - .withDivider(R.drawable.divider)); + RecyclerView.ItemDecoration dividerItemDecoration = new DividerItemDecoration( + recyclerView.getContext(), + layoutManager.getOrientation() + ); + recyclerView.addItemDecoration(dividerItemDecoration); swipeRefreshLayout.setOnRefreshListener(() -> fetchData(true)); - swipeRefreshLayout.setProgressBackgroundColorSchemeColor(getResources().getColor(R.color.colorPrimary)); + swipeRefreshLayout.setColorSchemeResources(R.color.colorPrimary); } private void dispose(@Nullable Disposable disposable) { diff --git a/app/src/main/res/drawable/divider.xml b/app/src/main/res/drawable/divider.xml deleted file mode 100644 index 0d9702995..000000000 --- a/app/src/main/res/drawable/divider.xml +++ /dev/null @@ -1,31 +0,0 @@ - - - - - - - - - - \ No newline at end of file From c56d4fb0f60dec7f7698fde54b2a8990de909c19 Mon Sep 17 00:00:00 2001 From: AndyScherzinger Date: Tue, 24 Oct 2017 22:07:41 +0200 Subject: [PATCH 04/10] shorting setting of list item decoration Signed-off-by: Andy Scherzinger --- .../com/nextcloud/talk/controllers/CallsListController.java | 5 ++--- .../com/nextcloud/talk/controllers/ContactsController.java | 5 ++--- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/app/src/main/java/com/nextcloud/talk/controllers/CallsListController.java b/app/src/main/java/com/nextcloud/talk/controllers/CallsListController.java index 01d63d564..8dfff3f1c 100644 --- a/app/src/main/java/com/nextcloud/talk/controllers/CallsListController.java +++ b/app/src/main/java/com/nextcloud/talk/controllers/CallsListController.java @@ -287,11 +287,10 @@ public class CallsListController extends BaseController implements SearchView.On recyclerView.setAdapter(adapter); - RecyclerView.ItemDecoration dividerItemDecoration = new DividerItemDecoration( + recyclerView.addItemDecoration(new DividerItemDecoration( recyclerView.getContext(), layoutManager.getOrientation() - ); - recyclerView.addItemDecoration(dividerItemDecoration); + )); swipeRefreshLayout.setOnRefreshListener(() -> fetchData(true)); swipeRefreshLayout.setColorSchemeResources(R.color.colorPrimary); diff --git a/app/src/main/java/com/nextcloud/talk/controllers/ContactsController.java b/app/src/main/java/com/nextcloud/talk/controllers/ContactsController.java index a96e04046..043741d76 100644 --- a/app/src/main/java/com/nextcloud/talk/controllers/ContactsController.java +++ b/app/src/main/java/com/nextcloud/talk/controllers/ContactsController.java @@ -333,11 +333,10 @@ public class ContactsController extends BaseController implements SearchView.OnQ recyclerView.setHasFixedSize(true); recyclerView.setAdapter(adapter); - RecyclerView.ItemDecoration dividerItemDecoration = new DividerItemDecoration( + recyclerView.addItemDecoration(new DividerItemDecoration( recyclerView.getContext(), layoutManager.getOrientation() - ); - recyclerView.addItemDecoration(dividerItemDecoration); + )); swipeRefreshLayout.setOnRefreshListener(() -> fetchData(true)); swipeRefreshLayout.setColorSchemeResources(R.color.colorPrimary); From f0e28c818c36963f576753ef9210481c1431473b Mon Sep 17 00:00:00 2001 From: AndyScherzinger Date: Tue, 24 Oct 2017 22:17:06 +0200 Subject: [PATCH 05/10] fix lint errors: Use -0.xx instead of -.xx to avoid crashes on some devices Signed-off-by: Andy Scherzinger --- app/src/main/res/drawable/ic_search_white_24dp.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/src/main/res/drawable/ic_search_white_24dp.xml b/app/src/main/res/drawable/ic_search_white_24dp.xml index a23fcd1be..7c24d66dd 100644 --- a/app/src/main/res/drawable/ic_search_white_24dp.xml +++ b/app/src/main/res/drawable/ic_search_white_24dp.xml @@ -27,8 +27,8 @@ Date: Tue, 24 Oct 2017 22:53:49 +0200 Subject: [PATCH 06/10] change loading design according to Nc files client Signed-off-by: Andy Scherzinger --- .../main/res/layout/controller_account_verification.xml | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/app/src/main/res/layout/controller_account_verification.xml b/app/src/main/res/layout/controller_account_verification.xml index 5e2cf1ddb..8d30e61a9 100644 --- a/app/src/main/res/layout/controller_account_verification.xml +++ b/app/src/main/res/layout/controller_account_verification.xml @@ -20,14 +20,15 @@ --> + android:textSize="26sp" + tools:text="Verifying..."/> \ No newline at end of file From 6ffb64d388c2d3613c9add9902c83661555e21a5 Mon Sep 17 00:00:00 2001 From: AndyScherzinger Date: Tue, 24 Oct 2017 22:56:50 +0200 Subject: [PATCH 07/10] centralize avatar corner radius value Signed-off-by: Andy Scherzinger --- app/src/main/res/layout/rv_item_call.xml | 4 ++-- app/src/main/res/layout/rv_item_contact.xml | 4 ++-- app/src/main/res/values/dimens.xml | 1 + 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/app/src/main/res/layout/rv_item_call.xml b/app/src/main/res/layout/rv_item_call.xml index e25072d81..57e12edc6 100644 --- a/app/src/main/res/layout/rv_item_call.xml +++ b/app/src/main/res/layout/rv_item_call.xml @@ -36,7 +36,7 @@ android:layout_marginEnd="@dimen/activity_horizontal_margin" android:layout_marginStart="@dimen/activity_horizontal_margin" android:scaleType="centerInside" - app:aiv_CornerRadius="20dp" + app:aiv_CornerRadius="@dimen/avatar_corner_radius" app:aiv_ShowBoarder="false" app:aiv_TextSizeRatio="0.5"/> @@ -48,7 +48,7 @@ android:layout_marginEnd="@dimen/activity_horizontal_margin" android:layout_marginStart="@dimen/activity_horizontal_margin" android:scaleType="centerInside" - app:aiv_CornerRadius="20dp" + app:aiv_CornerRadius="@dimen/avatar_corner_radius" app:aiv_ShowBoarder="false" app:aiv_TextSizeRatio="0.5"/> diff --git a/app/src/main/res/layout/rv_item_contact.xml b/app/src/main/res/layout/rv_item_contact.xml index 71433a8ac..cd1b193e0 100644 --- a/app/src/main/res/layout/rv_item_contact.xml +++ b/app/src/main/res/layout/rv_item_contact.xml @@ -37,7 +37,7 @@ android:layout_marginEnd="@dimen/activity_horizontal_margin" android:layout_marginStart="@dimen/activity_horizontal_margin" android:scaleType="centerInside" - app:aiv_CornerRadius="20dp" + app:aiv_CornerRadius="@dimen/avatar_corner_radius" app:aiv_ShowBoarder="false" app:aiv_TextSizeRatio="0.5"/> @@ -49,7 +49,7 @@ android:layout_marginEnd="@dimen/activity_horizontal_margin" android:layout_marginStart="@dimen/activity_horizontal_margin" android:scaleType="centerInside" - app:aiv_CornerRadius="20dp" + app:aiv_CornerRadius="@dimen/avatar_corner_radius" app:aiv_ShowBoarder="false" app:aiv_TextSizeRatio="0.5"/> diff --git a/app/src/main/res/values/dimens.xml b/app/src/main/res/values/dimens.xml index ddcf3af8b..b9e2a169b 100644 --- a/app/src/main/res/values/dimens.xml +++ b/app/src/main/res/values/dimens.xml @@ -14,5 +14,6 @@ 8dp 8dp 40dp + 20dp From db3d640bcc1b403ef016a8e599d7eeab07707712 Mon Sep 17 00:00:00 2001 From: AndyScherzinger Date: Tue, 24 Oct 2017 23:18:34 +0200 Subject: [PATCH 08/10] add new line at EOF Signed-off-by: Andy Scherzinger --- app/src/main/res/layout/controller_account_verification.xml | 3 +-- app/src/main/res/layout/controller_bottom_navigation.xml | 2 +- app/src/main/res/layout/controller_generic_rv.xml | 2 +- app/src/main/res/layout/controller_server_selection.xml | 2 +- app/src/main/res/layout/controller_settings.xml | 2 +- app/src/main/res/layout/controller_web_view_login.xml | 2 +- app/src/main/res/layout/rv_item_call.xml | 2 +- app/src/main/res/layout/rv_item_contact.xml | 2 +- 8 files changed, 8 insertions(+), 9 deletions(-) diff --git a/app/src/main/res/layout/controller_account_verification.xml b/app/src/main/res/layout/controller_account_verification.xml index 8d30e61a9..d7ecf224b 100644 --- a/app/src/main/res/layout/controller_account_verification.xml +++ b/app/src/main/res/layout/controller_account_verification.xml @@ -52,5 +52,4 @@ android:textSize="26sp" tools:text="Verifying..."/> - - \ No newline at end of file + diff --git a/app/src/main/res/layout/controller_bottom_navigation.xml b/app/src/main/res/layout/controller_bottom_navigation.xml index d262a422d..7d27cf978 100644 --- a/app/src/main/res/layout/controller_bottom_navigation.xml +++ b/app/src/main/res/layout/controller_bottom_navigation.xml @@ -22,4 +22,4 @@ android:layout_gravity="bottom" android:animateLayoutChanges="true" android:background="?android:attr/windowBackground"/> - \ No newline at end of file + diff --git a/app/src/main/res/layout/controller_generic_rv.xml b/app/src/main/res/layout/controller_generic_rv.xml index 063b26d94..4b6acec43 100644 --- a/app/src/main/res/layout/controller_generic_rv.xml +++ b/app/src/main/res/layout/controller_generic_rv.xml @@ -32,4 +32,4 @@ android:layout_height="match_parent" tools:listitem="@layout/rv_item_call"/> - \ No newline at end of file + diff --git a/app/src/main/res/layout/controller_server_selection.xml b/app/src/main/res/layout/controller_server_selection.xml index 1d0459d5a..93eb2fe83 100644 --- a/app/src/main/res/layout/controller_server_selection.xml +++ b/app/src/main/res/layout/controller_server_selection.xml @@ -47,4 +47,4 @@ - \ No newline at end of file + diff --git a/app/src/main/res/layout/controller_settings.xml b/app/src/main/res/layout/controller_settings.xml index 5a15ddc13..afe912e1f 100644 --- a/app/src/main/res/layout/controller_settings.xml +++ b/app/src/main/res/layout/controller_settings.xml @@ -23,4 +23,4 @@ android:layout_width="match_parent" android:layout_height="match_parent"> - \ No newline at end of file + diff --git a/app/src/main/res/layout/controller_web_view_login.xml b/app/src/main/res/layout/controller_web_view_login.xml index 9d012a362..731b7c08c 100644 --- a/app/src/main/res/layout/controller_web_view_login.xml +++ b/app/src/main/res/layout/controller_web_view_login.xml @@ -31,4 +31,4 @@ - \ No newline at end of file + diff --git a/app/src/main/res/layout/rv_item_call.xml b/app/src/main/res/layout/rv_item_call.xml index 57e12edc6..1bc65f680 100644 --- a/app/src/main/res/layout/rv_item_call.xml +++ b/app/src/main/res/layout/rv_item_call.xml @@ -79,4 +79,4 @@ - \ No newline at end of file + diff --git a/app/src/main/res/layout/rv_item_contact.xml b/app/src/main/res/layout/rv_item_contact.xml index cd1b193e0..e06eb2a08 100644 --- a/app/src/main/res/layout/rv_item_contact.xml +++ b/app/src/main/res/layout/rv_item_contact.xml @@ -64,4 +64,4 @@ android:layout_toEndOf="@id/avatar_image" tools:text="Contact item text"/> - \ No newline at end of file + From d23561a8291ffbe37b6d321dc77e9c2ddebfb592 Mon Sep 17 00:00:00 2001 From: AndyScherzinger Date: Tue, 24 Oct 2017 23:31:28 +0200 Subject: [PATCH 09/10] changed timestamp to relative value Signed-off-by: Andy Scherzinger --- app/src/main/res/layout/rv_item_call.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/main/res/layout/rv_item_call.xml b/app/src/main/res/layout/rv_item_call.xml index 1bc65f680..9dd41290e 100644 --- a/app/src/main/res/layout/rv_item_call.xml +++ b/app/src/main/res/layout/rv_item_call.xml @@ -75,7 +75,7 @@ android:layout_height="wrap_content" android:singleLine="true" android:textColor="?android:attr/textColorSecondary" - tools:text="30/12/2017 12:30am"/> + tools:text="A week ago"/> From 9bdd22913f0b226e5ef2b827c9eedda7d5039dc0 Mon Sep 17 00:00:00 2001 From: AndyScherzinger Date: Tue, 24 Oct 2017 23:37:36 +0200 Subject: [PATCH 10/10] changed siez to 18sp Signed-off-by: Andy Scherzinger --- app/src/main/res/layout/controller_account_verification.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/main/res/layout/controller_account_verification.xml b/app/src/main/res/layout/controller_account_verification.xml index d7ecf224b..cde4fc930 100644 --- a/app/src/main/res/layout/controller_account_verification.xml +++ b/app/src/main/res/layout/controller_account_verification.xml @@ -49,7 +49,7 @@ android:layout_marginRight="@dimen/activity_horizontal_margin" android:layout_marginStart="@dimen/activity_horizontal_margin" android:layout_marginTop="@dimen/padding_between_elements" - android:textSize="26sp" + android:textSize="18sp" tools:text="Verifying..."/>