feat: use custom base activity

This commit is contained in:
Kagura 2024-10-20 16:21:12 +08:00
parent 6f4b76353a
commit e73dea21a9
5 changed files with 22 additions and 9 deletions

View file

@ -0,0 +1,18 @@
package com.dazuoye.filemanager
import androidx.appcompat.app.AppCompatActivity
import com.dazuoye.filemanager.fileSystem.DeleteHelper.Companion.delete
import java.io.File
open class BaseActivity: AppCompatActivity() {
override fun onDestroy() {
super.onDestroy()
val clipFile = File(this.cacheDir,"clipboard")
if (clipFile.exists()){
delete(clipFile.path)
}
System.gc()
}
}

View file

@ -34,7 +34,7 @@ import kotlinx.coroutines.launch
import org.apache.commons.io.IOUtils import org.apache.commons.io.IOUtils
import java.io.File import java.io.File
class document_page : AppCompatActivity() { class document_page : BaseActivity() {
private var documentList = listOf<String>() private var documentList = listOf<String>()
private val pasteDir = "${Environment.getExternalStorageDirectory().path}/Documents/pasted" private val pasteDir = "${Environment.getExternalStorageDirectory().path}/Documents/pasted"
private var listOrderType = 0 private var listOrderType = 0

View file

@ -35,7 +35,7 @@ import kotlinx.coroutines.launch
import org.apache.commons.io.IOUtils import org.apache.commons.io.IOUtils
import java.io.File import java.io.File
class music_page : AppCompatActivity() { class music_page : BaseActivity() {
private var musicList = listOf<String>() private var musicList = listOf<String>()
private val pasteDir = "${Environment.getExternalStorageDirectory().path}/Music/pasted" private val pasteDir = "${Environment.getExternalStorageDirectory().path}/Music/pasted"
private var listOrderType = 0 private var listOrderType = 0

View file

@ -34,7 +34,7 @@ import kotlinx.coroutines.launch
import org.apache.commons.io.IOUtils import org.apache.commons.io.IOUtils
import java.io.File import java.io.File
class picture_page : AppCompatActivity() { class picture_page : BaseActivity() {
private var imageList = listOf<String>() private var imageList = listOf<String>()
private val pasteDir = "${Environment.getExternalStorageDirectory().path}/Pictures/pasted" private val pasteDir = "${Environment.getExternalStorageDirectory().path}/Pictures/pasted"
private var imageListOrderType = 0 private var imageListOrderType = 0
@ -292,9 +292,4 @@ class picture_page : AppCompatActivity() {
loadingText(loadingTextView, defaultText, next) loadingText(loadingTextView, defaultText, next)
} }
} }
override fun onDestroy() {
super.onDestroy()
System.gc()
}
} }

View file

@ -34,7 +34,7 @@ import kotlinx.coroutines.launch
import org.apache.commons.io.IOUtils import org.apache.commons.io.IOUtils
import java.io.File import java.io.File
class video_page : AppCompatActivity() { class video_page : BaseActivity() {
private var videoList = listOf<String>() private var videoList = listOf<String>()
private val pasteDir = "${Environment.getExternalStorageDirectory().path}/Movies/pasted" private val pasteDir = "${Environment.getExternalStorageDirectory().path}/Movies/pasted"
private var videoListOrderType = 0 private var videoListOrderType = 0