Commit 48e4d96a authored by wanglei's avatar wanglei

病毒扫描

parent 38b12d9c
...@@ -5,6 +5,9 @@ ...@@ -5,6 +5,9 @@
<entry key="App"> <entry key="App">
<State /> <State />
</entry> </entry>
<entry key="HomeActivity">
<State />
</entry>
</value> </value>
</component> </component>
</project> </project>
\ No newline at end of file
...@@ -9,24 +9,37 @@ import com.xm.test.myfile.util.FileUtil ...@@ -9,24 +9,37 @@ import com.xm.test.myfile.util.FileUtil
class FileManagerActivity : BaseActivity() { class FileManagerActivity : BaseActivity() {
private var mFileBeanList = ArrayList<FileBean>() private var mFileBeanList = ArrayList<FileBean>()
private lateinit var mFileTypeBeanList : ArrayList<FileBean>
private lateinit var mFileType: String private lateinit var mFileType: String
override fun getLayout(): Int { override fun getLayout(): Int {
return R.layout.activity_file_manager return R.layout.activity_file_manager
} }
companion object{
companion object {
val fileTypes = arrayOf( val fileTypes = arrayOf(
arrayOf("png","jpg"), arrayOf("png", "jpg"),
arrayOf("mp4","3gp", "avi"), arrayOf("mp4", "3gp", "avi"),
arrayOf("mp3","aac", "wav"), arrayOf("mp3", "aac", "wav"),
arrayOf("zip"), arrayOf("zip"),
arrayOf("apk"), arrayOf("apk"),
arrayOf("log"), arrayOf("log"),
arrayOf("png","jpg","doc","docm","docx","xlsx","xlsm","xlsb","xltx","ppt","pdf","txt"), arrayOf(
arrayOf("doc","docm","docx"), "png",
arrayOf("xlsx","xlsm","xlsb","xltx",), "jpg",
"doc",
"docm",
"docx",
"xlsx",
"xlsm",
"xlsb",
"xltx",
"ppt",
"pdf",
"txt"
),
arrayOf("doc", "docm", "docx"),
arrayOf("xlsx", "xlsm", "xlsb", "xltx"),
arrayOf("ppt"), arrayOf("ppt"),
arrayOf("pdf"), arrayOf("pdf"),
arrayOf("txt"), arrayOf("txt"),
...@@ -41,13 +54,11 @@ class FileManagerActivity : BaseActivity() { ...@@ -41,13 +54,11 @@ class FileManagerActivity : BaseActivity() {
isCurrantTvShow(false) isCurrantTvShow(false)
initData() initData()
setOnClickBtn() setOnClickBtn()
} }
private fun initData() { private fun initData() {
WaitDialog.show("please wait..") WaitDialog.show("please wait..")
Thread(Runnable { Thread {
if (mFileType.contains("audio")) { if (mFileType.contains("audio")) {
mFileBeanList.addAll(FileUtil.getFileType(FileUtil.MP3_MIME_TYPE, this)) mFileBeanList.addAll(FileUtil.getFileType(FileUtil.MP3_MIME_TYPE, this))
mFileBeanList.addAll(FileUtil.getFileType(FileUtil.WAV_MIME_TYPE, this)) mFileBeanList.addAll(FileUtil.getFileType(FileUtil.WAV_MIME_TYPE, this))
...@@ -99,11 +110,11 @@ class FileManagerActivity : BaseActivity() { ...@@ -99,11 +110,11 @@ class FileManagerActivity : BaseActivity() {
} }
} }
} }
runOnUiThread(Runnable { runOnUiThread {
setAdapter(findViewById(R.id.files_item_listview), mFileBeanList) setAdapter(findViewById(R.id.files_item_listview), mFileBeanList)
WaitDialog.dismiss() WaitDialog.dismiss()
}) }
}).start() }.start()
} }
} }
\ No newline at end of file
...@@ -174,7 +174,6 @@ class HomeActivity : AppCompatActivity() { ...@@ -174,7 +174,6 @@ class HomeActivity : AppCompatActivity() {
override fun onResume() { override fun onResume() {
super.onResume() super.onResume()
storePermission()
} }
......
...@@ -10,61 +10,59 @@ import android.view.View ...@@ -10,61 +10,59 @@ import android.view.View
import android.widget.ProgressBar import android.widget.ProgressBar
import android.widget.TextView import android.widget.TextView
import androidx.appcompat.app.AppCompatActivity import androidx.appcompat.app.AppCompatActivity
import androidx.datastore.preferences.core.booleanPreferencesKey
import androidx.datastore.preferences.core.stringPreferencesKey
import com.trustlook.sdk.cloudscan.CloudScanListener import com.trustlook.sdk.cloudscan.CloudScanListener
import com.trustlook.sdk.data.AppInfo import com.trustlook.sdk.data.AppInfo
import com.xm.test.myfile.MyApplication import com.xm.test.myfile.MyApplication
import com.xm.test.myfile.R import com.xm.test.myfile.R
import com.xm.test.myfile.activity.ScanResultActivity import com.xm.test.myfile.activity.ScanResultActivity
import com.xm.test.myfile.ad.MaxAdUtils
import com.xm.test.myfile.ad.queryDataStoreBlock
import com.xm.test.myfile.ad.saveDataStore
import com.xm.test.myfile.ad.saveDataStoreBlock
import com.xm.test.myfile.databinding.ActivityAntivirusBinding
class AntivirusActivity : AppCompatActivity() { class AntivirusActivity : AppCompatActivity() {
private lateinit var mPage2: View
private lateinit var mPagerCheck: View
private lateinit var mProgress: ProgressBar private lateinit var mProgress: ProgressBar
private lateinit var mScaningView: View private lateinit var mScaningView: View
private lateinit var mScanSuccessView: View private lateinit var mScanSuccessView: View
private lateinit var mScanAppNameText: TextView private lateinit var mScanAppNameText: TextView
private var mIntent : Intent? = null private var mIntent: Intent? = null
private var mTotal = "22" private var mTotal = "22"
private lateinit var binding: ActivityAntivirusBinding
private var isClickAgree = false private val AGREE_VIRUS_PRIVACY_KEY = booleanPreferencesKey("agree_virus_privacy")
private var mSp: SharedPreferences? = null
override fun onCreate(savedInstanceState: Bundle?) { override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState) super.onCreate(savedInstanceState)
setContentView(R.layout.activity_antivirus) binding = ActivityAntivirusBinding.inflate(layoutInflater)
setContentView(binding.root)
mIntent = Intent(this, ScanResultActivity::class.java) mIntent = Intent(this, ScanResultActivity::class.java)
initView() initView()
setOnclickListener() setOnclickListener()
// SharedPreferences(Context.MODE_PRIVATE, "isClickAgree") val isAgree = queryDataStoreBlock(AGREE_VIRUS_PRIVACY_KEY, false)
mSp = getSharedPreferences("antivirus", MODE_PRIVATE) if (isAgree) {
isClickAgree = mSp!!.getBoolean("isClickAgree", false) binding.llVirusScan.visibility = View.VISIBLE
if (isClickAgree){
startAntivirus() startAntivirus()
} else {
binding.flVirusPrivacy.visibility = View.VISIBLE
} }
} }
private fun setOnclickListener() { private fun setOnclickListener() {
// findViewById<View>(R.id.interrupt_cancel_text).setOnClickListener { binding.ivBack.setOnClickListener {
// MyApplication.mCloudScan?.cancelScan()
// finish()
// }
findViewById<View>(R.id.antivirus_quit_btn).setOnClickListener {
MyApplication.mCloudScan?.cancelScan() MyApplication.mCloudScan?.cancelScan()
finish() finish()
} }
findViewById<View>(R.id.antivirus_quit_btn_2).setOnClickListener { binding.ivBack2.setOnClickListener {
MyApplication.mCloudScan?.cancelScan() MyApplication.mCloudScan?.cancelScan()
finish() finish()
} }
findViewById<View>(R.id.Start_scanning).setOnClickListener { findViewById<View>(R.id.Start_scanning).setOnClickListener {
val edit = mSp!!.edit() saveDataStoreBlock(AGREE_VIRUS_PRIVACY_KEY, true)
edit.putBoolean("isClickAgree", true)
edit.apply()
startAntivirus() startAntivirus()
} }
findViewById<View>(R.id.antivirus_stop_text).setOnClickListener { findViewById<View>(R.id.antivirus_stop_text).setOnClickListener {
...@@ -74,25 +72,24 @@ class AntivirusActivity : AppCompatActivity() { ...@@ -74,25 +72,24 @@ class AntivirusActivity : AppCompatActivity() {
} }
private fun initView() { private fun initView() {
mPage2 = findViewById(R.id.antivirus_page_2)
mPagerCheck = findViewById(R.id.check_the_source_layout)
mProgress = findViewById(R.id.antivirus_progress) mProgress = findViewById(R.id.antivirus_progress)
mScaningView = findViewById(R.id.scan_ing_layout) mScaningView = findViewById(R.id.scan_ing_layout)
mScanSuccessView = findViewById(R.id.antivirus_success_layout) mScanSuccessView = findViewById(R.id.antivirus_success_layout)
mScanAppNameText = findViewById(R.id.scan_name_text) mScanAppNameText = findViewById(R.id.scan_name_text)
} }
private fun startAntivirus(){ private fun startAntivirus() {
mPage2.visibility = View.GONE MyApplication.mCloudScan?.startQuickScan(object : CloudScanListener() {
mPagerCheck.visibility = View.VISIBLE
MyApplication.mCloudScan?.startQuickScan(object : CloudScanListener(){
override fun onScanStarted() { override fun onScanStarted() {
Log.e("yanglin", "onScanStarted: start", ) Log.e("yanglin", "onScanStarted: start")
} }
override fun onScanProgress(curr: Int, total: Int, result: AppInfo?) { override fun onScanProgress(curr: Int, total: Int, result: AppInfo?) {
Log.e("yanglin", "onScanProgress, " + "curr=" + curr + " total=" + total + " app name=" + Log.e(
result?.appName, ) "yanglin",
"onScanProgress, " + "curr=" + curr + " total=" + total + " app name=" +
result?.appName,
)
mScanAppNameText.text = result?.appName mScanAppNameText.text = result?.appName
mIntent?.putExtra("curr", curr) mIntent?.putExtra("curr", curr)
mProgress.setProgress(curr) mProgress.setProgress(curr)
...@@ -101,19 +98,19 @@ class AntivirusActivity : AppCompatActivity() { ...@@ -101,19 +98,19 @@ class AntivirusActivity : AppCompatActivity() {
} }
override fun onScanError(errCode: Int, p1: String?) { override fun onScanError(errCode: Int, p1: String?) {
Log.e("yanglin", "onScanError=" + errCode, ) Log.e("yanglin", "onScanError=" + errCode)
} }
override fun onScanCanceled() { override fun onScanCanceled() {
Log.e("yanglin", "onScanStarted: cancel", ) Log.e("yanglin", "onScanStarted: cancel")
} }
override fun onScanInterrupt() { override fun onScanInterrupt() {
Log.e("yanglin", "onScanStarted: onScanInterrupt", ) Log.e("yanglin", "onScanStarted: onScanInterrupt")
} }
override fun onScanFinished(result: MutableList<AppInfo>?) { override fun onScanFinished(result: MutableList<AppInfo>?) {
Log.e("yanglin", "onScanFinished: start" + result!![0].toString(), ) Log.e("yanglin", "onScanFinished: start" + result!![0].toString())
mProgress.setProgress(100) mProgress.setProgress(100)
mScaningView.visibility = View.GONE mScaningView.visibility = View.GONE
mScanSuccessView.visibility = View.VISIBLE mScanSuccessView.visibility = View.VISIBLE
...@@ -121,18 +118,19 @@ class AntivirusActivity : AppCompatActivity() { ...@@ -121,18 +118,19 @@ class AntivirusActivity : AppCompatActivity() {
val bundle = Bundle() val bundle = Bundle()
bundle.putSerializable("result", appInfos) bundle.putSerializable("result", appInfos)
mIntent?.putExtra("total", mTotal) mIntent?.putExtra("total", mTotal)
for (appInfo in result){ for (appInfo in result) {
appInfos.add(appInfo) appInfos.add(appInfo)
} }
Thread(Runnable { Thread {
Handler(Looper.getMainLooper()).postDelayed(Runnable { Handler(Looper.getMainLooper()).postDelayed({
mIntent?.putExtras(bundle) mIntent?.putExtras(bundle)
startActivity(mIntent) startActivity(mIntent)
finish() finish()
}, 2000) }, 2000)
}).start() }.start()
} }
}) })
MaxAdUtils.showMaxNativeAd(null, binding.flAd)
} }
} }
\ No newline at end of file
...@@ -10,8 +10,12 @@ import android.view.ViewGroup ...@@ -10,8 +10,12 @@ import android.view.ViewGroup
import android.widget.GridView import android.widget.GridView
import com.xm.test.myfile.R import com.xm.test.myfile.R
import com.xm.test.myfile.activity.FileManagerActivity import com.xm.test.myfile.activity.FileManagerActivity
import com.xm.test.myfile.activity.HomeActivity
import com.xm.test.myfile.activity.MediaActivity import com.xm.test.myfile.activity.MediaActivity
import com.xm.test.myfile.ad.MaxAdUtils
import com.xm.test.myfile.adapter.MediaAdapter import com.xm.test.myfile.adapter.MediaAdapter
import com.xm.test.myfile.databinding.FragmentFileManagerBinding
import com.xm.test.myfile.databinding.FragmentHomeBinding
import com.xm.test.myfile.model.FileBean import com.xm.test.myfile.model.FileBean
import com.xm.test.myfile.util.MediaUtil import com.xm.test.myfile.util.MediaUtil
import com.xm.test.myfile.util.PermissionUtil import com.xm.test.myfile.util.PermissionUtil
...@@ -34,14 +38,9 @@ class FileManagerFragment : Fragment(), View.OnClickListener { ...@@ -34,14 +38,9 @@ class FileManagerFragment : Fragment(), View.OnClickListener {
private lateinit var mTxtBtn: View private lateinit var mTxtBtn: View
private lateinit var mRecentGrid: GridView private lateinit var mRecentGrid: GridView
private lateinit var mRecentView: View private lateinit var mRecentView: View
private var mFileBeanList: ArrayList<FileBean>? = null
private var mIntent: Intent? = null
private var mRecentAdapter: MediaAdapter? = null private var mRecentAdapter: MediaAdapter? = null
private var mRecentImages = ArrayList<FileBean>() private var mRecentImages = ArrayList<FileBean>()
private lateinit var binding: FragmentFileManagerBinding
override fun onCreateView( override fun onCreateView(
...@@ -49,7 +48,7 @@ class FileManagerFragment : Fragment(), View.OnClickListener { ...@@ -49,7 +48,7 @@ class FileManagerFragment : Fragment(), View.OnClickListener {
savedInstanceState: Bundle? savedInstanceState: Bundle?
): View { ): View {
mView = inflater.inflate(R.layout.fragment_file_manager, container, false) mView = inflater.inflate(R.layout.fragment_file_manager, container, false)
binding = FragmentFileManagerBinding.bind(mView)
initView() initView()
return mView return mView
} }
...@@ -84,14 +83,13 @@ class FileManagerFragment : Fragment(), View.OnClickListener { ...@@ -84,14 +83,13 @@ class FileManagerFragment : Fragment(), View.OnClickListener {
mTxtBtn.setOnClickListener(this) mTxtBtn.setOnClickListener(this)
mRecentView.setOnClickListener(this) mRecentView.setOnClickListener(this)
mIntent = Intent(context, FileManagerActivity::class.java) mImageBtn.setOnClickListener {
mImageBtn.setOnClickListener{
val intent = Intent(context, MediaActivity::class.java) val intent = Intent(context, MediaActivity::class.java)
intent.putExtra("fileType", "image") intent.putExtra("fileType", "image")
context?.startActivity(intent) context?.startActivity(intent)
} }
mVideoBtn.setOnClickListener{ mVideoBtn.setOnClickListener {
val intent = Intent(context, MediaActivity::class.java) val intent = Intent(context, MediaActivity::class.java)
intent.putExtra("fileType", "video") intent.putExtra("fileType", "video")
context?.startActivity(intent) context?.startActivity(intent)
...@@ -102,46 +100,58 @@ class FileManagerFragment : Fragment(), View.OnClickListener { ...@@ -102,46 +100,58 @@ class FileManagerFragment : Fragment(), View.OnClickListener {
context?.startActivity(intent) context?.startActivity(intent)
} }
val sparseBooleanArray = SparseBooleanArray() val sparseBooleanArray = SparseBooleanArray()
mRecentAdapter = MediaAdapter(mRecentImages, requireContext(), sparseBooleanArray, "image", 80) mRecentAdapter =
MediaAdapter(mRecentImages, requireContext(), sparseBooleanArray, "image", 80)
mRecentAdapter?.setItemHeight(80) mRecentAdapter?.setItemHeight(80)
mRecentGrid.adapter = mRecentAdapter mRecentGrid.adapter = mRecentAdapter
MaxAdUtils.showMaxNativeAd(requireActivity(), binding.flAd)
} }
override fun onClick(v: View?) { override fun onClick(v: View?) {
if (checkPermission()){ val mIntent = Intent(context, FileManagerActivity::class.java)
when(v?.id){ when (v?.id) {
R.id.btn_audio->{mIntent?.putExtra("fileType", "audio")} R.id.btn_audio -> {
R.id.btn_zip->{mIntent?.putExtra("fileType", "zip")} mIntent.putExtra("fileType", "audio")
R.id.btn_apk->{mIntent?.putExtra("fileType", "apk")} }
R.id.btn_log_file->{mIntent?.putExtra("fileType", "log")}
R.id.btn_all->{mIntent?.putExtra("fileType", "all")} R.id.btn_zip -> {
R.id.btn_word->{mIntent?.putExtra("fileType", "word")} mIntent.putExtra("fileType", "zip")
R.id.btn_excel->{mIntent?.putExtra("fileType", "excel")} }
R.id.btn_ppt->{mIntent?.putExtra("fileType", "ppt")}
R.id.btn_pdf->{mIntent?.putExtra("fileType", "pdf")} R.id.btn_apk -> {
R.id.btn_txt->{mIntent?.putExtra("fileType", "txt")} mIntent.putExtra("fileType", "apk")
}
R.id.btn_log_file -> {
mIntent.putExtra("fileType", "log")
}
R.id.btn_all -> {
mIntent.putExtra("fileType", "all")
}
R.id.btn_word -> {
mIntent.putExtra("fileType", "word")
}
R.id.btn_excel -> {
mIntent.putExtra("fileType", "excel")
} }
context?.startActivity(mIntent)
}
}
private fun checkPermission(): Boolean { R.id.btn_ppt -> {
// if (!PermissionUtil.checkGrantedPermission(activity)) { mIntent.putExtra("fileType", "ppt")
// val customDialog = CustomDialog(context) }
// customDialog.setsConfirm(View.OnClickListener {
// PermissionUtil.requestPermission(context) R.id.btn_pdf -> {
// customDialog.dismiss() mIntent.putExtra("fileType", "pdf")
// }).setsCancel(View.OnClickListener { }
// customDialog.dismiss()
// }).show() R.id.btn_txt -> {
// customDialog.isShowEditText(false) mIntent.putExtra("fileType", "txt")
// customDialog.setsTitle("not permission") }
// customDialog.setsHint("Please grant file management permissions") }
// return false context?.startActivity(mIntent)
// }
return true
} }
override fun onResume() { override fun onResume() {
......
...@@ -92,7 +92,6 @@ class HomeFragment : Fragment(), OnClickListener { ...@@ -92,7 +92,6 @@ class HomeFragment : Fragment(), OnClickListener {
} }
override fun onClick(v: View?) { override fun onClick(v: View?) {
if (checkPermission()) {
when (v?.id) { when (v?.id) {
R.id.scan_for_duplicate_picture -> { R.id.scan_for_duplicate_picture -> {
activity?.startActivity(Intent(context, SimilarImagesActivity::class.java)) activity?.startActivity(Intent(context, SimilarImagesActivity::class.java))
...@@ -116,26 +115,6 @@ class HomeFragment : Fragment(), OnClickListener { ...@@ -116,26 +115,6 @@ class HomeFragment : Fragment(), OnClickListener {
} else if (v?.id == R.id.antivirus_btn) { } else if (v?.id == R.id.antivirus_btn) {
activity?.startActivity(Intent(context, AntivirusActivity::class.java)) activity?.startActivity(Intent(context, AntivirusActivity::class.java))
} }
}
}
private fun checkPermission(): Boolean {
// if (!PermissionUtil.checkGrantedPermission(activity)) {
// val customDialog = CustomDialog(context)
// customDialog.setsConfirm(OnClickListener {
// PermissionUtil.requestPermission(context)
// customDialog.dismiss()
// }).setsCancel(OnClickListener {
// customDialog.dismiss()
// }).show()
// customDialog.isShowEditText(false)
// customDialog.setsTitle("not permission")
// customDialog.setsHint("Please grant fileAll management permissions")
// return false
// }
return true
} }
fun setUseStorage() { fun setUseStorage() {
......
...@@ -29,6 +29,7 @@ import com.xm.test.myfile.activity.HomeActivity ...@@ -29,6 +29,7 @@ import com.xm.test.myfile.activity.HomeActivity
import com.xm.test.myfile.activity.MoveOrCopyActivity import com.xm.test.myfile.activity.MoveOrCopyActivity
import com.xm.test.myfile.adapter.FilesItemViewAdapter import com.xm.test.myfile.adapter.FilesItemViewAdapter
import com.xm.test.myfile.base.BaseActivity import com.xm.test.myfile.base.BaseActivity
import com.xm.test.myfile.databinding.FragmentInternalStorageBinding
import com.xm.test.myfile.model.FileBean import com.xm.test.myfile.model.FileBean
import com.xm.test.myfile.util.FileUtil import com.xm.test.myfile.util.FileUtil
import com.xm.test.myfile.util.PermissionUtil import com.xm.test.myfile.util.PermissionUtil
...@@ -38,8 +39,6 @@ import java.io.File ...@@ -38,8 +39,6 @@ import java.io.File
class InternalStorageFragment : Fragment(), View.OnClickListener { class InternalStorageFragment : Fragment(), View.OnClickListener {
private lateinit var mView: View private lateinit var mView: View
lateinit var mTitleText: TextView
lateinit var mShareBtn: ImageView
lateinit var mDeleteBtn: ImageView lateinit var mDeleteBtn: ImageView
lateinit var mNewBtn: ImageView lateinit var mNewBtn: ImageView
lateinit var mCancelBtn: ImageView lateinit var mCancelBtn: ImageView
...@@ -48,9 +47,7 @@ class InternalStorageFragment : Fragment(), View.OnClickListener { ...@@ -48,9 +47,7 @@ class InternalStorageFragment : Fragment(), View.OnClickListener {
lateinit var mBottomBar: View lateinit var mBottomBar: View
lateinit var mSelectNumText: TextView lateinit var mSelectNumText: TextView
lateinit var mCurrentFilePathTv: TextView lateinit var mCurrentFilePathTv: TextView
lateinit var mCheckItemSelectAllBtn: CheckBox lateinit var mCheckItemSelectAllBtn: CheckBox
lateinit var mMoveBottomBtn: LinearLayout lateinit var mMoveBottomBtn: LinearLayout
lateinit var mRenameBottomBtn: LinearLayout lateinit var mRenameBottomBtn: LinearLayout
lateinit var mCopyBottomBtn: LinearLayout lateinit var mCopyBottomBtn: LinearLayout
...@@ -59,7 +56,6 @@ class InternalStorageFragment : Fragment(), View.OnClickListener { ...@@ -59,7 +56,6 @@ class InternalStorageFragment : Fragment(), View.OnClickListener {
lateinit var mSwitchSelectView: RelativeLayout lateinit var mSwitchSelectView: RelativeLayout
lateinit var mNotFileFoundLayout: View lateinit var mNotFileFoundLayout: View
lateinit var mNotPermissionLayout: View
private lateinit var mFilesItemListView: ListView private lateinit var mFilesItemListView: ListView
...@@ -73,6 +69,7 @@ class InternalStorageFragment : Fragment(), View.OnClickListener { ...@@ -73,6 +69,7 @@ class InternalStorageFragment : Fragment(), View.OnClickListener {
var mCurrentFileBean: FileBean? = null var mCurrentFileBean: FileBean? = null
var mTitleStr: String = "" var mTitleStr: String = ""
private var mCurrentPaths = ArrayList<String>() private var mCurrentPaths = ArrayList<String>()
private lateinit var binding: FragmentInternalStorageBinding
companion object { companion object {
var isClickEditBtn = false var isClickEditBtn = false
...@@ -92,6 +89,7 @@ class InternalStorageFragment : Fragment(), View.OnClickListener { ...@@ -92,6 +89,7 @@ class InternalStorageFragment : Fragment(), View.OnClickListener {
savedInstanceState: Bundle? savedInstanceState: Bundle?
): View? { ): View? {
mView = inflater.inflate(R.layout.fragment_internal_storage, container, false) mView = inflater.inflate(R.layout.fragment_internal_storage, container, false)
binding = FragmentInternalStorageBinding.bind(mView)
initView() initView()
return mView return mView
} }
...@@ -100,8 +98,6 @@ class InternalStorageFragment : Fragment(), View.OnClickListener { ...@@ -100,8 +98,6 @@ class InternalStorageFragment : Fragment(), View.OnClickListener {
mBaseViewModel = ViewModelProvider(this)[BaseActivityViewModel::class.java] mBaseViewModel = ViewModelProvider(this)[BaseActivityViewModel::class.java]
mTitleText = mView.findViewById(R.id.title_bar_text)
mShareBtn = mView.findViewById(R.id.btn_share)
mDeleteBtn = mView.findViewById(R.id.btn_delete) mDeleteBtn = mView.findViewById(R.id.btn_delete)
mNewBtn = mView.findViewById(R.id.btn_new) mNewBtn = mView.findViewById(R.id.btn_new)
mCancelBtn = mView.findViewById(R.id.btn_cancel) mCancelBtn = mView.findViewById(R.id.btn_cancel)
...@@ -112,9 +108,8 @@ class InternalStorageFragment : Fragment(), View.OnClickListener { ...@@ -112,9 +108,8 @@ class InternalStorageFragment : Fragment(), View.OnClickListener {
mSelectNumText = mView.findViewById(R.id.select_num) mSelectNumText = mView.findViewById(R.id.select_num)
mCheckItemSelectAllBtn = mView.findViewById(R.id.checkbox_item_all) mCheckItemSelectAllBtn = mView.findViewById(R.id.checkbox_item_all)
mNotFileFoundLayout = mView.findViewById(R.id.not_file_found_layout) mNotFileFoundLayout = mView.findViewById(R.id.not_file_found_layout)
mNotPermissionLayout = mView.findViewById(R.id.not_file_permission_layout)
mCurrentFilePathTv = mView.findViewById(R.id.current_file_path) mCurrentFilePathTv = mView.findViewById(R.id.current_file_path)
mFilesItemListView = mView.findViewById<ListView>(R.id.files_item_listview) mFilesItemListView = mView.findViewById(R.id.files_item_listview)
mMoveBottomBtn = mBottomBar.findViewById(R.id.btn_move_bottom) mMoveBottomBtn = mBottomBar.findViewById(R.id.btn_move_bottom)
...@@ -123,8 +118,8 @@ class InternalStorageFragment : Fragment(), View.OnClickListener { ...@@ -123,8 +118,8 @@ class InternalStorageFragment : Fragment(), View.OnClickListener {
mDeleteBottomBtn = mBottomBar.findViewById(R.id.btn_delete_bottom) mDeleteBottomBtn = mBottomBar.findViewById(R.id.btn_delete_bottom)
mCancelBottomBtn = mBottomBar.findViewById(R.id.btn_cancel_bottom) mCancelBottomBtn = mBottomBar.findViewById(R.id.btn_cancel_bottom)
mTitleText.setOnClickListener(this) binding.includeBar.titleBarText.setOnClickListener(this)
mShareBtn.setOnClickListener(this) binding.includeBar.btnShare.setOnClickListener(this)
mDeleteBtn.setOnClickListener(this) mDeleteBtn.setOnClickListener(this)
mNewBtn.setOnClickListener(this) mNewBtn.setOnClickListener(this)
mCancelBtn.setOnClickListener(this) mCancelBtn.setOnClickListener(this)
...@@ -146,7 +141,6 @@ class InternalStorageFragment : Fragment(), View.OnClickListener { ...@@ -146,7 +141,6 @@ class InternalStorageFragment : Fragment(), View.OnClickListener {
mQuitBtn.visibility = View.GONE mQuitBtn.visibility = View.GONE
mEditBtn.visibility = View.VISIBLE mEditBtn.visibility = View.VISIBLE
mNewBtn.visibility = View.VISIBLE mNewBtn.visibility = View.VISIBLE
mBaseViewModel.setNumber(0) mBaseViewModel.setNumber(0)
mBaseViewModel.myInt.observe(viewLifecycleOwner, Observer { mBaseViewModel.myInt.observe(viewLifecycleOwner, Observer {
mSelectNumText.text = mSelectNumText.text =
...@@ -155,6 +149,12 @@ class InternalStorageFragment : Fragment(), View.OnClickListener { ...@@ -155,6 +149,12 @@ class InternalStorageFragment : Fragment(), View.OnClickListener {
} }
private fun showNoPermissionUi(flag: Boolean) {
binding.includeBar.root.isVisible = !flag
binding.llContent.isVisible = !flag
binding.includeNoPermission.root.isVisible = flag
}
private fun requestDataList() { private fun requestDataList() {
println("yanglin start getData") println("yanglin start getData")
mNewBtn.visibility = View.VISIBLE mNewBtn.visibility = View.VISIBLE
...@@ -163,8 +163,7 @@ class InternalStorageFragment : Fragment(), View.OnClickListener { ...@@ -163,8 +163,7 @@ class InternalStorageFragment : Fragment(), View.OnClickListener {
if (mItemDataList.size == 0) { if (mItemDataList.size == 0) {
WaitDialog.show("please wait..") WaitDialog.show("please wait..")
Thread(Runnable { Thread {
// val allFilesAndDirectories = FileUtil.getAllFilesAndDirectories(requireContext())
val allFilesAndDirectories = val allFilesAndDirectories =
FileUtil.getFileList(Environment.getExternalStorageDirectory()) FileUtil.getFileList(Environment.getExternalStorageDirectory())
mItemDataList = FileUtil.fileListSort(allFilesAndDirectories) mItemDataList = FileUtil.fileListSort(allFilesAndDirectories)
...@@ -173,7 +172,7 @@ class InternalStorageFragment : Fragment(), View.OnClickListener { ...@@ -173,7 +172,7 @@ class InternalStorageFragment : Fragment(), View.OnClickListener {
setAdapter(mItemDataList) setAdapter(mItemDataList)
WaitDialog.dismiss() WaitDialog.dismiss()
}) })
}).start() }.start()
} else { } else {
if (mFilesItemLists.size < 1) { if (mFilesItemLists.size < 1) {
setAdapter(mFileDataBean) setAdapter(mFileDataBean)
...@@ -187,23 +186,16 @@ class InternalStorageFragment : Fragment(), View.OnClickListener { ...@@ -187,23 +186,16 @@ class InternalStorageFragment : Fragment(), View.OnClickListener {
mFileAdapter = FilesItemViewAdapter(itemList, requireContext(), mItemCheckedArray) mFileAdapter = FilesItemViewAdapter(itemList, requireContext(), mItemCheckedArray)
mFilesItemListView.adapter = mFileAdapter mFilesItemListView.adapter = mFileAdapter
setOnListViewItemClickListener() setOnListViewItemClickListener()
mNotPermissionLayout.visibility = View.GONE
if (HomeActivity.isPermission) { if (HomeActivity.isPermission) {
if (itemList.size > 0) { if (itemList.size > 0) {
mNotFileFoundLayout.visibility = View.GONE mNotFileFoundLayout.visibility = View.GONE
mFilesItemListView.visibility = View.VISIBLE mFilesItemListView.visibility = View.VISIBLE
// isEditShow(true)
} else { } else {
mFilesItemListView.visibility = View.GONE mFilesItemListView.visibility = View.GONE
mNotFileFoundLayout.visibility = View.VISIBLE mNotFileFoundLayout.visibility = View.VISIBLE
// isEditShow(false)
} }
} else { } else {
mNotPermissionLayout.visibility = View.VISIBLE
mFilesItemListView.visibility = View.GONE mFilesItemListView.visibility = View.GONE
// mNotFileFoundLayout.visibility = View.GONE
// isEditShow(false)
} }
} }
...@@ -227,7 +219,7 @@ class InternalStorageFragment : Fragment(), View.OnClickListener { ...@@ -227,7 +219,7 @@ class InternalStorageFragment : Fragment(), View.OnClickListener {
mEditBtn.visibility = View.GONE mEditBtn.visibility = View.GONE
mCancelBtn.visibility = View.VISIBLE mCancelBtn.visibility = View.VISIBLE
mShareBtn.visibility = View.VISIBLE binding.includeBar.btnShare.visibility = View.VISIBLE
mBottomBar.visibility = View.VISIBLE mBottomBar.visibility = View.VISIBLE
mSwitchSelectView.visibility = View.VISIBLE mSwitchSelectView.visibility = View.VISIBLE
...@@ -275,7 +267,6 @@ class InternalStorageFragment : Fragment(), View.OnClickListener { ...@@ -275,7 +267,6 @@ class InternalStorageFragment : Fragment(), View.OnClickListener {
R.id.btn_move_bottom -> { R.id.btn_move_bottom -> {
if (switchNumber == 0) return if (switchNumber == 0) return
// mFileAdapter?.setEditClickState(false)
isMove = true isMove = true
var intent = Intent(context, MoveOrCopyActivity::class.java) var intent = Intent(context, MoveOrCopyActivity::class.java)
intent.putExtra("checkedItemBeans", mFileCheckedItemList) intent.putExtra("checkedItemBeans", mFileCheckedItemList)
...@@ -323,12 +314,11 @@ class InternalStorageFragment : Fragment(), View.OnClickListener { ...@@ -323,12 +314,11 @@ class InternalStorageFragment : Fragment(), View.OnClickListener {
R.id.btn_cancel_bottom -> { R.id.btn_cancel_bottom -> {
mTitleText.text = mTitleStr binding.includeBar.titleBarText.text = mTitleStr
mCancelBottomBtn.visibility = View.GONE mCancelBottomBtn.visibility = View.GONE
mQuitBtn.visibility = View.GONE mQuitBtn.visibility = View.GONE
mCancelBtn.visibility = View.VISIBLE mCancelBtn.visibility = View.VISIBLE
// mDeleteBtn.visibility = View.VISIBLE binding.includeBar.btnShare.visibility = View.VISIBLE
mShareBtn.visibility = View.VISIBLE
mCopyBottomBtn.visibility = View.VISIBLE mCopyBottomBtn.visibility = View.VISIBLE
mMoveBottomBtn.visibility = View.VISIBLE mMoveBottomBtn.visibility = View.VISIBLE
mRenameBottomBtn.visibility = View.VISIBLE mRenameBottomBtn.visibility = View.VISIBLE
...@@ -358,7 +348,7 @@ class InternalStorageFragment : Fragment(), View.OnClickListener { ...@@ -358,7 +348,7 @@ class InternalStorageFragment : Fragment(), View.OnClickListener {
mEditBtn.visibility = View.VISIBLE mEditBtn.visibility = View.VISIBLE
mCancelBtn.visibility = View.GONE mCancelBtn.visibility = View.GONE
mDeleteBtn.visibility = View.GONE mDeleteBtn.visibility = View.GONE
mShareBtn.visibility = View.GONE binding.includeBar.btnShare.visibility = View.GONE
mBottomBar.visibility = View.GONE mBottomBar.visibility = View.GONE
mSwitchSelectView.visibility = View.GONE mSwitchSelectView.visibility = View.GONE
if (mFilesItemLists.size == 0) { if (mFilesItemLists.size == 0) {
...@@ -432,7 +422,6 @@ class InternalStorageFragment : Fragment(), View.OnClickListener { ...@@ -432,7 +422,6 @@ class InternalStorageFragment : Fragment(), View.OnClickListener {
} }
mFileAdapter?.notifyDataSetChanged() mFileAdapter?.notifyDataSetChanged()
mBaseViewModel.setNumber(switchNumber) mBaseViewModel.setNumber(switchNumber)
// mSelectNumText.text = String.format(getString(R.string.select_0, mSelectNum.toString()))
} }
fun updateCheckBoxStatus(view: View, position: Int) { fun updateCheckBoxStatus(view: View, position: Int) {
...@@ -494,9 +483,9 @@ class InternalStorageFragment : Fragment(), View.OnClickListener { ...@@ -494,9 +483,9 @@ class InternalStorageFragment : Fragment(), View.OnClickListener {
private fun createNewDir() { private fun createNewDir() {
val customDialog = CustomDialog(context) val customDialog = CustomDialog(context)
customDialog.setsCancel(View.OnClickListener { customDialog.setsCancel {
customDialog.dismiss() customDialog.dismiss()
}).setsConfirm(View.OnClickListener { }.setsConfirm(View.OnClickListener {
val editTextStr = customDialog.getEditTextStr() val editTextStr = customDialog.getEditTextStr()
for (fileBean: FileBean in mItemDataList) { for (fileBean: FileBean in mItemDataList) {
if (editTextStr.equals(fileBean.fileName)) { if (editTextStr.equals(fileBean.fileName)) {
...@@ -579,11 +568,10 @@ class InternalStorageFragment : Fragment(), View.OnClickListener { ...@@ -579,11 +568,10 @@ class InternalStorageFragment : Fragment(), View.OnClickListener {
isCopy = false isCopy = false
} }
if (PermissionUtil.checkGrantedPermission(requireActivity())) { if (PermissionUtil.checkGrantedPermission(requireActivity())) {
showNoPermissionUi(false)
requestDataList() requestDataList()
} else { } else {
mEditBtn.visibility = View.GONE showNoPermissionUi(true)
mCurrentFilePathTv.visibility = View.GONE
mNotPermissionLayout.visibility = View.VISIBLE
} }
} }
......
...@@ -6,11 +6,13 @@ ...@@ -6,11 +6,13 @@
android:layout_height="match_parent" android:layout_height="match_parent"
tools:context=".antivirus.AntivirusActivity"> tools:context=".antivirus.AntivirusActivity">
<!-- 扫描病毒隐私ui -->
<FrameLayout <FrameLayout
android:id="@+id/antivirus_page_2" android:id="@+id/fl_virus_privacy"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:background="#F8F8F8"> android:background="#F8F8F8"
android:visibility="gone">
<RelativeLayout <RelativeLayout
android:layout_width="match_parent" android:layout_width="match_parent"
...@@ -18,7 +20,7 @@ ...@@ -18,7 +20,7 @@
tools:ignore="UselessParent"> tools:ignore="UselessParent">
<ImageView <ImageView
android:id="@+id/antivirus_quit_btn" android:id="@+id/iv_back"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_alignParentStart="true" android:layout_alignParentStart="true"
...@@ -153,15 +155,158 @@ ...@@ -153,15 +155,158 @@
</FrameLayout> </FrameLayout>
<!-- 开始病毒扫描ui -->
<FrameLayout <LinearLayout
android:id="@+id/check_the_source_layout" android:id="@+id/ll_virus_scan"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:orientation="vertical"
android:visibility="gone"> android:visibility="gone">
<include layout="@layout/check_the_source_layout" /> <ImageView
</FrameLayout> android:id="@+id/iv_back_2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:layout_marginTop="16dp"
android:src="@drawable/ic_quit"
tools:ignore="ContentDescription" />
<ScrollView
android:layout_width="match_parent"
android:layout_height="wrap_content">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<LinearLayout
android:id="@+id/scan_ing_layout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:layout_marginTop="38dp"
android:text="Check the safety of the source"
android:textColor="@color/black"
android:textSize="16dp"
android:textStyle="bold"
tools:ignore="HardcodedText,SpUsage" />
<RelativeLayout
android:layout_width="wrap_content"
android:layout_height="389dp"
android:layout_gravity="center_horizontal"
android:background="@mipmap/antivirus_image">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_marginBottom="30dp"
android:text="Applications from unknow soursess: 10"
android:textColor="#FF0707"
android:textSize="16sp"
tools:ignore="HardcodedText" />
<TextView
android:id="@+id/scan_name_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:text="Tiktok"
android:textSize="16sp"
tools:ignore="HardcodedText" />
</RelativeLayout>
<ProgressBar
android:id="@+id/antivirus_progress"
style="@style/Widget.AppCompat.ProgressBar.Horizontal"
android:layout_width="match_parent"
android:layout_height="15dp"
android:layout_marginStart="16dp"
android:layout_marginTop="24dp"
android:layout_marginEnd="16dp"
android:progress="20"
android:progressDrawable="@drawable/progress_bg" />
<TextView
android:id="@+id/antivirus_stop_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:layout_marginTop="16dp"
android:text="Stop"
android:textColor="#999999"
android:textSize="16sp"
android:textStyle="bold"
tools:ignore="HardcodedText" />
</LinearLayout>
<RelativeLayout
android:id="@+id/antivirus_success_layout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:visibility="gone">
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:src="@mipmap/wancheng"
tools:ignore="ContentDescription" />
<ProgressBar
android:layout_width="54dp"
android:layout_height="54dp"
android:layout_alignParentBottom="true"
android:layout_centerHorizontal="true"
android:progressTint="@color/style_background" />
</RelativeLayout>
<LinearLayout
android:id="@+id/ad_group_layout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:orientation="vertical"
tools:ignore="UseCompoundDrawables,UselessParent">
<TextView
android:id="@+id/power_by_trust_look"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:layout_marginBottom="16dp"
android:text="Powered By Trustlook"
android:textColor="@color/style_background"
android:textSize="16sp"
tools:ignore="HardcodedText" />
<FrameLayout
android:id="@+id/fl_ad"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="8dp"
tools:ignore="ContentDescription" />
</LinearLayout>
</LinearLayout>
</ScrollView>
</LinearLayout>
</RelativeLayout> </RelativeLayout>
\ No newline at end of file
...@@ -32,7 +32,6 @@ ...@@ -32,7 +32,6 @@
android:id="@+id/not_file_found_layout" android:id="@+id/not_file_found_layout"
layout="@layout/not_found_layout" /> layout="@layout/not_found_layout" />
<include <include
android:id="@+id/bottom_btn_group" android:id="@+id/bottom_btn_group"
layout="@layout/bottom_bar_layout" layout="@layout/bottom_bar_layout"
......
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent">
<ImageView
android:id="@+id/antivirus_quit_btn_2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentStart="true"
android:layout_marginStart="16dp"
android:layout_marginTop="16dp"
android:src="@drawable/ic_quit"
tools:ignore="ContentDescription" />
<LinearLayout
android:id="@+id/scan_ing_layout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@+id/antivirus_quit_btn_2"
android:orientation="vertical">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:layout_marginTop="38dp"
android:text="Check the safety of the source"
android:textColor="@color/black"
android:textSize="16dp"
android:textStyle="bold"
tools:ignore="HardcodedText,SpUsage" />
<RelativeLayout
android:layout_width="wrap_content"
android:layout_height="389dp"
android:layout_gravity="center_horizontal"
android:background="@mipmap/antivirus_image">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_marginBottom="30dp"
android:text="Applications from unknow soursess: 10"
android:textColor="#FF0707"
android:textSize="16sp"
tools:ignore="HardcodedText" />
<TextView
android:id="@+id/scan_name_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:text="Tiktok"
android:textSize="16sp"
tools:ignore="HardcodedText" />
</RelativeLayout>
<ProgressBar
android:id="@+id/antivirus_progress"
style="@style/Widget.AppCompat.ProgressBar.Horizontal"
android:layout_width="match_parent"
android:layout_height="15dp"
android:layout_marginStart="16dp"
android:layout_marginTop="24dp"
android:layout_marginEnd="16dp"
android:progress="20"
android:progressDrawable="@drawable/progress_bg" />
<TextView
android:id="@+id/antivirus_stop_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:layout_marginTop="16dp"
android:text="Stop"
android:textColor="#999999"
android:textSize="16sp"
android:textStyle="bold"
tools:ignore="HardcodedText" />
</LinearLayout>
<RelativeLayout
android:id="@+id/antivirus_success_layout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_above="@+id/ad_group_layout"
android:layout_below="@id/antivirus_quit_btn_2"
android:visibility="gone">
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:src="@mipmap/wancheng"
tools:ignore="ContentDescription" />
<ProgressBar
android:layout_width="54dp"
android:layout_height="54dp"
android:layout_alignParentBottom="true"
android:layout_centerHorizontal="true"
android:progressTint="@color/style_background" />
</RelativeLayout>
<FrameLayout
android:id="@+id/ad_group_layout"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_centerHorizontal="true">
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical"
tools:ignore="UselessParent">
<TextView
android:id="@+id/power_by_trust_look"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:layout_marginBottom="16dp"
android:text="Powered By Trustlook"
android:textColor="@color/style_background"
android:textSize="16sp"
tools:ignore="HardcodedText" />
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@mipmap/ad"
tools:ignore="ContentDescription" />
</LinearLayout>
</FrameLayout>
</RelativeLayout>
\ No newline at end of file
...@@ -7,9 +7,9 @@ ...@@ -7,9 +7,9 @@
<ScrollView <ScrollView
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="wrap_content"
android:layout_above="@+id/file_manager_ad" android:scrollbars="none"
android:scrollbars="none"> tools:ignore="UselessParent">
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
...@@ -358,7 +358,8 @@ ...@@ -358,7 +358,8 @@
<ImageView <ImageView
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:src="@drawable/ic_ppt" /> android:src="@drawable/ic_ppt"
tools:ignore="ContentDescription" />
<TextView <TextView
android:layout_width="wrap_content" android:layout_width="wrap_content"
...@@ -420,23 +421,17 @@ ...@@ -420,23 +421,17 @@
</LinearLayout> </LinearLayout>
</LinearLayout> </LinearLayout>
</LinearLayout>
</ScrollView> <FrameLayout
android:id="@+id/fl_ad"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginVertical="8dp" />
</LinearLayout>
<FrameLayout
android:id="@+id/file_manager_ad" </ScrollView>
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true">
<!-- <include layout="@layout/ad_layout"/>-->
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:src="@mipmap/ad" />
</FrameLayout>
</RelativeLayout> </RelativeLayout>
\ No newline at end of file
...@@ -7,33 +7,46 @@ ...@@ -7,33 +7,46 @@
android:orientation="vertical" android:orientation="vertical"
tools:context=".fragment.InternalStorageFragment"> tools:context=".fragment.InternalStorageFragment">
<include layout="@layout/title_bar_layout" /> <include
android:id="@+id/include_bar"
layout="@layout/title_bar_layout"
android:visibility="gone" />
<ListView <LinearLayout
android:id="@+id/files_item_listview" android:id="@+id/ll_content"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="0dp" android:layout_height="match_parent"
android:layout_marginStart="16dp" android:orientation="vertical"
android:layout_marginTop="12dp" android:visibility="gone">
android:layout_marginEnd="16dp"
android:layout_weight="0.9"
android:divider="@null"
android:dividerHeight="10dp" />
<include <ListView
android:id="@+id/not_file_permission_layout" android:id="@+id/files_item_listview"
layout="@layout/not_permission_layout" android:layout_width="match_parent"
android:visibility="gone" /> android:layout_height="0dp"
android:layout_marginStart="16dp"
android:layout_marginTop="12dp"
android:layout_marginEnd="16dp"
android:layout_weight="1"
android:divider="@null"
android:dividerHeight="10dp" />
<include <include
android:id="@+id/not_file_found_layout" android:id="@+id/not_file_found_layout"
layout="@layout/not_found_layout" layout="@layout/not_found_layout"
android:visibility="gone" /> android:visibility="gone" />
<include
android:id="@+id/bottom_btn_group"
layout="@layout/bottom_bar_layout"
android:visibility="gone" />
</LinearLayout>
<include <include
android:id="@+id/bottom_btn_group" android:id="@+id/include_no_permission"
layout="@layout/bottom_bar_layout" layout="@layout/not_permission_layout"
android:visibility="gone" /> android:visibility="gone" />
</LinearLayout> </LinearLayout>
\ No newline at end of file
...@@ -17,7 +17,7 @@ ...@@ -17,7 +17,7 @@
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_centerHorizontal="true" android:layout_centerHorizontal="true"
android:src="@drawable/not_permissions" android:src="@mipmap/tu"
tools:ignore="ContentDescription" /> tools:ignore="ContentDescription" />
<TextView <TextView
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment