Commit 23714731 authored by wanglei's avatar wanglei Committed by wanglei

圆弧是以全圆来绘制的

parent 80187db9
......@@ -5,7 +5,7 @@
<option name="linkedExternalProjectsSettings">
<GradleProjectSettings>
<option name="externalProjectPath" value="$PROJECT_DIR$" />
<option name="gradleJvm" value="#GRADLE_LOCAL_JAVA_HOME" />
<option name="gradleJvm" value="#JAVA_HOME" />
<option name="modules">
<set>
<option value="$PROJECT_DIR$" />
......
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ExternalStorageConfigurationManager" enabled="true" />
<component name="ProjectRootManager" version="2" languageLevel="JDK_17" default="true" project-jdk-name="jbr-17" project-jdk-type="JavaSDK">
<component name="ProjectRootManager" version="2" languageLevel="JDK_17" default="true" project-jdk-name="17" project-jdk-type="JavaSDK">
<output url="file://$PROJECT_DIR$/out" />
</component>
</project>
\ No newline at end of file
......@@ -45,6 +45,8 @@ dependencies {
implementation(libs.material)
implementation(libs.androidx.activity)
implementation(libs.androidx.constraintlayout)
implementation(libs.androidx.navigation.fragment.ktx)
implementation(libs.androidx.navigation.ui.ktx)
testImplementation(libs.junit)
androidTestImplementation(libs.androidx.junit)
androidTestImplementation(libs.androidx.espresso.core)
......
......@@ -12,6 +12,25 @@
android:supportsRtl="true"
android:theme="@style/Theme.HFileManagerMaster"
tools:targetApi="31">
<activity
android:name="com.zxhy.hfilemanagermaster.video.VideoActivity"
android:exported="false" />
<activity
android:name="com.zxhy.hfilemanagermaster.image.ImageActivity"
android:exported="false"
android:launchMode="singleTop" />
<activity
android:name="com.zxhy.hfilemanagermaster.duplicate.DupPictureActivity"
android:exported="false"
android:launchMode="singleTop" />
<activity
android:name="com.zxhy.hfilemanagermaster.emptyfile.EmptyFileActivity"
android:exported="false"
android:launchMode="singleTop" />
<activity
android:name="com.zxhy.hfilemanagermaster.largefile.LargeFileActivity"
android:exported="false"
android:launchMode="singleTop" />
<activity
android:name="com.zxhy.hfilemanagermaster.ToolsActivity"
android:exported="false"
......
package com.zxhy.hfilemanagermaster
import android.os.Bundle
import androidx.fragment.app.Fragment
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import androidx.navigation.fragment.findNavController
import com.example.hfilemanagermaster.R
import com.example.hfilemanagermaster.databinding.FragmentFilesBinding
// TODO: Rename parameter arguments, choose names that match
// the fragment initialization parameters, e.g. ARG_ITEM_NUMBER
private const val ARG_PARAM1 = "param1"
private const val ARG_PARAM2 = "param2"
/**
* A simple [Fragment] subclass.
* Use the [FilesFragment.newInstance] factory method to
* create an instance of this fragment.
*/
class FilesFragment : Fragment() {
// TODO: Rename and change types of parameters
private var param1: String? = null
private var param2: String? = null
private lateinit var binding: FragmentFilesBinding
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
arguments?.let {
param1 = it.getString(ARG_PARAM1)
param2 = it.getString(ARG_PARAM2)
}
(activity as OverviewActivity).setStatusBarColor(R.color.white)
}
override fun onCreateView(
inflater: LayoutInflater, container: ViewGroup?,
savedInstanceState: Bundle?
): View? {
// Inflate the layout for this fragment
val view = inflater.inflate(R.layout.fragment_files, container, false)
binding = FragmentFilesBinding.bind(view)
return view
}
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
super.onViewCreated(view, savedInstanceState)
binding.ivImage.setOnClickListener {
findNavController().navigate(R.id.imageActivity)
}
binding.ivVideo.setOnClickListener {
findNavController().navigate(R.id.videoActivity)
}
}
companion object {
/**
* Use this factory method to create a new instance of
* this fragment using the provided parameters.
*
* @param param1 Parameter 1.
* @param param2 Parameter 2.
* @return A new instance of fragment FilesFragment.
*/
// TODO: Rename and change types and number of parameters
@JvmStatic
fun newInstance(param1: String, param2: String) =
FilesFragment().apply {
arguments = Bundle().apply {
putString(ARG_PARAM1, param1)
putString(ARG_PARAM2, param2)
}
}
}
}
\ No newline at end of file
package com.zxhy.hfilemanagermaster
// TODO: Rename parameter arguments, choose names that match
// the fragment initialization parameters, e.g. ARG_ITEM_NUMBER
private const val ARG_PARAM1 = "param1"
private const val ARG_PARAM2 = "param2"
package com.zxhy.hfilemanagermaster
import android.os.storage.StorageManager
import androidx.lifecycle.ViewModel
class ManagerViewModel : ViewModel() {
fun a(){
}
}
\ No newline at end of file
......@@ -5,10 +5,12 @@ import android.content.Intent
import android.os.Bundle
import android.view.WindowManager
import androidx.activity.enableEdgeToEdge
import androidx.annotation.ColorRes
import androidx.appcompat.app.AppCompatActivity
import androidx.core.content.ContextCompat
import androidx.core.view.ViewCompat
import androidx.core.view.WindowInsetsCompat
import androidx.navigation.findNavController
import com.example.hfilemanagermaster.R
import com.example.hfilemanagermaster.databinding.ActivityOverviewBinding
......@@ -21,31 +23,43 @@ class OverviewActivity : AppCompatActivity() {
enableEdgeToEdge()
binding = ActivityOverviewBinding.inflate(layoutInflater)
setContentView(binding.root)
window.statusBarColor = ContextCompat.getColor(this, R.color.color_B7FF03)
ViewCompat.setOnApplyWindowInsetsListener(findViewById(R.id.main)) { v, insets ->
val systemBars = insets.getInsets(WindowInsetsCompat.Type.systemBars())
v.setPadding(systemBars.left, systemBars.top, systemBars.right, systemBars.bottom)
insets
}
binding.tvUse.text = "25%"
binding.tvFree.text = "75GB"
window.statusBarColor = ContextCompat.getColor(this, R.color.color_B7FF03)
binding.ivManager.isSelected = true
binding.cardView1.setOnClickListener { }
binding.cardView2.setOnClickListener { }
binding.cardView3.setOnClickListener { }
binding.ivFile.setOnClickListener { }
binding.ivWord.setOnClickListener { }
binding.ivExcel.setOnClickListener { }
binding.ivPdf.setOnClickListener { }
binding.ivPpt.setOnClickListener { }
binding.ivManager.setOnClickListener {
binding.fragmentContainerView.findNavController().navigate(R.id.managerFragment)
showManager()
}
binding.ivTools.setOnClickListener {
val intent = Intent(this@OverviewActivity, ToolsActivity::class.java)
startActivity(intent)
binding.fragmentContainerView.findNavController().navigate(R.id.toolsFragment)
showTools()
}
}
fun setStatusBarColor(@ColorRes id: Int) {
window.statusBarColor = ContextCompat.getColor(this, id)
binding.ivTools.isSelected = true
binding.ivManager.isSelected = false
}
fun showManager() {
window.statusBarColor = ContextCompat.getColor(this, R.color.color_B7FF03)
binding.ivManager.isSelected = true
binding.ivTools.isSelected = false
}
fun showTools() {
binding.ivTools.isSelected = true
binding.ivManager.isSelected = false
window.statusBarColor = ContextCompat.getColor(this, R.color.white)
}
}
\ No newline at end of file
package com.zxhy.hfilemanagermaster
import android.os.Bundle
import androidx.fragment.app.Fragment
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import com.example.hfilemanagermaster.R
// TODO: Rename parameter arguments, choose names that match
// the fragment initialization parameters, e.g. ARG_ITEM_NUMBER
private const val ARG_PARAM1 = "param1"
private const val ARG_PARAM2 = "param2"
/**
* A simple [Fragment] subclass.
* Use the [ToolsFragment.newInstance] factory method to
* create an instance of this fragment.
*/
class ToolsFragment : Fragment() {
// TODO: Rename and change types of parameters
private var param1: String? = null
private var param2: String? = null
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
arguments?.let {
param1 = it.getString(ARG_PARAM1)
param2 = it.getString(ARG_PARAM2)
}
}
override fun onCreateView(
inflater: LayoutInflater, container: ViewGroup?,
savedInstanceState: Bundle?
): View? {
// Inflate the layout for this fragment
return inflater.inflate(R.layout.fragment_tools, container, false)
}
companion object {
/**
* Use this factory method to create a new instance of
* this fragment using the provided parameters.
*
* @param param1 Parameter 1.
* @param param2 Parameter 2.
* @return A new instance of fragment ToolsFragment.
*/
// TODO: Rename and change types and number of parameters
@JvmStatic
fun newInstance(param1: String, param2: String) =
ToolsFragment().apply {
arguments = Bundle().apply {
putString(ARG_PARAM1, param1)
putString(ARG_PARAM2, param2)
}
}
}
}
\ No newline at end of file
package com.zxhy.hfilemanagermaster.duplicate
import android.os.Bundle
import androidx.activity.enableEdgeToEdge
import androidx.appcompat.app.AppCompatActivity
import androidx.core.content.ContextCompat
import androidx.core.view.ViewCompat
import androidx.core.view.WindowInsetsCompat
import com.example.hfilemanagermaster.R
import com.example.hfilemanagermaster.databinding.ActivityDupPictureBinding
class DupPictureActivity : AppCompatActivity() {
private lateinit var binding: ActivityDupPictureBinding
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
enableEdgeToEdge()
binding = ActivityDupPictureBinding.inflate(layoutInflater)
setContentView(binding.root)
ViewCompat.setOnApplyWindowInsetsListener(findViewById(R.id.main)) { v, insets ->
val systemBars = insets.getInsets(WindowInsetsCompat.Type.systemBars())
v.setPadding(systemBars.left, systemBars.top, systemBars.right, systemBars.bottom)
insets
}
window.statusBarColor = ContextCompat.getColor(this, R.color.color_C2F300)
binding.ivArrow.setOnClickListener {
finish()
}
}
}
\ No newline at end of file
package com.zxhy.hfilemanagermaster.emptyfile
import android.os.Bundle
import androidx.activity.enableEdgeToEdge
import androidx.appcompat.app.AppCompatActivity
import androidx.core.content.ContextCompat
import androidx.core.view.ViewCompat
import androidx.core.view.WindowInsetsCompat
import com.example.hfilemanagermaster.R
import com.example.hfilemanagermaster.databinding.ActivityEmptyFileBinding
class EmptyFileActivity : AppCompatActivity() {
private lateinit var binding: ActivityEmptyFileBinding
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
enableEdgeToEdge()
binding = ActivityEmptyFileBinding.inflate(layoutInflater)
setContentView(binding.root)
ViewCompat.setOnApplyWindowInsetsListener(findViewById(R.id.main)) { v, insets ->
val systemBars = insets.getInsets(WindowInsetsCompat.Type.systemBars())
v.setPadding(systemBars.left, systemBars.top, systemBars.right, systemBars.bottom)
insets
}
window.statusBarColor = ContextCompat.getColor(this, R.color.color_C2F300)
binding.ivArrow.setOnClickListener {
finish()
}
}
}
\ No newline at end of file
package com.zxhy.hfilemanagermaster.image
import android.os.Bundle
import androidx.activity.enableEdgeToEdge
import androidx.appcompat.app.AppCompatActivity
import androidx.core.content.ContextCompat
import androidx.core.view.ViewCompat
import androidx.core.view.WindowInsetsCompat
import com.example.hfilemanagermaster.R
import com.example.hfilemanagermaster.databinding.ActivityImageBinding
class ImageActivity : AppCompatActivity() {
private lateinit var binding: ActivityImageBinding
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
enableEdgeToEdge()
binding = ActivityImageBinding.inflate(layoutInflater)
setContentView(binding.root)
ViewCompat.setOnApplyWindowInsetsListener(findViewById(R.id.main)) { v, insets ->
val systemBars = insets.getInsets(WindowInsetsCompat.Type.systemBars())
v.setPadding(systemBars.left, systemBars.top, systemBars.right, systemBars.bottom)
insets
}
window.statusBarColor = ContextCompat.getColor(this, R.color.color_C2F300)
binding.ivArrow.setOnClickListener {
finish()
}
}
}
\ No newline at end of file
package com.zxhy.hfilemanagermaster.knife
import android.graphics.Bitmap
import android.graphics.Matrix
fun Bitmap.setImageSize(scale: Float): Bitmap {
val matrix = Matrix()
matrix.postScale(scale, scale)
return Bitmap.createBitmap(this, 0, 0, this.width, this.height, matrix, true)
}
\ No newline at end of file
package com.zxhy.hfilemanagermaster.knife
import android.annotation.SuppressLint
import android.app.usage.StorageStatsManager
import android.content.Context
import android.os.Build
import android.os.storage.StorageManager
import android.os.storage.StorageVolume
import android.text.format.Formatter
import androidx.annotation.RequiresApi
import java.io.File
import java.lang.reflect.Field
import java.lang.reflect.Method
import java.util.UUID
/**
* 计算储存介质
*/
const val TYPE_U = 0 //u盘
const val TYPE_DATA = 1 //data区域
const val TYPE_EXTERNAL = 2 //外置存储
data class Disk(
val path: String = "", //路径
val name: String = "", //名称
val type: Int = 0,//类型 0U盘 1 data区域 2内置存储区域
val total: Long = 0, //总计数量
val used: Long = 0, //已用空间
val free: Long = 0, //空闲空间
) {
fun getTotalContent(context: Context): String {
return Formatter.formatFileSize(context, total)
}
fun getUsedContent(context: Context): String {
return Formatter.formatFileSize(context, used)
}
fun getFreeContent(context: Context): String {
return Formatter.formatFileSize(context, free)
}
}
@SuppressLint("SoonBlockedPrivateApi", "UsableSpace", "ObsoleteSdkInt", "DiscouragedPrivateApi")
fun Context.getMountInfoList(): List<Disk> {
val diskList = arrayListOf<Disk>()
val storageManager = getSystemService(Context.STORAGE_SERVICE) as StorageManager
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.M) {//小于6.0
val getVolumeListMethod = StorageManager::class.java.getDeclaredMethod("getVolumeList")
val volumes = getVolumeListMethod.invoke(storageManager) as Array<StorageVolume>
for (volume in volumes) {
try {
val fileMethod = volume.javaClass.getDeclaredMethod("getPathFile")
val file = fileMethod.invoke(volume) as File
val path = file.path
val name = file.name
val total = file.totalSpace //总计
val used = total - file.freeSpace //空闲
val usable = file.usableSpace //可用
diskList.add(Disk(path, name, -1, total, used, usable))
} catch (e: Exception) {
e.printStackTrace()
}
}
} else {
val getVolumeMethod = StorageManager::class.java.getDeclaredMethod("getVolumes")
val volumes = getVolumeMethod.invoke(storageManager) as List<Any>
for (volume in volumes) {
try {
val getTypeField: Field = volume.javaClass.getField("type")
val type: Int = getTypeField.getInt(volume)
val fileMethod = volume.javaClass.getDeclaredMethod("getPath")
val f: File = fileMethod.invoke(volume) as File
val path = f.path
val name = f.name
val total = if (type != TYPE_U && Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
val getFsUuid: Method = volume.javaClass.getDeclaredMethod("getFsUuid")
val fsUuid = getFsUuid.invoke(volume) as? String
getTotalSize(fsUuid)
} else {
f.totalSpace //总计
}
val used = total - f.usableSpace //空闲
val usable = f.usableSpace //空闲
val disk = Disk(path, name, type, total, used, usable)
diskList.add(disk)
} catch (e: Exception) {
e.printStackTrace()
}
}
}
return diskList
}
@RequiresApi(Build.VERSION_CODES.O)
fun Context.getTotalSize(fsUuid: String?): Long {
return try {
val id = if (fsUuid == null) StorageManager.UUID_DEFAULT else UUID.fromString(fsUuid)
val stats = getSystemService(StorageStatsManager::class.java)
stats.getTotalBytes(id)
} catch (e: Exception) {
e.printStackTrace()
-1
}
}
\ No newline at end of file
package com.zxhy.hfilemanagermaster.largefile
import android.os.Bundle
import androidx.activity.enableEdgeToEdge
import androidx.appcompat.app.AppCompatActivity
import androidx.core.content.ContextCompat
import androidx.core.view.ViewCompat
import androidx.core.view.WindowInsetsCompat
import androidx.navigation.findNavController
import com.example.hfilemanagermaster.R
import com.example.hfilemanagermaster.databinding.ActivityLargeFileBinding
class LargeFileActivity : AppCompatActivity() {
private lateinit var binding: ActivityLargeFileBinding
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
enableEdgeToEdge()
binding = ActivityLargeFileBinding.inflate(layoutInflater)
setContentView(binding.root)
ViewCompat.setOnApplyWindowInsetsListener(findViewById(R.id.main)) { v, insets ->
val systemBars = insets.getInsets(WindowInsetsCompat.Type.systemBars())
v.setPadding(systemBars.left, systemBars.top, systemBars.right, systemBars.bottom)
insets
}
window.statusBarColor = ContextCompat.getColor(this, R.color.color_C2F300)
binding.ivArrow.setOnClickListener {
finish()
}
}
}
\ No newline at end of file
package com.zxhy.hfilemanagermaster.largefile
import android.os.Bundle
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import androidx.fragment.app.Fragment
import com.example.hfilemanagermaster.R
import com.example.hfilemanagermaster.databinding.FragmentLargeFileBinding
import com.zxhy.hfilemanagermaster.OverviewActivity
/**
* A simple [Fragment] subclass.
* Use the [LargeFileFragment.newInstance] factory method to
* create an instance of this fragment.
*/
class LargeFileFragment : Fragment() {
private lateinit var binding: FragmentLargeFileBinding
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
(activity as OverviewActivity).setStatusBarColor(R.color.color_C2F300)
}
override fun onCreateView(
inflater: LayoutInflater, container: ViewGroup?,
savedInstanceState: Bundle?
): View? {
// Inflate the layout for this fragment
val view = inflater.inflate(R.layout.fragment_large_file, container, false)
binding = FragmentLargeFileBinding.bind(view)
return view
}
companion object {
/**
* Use this factory method to create a new instance of
* this fragment using the provided parameters.
*
* @param param1 Parameter 1.
* @param param2 Parameter 2.
* @return A new instance of fragment LargeFileFragment.
*/
// TODO: Rename and change types and number of parameters
@JvmStatic
fun newInstance(param1: String, param2: String) =
LargeFileFragment().apply {
arguments = Bundle().apply {}
}
}
}
\ No newline at end of file
package com.zxhy.hfilemanagermaster.manager
import android.annotation.SuppressLint
import android.os.Bundle
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import androidx.fragment.app.Fragment
import androidx.navigation.fragment.findNavController
import com.example.hfilemanagermaster.R
import com.example.hfilemanagermaster.databinding.FragmentManagerBinding
import com.zxhy.hfilemanagermaster.OverviewActivity
import com.zxhy.hfilemanagermaster.knife.getMountInfoList
import java.math.BigDecimal
/**
* A simple [Fragment] subclass.
* Use the [ManagerFragment.newInstance] factory method to
* create an instance of this fragment.
*/
class ManagerFragment : Fragment() {
private lateinit var binding: FragmentManagerBinding
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
arguments?.let {
}
}
override fun onCreateView(
inflater: LayoutInflater, container: ViewGroup?,
savedInstanceState: Bundle?
): View? {
val view = inflater.inflate(R.layout.fragment_manager, container, false)
binding = FragmentManagerBinding.bind(view.rootView)
return view
}
@SuppressLint("SetTextI18n")
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
super.onViewCreated(view, savedInstanceState)
val disk = requireContext().getMountInfoList().first()
binding.tvFree.text = disk.getTotalContent(requireContext())
val percent = BigDecimal(disk.used)
.divide(BigDecimal(disk.total), 2, BigDecimal.ROUND_HALF_UP).multiply(BigDecimal(100)).toInt()
binding.tvUse.text = "$percent%"
(requireActivity() as OverviewActivity).showManager()
binding.cardView1.setOnClickListener { }
binding.cardView2.setOnClickListener { }
binding.cardView3.setOnClickListener { }
binding.ivFile.setOnClickListener {
findNavController().navigate(R.id.filesFragment)
}
binding.ivWord.setOnClickListener { }
binding.ivExcel.setOnClickListener { }
binding.ivPdf.setOnClickListener { }
binding.ivPpt.setOnClickListener { }
binding.cardView1.setOnClickListener {
findNavController().navigate(R.id.dupPictureActivity)
}
binding.cardView2.setOnClickListener {
findNavController().navigate(R.id.largeFileActivity)
}
binding.cardView3.setOnClickListener {
findNavController().navigate(R.id.emptyFileActivity)
}
}
companion object {
@JvmStatic
fun newInstance(param1: String, param2: String) =
ManagerFragment().apply {
arguments = Bundle().apply {
}
}
}
}
\ No newline at end of file
package com.zxhy.hfilemanagermaster.video
import android.os.Bundle
import androidx.activity.enableEdgeToEdge
import androidx.appcompat.app.AppCompatActivity
import androidx.core.content.ContextCompat
import androidx.core.view.ViewCompat
import androidx.core.view.WindowInsetsCompat
import com.example.hfilemanagermaster.R
import com.example.hfilemanagermaster.databinding.ActivityVideoBinding
class VideoActivity : AppCompatActivity() {
private lateinit var binding: ActivityVideoBinding
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
enableEdgeToEdge()
binding = ActivityVideoBinding.inflate(layoutInflater)
setContentView(binding.root)
ViewCompat.setOnApplyWindowInsetsListener(findViewById(R.id.main)) { v, insets ->
val systemBars = insets.getInsets(WindowInsetsCompat.Type.systemBars())
v.setPadding(systemBars.left, systemBars.top, systemBars.right, systemBars.bottom)
insets
}
window.statusBarColor = ContextCompat.getColor(this, R.color.color_C2F300)
binding.ivArrow.setOnClickListener {
finish()
}
}
}
\ No newline at end of file
package com.zxhy.hfilemanagermaster.widget
import android.annotation.SuppressLint
import android.content.Context
import android.graphics.Bitmap
import android.graphics.BitmapFactory
import android.graphics.Canvas
import android.graphics.Paint
import android.graphics.Rect
import android.graphics.RectF
import android.util.AttributeSet
import android.util.Log
import android.view.View
import androidx.core.content.ContextCompat
import com.example.hfilemanagermaster.R
import java.math.BigDecimal
import java.math.RoundingMode
import kotlin.math.min
class IndicatorView : View {
private lateinit var bgBitmap: Bitmap
private var scale = 1f//背景图像缩放比例
private var strokeWidth = 1f//圆弧线宽
private var radius = 50f//圆弧半径(外圆弧)
private var hMargin = 50f//圆弧水平间距
private var topMargin = 50f//圆弧顶部距离
// 画原始刻度的画笔
private var arcPaint: Paint = Paint()
constructor(context: Context?) : super(context) {
setResource()
}
constructor(context: Context?, attrs: AttributeSet?) : super(context, attrs) {
setResource()
}
constructor(context: Context?, attrs: AttributeSet?, defStyleAttr: Int) : super(
context,
attrs,
defStyleAttr
) {
setResource()
}
private fun setResource() {
bgBitmap = BitmapFactory.decodeResource(context.resources, R.mipmap.ee_98985)
arcPaint.strokeWidth = strokeWidth
arcPaint.color = ContextCompat.getColor(context, R.color.color_DCFE86)
arcPaint.isAntiAlias = true
arcPaint.style = Paint.Style.STROKE
}
@SuppressLint("DrawAllocation")
override fun onLayout(changed: Boolean, left: Int, top: Int, right: Int, bottom: Int) {
super.onLayout(changed, left, top, right, bottom)
scale = BigDecimal(measuredWidth).divide(
BigDecimal(bgBitmap.width), 3, RoundingMode.HALF_UP
).toFloat()
}
override fun onMeasure(widthMeasureSpec: Int, heightMeasureSpec: Int) {
super.onMeasure(widthMeasureSpec, heightMeasureSpec)
// 通过测量规则获得宽和高,这里宽高一致
val width = MeasureSpec.getSize(widthMeasureSpec)
val height = MeasureSpec.getSize(heightMeasureSpec)
// Log.e("IndicatorView", "width=$width height=$height")
// 取出最小值
val len = min(width, height)
//获取半径
radius = len.toFloat() - topMargin
// Log.e("IndicatorView", "radius=$radius")
setMeasuredDimension(width, height)
}
@SuppressLint("DrawAllocation")
override fun onDraw(canvas: Canvas) {
super.onDraw(canvas)
//绘制背景图片
val srcRect = Rect(0, 0, measuredWidth, measuredHeight)
val dstRect = Rect(0, 0, measuredWidth, measuredHeight)
// canvas.drawBitmap(bgBitmap.setImageSize(scale), srcRect, dstRect, Paint())
Log.e("IndicatorView", "radius=$radius")
val left = hMargin
val top = topMargin
val right = hMargin + radius * 2
val bottom = hMargin + radius * 2
Log.e("IndicatorView", "left=$left top=$top right=$right bottom=$bottom")
//绘制半圆
val arcRect = RectF(left, top, right, bottom)
// RectF(0f, 0f, 100f,100f)
// val w=measuredWidth.toFloat()
// val h=measuredHeight.toFloat()
// Log.e("arcRect","W=$w h=$h")
canvas.drawArc(arcRect, 0f, -180f, false, arcPaint)
}
}
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/main"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context="com.zxhy.hfilemanagermaster.duplicate.DupPictureActivity">
<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/cl_top"
android:layout_width="match_parent"
android:layout_height="37dp"
android:background="@color/color_C2F300"
app:layout_constraintTop_toTopOf="parent">
<ImageView
android:id="@+id/iv_arrow"
android:layout_width="24dp"
android:layout_height="24dp"
android:layout_marginLeft="8dp"
android:src="@mipmap/rfg_9878985"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintTop_toTopOf="parent"
tools:ignore="RtlHardcoded" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Duplicate picture"
android:textSize="17sp"
android:textStyle="bold"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toRightOf="@id/iv_arrow"
app:layout_constraintTop_toTopOf="parent"
tools:ignore="HardcodedText" />
<TextView
android:id="@+id/tv_all"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginRight="16dp"
android:text="All"
android:textSize="17sp"
android:textStyle="bold"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent"
tools:ignore="HardcodedText,RtlHardcoded" />
<ImageView
android:id="@+id/iv_all"
android:layout_width="24dp"
android:layout_height="24dp"
android:layout_marginRight="5dp"
android:src="@mipmap/dd_78652"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintRight_toLeftOf="@id/tv_all"
app:layout_constraintTop_toTopOf="parent"
tools:ignore="RtlHardcoded" />
</androidx.constraintlayout.widget.ConstraintLayout>
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/rv"
android:layout_width="0dp"
android:layout_height="0dp"
android:layout_marginHorizontal="20dp"
android:layout_marginVertical="16dp"
app:layout_constraintBottom_toTopOf="@id/tv_delete"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toBottomOf="@id/cl_top" />
<TextView
android:id="@+id/tv_delete"
android:layout_width="0dp"
android:layout_height="51dp"
android:layout_marginHorizontal="50dp"
android:layout_marginBottom="45dp"
android:background="@mipmap/lopp_89956"
android:gravity="center"
android:text="Delete"
android:textColor="#FFFFFF"
android:textSize="17sp"
android:textStyle="bold"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
tools:ignore="HardcodedText" />
</androidx.constraintlayout.widget.ConstraintLayout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/main"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context="com.zxhy.hfilemanagermaster.emptyfile.EmptyFileActivity">
<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/cl_top"
android:layout_width="match_parent"
android:layout_height="37dp"
android:background="@color/color_C2F300"
app:layout_constraintTop_toTopOf="parent">
<ImageView
android:id="@+id/iv_arrow"
android:layout_width="24dp"
android:layout_height="24dp"
android:layout_marginLeft="8dp"
android:src="@mipmap/rfg_9878985"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintTop_toTopOf="parent"
tools:ignore="RtlHardcoded" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Empty files"
android:textSize="17sp"
android:textStyle="bold"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toRightOf="@id/iv_arrow"
app:layout_constraintTop_toTopOf="parent"
tools:ignore="HardcodedText" />
<TextView
android:id="@+id/tv_all"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginRight="16dp"
android:text="All"
android:textSize="17sp"
android:textStyle="bold"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent"
tools:ignore="HardcodedText,RtlHardcoded" />
<ImageView
android:id="@+id/iv_all"
android:layout_width="24dp"
android:layout_height="24dp"
android:layout_marginRight="5dp"
android:src="@mipmap/dd_78652"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintRight_toLeftOf="@id/tv_all"
app:layout_constraintTop_toTopOf="parent"
tools:ignore="RtlHardcoded" />
</androidx.constraintlayout.widget.ConstraintLayout>
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/rv"
android:layout_width="0dp"
android:layout_height="0dp"
android:layout_marginHorizontal="20dp"
android:layout_marginVertical="16dp"
app:layout_constraintBottom_toTopOf="@id/tv_delete"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toBottomOf="@id/cl_top" />
<TextView
android:id="@+id/tv_delete"
android:layout_width="0dp"
android:layout_height="51dp"
android:layout_marginHorizontal="50dp"
android:layout_marginBottom="45dp"
android:background="@mipmap/lopp_89956"
android:gravity="center"
android:text="Delete"
android:textColor="#FFFFFF"
android:textSize="17sp"
android:textStyle="bold"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
tools:ignore="HardcodedText" />
</androidx.constraintlayout.widget.ConstraintLayout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/main"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context="com.zxhy.hfilemanagermaster.image.ImageActivity">
<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/cl_top"
android:layout_width="match_parent"
android:layout_height="37dp"
android:background="@color/color_C2F300"
app:layout_constraintTop_toTopOf="parent">
<ImageView
android:id="@+id/iv_arrow"
android:layout_width="24dp"
android:layout_height="24dp"
android:layout_marginLeft="8dp"
android:src="@mipmap/rfg_9878985"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintTop_toTopOf="parent"
tools:ignore="RtlHardcoded" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Image"
android:textSize="17sp"
android:textStyle="bold"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toRightOf="@id/iv_arrow"
app:layout_constraintTop_toTopOf="parent"
tools:ignore="HardcodedText" />
<TextView
android:id="@+id/tv_all"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginRight="16dp"
android:text="All"
android:textSize="17sp"
android:textStyle="bold"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent"
tools:ignore="HardcodedText,RtlHardcoded" />
<ImageView
android:id="@+id/iv_all"
android:layout_width="24dp"
android:layout_height="24dp"
android:layout_marginRight="5dp"
android:src="@mipmap/dd_78652"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintRight_toLeftOf="@id/tv_all"
app:layout_constraintTop_toTopOf="parent"
tools:ignore="RtlHardcoded" />
</androidx.constraintlayout.widget.ConstraintLayout>
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/rv"
android:layout_width="0dp"
android:layout_height="0dp"
android:layout_marginHorizontal="20dp"
android:layout_marginVertical="16dp"
app:layout_constraintBottom_toTopOf="@id/tv_delete"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toBottomOf="@id/cl_top" />
<TextView
android:id="@+id/tv_delete"
android:layout_width="0dp"
android:layout_height="51dp"
android:layout_marginHorizontal="50dp"
android:layout_marginBottom="45dp"
android:background="@mipmap/lopp_89956"
android:gravity="center"
android:text="Delete"
android:textColor="#FFFFFF"
android:textSize="17sp"
android:textStyle="bold"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
tools:ignore="HardcodedText" />
</androidx.constraintlayout.widget.ConstraintLayout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/main"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context="com.zxhy.hfilemanagermaster.largefile.LargeFileActivity">
<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/cl_top"
android:layout_width="match_parent"
android:layout_height="37dp"
android:background="@color/color_C2F300"
app:layout_constraintTop_toTopOf="parent">
<ImageView
android:id="@+id/iv_arrow"
android:layout_width="24dp"
android:layout_height="24dp"
android:layout_marginLeft="8dp"
android:src="@mipmap/rfg_9878985"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintTop_toTopOf="parent"
tools:ignore="RtlHardcoded" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Large files"
android:textSize="17sp"
android:textStyle="bold"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toRightOf="@id/iv_arrow"
app:layout_constraintTop_toTopOf="parent"
tools:ignore="HardcodedText" />
<TextView
android:id="@+id/tv_all"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginRight="16dp"
android:text="All"
android:textSize="17sp"
android:textStyle="bold"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent"
tools:ignore="HardcodedText,RtlHardcoded" />
<ImageView
android:id="@+id/iv_all"
android:layout_width="24dp"
android:layout_height="24dp"
android:layout_marginRight="5dp"
android:src="@mipmap/dd_78652"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintRight_toLeftOf="@id/tv_all"
app:layout_constraintTop_toTopOf="parent"
tools:ignore="RtlHardcoded" />
</androidx.constraintlayout.widget.ConstraintLayout>
<TextView
android:id="@+id/tv_file"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="59dp"
android:layout_marginTop="12dp"
android:text="File"
android:textColor="#333333"
android:textSize="15sp"
android:textStyle="bold"
app:layout_constraintHorizontal_chainStyle="spread_inside"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toLeftOf="@id/tv_image"
app:layout_constraintTop_toBottomOf="@id/cl_top"
tools:ignore="HardcodedText,RtlHardcoded" />
<TextView
android:id="@+id/tv_image"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Image"
android:textColor="#333333"
android:textSize="15sp"
android:textStyle="bold"
app:layout_constraintLeft_toRightOf="@id/tv_file"
app:layout_constraintRight_toLeftOf="@id/tv_video"
app:layout_constraintTop_toTopOf="@id/tv_file"
tools:ignore="HardcodedText" />
<TextView
android:id="@+id/tv_video"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginRight="59dp"
android:text="Video"
android:textColor="#333333"
android:textSize="15sp"
android:textStyle="bold"
app:layout_constraintLeft_toRightOf="@id/tv_image"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="@id/tv_file"
tools:ignore="HardcodedText,RtlHardcoded" />
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/rv"
android:layout_width="0dp"
android:layout_height="0dp"
android:layout_marginHorizontal="20dp"
android:layout_marginVertical="16dp"
app:layout_constraintBottom_toTopOf="@id/tv_delete"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toBottomOf="@id/tv_file" />
<TextView
android:id="@+id/tv_delete"
android:layout_width="0dp"
android:layout_height="51dp"
android:layout_marginHorizontal="50dp"
android:layout_marginBottom="45dp"
android:background="@mipmap/lopp_89956"
android:gravity="center"
android:text="Delete"
android:textColor="#FFFFFF"
android:textSize="17sp"
android:textStyle="bold"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
tools:ignore="HardcodedText" />
</androidx.constraintlayout.widget.ConstraintLayout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/main"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context="com.zxhy.hfilemanagermaster.video.VideoActivity">
<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/cl_top"
android:layout_width="match_parent"
android:layout_height="37dp"
android:background="@color/color_C2F300"
app:layout_constraintTop_toTopOf="parent">
<ImageView
android:id="@+id/iv_arrow"
android:layout_width="24dp"
android:layout_height="24dp"
android:layout_marginLeft="8dp"
android:src="@mipmap/rfg_9878985"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintTop_toTopOf="parent"
tools:ignore="RtlHardcoded" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Video"
android:textSize="17sp"
android:textStyle="bold"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toRightOf="@id/iv_arrow"
app:layout_constraintTop_toTopOf="parent"
tools:ignore="HardcodedText" />
<TextView
android:id="@+id/tv_all"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginRight="16dp"
android:text="All"
android:textSize="17sp"
android:textStyle="bold"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent"
tools:ignore="HardcodedText,RtlHardcoded" />
<ImageView
android:id="@+id/iv_all"
android:layout_width="24dp"
android:layout_height="24dp"
android:layout_marginRight="5dp"
android:src="@mipmap/dd_78652"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintRight_toLeftOf="@id/tv_all"
app:layout_constraintTop_toTopOf="parent"
tools:ignore="RtlHardcoded" />
</androidx.constraintlayout.widget.ConstraintLayout>
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/rv"
android:layout_width="0dp"
android:layout_height="0dp"
android:layout_marginHorizontal="20dp"
android:layout_marginVertical="16dp"
app:layout_constraintBottom_toTopOf="@id/tv_delete"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toBottomOf="@id/cl_top" />
<TextView
android:id="@+id/tv_delete"
android:layout_width="0dp"
android:layout_height="51dp"
android:layout_marginHorizontal="50dp"
android:layout_marginBottom="45dp"
android:background="@mipmap/lopp_89956"
android:gravity="center"
android:text="Delete"
android:textColor="#FFFFFF"
android:textSize="17sp"
android:textStyle="bold"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
tools:ignore="HardcodedText" />
</androidx.constraintlayout.widget.ConstraintLayout>
\ No newline at end of file
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context="com.zxhy.hfilemanagermaster.FilesFragment">
<TextView
android:id="@+id/tv_file"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="16dp"
android:layout_marginTop="16dp"
android:text="My Files"
android:textAllCaps="false"
android:textColor="#333333"
android:textSize="17sp"
android:textStyle="bold"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintTop_toTopOf="parent"
tools:ignore="HardcodedText,RtlHardcoded" />
<ImageView
android:id="@+id/iv_image"
android:layout_width="40dp"
android:layout_height="40dp"
android:layout_marginLeft="40dp"
android:layout_marginTop="20dp"
android:src="@mipmap/uwe_0705"
app:layout_constraintHorizontal_chainStyle="spread_inside"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toLeftOf="@id/iv_video"
app:layout_constraintTop_toBottomOf="@id/tv_file"
tools:ignore="ContentDescription,RtlHardcoded" />
<TextView
android:id="@+id/tv_image"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="4dp"
android:text="Image"
android:textColor="#333333"
android:textSize="12sp"
app:layout_constraintLeft_toLeftOf="@id/iv_image"
app:layout_constraintRight_toRightOf="@id/iv_image"
app:layout_constraintTop_toBottomOf="@id/iv_image"
tools:ignore="HardcodedText" />
<ImageView
android:id="@+id/iv_video"
android:layout_width="40dp"
android:layout_height="40dp"
android:layout_marginTop="20dp"
android:src="@mipmap/ft_899520"
app:layout_constraintLeft_toRightOf="@id/iv_image"
app:layout_constraintRight_toLeftOf="@id/iv_audio"
app:layout_constraintTop_toBottomOf="@id/tv_file"
tools:ignore="ContentDescription,RtlHardcoded" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="4dp"
android:text="Video"
android:textColor="#333333"
android:textSize="12sp"
app:layout_constraintLeft_toLeftOf="@id/iv_video"
app:layout_constraintRight_toRightOf="@id/iv_video"
app:layout_constraintTop_toBottomOf="@id/iv_video"
tools:ignore="HardcodedText" />
<ImageView
android:id="@+id/iv_audio"
android:layout_width="40dp"
android:layout_height="40dp"
android:layout_marginTop="20dp"
android:layout_marginRight="40dp"
android:src="@mipmap/wqe_09"
app:layout_constraintLeft_toRightOf="@id/iv_video"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toBottomOf="@id/tv_file"
tools:ignore="ContentDescription,RtlHardcoded" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="4dp"
android:text="Audio"
android:textColor="#333333"
android:textSize="12sp"
app:layout_constraintLeft_toLeftOf="@id/iv_audio"
app:layout_constraintRight_toRightOf="@id/iv_audio"
app:layout_constraintTop_toBottomOf="@id/iv_audio"
tools:ignore="HardcodedText" />
<ImageView
android:id="@+id/iv_apk"
android:layout_width="40dp"
android:layout_height="40dp"
android:layout_marginLeft="40dp"
android:layout_marginTop="20dp"
android:src="@mipmap/fe_98856"
app:layout_constraintHorizontal_chainStyle="spread_inside"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toLeftOf="@id/iv_zip"
app:layout_constraintTop_toBottomOf="@id/tv_image"
tools:ignore="RtlHardcoded" />
<TextView
android:id="@+id/tv_apk"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="4dp"
android:text="Apk"
android:textColor="#333333"
android:textSize="12sp"
app:layout_constraintLeft_toLeftOf="@id/iv_apk"
app:layout_constraintRight_toRightOf="@id/iv_apk"
app:layout_constraintTop_toBottomOf="@id/iv_apk"
tools:ignore="HardcodedText" />
<ImageView
android:id="@+id/iv_zip"
android:layout_width="40dp"
android:layout_height="40dp"
android:src="@mipmap/qwett_98959"
app:layout_constraintLeft_toRightOf="@id/iv_apk"
app:layout_constraintRight_toLeftOf="@id/iv_log"
app:layout_constraintTop_toTopOf="@id/iv_apk"
tools:ignore="RtlHardcoded" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="4dp"
android:text="Zip"
android:textColor="#333333"
android:textSize="12sp"
app:layout_constraintLeft_toLeftOf="@id/iv_zip"
app:layout_constraintRight_toRightOf="@id/iv_zip"
app:layout_constraintTop_toBottomOf="@id/iv_zip"
tools:ignore="HardcodedText" />
<ImageView
android:id="@+id/iv_log"
android:layout_width="40dp"
android:layout_height="40dp"
android:layout_marginRight="40dp"
android:src="@mipmap/rqwr_875"
app:layout_constraintLeft_toRightOf="@id/iv_zip"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="@id/iv_zip"
tools:ignore="RtlHardcoded" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="4dp"
android:text="Audio"
android:textColor="#333333"
android:textSize="12sp"
app:layout_constraintLeft_toLeftOf="@id/iv_log"
app:layout_constraintRight_toRightOf="@id/iv_log"
app:layout_constraintTop_toBottomOf="@id/iv_log"
tools:ignore="HardcodedText" />
<TextView
android:id="@+id/tv_recent"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="16dp"
android:layout_marginTop="16dp"
android:text="Recent"
android:textAllCaps="false"
android:textColor="#333333"
android:textSize="17sp"
android:textStyle="bold"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintTop_toBottomOf="@id/tv_apk"
tools:ignore="HardcodedText,RtlHardcoded" />
<androidx.cardview.widget.CardView
android:layout_width="0dp"
android:layout_height="104dp"
android:layout_marginHorizontal="16dp"
android:layout_marginTop="11dp"
app:cardCornerRadius="8dp"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toBottomOf="@id/tv_recent" />
</androidx.constraintlayout.widget.ConstraintLayout>
\ No newline at end of file
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context="com.zxhy.hfilemanagermaster.largefile.LargeFileFragment">
<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/cl_top"
android:layout_width="match_parent"
android:layout_height="37dp"
android:background="@color/color_C2F300"
app:layout_constraintTop_toTopOf="parent">
<ImageView
android:id="@+id/iv_arrow"
android:layout_width="24dp"
android:layout_height="24dp"
android:layout_marginLeft="8dp"
android:src="@mipmap/rfg_9878985"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintTop_toTopOf="parent"
tools:ignore="RtlHardcoded" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Large files"
android:textSize="17sp"
android:textStyle="bold"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toRightOf="@id/iv_arrow"
app:layout_constraintTop_toTopOf="parent"
tools:ignore="HardcodedText" />
<TextView
android:id="@+id/tv_all"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginRight="16dp"
android:text="All"
android:textSize="17sp"
android:textStyle="bold"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent"
tools:ignore="HardcodedText,RtlHardcoded" />
<ImageView
android:id="@+id/iv_all"
android:layout_width="24dp"
android:layout_height="24dp"
android:layout_marginRight="5dp"
android:src="@mipmap/dd_78652"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintRight_toLeftOf="@id/tv_all"
app:layout_constraintTop_toTopOf="parent"
tools:ignore="RtlHardcoded" />
</androidx.constraintlayout.widget.ConstraintLayout>
<TextView
android:layout_marginLeft="59dp"
app:layout_constraintHorizontal_chainStyle="spread_inside"
android:id="@+id/tv_file"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="12dp"
android:text="File"
android:textColor="#333333"
android:textSize="15sp"
android:textStyle="bold"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toLeftOf="@id/tv_image"
app:layout_constraintTop_toBottomOf="@id/cl_top"
tools:ignore="HardcodedText,RtlHardcoded" />
<TextView
android:id="@+id/tv_image"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Image"
android:textColor="#333333"
android:textSize="15sp"
android:textStyle="bold"
app:layout_constraintLeft_toRightOf="@id/tv_file"
app:layout_constraintRight_toLeftOf="@id/tv_video"
app:layout_constraintTop_toTopOf="@id/tv_file"
tools:ignore="HardcodedText" />
<TextView
android:layout_marginRight="59dp"
android:id="@+id/tv_video"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Video"
android:textColor="#333333"
android:textSize="15sp"
android:textStyle="bold"
app:layout_constraintLeft_toRightOf="@id/tv_image"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="@id/tv_file"
tools:ignore="HardcodedText,RtlHardcoded" />
</androidx.constraintlayout.widget.ConstraintLayout>
\ No newline at end of file
This diff is collapsed.
<FrameLayout 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"
tools:context="com.zxhy.hfilemanagermaster.ToolsFragment">
<!-- TODO: Update blank fragment layout -->
<TextView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:text="@string/hello_blank_fragment" />
</FrameLayout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<navigation xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/nav"
app:startDestination="@id/managerFragment">
<fragment
android:id="@+id/managerFragment"
android:name="com.zxhy.hfilemanagermaster.manager.ManagerFragment"
android:label="fragment_manager"
tools:layout="@layout/fragment_manager" >
<action
android:id="@+id/action_managerFragment_to_toolsFragment"
app:destination="@id/toolsFragment" />
<action
android:id="@+id/action_managerFragment_to_largeFileActivity"
app:destination="@id/largeFileActivity" />
<action
android:id="@+id/action_managerFragment_to_emptyFileActivity"
app:destination="@id/emptyFileActivity" />
<action
android:id="@+id/action_managerFragment_to_dupPictureActivity"
app:destination="@id/dupPictureActivity" />
</fragment>
<fragment
android:id="@+id/toolsFragment"
android:name="com.zxhy.hfilemanagermaster.ToolsFragment"
android:label="fragment_tools"
tools:layout="@layout/fragment_tools" >
<action
android:id="@+id/action_toolsFragment_to_managerFragment"
app:destination="@id/managerFragment" />
<action
android:id="@+id/action_toolsFragment_to_filesFragment"
app:destination="@id/filesFragment" />
</fragment>
<fragment
android:id="@+id/filesFragment"
android:name="com.zxhy.hfilemanagermaster.FilesFragment"
android:label="fragment_files"
tools:layout="@layout/fragment_files" >
<action
android:id="@+id/action_filesFragment_to_imageActivity"
app:destination="@id/imageActivity" />
<action
android:id="@+id/action_filesFragment_to_videoActivity"
app:destination="@id/videoActivity" />
</fragment>
<activity
android:id="@+id/largeFileActivity"
android:name="com.zxhy.hfilemanagermaster.largefile.LargeFileActivity"
android:label="activity_large_file"
tools:layout="@layout/activity_large_file" />
<activity
android:id="@+id/emptyFileActivity"
android:name="com.zxhy.hfilemanagermaster.emptyfile.EmptyFileActivity"
android:label="activity_empty_file"
tools:layout="@layout/activity_empty_file" />
<activity
android:id="@+id/dupPictureActivity"
android:name="com.zxhy.hfilemanagermaster.duplicate.DupPictureActivity"
android:label="activity_dup_picture"
tools:layout="@layout/activity_dup_picture" />
<activity
android:id="@+id/imageActivity"
android:name="com.zxhy.hfilemanagermaster.image.ImageActivity"
android:label="activity_image"
tools:layout="@layout/activity_image" />
<activity
android:id="@+id/videoActivity"
android:name="com.zxhy.hfilemanagermaster.video.VideoActivity"
android:label="activity_video"
tools:layout="@layout/activity_video" />
</navigation>
\ No newline at end of file
......@@ -3,4 +3,6 @@
<color name="black">#FF000000</color>
<color name="white">#FFFFFFFF</color>
<color name="color_B7FF03">#B7FF03</color>
<color name="color_C2F300">#C2F300</color>
<color name="color_DCFE86">#DCFE86</color>
</resources>
\ No newline at end of file
<resources>
<string name="app_name">HFileManagerMaster</string>
<!-- TODO: Remove or change this placeholder text -->
<string name="hello_blank_fragment">Hello blank fragment</string>
</resources>
\ No newline at end of file
......@@ -9,6 +9,8 @@ appcompat = "1.6.1"
material = "1.10.0"
activity = "1.8.0"
constraintlayout = "2.1.4"
navigationFragmentKtx = "2.7.7"
navigationUiKtx = "2.7.7"
[libraries]
androidx-core-ktx = { group = "androidx.core", name = "core-ktx", version.ref = "coreKtx" }
......@@ -19,6 +21,8 @@ androidx-appcompat = { group = "androidx.appcompat", name = "appcompat", version
material = { group = "com.google.android.material", name = "material", version.ref = "material" }
androidx-activity = { group = "androidx.activity", name = "activity", version.ref = "activity" }
androidx-constraintlayout = { group = "androidx.constraintlayout", name = "constraintlayout", version.ref = "constraintlayout" }
androidx-navigation-fragment-ktx = { group = "androidx.navigation", name = "navigation-fragment-ktx", version.ref = "navigationFragmentKtx" }
androidx-navigation-ui-ktx = { group = "androidx.navigation", name = "navigation-ui-ktx", version.ref = "navigationUiKtx" }
[plugins]
androidApplication = { id = "com.android.application", version.ref = "agp" }
......
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