From 68e7718ea563942ce182eb51c50d84797fbbd2e3 Mon Sep 17 00:00:00 2001 From: Jeff Boek Date: Tue, 23 Apr 2019 16:18:59 -0700 Subject: [PATCH] [fenix] For https://github.com/mozilla-mobile/fenix/issues/1843 - Adds the selected tabs button --- .../collections/CollectionCreationUIView.kt | 9 ++- .../add_tabs_to_collection_background.xml | 9 +++ .../layout/component_collection_creation.xml | 59 ++++++++++++++++++- .../res/layout/fragment_create_collection.xml | 1 + app/src/main/res/values/strings.xml | 13 ++++ 5 files changed, 87 insertions(+), 4 deletions(-) create mode 100644 app/src/main/res/drawable/add_tabs_to_collection_background.xml diff --git a/app/src/main/java/org/mozilla/fenix/collections/CollectionCreationUIView.kt b/app/src/main/java/org/mozilla/fenix/collections/CollectionCreationUIView.kt index ac95af1963..aa6925eb03 100644 --- a/app/src/main/java/org/mozilla/fenix/collections/CollectionCreationUIView.kt +++ b/app/src/main/java/org/mozilla/fenix/collections/CollectionCreationUIView.kt @@ -4,7 +4,6 @@ package org.mozilla.fenix.collections License, v. 2.0. If a copy of the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/. */ -import android.util.Log import android.view.LayoutInflater import android.view.ViewGroup import androidx.recyclerview.widget.LinearLayoutManager @@ -47,5 +46,13 @@ class CollectionCreationUIView( override fun updateView() = Consumer { collectionCreationTabListAdapter.updateData(it.tabs, it.selectedTabs) + + val buttonText = if (it.selectedTabs.isEmpty()) { + view.context.getString(R.string.create_collection_save_to_collection_empty) + } else { + view.context.getString(R.string.create_collection_save_to_collection_full, it.selectedTabs.size) + } + + view.add_tabs_button_text.text = buttonText } } \ No newline at end of file diff --git a/app/src/main/res/drawable/add_tabs_to_collection_background.xml b/app/src/main/res/drawable/add_tabs_to_collection_background.xml new file mode 100644 index 0000000000..6b6d8c02a1 --- /dev/null +++ b/app/src/main/res/drawable/add_tabs_to_collection_background.xml @@ -0,0 +1,9 @@ + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/layout/component_collection_creation.xml b/app/src/main/res/layout/component_collection_creation.xml index c9cf419956..0e3efaaf1a 100644 --- a/app/src/main/res/layout/component_collection_creation.xml +++ b/app/src/main/res/layout/component_collection_creation.xml @@ -6,6 +6,7 @@ xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" + android:clipToPadding="false" xmlns:app="http://schemas.android.com/apk/res-auto">