tweak the placeholders at empty favorites

This commit is contained in:
tibbi 2018-01-07 22:39:17 +01:00
parent 5aa5b19550
commit bef2f89b79
3 changed files with 32 additions and 7 deletions

View file

@ -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
}

View file

@ -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"/>
<com.simplemobiletools.commons.views.MyTextView
android:id="@+id/manage_favorites_placeholder_2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/manage_favorites_placeholder"
android:layout_centerHorizontal="true"
android:background="?attr/selectableItemBackground"
android:gravity="center"
android:padding="@dimen/normal_margin"
android:text="@string/add_favorites"
android:textSize="@dimen/bigger_text_size"
android:visibility="gone"/>
</RelativeLayout>

View file

@ -4,6 +4,6 @@
<item
android:id="@+id/add_favorite"
android:icon="@drawable/ic_plus"
android:title="@string/add_to_favorites"
android:title="@string/add_favorites"
app:showAsAction="ifRoom"/>
</menu>