Skip to content

Commit

Permalink
show a placeholder if not recents are found
Browse files Browse the repository at this point in the history
  • Loading branch information
tibbi committed May 19, 2021
1 parent 92092b6 commit b526ae5
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,19 @@ import android.content.Context
import android.provider.MediaStore
import android.util.AttributeSet
import androidx.recyclerview.widget.GridLayoutManager
import com.simplemobiletools.commons.extensions.beVisibleIf
import com.simplemobiletools.commons.extensions.getLongValue
import com.simplemobiletools.commons.extensions.getStringValue
import com.simplemobiletools.commons.helpers.VIEW_TYPE_GRID
import com.simplemobiletools.commons.helpers.VIEW_TYPE_LIST
import com.simplemobiletools.commons.helpers.ensureBackgroundThread
import com.simplemobiletools.commons.helpers.mydebug
import com.simplemobiletools.commons.models.FileDirItem
import com.simplemobiletools.commons.views.MyGridLayoutManager
import com.simplemobiletools.filemanager.pro.activities.SimpleActivity
import com.simplemobiletools.filemanager.pro.adapters.ItemsAdapter
import com.simplemobiletools.filemanager.pro.extensions.config
import com.simplemobiletools.filemanager.pro.interfaces.ItemOperationsListener
import com.simplemobiletools.filemanager.pro.models.ListItem
import kotlinx.android.synthetic.main.items_fragment.view.*
import kotlinx.android.synthetic.main.recents_fragment.view.*
import java.util.*

Expand All @@ -35,6 +34,8 @@ class RecentsFragment(context: Context, attributeSet: AttributeSet) : MyViewPage
ensureBackgroundThread {
getRecents { recents ->
recents_swipe_refresh?.isRefreshing = false
recents_list.beVisibleIf(recents.isNotEmpty())
recents_placeholder.beVisibleIf(recents.isEmpty())
addItems(recents, false)

if (context != null && currentViewType != context!!.config.getFolderViewType(currentPath)) {
Expand Down
1 change: 1 addition & 0 deletions app/src/main/res/layout/recents_fragment.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_marginTop="@dimen/activity_margin"
android:alpha="0.8"
android:gravity="center"
android:paddingStart="@dimen/activity_margin"
Expand Down

0 comments on commit b526ae5

Please sign in to comment.