添加最近阅读,优化界面展示。

This commit is contained in:
ocean 2025-09-19 15:08:36 +08:00
parent 82bf542cbb
commit 9608ccf4f3
35 changed files with 558 additions and 157 deletions

View File

@ -29,6 +29,9 @@ interface PdfDocumentDao {
@Query("SELECT * FROM pdf_documents ORDER BY lastOpenedTime DESC")
fun getAllDocuments(): Flow<List<PdfDocumentEntity>>
@Query("SELECT * FROM pdf_documents WHERE lastOpenedTime > 0 ORDER BY lastOpenedTime DESC")
fun getRecentlyOpenedDocuments(): Flow<List<PdfDocumentEntity>>
@Query("SELECT * FROM pdf_documents ORDER BY lastOpenedTime DESC")
suspend fun getAllDocumentsOnce(): List<PdfDocumentEntity>
@ -44,4 +47,8 @@ interface PdfDocumentDao {
@Query("UPDATE pdf_documents SET isPassword = :hasPassword WHERE filePath = :filePath")
suspend fun updateIsPassword(filePath: String, hasPassword: Boolean)
@Query("UPDATE pdf_documents SET lastOpenedTime = :time WHERE filePath = :filePath")
suspend fun updateLastOpenTime(filePath: String, time: Long)
}

View File

@ -35,6 +35,9 @@ class PdfRepository private constructor(context: Context) {
suspend fun getAllDocumentsOnce(): List<PdfDocumentEntity> = pdfDao.getAllDocumentsOnce()
fun getAllDocuments(): Flow<List<PdfDocumentEntity>> = pdfDao.getAllDocuments()
fun getRecentlyOpenedDocuments(): Flow<List<PdfDocumentEntity>> =
pdfDao.getRecentlyOpenedDocuments()
fun getFavoriteDocuments(): Flow<List<PdfDocumentEntity>> = pdfDao.getFavoriteDocuments()
fun searchDocuments(query: String): Flow<List<PdfDocumentEntity>> =
pdfDao.searchDocuments(query)
@ -52,6 +55,11 @@ class PdfRepository private constructor(context: Context) {
pdfDao.updateIsPassword(filePath, hasPassword)
}
//更新最后打开时间可以设置为0L相当于更新成未打开过。
suspend fun updateLastOpenTime(filePath: String, time: Long) {
pdfDao.updateLastOpenTime(filePath, time)
}
suspend fun updateFavoriteStatus(filePath: String, isFavorite: Boolean) {
val document = pdfDao.getByPath(filePath)?.copy(
isFavorite = isFavorite,

View File

@ -67,7 +67,6 @@ class MainActivity : BaseActivity(), PermissionDialogFragment.PermissionCallback
supportFragmentManager.beginTransaction().hide(homeFragment).hide(recentlyFragment)
.hide(favoriteFragment).hide(toolsFragment).show(activeFragment).commit()
}
updateSelectedNav(activeFragment)
}
private fun initObserve() {
@ -79,28 +78,28 @@ class MainActivity : BaseActivity(), PermissionDialogFragment.PermissionCallback
showToast(event.renameResult.errorMessage.toString())
}
}
viewModel.fileActionEvent.observeEvent<FileActionEvent.Delete>(this){ event ->
viewModel.fileActionEvent.observeEvent<FileActionEvent.Delete>(this) { event ->
if (event.deleteResult.success) {
showToast(getString(R.string.delete_successfully))
} else {
showToast(event.deleteResult.errorMessage.toString())
}
}
viewModel.fileActionEvent.observeEvent<FileActionEvent.Favorite>(this){ event ->
viewModel.fileActionEvent.observeEvent<FileActionEvent.Favorite>(this) { event ->
if (event.isFavorite) {
showToast(getString(R.string.added_to_favorites))
} else {
showToast(getString(R.string.removed_from_favorites))
}
}
viewModel.fileActionEvent.observeEvent<FileActionEvent.Duplicate>(this){ event ->
viewModel.fileActionEvent.observeEvent<FileActionEvent.Duplicate>(this) { event ->
if (event.file != null) {
showToast(getString(R.string.duplicate_created_successfully))
} else {
showToast(getString(R.string.duplicate_created_failed))
}
}
viewModel.fileActionEvent.observeEvent<FileActionEvent.SetPassword>(this){ event ->
viewModel.fileActionEvent.observeEvent<FileActionEvent.SetPassword>(this) { event ->
when (event.status) {
FileActionEvent.SetPassword.Status.START -> {
progressDialog = ProgressDialogFragment()
@ -118,7 +117,7 @@ class MainActivity : BaseActivity(), PermissionDialogFragment.PermissionCallback
}
}
}
viewModel.fileActionEvent.observeEvent<FileActionEvent.RemovePassword>(this){ event ->
viewModel.fileActionEvent.observeEvent<FileActionEvent.RemovePassword>(this) { event ->
when (event.status) {
FileActionEvent.RemovePassword.Status.START -> {
progressDialog = ProgressDialogFragment()
@ -185,26 +184,70 @@ class MainActivity : BaseActivity(), PermissionDialogFragment.PermissionCallback
}
private fun updateSelectedNav(fragment: Fragment) {
binding.homeIv.alpha = 0.5f
binding.recentlyIv.alpha = 0.5f
binding.favoriteIv.alpha = 0.5f
binding.toolsIv.alpha = 0.5f
if (fragment is ToolsFrag) {//工具界面不展示权限
binding.pnLayout.visibility = View.GONE
} else {
if (!StoragePermissionHelper.hasBasicStoragePermission(this)) {
binding.pnLayout.visibility = View.VISIBLE
}
val targetIcon = when (fragment) {
is HomeFrag -> binding.homeIv
is RecentlyFrag -> binding.recentlyIv
is FavoriteFrag -> binding.favoriteIv
is ToolsFrag -> binding.toolsIv
else -> null
}
targetIcon?.apply {
alpha = 1f
animate().scaleX(1.2f).scaleY(1.2f).setDuration(150).withEndAction {
animate().scaleX(1f).scaleY(1f).setDuration(150).start()
}.start()
if (fragment is HomeFrag) {
if (StoragePermissionHelper.hasBasicStoragePermission(this)) {
binding.topButtonLayout.visibility = View.VISIBLE
} else {
binding.topButtonLayout.visibility = View.GONE
}
} else {
binding.topButtonLayout.visibility = View.GONE
}
when (fragment) {
is HomeFrag -> {
binding.homeIv.setImageResource(R.drawable.icon_home_sel_on)
binding.recentlyIv.setImageResource(R.drawable.icon_recently_sel_off)
binding.favoriteIv.setImageResource(R.drawable.collect)
binding.toolsIv.setImageResource(R.drawable.icon_tools_sel_off)
}
is RecentlyFrag -> {
binding.homeIv.setImageResource(R.drawable.icon_home_sel_off)
binding.recentlyIv.setImageResource(R.drawable.icon_recently_sel_on)
binding.favoriteIv.setImageResource(R.drawable.collect)
binding.toolsIv.setImageResource(R.drawable.icon_tools_sel_off)
}
is FavoriteFrag -> {
binding.homeIv.setImageResource(R.drawable.icon_home_sel_off)
binding.recentlyIv.setImageResource(R.drawable.icon_recently_sel_off)
binding.favoriteIv.setImageResource(R.drawable.collected)
binding.toolsIv.setImageResource(R.drawable.icon_tools_sel_off)
}
is ToolsFrag -> {
binding.homeIv.setImageResource(R.drawable.icon_home_sel_off)
binding.recentlyIv.setImageResource(R.drawable.icon_recently_sel_off)
binding.favoriteIv.setImageResource(R.drawable.collect)
binding.toolsIv.setImageResource(R.drawable.icon_tools_sel_on)
}
}
// binding.homeIv.alpha = 0.5f
// binding.recentlyIv.alpha = 0.5f
// binding.favoriteIv.alpha = 0.5f
// binding.toolsIv.alpha = 0.5f
// val targetIcon = when (fragment) {
// is HomeFrag -> binding.homeIv
// is RecentlyFrag -> binding.recentlyIv
// is FavoriteFrag -> binding.favoriteIv
// is ToolsFrag -> binding.toolsIv
// else -> null
// }
// targetIcon?.apply {
// alpha = 1f
// animate().scaleX(1.2f).scaleY(1.2f).setDuration(150).withEndAction {
// animate().scaleX(1f).scaleY(1f).setDuration(150).start()
// }.start()
// }
}
@ -229,6 +272,7 @@ class MainActivity : BaseActivity(), PermissionDialogFragment.PermissionCallback
dialog.show(supportFragmentManager, TAG)
}
}
updateSelectedNav(activeFragment)
}
private fun scanningStrategy() {

View File

@ -15,6 +15,7 @@ import com.all.pdfreader.pro.app.ui.dialog.BookmarksDialogFragment
import com.all.pdfreader.pro.app.ui.dialog.PdfPasswordProtectionDialogFragment
import com.all.pdfreader.pro.app.ui.dialog.ViewModelDialogFragment
import com.all.pdfreader.pro.app.ui.view.CustomScrollHandle
import com.all.pdfreader.pro.app.util.AppUtils
import com.all.pdfreader.pro.app.viewmodel.PdfViewModel
import com.all.pdfreader.pro.app.viewmodel.observeEvent
import com.github.barteksc.pdfviewer.listener.OnErrorListener
@ -124,6 +125,9 @@ class PdfViewActivity : BaseActivity(), OnLoadCompleteListener, OnPageChangeList
}, 200)
}).show(supportFragmentManager, "BookmarksDialogFragment")
}
binding.shareBtn.setOnClickListener {
AppUtils.shareFile(this, File(pdfDocument.filePath))
}
}
private fun loadPdf() {

View File

@ -111,7 +111,7 @@ class BookmarksDialogFragment(
} else {
binding.addTv.text = getString(R.string.add)
binding.addTv.setTextColor(requireActivity().getColor(R.color.white))
binding.addBtn.setBackgroundResource(R.drawable.dr_click_btn_red_bg)
binding.addBtn.setBackgroundResource(R.drawable.dr_click_btn_bg)
binding.addIv.setImageResource(R.drawable.add_icon_white)
}
}
@ -133,7 +133,7 @@ class BookmarksDialogFragment(
adapter.removeAllItems()
bookmarks = emptyList()
updateUi()
}).show(parentFragmentManager, "DeleteDialogFragment")
}).show(parentFragmentManager, "deleteAllBookmark")
}
}

