Commit 5471aaee authored by wanglei's avatar wanglei

...提交部分功能...

parent c4e192c2
...@@ -48,7 +48,7 @@ dependencies { ...@@ -48,7 +48,7 @@ dependencies {
androidTestImplementation libs.androidx.junit androidTestImplementation libs.androidx.junit
androidTestImplementation libs.androidx.espresso.core androidTestImplementation libs.androidx.espresso.core
implementation "androidx.swiperefreshlayout:swiperefreshlayout:1.1.0" implementation "androidx.swiperefreshlayout:swiperefreshlayout:1.1.0"
implementation 'com.google.android.material:material:1.4.0'
//ui第三方 //ui第三方
implementation("com.github.JavaNoober.BackgroundLibrary:libraryx:1.7.6") implementation("com.github.JavaNoober.BackgroundLibrary:libraryx:1.7.6")
......
...@@ -18,6 +18,9 @@ ...@@ -18,6 +18,9 @@
android:supportsRtl="true" android:supportsRtl="true"
android:theme="@style/Theme.SuperPDFReader" android:theme="@style/Theme.SuperPDFReader"
tools:targetApi="31"> tools:targetApi="31">
<activity
android:name=".activity.ImageToPdfActivity"
android:exported="false" />
<activity <activity
android:name=".activity.XlsBrowserActivity" android:name=".activity.XlsBrowserActivity"
android:exported="false" /> android:exported="false" />
......
package com.base.superpdfreader package com.base.superpdfreader
import android.annotation.SuppressLint import android.annotation.SuppressLint
import android.content.res.ColorStateList
import android.graphics.Color import android.graphics.Color
import androidx.core.content.ContextCompat import androidx.core.content.ContextCompat
import androidx.fragment.app.Fragment import androidx.fragment.app.Fragment
...@@ -71,22 +72,24 @@ class MainActivity : BaseActivity<ActivityMainBinding>() { ...@@ -71,22 +72,24 @@ class MainActivity : BaseActivity<ActivityMainBinding>() {
when (position) { when (position) {
0 -> { 0 -> {
binding.llTop.setBackgroundColor(ContextCompat.getColor(this@MainActivity, R.color.color_pdf)) binding.llTop.setBackgroundColor(ContextCompat.getColor(this@MainActivity, R.color.color_pdf))
binding.fab.setColorFilter(ContextCompat.getColor(this@MainActivity, R.color.color_pdf))
} }
1 -> { 1 -> {
binding.llTop.setBackgroundColor(ContextCompat.getColor(this@MainActivity, R.color.color_word)) binding.llTop.setBackgroundColor(ContextCompat.getColor(this@MainActivity, R.color.color_word))
binding.fab.setColorFilter(ContextCompat.getColor(this@MainActivity, R.color.color_word))
} }
2 -> { 2 -> {
binding.llTop.setBackgroundColor(ContextCompat.getColor(this@MainActivity, R.color.color_ppt)) binding.llTop.setBackgroundColor(ContextCompat.getColor(this@MainActivity, R.color.color_ppt))
binding.fab.setColorFilter(ContextCompat.getColor(this@MainActivity, R.color.color_ppt))
} }
3 -> { 3 -> {
binding.llTop.setBackgroundColor(ContextCompat.getColor(this@MainActivity, R.color.color_excel)) binding.llTop.setBackgroundColor(ContextCompat.getColor(this@MainActivity, R.color.color_excel))
binding.fab.setColorFilter(ContextCompat.getColor(this@MainActivity, R.color.color_excel))
} }
} }
} }
......
package com.base.superpdfreader.activity package com.base.superpdfreader.activity
import android.os.Bundle import android.content.Intent
import androidx.activity.enableEdgeToEdge import android.graphics.Color
import androidx.appcompat.app.AppCompatActivity import android.net.Uri
import androidx.core.view.ViewCompat import androidx.lifecycle.lifecycleScope
import androidx.core.view.WindowInsetsCompat
import com.base.superpdfreader.R
import com.base.superpdfreader.adapter.ImageSelectionAdapter import com.base.superpdfreader.adapter.ImageSelectionAdapter
import com.base.superpdfreader.adapter.ImageSelectionAdapter.Companion.UI_IMAGE_GRID
import com.base.superpdfreader.adapter.ImageSelectionAdapter.Companion.UI_IMAGE_LIST
import com.base.superpdfreader.bean.ImageBean
import com.base.superpdfreader.databinding.ActivityImageSelectionBinding import com.base.superpdfreader.databinding.ActivityImageSelectionBinding
import com.base.superpdfreader.helps.BaseActivity import com.base.superpdfreader.helps.BaseActivity
import com.base.superpdfreader.helps.LogEx
import com.base.superpdfreader.helps.MediaStoreHelp.getMediaImage
import com.base.superpdfreader.utils.BarUtils
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.launch
import java.io.File
class ImageSelectionActivity : BaseActivity<ActivityImageSelectionBinding>() { class ImageSelectionActivity : BaseActivity<ActivityImageSelectionBinding>() {
private val TAG = "ImageSelectionActivity"
private lateinit var imageSelectionAdapter: ImageSelectionAdapter private lateinit var imageSelectionAdapter: ImageSelectionAdapter
private lateinit var selectedAdapter: ImageSelectionAdapter
override val binding: ActivityImageSelectionBinding by lazy { override val binding: ActivityImageSelectionBinding by lazy {
ActivityImageSelectionBinding.inflate(layoutInflater) ActivityImageSelectionBinding.inflate(layoutInflater)
} }
override fun initView() { override fun initView() {
imageSelectionAdapter = ImageSelectionAdapter() BarUtils.setStatusBarLightMode(this, true)
BarUtils.setStatusBarColor(this, Color.TRANSPARENT)
imageSelectionAdapter = ImageSelectionAdapter(UI_IMAGE_GRID, select = { imageBean ->
imageSelectAction(imageBean)
})
binding.rvImage.adapter = imageSelectionAdapter
selectedAdapter = ImageSelectionAdapter(UI_IMAGE_LIST, remove = { imageBean ->
selectedImageRemoveAction(imageBean)
})
binding.rvSelectedImage.adapter = selectedAdapter
initData()
}
private fun selectedImageRemoveAction(imageBean: ImageBean) {
selectedAdapter.removeBean(imageBean)
imageSelectionAdapter.unSelectBean(imageBean)
binding.tvImport.isEnabled = imageSelectionAdapter.getSelectBeanSize() > 0
}
private fun imageSelectAction(imageBean: ImageBean) {
if (imageBean.isSelect) {
selectedAdapter.addBean(imageBean)
} else {
selectedAdapter.removeBean(imageBean)
}
val selectedSize = imageSelectionAdapter.getSelectBeanSize()
if (selectedSize > 0) {
binding.tvImport.isEnabled = true
binding.tvImport.text = "IMPORT(${selectedSize})"
} else {
binding.tvImport.isEnabled = false
binding.tvImport.text = "IMPORT"
}
}
override fun initListener() {
super.initListener()
binding.flBack.setOnClickListener {
finishToMain()
}
binding.tvImport.setOnClickListener {
startActivity(Intent(this@ImageSelectionActivity, ImageToPdfActivity::class.java))
}
}
private fun initData() = lifecycleScope.launch(Dispatchers.IO) {
val files = arrayListOf<Pair<File, Uri>>()
getMediaImage(files)
LogEx.logDebug(TAG, "files.size=${files.size}")
launch(Dispatchers.Main) {
imageSelectionAdapter.setData(files)
}
} }
} }
\ No newline at end of file
package com.base.superpdfreader.activity
import com.base.superpdfreader.databinding.ActivityImageDragBinding
import com.base.superpdfreader.helps.BaseActivity
class ImageToPdfActivity : BaseActivity<ActivityImageDragBinding>() {
override val binding: ActivityImageDragBinding by lazy {
ActivityImageDragBinding.inflate(layoutInflater)
}
override fun initView() {
}
}
\ No newline at end of file
package com.base.superpdfreader.adapter
class ImageDragAdapter {
}
\ No newline at end of file
package com.base.superpdfreader.adapter package com.base.superpdfreader.adapter
import android.net.Uri
import android.view.View import android.view.View
import android.view.ViewGroup import android.view.ViewGroup
import androidx.recyclerview.widget.RecyclerView import androidx.recyclerview.widget.RecyclerView
...@@ -10,8 +11,15 @@ import com.base.superpdfreader.databinding.ItemImageSelectedBinding ...@@ -10,8 +11,15 @@ import com.base.superpdfreader.databinding.ItemImageSelectedBinding
import com.base.superpdfreader.databinding.ItemImageSelectionBinding import com.base.superpdfreader.databinding.ItemImageSelectionBinding
import com.base.superpdfreader.view.XmlEx.inflate import com.base.superpdfreader.view.XmlEx.inflate
import com.bumptech.glide.Glide import com.bumptech.glide.Glide
import kotlinx.coroutines.selects.select
import java.io.File
import java.util.ArrayList
class ImageSelectionAdapter(val uiMode: Int = UI_IMAGE_GRID) : RecyclerView.Adapter<ImageSelectionAdapter.IMAGE>() { class ImageSelectionAdapter(
val uiMode: Int = UI_IMAGE_GRID,
val select: ((imageBean: ImageBean) -> Unit)? = null,
val remove: ((imageBean: ImageBean) -> Unit)? = null,
) : RecyclerView.Adapter<ImageSelectionAdapter.IMAGE>() {
private val imageBeans = arrayListOf<ImageBean>() private val imageBeans = arrayListOf<ImageBean>()
...@@ -22,49 +30,15 @@ class ImageSelectionAdapter(val uiMode: Int = UI_IMAGE_GRID) : RecyclerView.Adap ...@@ -22,49 +30,15 @@ class ImageSelectionAdapter(val uiMode: Int = UI_IMAGE_GRID) : RecyclerView.Adap
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): IMAGE { override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): IMAGE {
val layout = if (uiMode == UI_IMAGE_GRID) R.layout.item_image_selection else R.layout.item_image_selected val layout = if (uiMode == UI_IMAGE_GRID) R.layout.item_image_selection else R.layout.item_image_selected
return IMAGE(R.layout.item_image_selection.inflate(parent)) return IMAGE(layout.inflate(parent))
}
override fun getItemCount(): Int {
return imageBeans.size
} }
override fun onBindViewHolder(holder: IMAGE, position: Int) { override fun onBindViewHolder(holder: IMAGE, position: Int) {
val data = imageBeans[position]
val context = holder.itemView.context
when (uiMode) {
UI_IMAGE_GRID -> {
val binding = ItemImageSelectionBinding.bind(holder.itemView)
if (data.isCamera) {
binding.flContent.visibility = View.GONE
binding.flCamera.visibility = View.VISIBLE
} else {
binding.flCamera.visibility = View.GONE
binding.flContent.visibility = View.VISIBLE
if (data.file?.exists() == true) {
Glide.with(context).load(data.file).into(binding.iv)
}
binding.ivSelector.isSelected = data.isSelect
binding.ivSelector.setOnClickListener {
data.isSelect = !data.isSelect
binding.ivSelector.isSelected = data.isSelect
notifyItemChanged(position, "KOKO")
}
}
}
UI_IMAGE_LIST -> {
val binding = ItemImageSelectedBinding.bind(holder.itemView)
if (data.file?.exists() == true) {
Glide.with(context).load(data.file).into(binding.iv)
}
binding.ivDelete.setOnClickListener {
} }
}
}
override fun getItemCount(): Int {
return imageBeans.size
} }
override fun onBindViewHolder(holder: IMAGE, position: Int, payloads: MutableList<Any>) { override fun onBindViewHolder(holder: IMAGE, position: Int, payloads: MutableList<Any>) {
...@@ -82,13 +56,16 @@ class ImageSelectionAdapter(val uiMode: Int = UI_IMAGE_GRID) : RecyclerView.Adap ...@@ -82,13 +56,16 @@ class ImageSelectionAdapter(val uiMode: Int = UI_IMAGE_GRID) : RecyclerView.Adap
binding.flCamera.visibility = View.GONE binding.flCamera.visibility = View.GONE
binding.flContent.visibility = View.VISIBLE binding.flContent.visibility = View.VISIBLE
if (data.file?.exists() == true) { if (data.file?.exists() == true) {
Glide.with(context).load(data.file).into(binding.iv) Glide.with(context).load(data.file).centerCrop().into(binding.iv)
} }
binding.ivSelector.isSelected = data.isSelect binding.ivSelector.isSelected = data.isSelect
binding.ivSelector.setOnClickListener { arrayOf(binding.root, binding.ivSelector).forEach {
data.isSelect = !data.isSelect it.setOnClickListener {
binding.ivSelector.isSelected = data.isSelect data.isSelect = !data.isSelect
notifyItemChanged(position, "KOKO") binding.ivSelector.isSelected = data.isSelect
notifyItemChanged(position, "KOKO")
select?.invoke(data)
}
} }
} }
} else { } else {
...@@ -100,16 +77,54 @@ class ImageSelectionAdapter(val uiMode: Int = UI_IMAGE_GRID) : RecyclerView.Adap ...@@ -100,16 +77,54 @@ class ImageSelectionAdapter(val uiMode: Int = UI_IMAGE_GRID) : RecyclerView.Adap
UI_IMAGE_LIST -> { UI_IMAGE_LIST -> {
val binding = ItemImageSelectedBinding.bind(holder.itemView) val binding = ItemImageSelectedBinding.bind(holder.itemView)
if (data.file?.exists() == true) { if (data.file?.exists() == true) {
Glide.with(context).load(data.file).into(binding.iv) Glide.with(context).load(data.file).centerCrop().into(binding.iv)
} }
binding.ivDelete.setOnClickListener { binding.ivDelete.setOnClickListener {
remove?.invoke(data)
} }
} }
} }
} }
fun setData(files: List<Pair<File, Uri>>, isClean: Boolean = true) {
if (isClean) {
imageBeans.clear()
}
files.forEach { pair ->
imageBeans.add(ImageBean(pair.first))
}
notifyDataSetChanged()
}
fun addBean(image: ImageBean) {
imageBeans.add(image)
notifyDataSetChanged()
}
fun removeBean(imageBean: ImageBean) {
imageBeans.remove(imageBean)
notifyDataSetChanged()
}
fun getSelectBeanSize(): Int {
return imageBeans.filter { it.isSelect }.size
}
fun getSelectBean(): List<ImageBean> {
return imageBeans.filter { it.isSelect }
}
fun unSelectBean(imageBean: ImageBean) {
imageBeans.forEach {
if (it.file == imageBean.file) {
it.isSelect = false
}
}
notifyDataSetChanged()
}
companion object { companion object {
const val UI_IMAGE_GRID = 0 const val UI_IMAGE_GRID = 0
const val UI_IMAGE_LIST = 1 const val UI_IMAGE_LIST = 1
......
package com.base.superpdfreader.fragment package com.base.superpdfreader.fragment
import android.net.Uri import android.net.Uri
import android.provider.MediaStore
import android.widget.Toast
import androidx.core.content.ContextCompat import androidx.core.content.ContextCompat
import androidx.core.view.isVisible import androidx.core.view.isVisible
import androidx.lifecycle.lifecycleScope import androidx.lifecycle.lifecycleScope
...@@ -11,13 +9,10 @@ import com.base.superpdfreader.R ...@@ -11,13 +9,10 @@ import com.base.superpdfreader.R
import com.base.superpdfreader.adapter.DocumentAdapter import com.base.superpdfreader.adapter.DocumentAdapter
import com.base.superpdfreader.databinding.FragmentDocumentListBinding import com.base.superpdfreader.databinding.FragmentDocumentListBinding
import com.base.superpdfreader.helps.BaseFragment import com.base.superpdfreader.helps.BaseFragment
import com.base.superpdfreader.helps.FileHelp.loadDocument
import com.base.superpdfreader.helps.LogEx
import com.base.superpdfreader.helps.MediaStoreHelp.geFileMedia import com.base.superpdfreader.helps.MediaStoreHelp.geFileMedia
import com.base.superpdfreader.helps.PermissionHelp.checkStorePermission import com.base.superpdfreader.helps.PermissionHelp.checkStorePermission
import com.base.superpdfreader.helps.PermissionHelp.requestStorePermission import com.base.superpdfreader.helps.PermissionHelp.requestStorePermission
import com.base.superpdfreader.view.DocumentDetailDialog.showDocumentDetailDialog import com.base.superpdfreader.view.DocumentDetailDialog.showDocumentDetailDialog
import com.bumptech.glide.load.data.mediastore.MediaStoreUtil
import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.launch import kotlinx.coroutines.launch
import java.io.File import java.io.File
......
...@@ -11,69 +11,69 @@ import java.util.LinkedList ...@@ -11,69 +11,69 @@ import java.util.LinkedList
object FileHelp { object FileHelp {
private val TAG = "FileHelp" // private val TAG = "FileHelp"
fun loadDocument( // fun loadDocument(
filter: (file: File) -> Boolean, // filter: (file: File) -> Boolean,
eachFile: (eachFiles: List<File>) -> Unit // eachFile: (eachFiles: List<File>) -> Unit
) { // ) {
//
// val resultList = arrayListOf<File>()
//
// val root = Environment.getExternalStorageDirectory()
// loadFileByFilter(root, filter = filter, onDo = {
//
// if (resultList.size == 5) {
// val mainList = arrayListOf<File>()
// mainList.addAll(resultList)
// resultList.clear()
// Log.e(TAG, "size=${mainList.size}")
// //这里onDo切换到main主协程,避免IO协程里的数据和main协程里的数据共用同一对象
// eachFile.invoke(mainList)
//
// } else {
// resultList.add(it)
// }
// })
// eachFile.invoke(resultList)
// }
val resultList = arrayListOf<File>() // private fun loadFileByFilter(
// folder: File,
val root = Environment.getExternalStorageDirectory() // filter: (file: File) -> Boolean,
loadFileByFilter(root, filter = filter, onDo = { // onDo: ((file: File) -> Unit)?
// ) {
if (resultList.size == 5) { //
val mainList = arrayListOf<File>() // //添加第一层文件到链表
mainList.addAll(resultList) // val linkList = LinkedList<File>()
resultList.clear() // val fileList = folder.listFiles()
Log.e(TAG, "size=${mainList.size}") // fileList?.forEach {
//这里onDo切换到main主协程,避免IO协程里的数据和main协程里的数据共用同一对象 // if (it.isDirectory) {
eachFile.invoke(mainList) // linkList.add(it)
// } else {
} else { // val flag = filter(it)
resultList.add(it) // LogEx.logDebug(TAG, "$it flag=$flag")
} // if (flag) {
}) // onDo?.invoke(it)
eachFile.invoke(resultList) // }
} // }
// }
private fun loadFileByFilter( //
folder: File, // //链表取文件
filter: (file: File) -> Boolean, // var tempFile: File
onDo: ((file: File) -> Unit)? // while (!linkList.isEmpty()) {
) { // tempFile = linkList.removeFirst()
// val tempFileList = tempFile.listFiles()
//添加第一层文件到链表 // tempFileList?.forEach {
val linkList = LinkedList<File>() // if (it.isDirectory) {
val fileList = folder.listFiles() // linkList.add(it)
fileList?.forEach { // } else {
if (it.isDirectory) { // val flag = filter(it)
linkList.add(it) // LogEx.logDebug(TAG, "$it flag=$flag")
} else { // if (flag) {
val flag = filter(it) // onDo?.invoke(it)
LogEx.logDebug(TAG, "$it flag=$flag") // }
if (flag) { // }
onDo?.invoke(it) // }
} // }
} // }
}
//链表取文件
var tempFile: File
while (!linkList.isEmpty()) {
tempFile = linkList.removeFirst()
val tempFileList = tempFile.listFiles()
tempFileList?.forEach {
if (it.isDirectory) {
linkList.add(it)
} else {
val flag = filter(it)
LogEx.logDebug(TAG, "$it flag=$flag")
if (flag) {
onDo?.invoke(it)
}
}
}
}
}
} }
\ No newline at end of file
...@@ -73,6 +73,52 @@ object MediaStoreHelp { ...@@ -73,6 +73,52 @@ object MediaStoreHelp {
} }
fun Context.getMediaImage(
list: ArrayList<Pair<File, Uri>>,
): ArrayList<Pair<File, Uri>> {
val projection = arrayOf(
MediaStore.Files.FileColumns._ID,
MediaStore.Files.FileColumns.DATA,
)
var cursor: Cursor? = null
val externalUri = MediaStore.Images.Media.EXTERNAL_CONTENT_URI // 你也可以使用INTERNAL_CONTENT_URI来查询内部存储
try {
cursor = contentResolver.query(
externalUri,
projection,
null,
null,
MediaStore.Images.Media.DATE_TAKEN + " DESC"// 排序方式,按照拍摄
)
if (cursor != null) {
while (cursor.moveToNext()) {
val path =
cursor.getString(cursor.getColumnIndex(MediaStore.Files.FileColumns.DATA))
val uri =
ContentUris.withAppendedId(
externalUri,
cursor.getLong(cursor.getColumnIndexOrThrow(MediaStore.Files.FileColumns._ID))
)
// 其他属性...
list.add(
Pair(File(path), uri)
)
}
}
} catch (e: Exception) {
} finally {
cursor?.close()
}
return list
}
val commonMediaDir = arrayOf( val commonMediaDir = arrayOf(
Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DCIM).absolutePath, Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DCIM).absolutePath,
Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DOWNLOADS).absolutePath, Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DOWNLOADS).absolutePath,
......
...@@ -30,7 +30,7 @@ object DocumentDetailDialog { ...@@ -30,7 +30,7 @@ object DocumentDetailDialog {
binding.tvName.text = bean.name binding.tvName.text = bean.name
binding.tvInfo.text = "Last modified: ${bean.info(true)}" binding.tvInfo.text = "Last modified: ${bean.info(true)}"
when (UI_MODE) { when (UI_MODE) {
DocumentListFragment.MODE_PDF -> { MODE_PDF -> {
binding.ivDocument.setImageResource(R.mipmap.pdf) binding.ivDocument.setImageResource(R.mipmap.pdf)
binding.ivOpen.setImageResource(R.mipmap.openfileh) binding.ivOpen.setImageResource(R.mipmap.openfileh)
binding.ivEmail.setImageResource(R.mipmap.emailh) binding.ivEmail.setImageResource(R.mipmap.emailh)
...@@ -96,5 +96,8 @@ object DocumentDetailDialog { ...@@ -96,5 +96,8 @@ object DocumentDetailDialog {
} }
dialog.dismiss() dialog.dismiss()
} }
binding.llDelete.setOnClickListener {
}
} }
} }
\ No newline at end of file
package com.base.superpdfreader.view package com.base.superpdfreader.view
import android.content.Context import android.content.Context
import android.content.Intent
import android.view.LayoutInflater import android.view.LayoutInflater
import com.base.superpdfreader.activity.ImageSelectionActivity
import com.base.superpdfreader.databinding.DialogPdfCreateConverterBinding import com.base.superpdfreader.databinding.DialogPdfCreateConverterBinding
import com.google.android.material.bottomsheet.BottomSheetDialog import com.google.android.material.bottomsheet.BottomSheetDialog
...@@ -12,5 +14,10 @@ object PDFOperationDialog { ...@@ -12,5 +14,10 @@ object PDFOperationDialog {
dialog.setContentView(binding.root) dialog.setContentView(binding.root)
dialog.setCanceledOnTouchOutside(true) dialog.setCanceledOnTouchOutside(true)
dialog.show() dialog.show()
binding.llImagePdf.setOnClickListener {
startActivity(Intent(this, ImageSelectionActivity::class.java))
dialog.show()
}
} }
} }
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout 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"
android:orientation="vertical"
tools:context=".activity.ImageToPdfActivity">
<View
android:layout_width="match_parent"
android:layout_height="30dp"
android:background="@color/white" />
<FrameLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
tools:ignore="UselessParent">
<FrameLayout
android:id="@+id/fl_back"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:background="@color/white"
android:padding="10dp"
tools:ignore="UselessParent">
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@mipmap/fanhui"
tools:ignore="ContentDescription" />
</FrameLayout>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:text="Image to PDF"
android:textColor="@color/black"
android:textSize="19sp"
android:textStyle="bold"
tools:ignore="HardcodedText" />
</FrameLayout>
</LinearLayout>
\ No newline at end of file
...@@ -9,50 +9,67 @@ ...@@ -9,50 +9,67 @@
android:orientation="vertical" android:orientation="vertical"
tools:context=".activity.ImageSelectionActivity"> tools:context=".activity.ImageSelectionActivity">
<FrameLayout <LinearLayout
android:id="@+id/fl_top" android:id="@+id/ll_top"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
app:layout_constraintTop_toTopOf="parent" android:background="@color/white"
tools:ignore="UselessParent"> android:orientation="vertical">
<View
android:id="@+id/v_top"
android:layout_width="match_parent"
android:layout_height="40dp" />
<FrameLayout <FrameLayout
android:id="@+id/fl_back" android:layout_width="match_parent"
android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:padding="10dp"
tools:ignore="UselessParent"> tools:ignore="UselessParent">
<ImageView <FrameLayout
android:id="@+id/fl_back"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:src="@mipmap/fanhui" android:layout_gravity="center_vertical"
tools:ignore="ContentDescription" /> android:padding="10dp"
</FrameLayout> tools:ignore="UselessParent">
<TextView <ImageView
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_gravity="center" android:src="@mipmap/fanhui"
android:text="Image Selection" tools:ignore="ContentDescription" />
android:textColor="@color/black" </FrameLayout>
android:textSize="19sp"
android:textStyle="bold" <TextView
tools:ignore="HardcodedText" /> android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:text="Image Selection"
android:textColor="@color/black"
android:textSize="19sp"
android:textStyle="bold"
tools:ignore="HardcodedText" />
</FrameLayout> </FrameLayout>
</LinearLayout>
<androidx.recyclerview.widget.RecyclerView <androidx.recyclerview.widget.RecyclerView
android:id="@+id/rv_image" android:id="@+id/rv_image"
android:layout_width="match_parent" android:layout_width="wrap_content"
android:layout_height="0dp" android:layout_height="0dp"
android:layout_marginVertical="8dp"
app:layoutManager="androidx.recyclerview.widget.GridLayoutManager" app:layoutManager="androidx.recyclerview.widget.GridLayoutManager"
app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintBottom_toTopOf="@id/cl_bottom"
app:layout_constraintTop_toBottomOf="@id/fl_top" app:layout_constraintEnd_toEndOf="parent"
app:spanCount="3" /> app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/ll_top"
app:spanCount="3"
tools:listitem="@layout/item_image_selection" />
<androidx.constraintlayout.widget.ConstraintLayout <androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/cl_bottom"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:background="@color/white" android:background="@color/white"
...@@ -60,15 +77,19 @@ ...@@ -60,15 +77,19 @@
app:layout_constraintBottom_toBottomOf="parent"> app:layout_constraintBottom_toBottomOf="parent">
<androidx.recyclerview.widget.RecyclerView <androidx.recyclerview.widget.RecyclerView
android:id="@+id/rv_select_image" android:id="@+id/rv_selected_image"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="0dp" android:layout_height="wrap_content"
android:orientation="horizontal"
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"
app:layout_constraintBottom_toTopOf="@id/tv_import" app:layout_constraintBottom_toTopOf="@id/tv_import"
app:layout_constraintTop_toTopOf="parent" /> app:layout_constraintTop_toTopOf="parent"
tools:listitem="@layout/item_image_selected" />
<com.noober.background.view.BLTextView <com.noober.background.view.BLTextView
android:id="@+id/tv_import" android:id="@+id/tv_import"
android:layout_width="135dp" android:minWidth="135dp"
android:layout_width="wrap_content"
android:layout_height="40dp" android:layout_height="40dp"
android:layout_marginVertical="20dp" android:layout_marginVertical="20dp"
android:layout_marginEnd="16dp" android:layout_marginEnd="16dp"
...@@ -83,7 +104,7 @@ ...@@ -83,7 +104,7 @@
app:bl_unEnabled_solid_color="#D7DFE0" app:bl_unEnabled_solid_color="#D7DFE0"
app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toBottomOf="@id/rv_select_image" app:layout_constraintTop_toBottomOf="@id/rv_selected_image"
tools:ignore="HardcodedText" /> tools:ignore="HardcodedText" />
<TextView <TextView
......
...@@ -58,14 +58,18 @@ ...@@ -58,14 +58,18 @@
android:id="@+id/fab" android:id="@+id/fab"
android:layout_width="76dp" android:layout_width="76dp"
android:layout_height="76dp" android:layout_height="76dp"
app:pressedTranslationZ="0dp"
android:layout_marginEnd="16dp" android:layout_marginEnd="16dp"
android:layout_marginBottom="99dp" android:layout_marginBottom="99dp"
android:scaleType="centerCrop" android:scaleType="centerCrop"
android:src="@drawable/tianjia" android:src="@drawable/tianjia"
app:backgroundTint="@android:color/transparent"
app:elevation="0dp"
app:fabCustomSize="76dp" app:fabCustomSize="76dp"
app:layout_constraintBottom_toBottomOf="@id/viewpager2" app:layout_constraintBottom_toBottomOf="@id/viewpager2"
app:layout_constraintEnd_toEndOf="@id/viewpager2" app:layout_constraintEnd_toEndOf="@id/viewpager2"
app:maxImageSize="76dp" app:maxImageSize="76dp"
tools:ignore="ContentDescription" /> tools:ignore="ContentDescription"
tools:tint="@color/color_pdf" />
</androidx.constraintlayout.widget.ConstraintLayout> </androidx.constraintlayout.widget.ConstraintLayout>
\ No newline at end of file
...@@ -34,6 +34,7 @@ ...@@ -34,6 +34,7 @@
tools:ignore="DisableBaselineAlignment"> tools:ignore="DisableBaselineAlignment">
<com.noober.background.view.BLLinearLayout <com.noober.background.view.BLLinearLayout
android:id="@+id/ll_image_pdf"
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_margin="16dp" android:layout_margin="16dp"
......
...@@ -2,10 +2,12 @@ ...@@ -2,10 +2,12 @@
<androidx.cardview.widget.CardView xmlns:android="http://schemas.android.com/apk/res/android" <androidx.cardview.widget.CardView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools" xmlns:tools="http://schemas.android.com/tools"
android:layout_width="106dp" android:layout_width="120dp"
android:layout_height="106dp" android:layout_height="120dp"
android:layout_margin="6dp" android:layout_margin="6dp"
android:clickable="true"
android:elevation="0dp" android:elevation="0dp"
android:focusable="true"
app:cardCornerRadius="9dp"> app:cardCornerRadius="9dp">
<FrameLayout <FrameLayout
......
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