From bef2f89b793d4da966e549686e30a0d45087429a Mon Sep 17 00:00:00 2001 From: tibbi Date: Sun, 7 Jan 2018 22:39:17 +0100 Subject: [PATCH] tweak the placeholders at empty favorites --- .../activities/FavoritesActivity.kt | 13 ++++++++-- .../main/res/layout/activity_favorites.xml | 24 +++++++++++++++---- app/src/main/res/menu/menu_favorites.xml | 2 +- 3 files changed, 32 insertions(+), 7 deletions(-) diff --git a/app/src/main/kotlin/com/simplemobiletools/filemanager/activities/FavoritesActivity.kt b/app/src/main/kotlin/com/simplemobiletools/filemanager/activities/FavoritesActivity.kt index 49cfe071..51504384 100644 --- a/app/src/main/kotlin/com/simplemobiletools/filemanager/activities/FavoritesActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/filemanager/activities/FavoritesActivity.kt @@ -1,10 +1,12 @@ package com.simplemobiletools.filemanager.activities +import android.graphics.Paint import android.os.Bundle import android.view.Menu import android.view.MenuItem import com.simplemobiletools.commons.dialogs.FilePickerDialog import com.simplemobiletools.commons.extensions.beVisibleIf +import com.simplemobiletools.commons.extensions.getAdjustedPrimaryColor import com.simplemobiletools.commons.interfaces.RefreshRecyclerViewListener import com.simplemobiletools.filemanager.R import com.simplemobiletools.filemanager.adapters.ManageFavoritesAdapter @@ -24,9 +26,16 @@ class FavoritesActivity : SimpleActivity(), RefreshRecyclerViewListener { manage_favorites_placeholder.beVisibleIf(favorites.isEmpty()) manage_favorites_placeholder.setTextColor(config.textColor) - ManageFavoritesAdapter(this, favorites, this, manage_favorites_list) { + manage_favorites_placeholder_2.apply { + paintFlags = paintFlags or Paint.UNDERLINE_TEXT_FLAG + beVisibleIf(favorites.isEmpty()) + setTextColor(getAdjustedPrimaryColor()) + setOnClickListener { + addFavorite() + } + } - }.apply { + ManageFavoritesAdapter(this, favorites, this, manage_favorites_list) { }.apply { setupDragListener(true) manage_favorites_list.adapter = this } diff --git a/app/src/main/res/layout/activity_favorites.xml b/app/src/main/res/layout/activity_favorites.xml index 3e58fc9e..b7269764 100644 --- a/app/src/main/res/layout/activity_favorites.xml +++ b/app/src/main/res/layout/activity_favorites.xml @@ -17,11 +17,27 @@ android:id="@+id/manage_favorites_placeholder" android:layout_width="match_parent" android:layout_height="wrap_content" - android:gravity="center_horizontal" - android:paddingLeft="@dimen/big_margin" - android:paddingRight="@dimen/big_margin" - android:paddingTop="@dimen/activity_margin" + android:layout_centerHorizontal="true" + android:layout_marginBottom="@dimen/small_margin" + android:layout_marginTop="@dimen/activity_margin" + android:gravity="center" + android:lineSpacingExtra="@dimen/tiny_margin" + android:paddingLeft="@dimen/activity_margin" + android:paddingRight="@dimen/activity_margin" android:text="@string/favorites_activity_placeholder" android:visibility="gone"/> + + diff --git a/app/src/main/res/menu/menu_favorites.xml b/app/src/main/res/menu/menu_favorites.xml index e613ff15..b4839649 100644 --- a/app/src/main/res/menu/menu_favorites.xml +++ b/app/src/main/res/menu/menu_favorites.xml @@ -4,6 +4,6 @@