View File

@ -14,6 +14,7 @@ import com.all.pdfreader.pro.app.databinding.DialogDeleteBinding
class DeleteDialogFragment(
private val title: String,
private val desc: String,
private val okBtnText: String? = null,
private val onDeleteClick: () -> Unit
) : DialogFragment() {
@ -41,6 +42,11 @@ class DeleteDialogFragment(
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
super.onViewCreated(view, savedInstanceState)
if (okBtnText.isNullOrEmpty()) {
binding.okBtnTv.text = getString(R.string.delete)
} else {
binding.okBtnTv.text = okBtnText
}
binding.deleteTitleTv.text = title
binding.deleteDescTv.text = desc
setupOnClick()

View File

@ -71,6 +71,11 @@ class ListMoreDialogFragment(val filePath: String) : BottomSheetDialogFragment()
}
private fun initUi() {
if (pdfDocument.lastOpenedTime > 0) {
binding.removeRecentBtn.visibility = View.VISIBLE
} else {
binding.removeRecentBtn.visibility = View.GONE
}
binding.tvFileName.text = pdfDocument.fileName
binding.tvFileSize.text = pdfDocument.fileSize.toFormatFileSize()
binding.tvFileDate.text = pdfDocument.lastModified.toSlashDate()
@ -108,7 +113,7 @@ class ListMoreDialogFragment(val filePath: String) : BottomSheetDialogFragment()
getString(R.string.delete_file_desc),
onDeleteClick = {
viewModel.deleteFile(pdfDocument.filePath)
}).show(parentFragmentManager, "DeleteDialogFragment")
}).show(parentFragmentManager, "deleteFile")
dismiss()
}
binding.detailsBtn.setOnClickListener {
@ -166,6 +171,16 @@ class ListMoreDialogFragment(val filePath: String) : BottomSheetDialogFragment()
}
dismiss()
}
binding.removeRecentBtn.setOnClickListener {
DeleteDialogFragment(
getString(R.string.remove_dialog_title),
getString(R.string.remove_dialog_desc),
getString(R.string.remove),
onDeleteClick = {
viewModel.removeRecent(pdfDocument.filePath)
}).show(parentFragmentManager, "removeRecent")
dismiss()
}
}
private fun updateCollectUi(b: Boolean) {

View File

@ -4,11 +4,21 @@ import android.os.Bundle
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import androidx.fragment.app.Fragment
import androidx.lifecycle.Lifecycle
import androidx.lifecycle.lifecycleScope
import androidx.lifecycle.repeatOnLifecycle
import androidx.recyclerview.widget.LinearLayoutManager
import com.all.pdfreader.pro.app.databinding.FragmentRecentlyBinding
import com.all.pdfreader.pro.app.room.repository.PdfRepository
import com.all.pdfreader.pro.app.ui.act.PdfViewActivity
import com.all.pdfreader.pro.app.ui.adapter.PdfAdapter
import com.all.pdfreader.pro.app.ui.dialog.ListMoreDialogFragment
import kotlinx.coroutines.launch
class RecentlyFrag : Fragment() {
class RecentlyFrag : BaseFrag() {
override val TAG: String = "RecentlyFrag"
private lateinit var binding: FragmentRecentlyBinding
private lateinit var adapter: PdfAdapter
override fun onCreateView(
inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?
@ -20,9 +30,37 @@ class RecentlyFrag : Fragment() {
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
super.onViewCreated(view, savedInstanceState)
initView()
observeDocuments()
}
private fun initView() {
adapter = PdfAdapter(pdfList = mutableListOf(), onItemClick = { pdf ->
val intent = PdfViewActivity.createIntent(requireContext(), pdf.filePath)
startActivity(intent)
}, onMoreClick = { pdf ->
ListMoreDialogFragment(pdf.filePath).show(parentFragmentManager, TAG)
})
binding.recyclerView.layoutManager = LinearLayoutManager(requireContext())
binding.recyclerView.adapter = adapter
// 下拉刷新示例
binding.swipeRefreshLayout.setOnRefreshListener {
observeDocuments{
binding.swipeRefreshLayout.isRefreshing = false
}
}
}
private fun observeDocuments(onComplete: () -> Unit = {}) {
lifecycleScope.launch {
viewLifecycleOwner.lifecycle.repeatOnLifecycle(Lifecycle.State.STARTED) {
PdfRepository.getInstance().getRecentlyOpenedDocuments().collect { list ->
adapter.updateData(list)
onComplete()
logDebug("更新adapter数据")
}
}
}
}
}

View File

@ -194,6 +194,12 @@ class PdfViewModel : ViewModel() {
}
}
fun removeRecent(filePath: String) {
viewModelScope.launch {
pdfRepository.updateLastOpenTime(filePath, 0L)
}
}
/**
* 书签相关方法
*/
@ -218,7 +224,7 @@ class PdfViewModel : ViewModel() {
}
}
fun updateBookmark(bookmark: BookmarkEntity){
fun updateBookmark(bookmark: BookmarkEntity) {
viewModelScope.launch {
val int = pdfRepository.updateBookmark(bookmark)
val success = int > 0

View File

@ -1,9 +1,13 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="256dp"
android:height="256dp"
android:viewportWidth="1024"
android:viewportHeight="1024">
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24">
<path
android:pathData="M859.7,253.9c-44.8,-44.8 -102.4,-70.4 -166.4,-70.4 -61.9,0 -121.6,25.6 -166.4,70.4l-14.9,17.1 -17.1,-17.1c-44.8,-44.8 -102.4,-70.4 -166.4,-70.4 -61.9,0 -121.6,25.6 -166.4,70.4 -91.7,91.7 -91.7,243.2 0,337.1l324.3,330.7c6.4,6.4 14.9,8.5 23.5,8.5s17.1,-4.3 23.5,-8.5l324.3,-330.7c44.8,-44.8 68.3,-104.5 68.3,-168.5s-21.3,-123.7 -66.1,-168.5zM814.9,544L512,853.3 209.1,544c-66.1,-68.3 -66.1,-179.2 0,-247.5 32,-32 74.7,-51.2 119.5,-51.2 44.8,0 87.5,17.1 119.5,51.2l38.4,40.5c12.8,12.8 34.1,12.8 44.8,0l38.4,-40.5c32,-32 74.7,-51.2 119.5,-51.2 44.8,0 87.5,17.1 119.5,51.2 32,32 49.1,76.8 49.1,123.7s-12.8,91.7 -42.7,123.7z"
android:fillColor="#666666"/>
android:pathData="M12,20.88L10.55,19.55C5.4,14.9 3,12.36 3,9.5C3,7.01 5.01,5 7.5,5C8.74,5 9.91,5.5 10.7,6.35L12,7.63L13.3,6.35C14.09,5.5 15.26,5 16.5,5C18.99,5 21,7.01 21,9.5C21,12.36 18.6,14.9 13.45,19.55L12,20.88Z"
android:strokeWidth="1.5"
android:fillColor="#00000000"
android:strokeColor="#CCCCCC"
android:strokeLineCap="round"
android:strokeLineJoin="round"/>
</vector>

View File

@ -1,9 +1,13 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="256dp"
android:height="256dp"
android:viewportWidth="1024"
android:viewportHeight="1024">
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24">
<path
android:pathData="M669.8,130.8c71.6,-11.1 138.9,11.5 193.3,64.5 55.3,53.9 81.8,125 74.3,199.5 -7.5,73.6 -46.5,146.4 -112.3,210.5 -18.3,17.9 -67.7,66.2 -138.5,135.6 -31.8,31.2 -65.7,64.4 -99.8,98L553.6,871.5l-13.2,12.9a40.6,40.6 0,0 1,-56.8 0l-114.6,-112.6 -24.2,-23.7a677626.4,677626.4 0,0 0,-145.9 -142.8C133.1,541.2 94.1,468.5 86.6,394.8c-7.6,-74.5 18.9,-145.6 74.3,-199.5 54.4,-53.1 121.7,-75.6 193.3,-64.5 53.2,8.2 107.1,34.7 157.8,76.9 50.7,-42.2 104.6,-68.7 157.8,-76.9z"
android:fillColor="#F1494F"/>
android:pathData="M12,20.88L10.55,19.55C5.4,14.9 3,12.36 3,9.5C3,7.01 5.01,5 7.5,5C8.74,5 9.91,5.5 10.7,6.35L12,7.63L13.3,6.35C14.09,5.5 15.26,5 16.5,5C18.99,5 21,7.01 21,9.5C21,12.36 18.6,14.9 13.45,19.55L12,20.88Z"
android:strokeWidth="1.5"
android:fillColor="#E43521"
android:strokeColor="#E43521"
android:strokeLineCap="round"
android:strokeLineJoin="round"/>
</vector>

View File

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="oval">
<solid android:color="#E9C5C5"/>
<solid android:color="@color/btn_sel_on_color"/>
</shape>

View File

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<solid android:color="#E6E6E6" /> <!-- 默认颜色 -->
<solid android:color="@color/btn_sel_off_color" /> <!-- 默认颜色 -->
<corners android:radius="24dp" />
</shape>

View File

@ -5,7 +5,7 @@
<item android:state_pressed="true">
<shape android:shape="rectangle">
<solid android:color="#80E6E6E6"/> <!-- 按下颜色:深一点 -->
<corners android:radius="12dp"/>
<corners android:radius="24dp"/>
</shape>
</item>
@ -13,7 +13,7 @@
<item>
<shape android:shape="rectangle">
<solid android:color="#E6E6E6"/> <!-- 默认颜色 -->
<corners android:radius="12dp"/>
<corners android:radius="24dp"/>
</shape>
</item>

View File

@ -4,7 +4,7 @@
<!-- 按下状态 -->
<item android:state_pressed="true">
<shape android:shape="rectangle">
<solid android:color="#3B5C8E"/> <!-- 按下颜色:深一点 -->
<solid android:color="#C42F1C"/> <!-- 按下颜色:深一点 -->
<corners android:radius="24dp"/>
</shape>
</item>
@ -12,7 +12,7 @@
<!-- 默认状态 -->
<item>
<shape android:shape="rectangle">
<solid android:color="#4E78BA"/> <!-- 默认颜色 -->
<solid android:color="#E43521"/> <!-- 默认颜色 -->
<corners android:radius="24dp"/>
</shape>
</item>

View File

@ -1,20 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<!-- 按下状态 -->
<item android:state_pressed="true">
<shape android:shape="rectangle">
<solid android:color="#ED343B"/> <!-- 按下颜色:深一点 -->
<corners android:radius="24dp"/>
</shape>
</item>
<!-- 默认状态 -->
<item>
<shape android:shape="rectangle">
<solid android:color="#F1494F"/> <!-- 默认颜色 -->
<corners android:radius="24dp"/>
</shape>
</item>
</selector>

View File

@ -0,0 +1,17 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24">
<path
android:pathData="M3.2,12.18C3.2,10.33 3.2,9.44 3.68,8.64C4.16,7.84 5.06,7.28 6.59,6.49L8.59,5.18C10.29,3.96 11.19,3.3 12,3.3C12.81,3.3 13.71,3.96 15.41,5.18L17.41,6.49C18.94,7.28 19.84,7.84 20.32,8.64C20.8,9.44 20.8,10.33 20.8,12.18V13.61C20.8,16.86 20.8,18.64 19.74,19.71C18.68,20.78 17.19,20.78 14,20.78H10C6.81,20.78 5.32,20.78 4.26,19.71C3.2,18.64 3.2,16.86 3.2,13.61V12.18Z"
android:strokeWidth="1.5"
android:fillColor="#00000000"
android:strokeColor="#CCCCCC"/>
<path
android:pathData="M12,15.3V18"
android:strokeWidth="1.5"
android:fillColor="#00000000"
android:strokeColor="#CCCCCC"
android:strokeLineCap="round"/>
</vector>

View File

@ -0,0 +1,17 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24">
<path
android:pathData="M3.2,12.18C3.2,10.33 3.2,9.44 3.68,8.64C4.16,7.84 5.06,7.28 6.59,6.49L8.59,5.18C10.29,3.96 11.19,3.3 12,3.3C12.81,3.3 13.71,3.96 15.41,5.18L17.41,6.49C18.94,7.28 19.84,7.84 20.32,8.64C20.8,9.44 20.8,10.33 20.8,12.18V13.61C20.8,16.86 20.8,18.64 19.74,19.71C18.68,20.78 17.19,20.78 14,20.78H10C6.81,20.78 5.32,20.78 4.26,19.71C3.2,18.64 3.2,16.86 3.2,13.61V12.18Z"
android:strokeWidth="1.5"
android:fillColor="#E43521"
android:strokeColor="#E43521"/>
<path
android:pathData="M12,15.3V18"
android:strokeWidth="1.5"
android:fillColor="#00000000"
android:strokeColor="#FFFFFF"
android:strokeLineCap="round"/>
</vector>

View File

@ -0,0 +1,22 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24">
<path
android:pathData="M12,4C9.243,4 7,6.243 7,9V15L5,17V18H19V17L17,15V9C17,6.243 14.757,4 12,4Z"
android:strokeWidth="1.5"
android:fillColor="#00000000"
android:strokeColor="#E43521"
android:strokeLineCap="round"
android:strokeLineJoin="round"/>
<path
android:pathData="M12,20C13.104,20 14,19.104 14,18H10C10,19.104 10.896,20 12,20Z"
android:strokeWidth="1.5"
android:fillColor="#00000000"
android:strokeColor="#E43521"
android:strokeLineCap="round"
android:strokeLineJoin="round"/>
</vector>

View File

@ -0,0 +1,20 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24">
<path
android:fillColor="#00000000"
android:pathData="M3,12C3,13.181 3.233,14.352 3.685,15.444C4.137,16.536 4.8,17.528 5.636,18.364C6.472,19.2 7.464,19.863 8.556,20.315C9.648,20.767 10.819,21 12,21C13.181,21 14.352,20.767 15.444,20.315C16.536,19.863 17.528,19.2 18.364,18.364C19.2,17.528 19.863,16.536 20.315,15.444C20.767,14.352 21,13.181 21,12C21,9.613 20.052,7.324 18.364,5.636C16.676,3.948 14.387,3 12,3C9.613,3 7.324,3.948 5.636,5.636C3.948,7.324 3,9.613 3,12Z"
android:strokeWidth="1.5"
android:strokeColor="#cccccc"
android:strokeLineCap="round"
android:strokeLineJoin="round" />
<path
android:fillColor="#00000000"
android:pathData="M12,7V12L15,15"
android:strokeWidth="1.5"
android:strokeColor="#cccccc"
android:strokeLineCap="round"
android:strokeLineJoin="round" />
</vector>

View File

@ -0,0 +1,20 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24">
<path
android:fillColor="#E43521"
android:pathData="M3,12C3,13.181 3.233,14.352 3.685,15.444C4.137,16.536 4.8,17.528 5.636,18.364C6.472,19.2 7.464,19.863 8.556,20.315C9.648,20.767 10.819,21 12,21C13.181,21 14.352,20.767 15.444,20.315C16.536,19.863 17.528,19.2 18.364,18.364C19.2,17.528 19.863,16.536 20.315,15.444C20.767,14.352 21,13.181 21,12C21,9.613 20.052,7.324 18.364,5.636C16.676,3.948 14.387,3 12,3C9.613,3 7.324,3.948 5.636,5.636C3.948,7.324 3,9.613 3,12Z"
android:strokeWidth="1.5"
android:strokeColor="#E43521"
android:strokeLineCap="round"
android:strokeLineJoin="round" />
<path
android:fillColor="#00000000"
android:pathData="M12,7V12L15,15"
android:strokeWidth="1.5"
android:strokeColor="#FFFFFF"
android:strokeLineCap="round"
android:strokeLineJoin="round" />
</vector>

View File

@ -0,0 +1,34 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24">
<path
android:pathData="M3,3H10V10H3V3Z"
android:strokeWidth="1.5"
android:fillColor="#00000000"
android:strokeColor="#CCCCCC"
android:strokeLineJoin="round"/>
<path
android:pathData="M14,3H21V10H14V3Z"
android:strokeWidth="1.5"
android:fillColor="#00000000"
android:strokeColor="#CCCCCC"
android:strokeLineJoin="round"/>
<path
android:pathData="M3,14H10V21H3V14Z"
android:strokeWidth="1.5"
android:fillColor="#00000000"
android:strokeColor="#CCCCCC"
android:strokeLineJoin="round"/>
<path
android:pathData="M14,14H21V21H14V14Z"
android:strokeWidth="1.5"
android:fillColor="#00000000"
android:strokeColor="#CCCCCC"
android:strokeLineJoin="round"/>
</vector>

View File

@ -0,0 +1,34 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24">
<path
android:pathData="M3,3H10V10H3V3Z"
android:strokeWidth="1.5"
android:fillColor="#E43521"
android:strokeColor="#E43521"
android:strokeLineJoin="round"/>
<path
android:pathData="M14,3H21V10H14V3Z"
android:strokeWidth="1.5"
android:fillColor="#00000000"
android:strokeColor="#E43521"
android:strokeLineJoin="round"/>
<path
android:pathData="M3,14H10V21H3V14Z"
android:strokeWidth="1.5"
android:fillColor="#00000000"
android:strokeColor="#E43521"
android:strokeLineJoin="round"/>
<path
android:pathData="M14,14H21V21H14V14Z"
android:strokeWidth="1.5"
android:fillColor="#E43521"
android:strokeColor="#E43521"
android:strokeLineJoin="round"/>
</vector>

View File

@ -1,9 +1,45 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="256dp"
android:height="256dp"
android:viewportWidth="1024"
android:viewportHeight="1024">
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24">
<group>
<path
android:pathData="M576,192a64,64 0,1 0,-128 0,64 64,0 0,0 128,0zM576,512a64,64 0,1 0,-128 0,64 64,0 0,0 128,0zM512,896a64,64 0,1 1,0 -128,64 64,0 0,1 0,128z"
android:fillColor="#5A5A5A"/>
android:pathData="M12,6C12.552,6 13,5.552 13,5C13,4.448 12.552,4 12,4C11.448,4 11,4.448 11,5C11,5.552 11.448,6 12,6Z"
android:strokeWidth="1.5"
android:fillColor="#00000000"
android:strokeColor="#000000"
android:strokeLineCap="round"
android:strokeLineJoin="round"/>
<path
android:pathData="M12,5.5C12.276,5.5 12.5,5.276 12.5,5C12.5,4.724 12.276,4.5 12,4.5C11.724,4.5 11.5,4.724 11.5,5C11.5,5.276 11.724,5.5 12,5.5Z"
android:fillColor="#000000"/>
</group>
<group>
<path
android:pathData="M12,12C12.552,12 13,11.552 13,11C13,10.448 12.552,10 12,10C11.448,10 11,10.448 11,11C11,11.552 11.448,12 12,12Z"
android:strokeWidth="1.5"
android:fillColor="#00000000"
android:strokeColor="#000000"
android:strokeLineCap="round"
android:strokeLineJoin="round"/>
<path
android:pathData="M12,11.5C12.276,11.5 12.5,11.276 12.5,11C12.5,10.724 12.276,10.5 12,10.5C11.724,10.5 11.5,10.724 11.5,11C11.5,11.276 11.724,11.5 12,11.5Z"
android:fillColor="#000000"/>
</group>
<group>
<path
android:pathData="M12,18C12.552,18 13,17.552 13,17C13,16.448 12.552,16 12,16C11.448,16 11,16.448 11,17C11,17.552 11.448,18 12,18Z"
android:strokeWidth="1.5"
android:fillColor="#00000000"
android:strokeColor="#000000"
android:strokeLineCap="round"
android:strokeLineJoin="round"/>
<path
android:pathData="M12,17.5C12.276,17.5 12.5,17.276 12.5,17C12.5,16.724 12.276,16.5 12,16.5C11.724,16.5 11.5,16.724 11.5,17C11.5,17.276 11.724,17.5 12,17.5Z"
android:fillColor="#000000"/>
</group>
</vector>

View File

@ -1,9 +1,20 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="256dp"
android:height="256dp"
android:viewportWidth="1024"
android:viewportHeight="1024">
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24">
<path
android:pathData="M781.3,738.7l105.4,168.1a42.8,42.8 0,0 1,-13.9 59.2,43.4 43.4,0 0,1 -59.6,-13.8l-103.8,-165.4a421,421 0,0 1,-197.9 49.2C279.3,835.9 90.4,648.4 90.4,418S279.3,0 511.6,0c232.3,0 421.2,187.5 421.2,418 0,128.7 -59,243.9 -151.5,320.6zM511.6,85.9C327.1,85.9 177,234.9 177,418s150.1,332.1 334.6,332.1c184.6,0 334.7,-149 334.7,-332.1s-150.1,-332.1 -334.7,-332.1z"
android:fillColor="#2c2c2c"/>
android:fillColor="#00000000"
android:pathData="M11,4C7.13,4 4,7.13 4,11C4,14.87 7.13,18 11,18C14.87,18 18,14.87 18,11C18,7.13 14.87,4 11,4Z"
android:strokeWidth="1.5"
android:strokeColor="#000000"
android:strokeLineCap="round"
android:strokeLineJoin="round" />
<path
android:pathData="M16.5,16.5L20,20"
android:strokeWidth="1.5"
android:strokeColor="#000000"
android:strokeLineCap="round" />
</vector>

View File

@ -1,9 +1,24 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="256dp"
android:height="256dp"
android:viewportWidth="1024"
android:viewportHeight="1024">
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24">
<path
android:pathData="M46.5,791.3c0,27.9 18.6,46.5 46.5,46.5h418.9c23.3,0 46.5,-18.6 46.5,-46.5s-18.6,-46.5 -46.5,-46.5h-418.9c-27.9,0 -46.5,18.6 -46.5,46.5zM46.5,512c0,27.9 18.6,46.5 46.5,46.5h651.6c27.9,0 46.5,-18.6 46.5,-46.5s-18.6,-46.5 -46.5,-46.5h-651.6c-27.9,0 -46.5,18.6 -46.5,46.5zM46.5,232.7c0,27.9 23.3,46.5 46.5,46.5h837.8c23.3,0 46.5,-18.6 46.5,-46.5s-23.3,-46.5 -46.5,-46.5h-837.8c-27.9,0 -46.5,18.6 -46.5,46.5z"
android:fillColor="#2c2c2c"/>
android:pathData="M3,6H21"
android:strokeWidth="1.5"
android:strokeColor="#000000"
android:strokeLineCap="round"/>
<path
android:pathData="M3,12H17"
android:strokeWidth="1.5"
android:strokeColor="#000000"
android:strokeLineCap="round"/>
<path
android:pathData="M3,18H13"
android:strokeWidth="1.5"
android:strokeColor="#000000"
android:strokeLineCap="round"/>
</vector>

View File

@ -1,9 +1,14 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="256dp"
android:height="256dp"
android:viewportWidth="1024"
android:viewportHeight="1024">
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24">
<path
android:pathData="M600.4,60.5v907.6c0,27.9 18.6,46.5 46.5,46.5s46.5,-18.6 46.5,-46.5V158.3l116.4,93.1c18.6,18.6 51.2,14 65.2,-4.7 18.6,-18.6 14,-51.2 -4.7,-65.2L679.6,23.3c-32.6,-27.9 -79.1,-4.7 -79.1,37.2zM377,9.3c-27.9,0 -46.5,18.6 -46.5,46.5v809.9l-116.4,-93.1c-18.6,-18.6 -51.2,-14 -65.2,4.7 -18.6,18.6 -14,51.2 4.7,65.2l190.8,158.3c32.6,23.3 74.5,4.7 74.5,-37.2V55.9c4.7,-23.3 -18.6,-46.5 -41.9,-46.5z"
android:fillColor="#2c2c2c"/>
android:pathData="M4,4H20V6.2C20,6.57 19.84,6.92 19.57,7.19L14.5,12V19L9.5,20.5V12.5L4.43,7.31C4.18,7.03 4,6.69 4,6.31V4Z"
android:strokeLineJoin="round"
android:strokeWidth="1.5"
android:fillColor="#00000000"
android:strokeColor="#000000"
android:strokeLineCap="round"/>
</vector>

View File

@ -2,7 +2,7 @@
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/white"
android:background="@color/bg_color"
android:orientation="vertical">
<View
@ -11,17 +11,17 @@
android:layout_height="0dp" />
<LinearLayout
android:id="@+id/topLayout"
android:layout_width="match_parent"
android:layout_height="48dp"
android:layout_height="56dp"
android:gravity="center_vertical"
android:orientation="horizontal">
<LinearLayout
android:id="@+id/sidebarBtn"
android:layout_width="44dp"
android:layout_height="44dp"
android:layout_marginStart="6dp"
android:layout_marginEnd="6dp"
android:layout_width="40dp"
android:layout_height="40dp"
android:layout_marginStart="8dp"
android:gravity="center">
<ImageView
@ -30,17 +30,28 @@
android:src="@drawable/sidebar" />
</LinearLayout>
<View
<TextView
style="@style/TextViewFont_PopMedium"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1" />
android:layout_height="wrap_content"
android:layout_marginStart="8dp"
android:layout_marginEnd="8dp"
android:layout_weight="1"
android:text="@string/app_name"
android:textColor="@color/black"
android:textSize="18sp" />
<LinearLayout
android:id="@+id/topButtonLayout"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal">
<LinearLayout
android:id="@+id/searchBtn"
android:layout_width="44dp"
android:layout_height="44dp"
android:layout_marginStart="6dp"
android:layout_marginEnd="6dp"
android:layout_width="40dp"
android:layout_height="40dp"
android:gravity="center">
<ImageView
@ -51,10 +62,9 @@
<LinearLayout
android:id="@+id/sortingBtn"
android:layout_width="44dp"
android:layout_height="44dp"
android:layout_marginStart="6dp"
android:layout_marginEnd="6dp"
android:layout_width="40dp"
android:layout_height="40dp"
android:layout_marginEnd="8dp"
android:gravity="center">
<ImageView
@ -63,14 +73,13 @@
android:layout_height="24dp"
android:src="@drawable/sorting" />
</LinearLayout>
</LinearLayout>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"
android:background="@color/bg_color"
android:orientation="vertical">
<FrameLayout
@ -101,7 +110,7 @@
<ImageView
android:layout_width="24dp"
android:layout_height="24dp"
android:src="@mipmap/ic_launcher_round" />
android:src="@drawable/icon_notice" />
<LinearLayout
android:layout_width="0dp"
@ -153,9 +162,16 @@
</LinearLayout>
</LinearLayout>
<View
android:layout_width="match_parent"
android:layout_height="0.5dp"
android:background="@color/line_color" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="68dp">
android:background="@color/white"
android:layout_height="64dp"
android:orientation="horizontal">
<LinearLayout
android:id="@+id/home_ll_btn"
@ -169,17 +185,16 @@
android:id="@+id/home_iv"
android:layout_width="24dp"
android:layout_height="24dp"
android:src="@mipmap/ic_launcher" />
android:src="@drawable/icon_home_sel_on" />
<TextView
android:id="@+id/home_tv"
style="@style/TextViewFont_PopRegular"
style="@style/TextViewFont_PopMedium"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="2dp"
android:text="@string/home"
android:textColor="@color/black"
android:textSize="14sp" />
android:textSize="12sp" />
</LinearLayout>
<LinearLayout
@ -194,17 +209,16 @@
android:id="@+id/recently_iv"
android:layout_width="24dp"
android:layout_height="24dp"
android:src="@mipmap/ic_launcher" />
android:src="@drawable/icon_recently_sel_off" />
<TextView
android:id="@+id/recently_tv"
style="@style/TextViewFont_PopRegular"
style="@style/TextViewFont_PopMedium"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="2dp"
android:text="@string/recently"
android:textColor="@color/black"
android:textSize="14sp" />
android:textSize="12sp" />
</LinearLayout>
<LinearLayout
@ -219,17 +233,16 @@
android:id="@+id/favorite_iv"
android:layout_width="24dp"
android:layout_height="24dp"
android:src="@mipmap/ic_launcher" />
android:src="@drawable/collect" />
<TextView
android:id="@+id/favorite_tv"
style="@style/TextViewFont_PopRegular"
style="@style/TextViewFont_PopMedium"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="2dp"
android:text="@string/favorite"
android:textColor="@color/black"
android:textSize="14sp" />
android:textSize="12sp" />
</LinearLayout>
<LinearLayout
@ -244,17 +257,16 @@
android:id="@+id/tools_iv"
android:layout_width="24dp"
android:layout_height="24dp"
android:src="@mipmap/ic_launcher" />
android:src="@drawable/icon_tools_sel_off" />
<TextView
android:id="@+id/tools_tv"
style="@style/TextViewFont_PopRegular"
style="@style/TextViewFont_PopMedium"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="2dp"
android:text="@string/tools"
android:textColor="@color/black"
android:textSize="14sp" />
android:textSize="12sp" />
</LinearLayout>
</LinearLayout>

View File

@ -106,7 +106,7 @@
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_height="0.5dp"
android:layout_marginTop="16dp"
android:layout_marginEnd="16dp"
android:background="@color/line_color" />

View File

@ -46,7 +46,7 @@
android:id="@+id/addBtn"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:background="@drawable/dr_click_btn_red_bg"
android:background="@drawable/dr_click_btn_bg"
android:gravity="center"
android:orientation="horizontal"
android:paddingStart="12dp"
@ -124,7 +124,7 @@
android:layout_width="wrap_content"
android:layout_height="44dp"
android:layout_marginTop="24dp"
android:background="@drawable/dr_click_btn_red_bg"
android:background="@drawable/dr_click_btn_bg"
android:gravity="center"
android:paddingStart="24dp"
android:paddingEnd="24dp">

View File

@ -57,10 +57,11 @@
android:layout_height="48dp"
android:layout_marginStart="8dp"
android:layout_weight="1"
android:background="@drawable/dr_click_btn_red_bg"
android:background="@drawable/dr_click_btn_bg"
android:gravity="center">
<TextView
android:id="@+id/okBtnTv"
style="@style/TextViewFont_PopSemiBold"
android:layout_width="wrap_content"
android:layout_height="wrap_content"

View File

@ -275,7 +275,7 @@
</LinearLayout>
<LinearLayout
android:id="@+id/deleteFileBtn"
android:id="@+id/removeRecentBtn"
android:layout_width="match_parent"
android:layout_height="48dp"
android:gravity="center_vertical"
@ -286,6 +286,28 @@
android:layout_height="24dp"
android:src="@drawable/file_delete" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:text="@string/remove_recent"
android:textColor="@color/grey_text_color"
android:textSize="16sp" />
</LinearLayout>
<LinearLayout
android:id="@+id/deleteFileBtn"
android:layout_width="match_parent"
android:layout_height="48dp"
android:gravity="center_vertical"
android:orientation="horizontal">
<ImageView
android:layout_width="24dp"
android:layout_height="24dp"
android:src="@drawable/delete" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"

View File

@ -1,8 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:background="@color/bg_color"
android:layout_height="match_parent"
android:background="@color/bg_color"
android:orientation="vertical">
<View
@ -10,9 +10,18 @@
android:layout_width="match_parent"
android:layout_height="0dp" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/recently"/>
<androidx.swiperefreshlayout.widget.SwipeRefreshLayout
android:id="@+id/swipeRefreshLayout"
android:layout_width="match_parent"
android:layout_height="match_parent">
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/recyclerView"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:clipToPadding="false"
android:paddingBottom="40dp" />
</androidx.swiperefreshlayout.widget.SwipeRefreshLayout>
</LinearLayout>

View File

@ -10,11 +10,17 @@
<color name="black_60">#99000000</color>
<color name="white">#FFFFFFFF</color>
<color name="grey">#E6E6E6</color>
<color name="bg_color">#F6F6F6</color>
<color name="bg_color">#FAFAFA</color>
<color name="line_color">#E0E0E0</color>
<color name="black_img_color">#2c2c2c</color>
<color name="grey_text_color">#666666</color>
<color name="eye_protection_color">#80FFD699</color>
<color name="icon_color">#636366</color>
<color name="red">#F1494F</color>
<color name="icon_sel_on_color">#E43521</color>
<color name="icon_sel_off_color">#CCCCCC</color>
<color name="text_red_lv1">#E43521</color>
<color name="text_red_lv2">#BB6D64</color>
<color name="btn_sel_on_color">#E43521</color>
<color name="btn_sel_off_color">#33E43521</color>
</resources>

View File

@ -50,6 +50,10 @@
<string name="add_bookmark">Add Bookmark</string>
<string name="added">Added</string>
<string name="add">Add</string>
<string name="remove">Remove</string>
<string name="remove_recent">Remove from Recent</string>
<string name="remove_dialog_title">Remove from Recent?</string>
<string name="remove_dialog_desc">The file(s) will be removed from Recent,not deleted</string>
<string name="removed_from_favorites">Removed from Favorites</string>
<string name="delete_file">Delete File</string>
<string name="delete">Delete</string>