update
This commit is contained in:
parent
854c0debc1
commit
40db31489d
@ -74,8 +74,8 @@ dependencies {
|
||||
testImplementation(libs.junit)
|
||||
androidTestImplementation(libs.androidx.junit)
|
||||
androidTestImplementation(libs.androidx.espresso.core)
|
||||
// implementation(libs.immersionbar)
|
||||
// implementation(libs.immersionbar.ktx)
|
||||
implementation(libs.immersionbar)
|
||||
implementation(libs.immersionbar.ktx)
|
||||
implementation(libs.androidx.room.runtime)
|
||||
ksp(libs.androidx.room.compiler)
|
||||
implementation(libs.androidx.room.ktx)
|
||||
|
||||
@ -34,9 +34,9 @@
|
||||
android:fullBackupContent="@xml/backup_rules"
|
||||
android:icon="@mipmap/app_logo"
|
||||
android:label="@string/app_name"
|
||||
android:largeHeap="true"
|
||||
android:requestLegacyExternalStorage="true"
|
||||
android:roundIcon="@mipmap/app_logo"
|
||||
android:largeHeap="true"
|
||||
android:supportsRtl="true"
|
||||
android:theme="@style/Theme.PDFReaderPro">
|
||||
<meta-data
|
||||
@ -137,6 +137,12 @@
|
||||
android:label="@string/app_name"
|
||||
android:screenOrientation="portrait" />
|
||||
|
||||
<activity
|
||||
android:name=".ui.act.PictureSelectorActivity"
|
||||
android:exported="true"
|
||||
android:label="@string/app_name"
|
||||
android:screenOrientation="portrait" />
|
||||
|
||||
<provider
|
||||
android:name="androidx.core.content.FileProvider"
|
||||
android:authorities="${applicationId}.fileprovider"
|
||||
|
||||
@ -2,19 +2,20 @@ package com.all.pdfreader.pro.app.ui.act
|
||||
|
||||
import android.os.Bundle
|
||||
import android.util.Log
|
||||
import android.view.View
|
||||
import androidx.appcompat.app.AppCompatActivity
|
||||
import androidx.core.view.WindowCompat
|
||||
import com.all.pdfreader.pro.app.room.repository.PdfRepository
|
||||
import com.all.pdfreader.pro.app.sp.AppStore
|
||||
import com.all.pdfreader.pro.app.util.ToastUtils
|
||||
import com.gyf.immersionbar.ImmersionBar
|
||||
import com.gyf.immersionbar.OnInsetsChangeListener
|
||||
|
||||
abstract class BaseActivity : AppCompatActivity() {
|
||||
|
||||
protected open val rootBottomView: View? = null
|
||||
protected abstract val TAG: String
|
||||
protected val appStore by lazy { AppStore(this) }
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
super.onCreate(savedInstanceState)
|
||||
WindowCompat.setDecorFitsSystemWindows(window, true)
|
||||
Log.d("ocean", "🚀 ${javaClass.simpleName} onCreate")
|
||||
}
|
||||
|
||||
@ -67,4 +68,18 @@ abstract class BaseActivity : AppCompatActivity() {
|
||||
protected fun getRepository(): PdfRepository {
|
||||
return PdfRepository.getInstance()
|
||||
}
|
||||
|
||||
protected fun setupImmersionBar(block: ImmersionBar.() -> Unit) {
|
||||
val bar = ImmersionBar.with(this)
|
||||
|
||||
// 通用逻辑:监听 insets 改变
|
||||
bar.setOnInsetsChangeListener(object : OnInsetsChangeListener {
|
||||
override fun onInsetsChanged(top: Int, bottom: Int, left: Int, right: Int) {
|
||||
rootBottomView?.setPadding(left, 0, right, bottom)
|
||||
}
|
||||
})
|
||||
bar.block()
|
||||
|
||||
bar.init()
|
||||
}
|
||||
}
|
||||
@ -10,7 +10,8 @@ import com.all.pdfreader.pro.app.databinding.ActivityFaqBinding
|
||||
|
||||
class FAQActivity : BaseActivity() {
|
||||
override val TAG: String = "FAQActivity"
|
||||
|
||||
override val rootBottomView: View?
|
||||
get() = binding.rootBottomLayout
|
||||
private lateinit var binding: ActivityFaqBinding
|
||||
private var faqAboutApp1IsOpen = true
|
||||
private var faqAboutApp2IsOpen = false
|
||||
@ -21,6 +22,11 @@ class FAQActivity : BaseActivity() {
|
||||
super.onCreate(savedInstanceState)
|
||||
binding = ActivityFaqBinding.inflate(layoutInflater)
|
||||
setContentView(binding.root)
|
||||
setupImmersionBar {
|
||||
statusBarView(binding.view)
|
||||
statusBarDarkFont(true)
|
||||
navigationBarColor(R.color.white)
|
||||
}
|
||||
initView()
|
||||
}
|
||||
|
||||
|
||||
@ -40,7 +40,8 @@ class MainActivity : BaseActivity(), PermissionDialogFragment.PermissionCallback
|
||||
RecentlyFrag.OnItemLongClickListener, FavoriteFrag.OnItemLongClickListener {
|
||||
|
||||
override val TAG: String = "MainActivity"
|
||||
|
||||
override val rootBottomView: View?
|
||||
get() = binding.rootBottomLayout
|
||||
private lateinit var binding: ActivityMainBinding
|
||||
private val pdfRepository = getRepository()
|
||||
private lateinit var pdfScanner: PdfScanner
|
||||
@ -60,6 +61,11 @@ class MainActivity : BaseActivity(), PermissionDialogFragment.PermissionCallback
|
||||
setContentView(binding.root)
|
||||
setupDoubleBackExit()
|
||||
initObserve()
|
||||
setupImmersionBar {
|
||||
statusBarView(binding.view)
|
||||
statusBarDarkFont(false)
|
||||
navigationBarColor(R.color.white)
|
||||
}
|
||||
setupFragments()
|
||||
setupNavigation()
|
||||
pdfScanner = PdfScanner(this, pdfRepository)
|
||||
|
||||
@ -6,6 +6,7 @@ import android.content.Intent
|
||||
import android.os.Build
|
||||
import android.os.Bundle
|
||||
import android.os.Parcelable
|
||||
import android.view.View
|
||||
import androidx.activity.OnBackPressedCallback
|
||||
import androidx.activity.result.contract.ActivityResultContract
|
||||
import androidx.lifecycle.lifecycleScope
|
||||
@ -25,6 +26,8 @@ import java.io.File
|
||||
|
||||
class MergePdfActivity : BaseActivity() {
|
||||
override val TAG: String = "MergePdfActivity"
|
||||
override val rootBottomView: View?
|
||||
get() = binding.rootBottomLayout
|
||||
private lateinit var binding: ActivityPdfMergeBinding
|
||||
private var selectedList: ArrayList<PdfDocumentEntity> = arrayListOf()
|
||||
private lateinit var adapter: PdfAdapter
|
||||
@ -34,6 +37,11 @@ class MergePdfActivity : BaseActivity() {
|
||||
binding = ActivityPdfMergeBinding.inflate(layoutInflater)
|
||||
setContentView(binding.root)
|
||||
setupBackPressedCallback()
|
||||
setupImmersionBar {
|
||||
statusBarView(binding.view)
|
||||
statusBarDarkFont(true)
|
||||
navigationBarColor(R.color.white)
|
||||
}
|
||||
val list: ArrayList<PdfDocumentEntity> = requireParcelableArrayList(EXTRA_PDF_LIST)
|
||||
updateContinueNowBtnState(list.size >= 2)
|
||||
lifecycleScope.launch {
|
||||
|
||||
@ -30,6 +30,8 @@ import java.io.Serializable
|
||||
|
||||
class PdfPickerActivity : BaseActivity() {
|
||||
override val TAG: String = "PdfPickerActivity"
|
||||
override val rootBottomView: View?
|
||||
get() = binding.rootBottomLayout
|
||||
private lateinit var binding: ActivityPdfPickerBinding
|
||||
private lateinit var adapter: PdfAdapter
|
||||
private lateinit var source: PdfPickerSource // 保存来源
|
||||
@ -49,6 +51,11 @@ class PdfPickerActivity : BaseActivity() {
|
||||
}
|
||||
fromActivityResult = intent.getStringExtra(EXTRA_FROM) ?: ""
|
||||
historyList = requireParcelableArrayList(EXTRA_HISTORY_LIST)
|
||||
setupImmersionBar {
|
||||
statusBarView(binding.view)
|
||||
statusBarDarkFont(true)
|
||||
navigationBarColor(R.color.white)
|
||||
}
|
||||
updateViewAndState()
|
||||
initView()
|
||||
setupClick()
|
||||
|
||||
@ -34,6 +34,7 @@ import com.all.pdfreader.pro.app.util.ToastUtils
|
||||
import com.bumptech.glide.Glide
|
||||
import com.bumptech.glide.load.resource.bitmap.CenterCrop
|
||||
import com.bumptech.glide.load.resource.bitmap.RoundedCorners
|
||||
import com.gyf.immersionbar.ImmersionBar
|
||||
import kotlinx.coroutines.Dispatchers
|
||||
import kotlinx.coroutines.launch
|
||||
import kotlinx.coroutines.withContext
|
||||
@ -42,7 +43,8 @@ import java.io.Serializable
|
||||
|
||||
class PdfResultActivity : BaseActivity() {
|
||||
override val TAG: String = "PdfResultActivity"
|
||||
|
||||
override val rootBottomView: View?
|
||||
get() = binding.rootBottomLayout
|
||||
companion object {
|
||||
private const val EXTRA_SELECTED_LIST = "extra_selected_list"
|
||||
private const val EXTRA_FILE_LIST = "extra_file_list"
|
||||
@ -126,6 +128,11 @@ class PdfResultActivity : BaseActivity() {
|
||||
binding = ActivityPdfSplitResultBinding.inflate(layoutInflater)
|
||||
setContentView(binding.root)
|
||||
setupBackPressedCallback()
|
||||
setupImmersionBar {
|
||||
statusBarView(binding.view)
|
||||
statusBarDarkFont(true)
|
||||
navigationBarColor(R.color.bg_color)
|
||||
}
|
||||
source = getSerializableOrDefault(EXTRA_SOURCE, PdfPickerSource.NONE)
|
||||
if (source == PdfPickerSource.NONE) {
|
||||
showToast(getString(R.string.pdf_loading_failed))
|
||||
|
||||
@ -24,7 +24,8 @@ import java.io.Serializable
|
||||
|
||||
class PdfToImageActivity : BaseActivity() {
|
||||
override val TAG: String = "PdfToImageActivity"
|
||||
|
||||
override val rootBottomView: View?
|
||||
get() = binding.rootBottomLayout
|
||||
|
||||
var currentPassword: String? = null//只会选择一个文件。直接进行密码传递
|
||||
private lateinit var source: PdfPickerSource
|
||||
@ -49,6 +50,11 @@ class PdfToImageActivity : BaseActivity() {
|
||||
super.onCreate(savedInstanceState)
|
||||
binding = ActivityPdfToImgBinding.inflate(layoutInflater)
|
||||
setContentView(binding.root)
|
||||
setupImmersionBar {
|
||||
statusBarView(binding.view)
|
||||
statusBarDarkFont(true)
|
||||
navigationBarColor(R.color.bg_color)
|
||||
}
|
||||
filePath = intent.getStringExtra(EXTRA_PDF_PATH)
|
||||
?: throw IllegalArgumentException("PDF file hash is required")
|
||||
source = getSerializableOrDefault(EXTRA_SOURCE, PdfPickerSource.NONE)
|
||||
|
||||
@ -32,6 +32,8 @@ import com.github.barteksc.pdfviewer.listener.OnErrorListener
|
||||
import com.github.barteksc.pdfviewer.listener.OnLoadCompleteListener
|
||||
import com.github.barteksc.pdfviewer.listener.OnPageChangeListener
|
||||
import com.github.barteksc.pdfviewer.listener.OnTapListener
|
||||
import com.gyf.immersionbar.BarHide
|
||||
import com.gyf.immersionbar.ImmersionBar
|
||||
import com.tom_roush.pdfbox.pdmodel.PDDocument
|
||||
import kotlinx.coroutines.Dispatchers
|
||||
import kotlinx.coroutines.Job
|
||||
@ -43,7 +45,8 @@ import java.io.File
|
||||
class PdfViewActivity : BaseActivity(), OnLoadCompleteListener, OnPageChangeListener,
|
||||
OnErrorListener, OnTapListener {
|
||||
override val TAG: String = "PdfViewActivity"
|
||||
|
||||
override val rootBottomView: View?
|
||||
get() = binding.rootBottomLayout
|
||||
companion object {
|
||||
const val FRAG_TAG = "PdfViewActivity"
|
||||
private const val EXTRA_PDF_HASH = "extra_pdf_hash"
|
||||
@ -72,6 +75,11 @@ class PdfViewActivity : BaseActivity(), OnLoadCompleteListener, OnPageChangeList
|
||||
super.onCreate(savedInstanceState)
|
||||
binding = ActivityPdfViewBinding.inflate(layoutInflater)
|
||||
setContentView(binding.root)
|
||||
setupImmersionBar {
|
||||
statusBarView(binding.view)
|
||||
statusBarDarkFont(true)
|
||||
navigationBarColor(R.color.white)
|
||||
}
|
||||
setupDoubleBackExit()
|
||||
initObserve()
|
||||
val filePath = intent.getStringExtra(EXTRA_PDF_HASH)
|
||||
@ -384,12 +392,12 @@ class PdfViewActivity : BaseActivity(), OnLoadCompleteListener, OnPageChangeList
|
||||
isFullScreen = !isFullScreen
|
||||
updateStatusAndNavigationLayout(isFullScreen)
|
||||
if (isFullScreen) {
|
||||
// ImmersionBar.with(this).hideBar(BarHide.FLAG_HIDE_BAR).init()
|
||||
ImmersionBar.with(this).hideBar(BarHide.FLAG_HIDE_BAR).init()
|
||||
} else {
|
||||
val navColor =
|
||||
if (appStore.isEyeCareMode) R.color.eye_protection_color else R.color.white
|
||||
// ImmersionBar.with(this).statusBarView(binding.view).statusBarDarkFont(true)
|
||||
// .navigationBarColor(navColor).hideBar(BarHide.FLAG_SHOW_BAR).init()
|
||||
ImmersionBar.with(this).statusBarView(binding.view).statusBarDarkFont(true)
|
||||
.navigationBarColor(navColor).hideBar(BarHide.FLAG_SHOW_BAR).init()
|
||||
}
|
||||
}
|
||||
|
||||
@ -416,8 +424,8 @@ class PdfViewActivity : BaseActivity(), OnLoadCompleteListener, OnPageChangeList
|
||||
binding.eyeCareOverlay.visibility = View.GONE
|
||||
binding.eyeProtectIv.setImageResource(R.drawable.eye_protect)
|
||||
}
|
||||
// ImmersionBar.with(this).statusBarView(binding.view).statusBarDarkFont(true)
|
||||
// .navigationBarColor(navColor).init()
|
||||
ImmersionBar.with(this).statusBarView(binding.view).statusBarDarkFont(true)
|
||||
.navigationBarColor(navColor).init()
|
||||
}
|
||||
|
||||
private fun setupDoubleBackExit() {
|
||||
|
||||
@ -0,0 +1,181 @@
|
||||
package com.all.pdfreader.pro.app.ui.act
|
||||
|
||||
import android.content.Context
|
||||
import android.net.Uri
|
||||
import android.os.Bundle
|
||||
import android.view.View
|
||||
import androidx.core.net.toUri
|
||||
import androidx.fragment.app.Fragment
|
||||
import com.all.pdfreader.pro.app.PRApp
|
||||
import com.all.pdfreader.pro.app.R
|
||||
import com.all.pdfreader.pro.app.databinding.ActPictureSelectorBinding
|
||||
import com.all.pdfreader.pro.app.model.PdfPickerSource
|
||||
import com.all.pdfreader.pro.app.util.GlideEngine
|
||||
import com.luck.picture.lib.basic.PictureSelector
|
||||
import com.luck.picture.lib.config.PictureMimeType
|
||||
import com.luck.picture.lib.config.SelectMimeType
|
||||
import com.luck.picture.lib.config.SelectModeConfig
|
||||
import com.luck.picture.lib.engine.CompressFileEngine
|
||||
import com.luck.picture.lib.entity.LocalMedia
|
||||
import com.luck.picture.lib.interfaces.OnKeyValueResultCallbackListener
|
||||
import com.luck.picture.lib.interfaces.OnMediaEditInterceptListener
|
||||
import com.luck.picture.lib.interfaces.OnResultCallbackListener
|
||||
import com.luck.picture.lib.style.PictureSelectorStyle
|
||||
import com.luck.picture.lib.style.SelectMainStyle
|
||||
import com.luck.picture.lib.utils.DateUtils
|
||||
import com.yalantis.ucrop.UCrop
|
||||
import top.zibin.luban.Luban
|
||||
import top.zibin.luban.OnNewCompressListener
|
||||
import java.io.File
|
||||
|
||||
class PictureSelectorActivity : BaseActivity() {
|
||||
private lateinit var binding: ActPictureSelectorBinding
|
||||
override val rootBottomView: View?
|
||||
get() = binding.rootBottomLayout
|
||||
override val TAG = "PictureSelectorActivity"
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
super.onCreate(savedInstanceState)
|
||||
binding = ActPictureSelectorBinding.inflate(layoutInflater)
|
||||
setContentView(binding.root)
|
||||
setupImmersionBar {
|
||||
statusBarView(binding.view)
|
||||
statusBarDarkFont(false)
|
||||
}
|
||||
openImagePicker()
|
||||
}
|
||||
|
||||
private fun openImagePicker() {
|
||||
val selectorStyle = PictureSelectorStyle().apply {
|
||||
selectMainStyle = SelectMainStyle().apply {
|
||||
isSelectNumberStyle = true
|
||||
isPreviewSelectNumberStyle = true
|
||||
selectBackground = R.drawable.num_checkbox_selector
|
||||
}
|
||||
}
|
||||
PictureSelector.create(this)
|
||||
.openGallery(SelectMimeType.ofImage())
|
||||
.setSelectorUIStyle(selectorStyle)
|
||||
.setImageEngine(GlideEngine.createGlideEngine())
|
||||
.setImageSpanCount(3)
|
||||
.isGif(false)
|
||||
.isFastSlidingSelect(true)
|
||||
.setSelectionMode(SelectModeConfig.MULTIPLE)
|
||||
.setMaxSelectNum(50)
|
||||
.isPreviewFullScreenMode(false)
|
||||
.setCompressEngine(object : CompressFileEngine {
|
||||
override fun onStartCompress(
|
||||
context: Context?,
|
||||
source: ArrayList<Uri?>?,
|
||||
call: OnKeyValueResultCallbackListener?
|
||||
) {
|
||||
Luban.with(context)
|
||||
.load(source)
|
||||
.ignoreBy(100)
|
||||
.setCompressListener(object : OnNewCompressListener {
|
||||
override fun onStart() {
|
||||
|
||||
}
|
||||
|
||||
override fun onSuccess(
|
||||
source: String?,
|
||||
compressFile: File?
|
||||
) {
|
||||
call?.onCallback(source, compressFile?.absolutePath)
|
||||
}
|
||||
|
||||
override fun onError(source: String?, e: Throwable?) {
|
||||
call?.onCallback(source, null)
|
||||
}
|
||||
})
|
||||
.launch()
|
||||
}
|
||||
})
|
||||
.setEditMediaInterceptListener(object : OnMediaEditInterceptListener {
|
||||
override fun onStartMediaEdit(
|
||||
fragment: Fragment, currentLocalMedia: LocalMedia, requestCode: Int
|
||||
) {
|
||||
val currentEditPath = currentLocalMedia.getAvailablePath()
|
||||
val inputUri = if (PictureMimeType.isContent(currentEditPath)) {
|
||||
currentEditPath.toUri()
|
||||
} else {
|
||||
Uri.fromFile(File(currentEditPath))
|
||||
}
|
||||
val destinationUri = Uri.fromFile(
|
||||
File(
|
||||
getSandboxPath(), DateUtils.getCreateFileName("CROP_") + ".jpeg"
|
||||
)
|
||||
)
|
||||
val uCrop = UCrop.of<Any>(inputUri, destinationUri)
|
||||
val buildOptions = UCrop.Options().apply {
|
||||
isDarkStatusBarBlack(true)
|
||||
}
|
||||
uCrop.withOptions(buildOptions)
|
||||
uCrop.start(this@PictureSelectorActivity, fragment, requestCode)
|
||||
}
|
||||
|
||||
}).buildLaunch(R.id.fragment_container,object : OnResultCallbackListener<LocalMedia>{
|
||||
override fun onResult(result: ArrayList<LocalMedia>) {
|
||||
logDebug("forResult ->${result.size}")
|
||||
if (result.isNotEmpty()) {
|
||||
// result 中可能有带裁剪的 Uri 或原图 Uri
|
||||
// 取出路径列表
|
||||
val paths = result.mapNotNull { media ->
|
||||
media.availablePath
|
||||
}
|
||||
if (paths.isEmpty()) {
|
||||
return
|
||||
}
|
||||
val intent = PdfResultActivity.createIntentInputFile(
|
||||
this@PictureSelectorActivity,
|
||||
ArrayList(paths),
|
||||
PdfPickerSource.IMAGES_TO_PDF
|
||||
)
|
||||
startActivity(intent)
|
||||
finish()
|
||||
}
|
||||
}
|
||||
|
||||
override fun onCancel() {
|
||||
finish()
|
||||
}
|
||||
|
||||
})
|
||||
|
||||
// .forResult(object : OnResultCallbackListener<LocalMedia> {
|
||||
// override fun onResult(result: ArrayList<LocalMedia>) {
|
||||
// logDebug("forResult ->${result.size}")
|
||||
// if (result.isNotEmpty()) {
|
||||
// // result 中可能有带裁剪的 Uri 或原图 Uri
|
||||
// // 取出路径列表
|
||||
// val paths = result.mapNotNull { media ->
|
||||
// media.availablePath
|
||||
// }
|
||||
// if (paths.isEmpty()) {
|
||||
// return
|
||||
// }
|
||||
// val intent = PdfResultActivity.createIntentInputFile(
|
||||
// this@PictureSelectorActivity,
|
||||
// ArrayList(paths),
|
||||
// PdfPickerSource.IMAGES_TO_PDF
|
||||
// )
|
||||
// startActivity(intent)
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// override fun onCancel() {
|
||||
// logDebug("onCancel")
|
||||
// }
|
||||
// })
|
||||
|
||||
// supportFragmentManager.beginTransaction()
|
||||
// .add(R.id.fragment_fl, selectorFragment, selectorFragment.getFragmentTag())
|
||||
// .addToBackStack(selectorFragment.getFragmentTag())
|
||||
// .commitAllowingStateLoss();
|
||||
}
|
||||
|
||||
fun getSandboxPath(): String {
|
||||
val dir = File(PRApp.getContext().externalCacheDir, "SandboxPdfPro")
|
||||
if (!dir.exists()) dir.mkdirs()
|
||||
return dir.absolutePath
|
||||
}
|
||||
}
|
||||
@ -1,6 +1,7 @@
|
||||
package com.all.pdfreader.pro.app.ui.act
|
||||
|
||||
import android.os.Bundle
|
||||
import android.view.View
|
||||
import android.webkit.WebChromeClient
|
||||
import android.webkit.WebResourceError
|
||||
import android.webkit.WebResourceRequest
|
||||
@ -11,12 +12,19 @@ import com.all.pdfreader.pro.app.databinding.ActPrivacyPolicyBinding
|
||||
|
||||
class PrivacyPolicyActivity : BaseActivity() {
|
||||
private lateinit var binding: ActPrivacyPolicyBinding
|
||||
override val rootBottomView: View?
|
||||
get() = binding.rootBottomLayout
|
||||
|
||||
override val TAG = "PrivacyPolicyActivity"
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
super.onCreate(savedInstanceState)
|
||||
binding = ActPrivacyPolicyBinding.inflate(layoutInflater)
|
||||
setContentView(binding.root)
|
||||
setupImmersionBar {
|
||||
statusBarView(binding.view)
|
||||
statusBarDarkFont(true)
|
||||
navigationBarColor(R.color.bg_color)
|
||||
}
|
||||
binding.backBtn.setOnClickListener {
|
||||
finish()
|
||||
}
|
||||
|
||||
@ -36,7 +36,8 @@ import java.io.Serializable
|
||||
|
||||
class SearchActivity : BaseActivity() {
|
||||
override val TAG: String = "SearchActivity"
|
||||
|
||||
override val rootBottomView: View?
|
||||
get() = binding.rootBottomLayout
|
||||
companion object {
|
||||
const val FRAG_TAG = "SearchActivity"
|
||||
private const val PREF_SEARCH_HISTORY = "pref_search_history"
|
||||
@ -64,6 +65,11 @@ class SearchActivity : BaseActivity() {
|
||||
super.onCreate(savedInstanceState)
|
||||
binding = ActivitySearchPdfBinding.inflate(layoutInflater)
|
||||
setContentView(binding.root)
|
||||
setupImmersionBar {
|
||||
statusBarView(binding.view)
|
||||
statusBarDarkFont(true)
|
||||
navigationBarColor(R.color.bg_color)
|
||||
}
|
||||
source = getSerializableOrDefault(EXTRA_SOURCE, PdfPickerSource.NONE)
|
||||
sp = getSharedPreferences(PREF_SEARCH_HISTORY, MODE_PRIVATE)
|
||||
loadHistory()
|
||||
|
||||
@ -5,7 +5,10 @@ import android.content.Intent
|
||||
import android.os.Bundle
|
||||
import android.os.Handler
|
||||
import android.os.Looper
|
||||
import com.all.pdfreader.pro.app.R
|
||||
import com.all.pdfreader.pro.app.databinding.ActivitySplashBinding
|
||||
import com.gyf.immersionbar.BarHide
|
||||
import com.gyf.immersionbar.ImmersionBar
|
||||
|
||||
@SuppressLint("CustomSplashScreen")
|
||||
class SplashActivity : BaseActivity() {
|
||||
@ -21,6 +24,11 @@ class SplashActivity : BaseActivity() {
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
super.onCreate(savedInstanceState)
|
||||
binding = ActivitySplashBinding.inflate(layoutInflater)
|
||||
setupImmersionBar {
|
||||
fullScreen(true)
|
||||
statusBarDarkFont(true)
|
||||
hideBar(BarHide.FLAG_HIDE_NAVIGATION_BAR)
|
||||
}
|
||||
// 设置启动页布局
|
||||
setContentView(binding.root)
|
||||
|
||||
|
||||
@ -23,6 +23,7 @@ import com.all.pdfreader.pro.app.util.AppUtils.setOnSingleClickListener
|
||||
import com.all.pdfreader.pro.app.util.FileUtils.isPdfEncrypted
|
||||
import com.all.pdfreader.pro.app.util.FileUtils.toUnderscoreDateTime
|
||||
import com.all.pdfreader.pro.app.util.PdfUtils
|
||||
import com.gyf.immersionbar.ImmersionBar
|
||||
import kotlinx.coroutines.Dispatchers
|
||||
import kotlinx.coroutines.launch
|
||||
import kotlinx.coroutines.withContext
|
||||
@ -30,7 +31,8 @@ import java.io.File
|
||||
|
||||
class SplitPdfActivity : BaseActivity() {
|
||||
override val TAG: String = "SplitPdfActivity"
|
||||
|
||||
override val rootBottomView: View?
|
||||
get() = binding.rootBottomLayout
|
||||
|
||||
private var currentViewState: ViewState = ViewState.SPLIT_LIST
|
||||
var currentPassword : String? = null//拆分只会选择一个文件。直接进行密码传递
|
||||
@ -63,6 +65,11 @@ class SplitPdfActivity : BaseActivity() {
|
||||
binding = ActivityPdfSplitBinding.inflate(layoutInflater)
|
||||
setContentView(binding.root)
|
||||
setupBackPressedCallback()
|
||||
setupImmersionBar {
|
||||
statusBarView(binding.view)
|
||||
statusBarDarkFont(true)
|
||||
navigationBarColor(R.color.bg_color)
|
||||
}
|
||||
filePath = intent.getStringExtra(EXTRA_PDF_PATH)
|
||||
?: throw IllegalArgumentException("PDF file hash is required")
|
||||
if (filePath.isEmpty()) {
|
||||
|
||||
@ -1,6 +1,7 @@
|
||||
package com.all.pdfreader.pro.app.ui.fragment
|
||||
|
||||
import android.content.Context
|
||||
import android.content.Intent
|
||||
import android.net.Uri
|
||||
import android.os.Bundle
|
||||
import android.view.LayoutInflater
|
||||
@ -14,6 +15,7 @@ import com.all.pdfreader.pro.app.databinding.FragmentToolsBinding
|
||||
import com.all.pdfreader.pro.app.model.PdfPickerSource
|
||||
import com.all.pdfreader.pro.app.ui.act.PdfPickerActivity
|
||||
import com.all.pdfreader.pro.app.ui.act.PdfResultActivity
|
||||
import com.all.pdfreader.pro.app.ui.act.PictureSelectorActivity
|
||||
import com.all.pdfreader.pro.app.util.GlideEngine
|
||||
import com.luck.picture.lib.basic.PictureSelector
|
||||
import com.luck.picture.lib.config.PictureMimeType
|
||||
@ -66,7 +68,8 @@ class ToolsFrag : BaseFrag() {
|
||||
startActivity(intent)
|
||||
}
|
||||
binding.imgToPdfBtn.setOnClickListener {
|
||||
openImagePicker()
|
||||
val intent = Intent(requireActivity(), PictureSelectorActivity::class.java)
|
||||
startActivity(intent)
|
||||
}
|
||||
binding.pdfToImgBtn.setOnClickListener {
|
||||
val intent = PdfPickerActivity.createIntent(requireActivity(), PdfPickerSource.PDF_TO_IMAGES)
|
||||
@ -81,106 +84,4 @@ class ToolsFrag : BaseFrag() {
|
||||
startActivity(intent)
|
||||
}
|
||||
}
|
||||
|
||||
private fun openImagePicker() {
|
||||
val selectorStyle = PictureSelectorStyle().apply {
|
||||
selectMainStyle = SelectMainStyle().apply {
|
||||
isSelectNumberStyle = true
|
||||
isPreviewSelectNumberStyle = true
|
||||
selectBackground = R.drawable.num_checkbox_selector
|
||||
}
|
||||
}
|
||||
PictureSelector.create(this)
|
||||
.openGallery(SelectMimeType.ofImage())
|
||||
.setSelectorUIStyle(selectorStyle)
|
||||
.setImageEngine(GlideEngine.createGlideEngine())
|
||||
.setImageSpanCount(3)
|
||||
.isGif(false)
|
||||
.isFastSlidingSelect(true)
|
||||
.setSelectionMode(SelectModeConfig.MULTIPLE)
|
||||
.setMaxSelectNum(50)
|
||||
|
||||
.setCompressEngine(object : CompressFileEngine {
|
||||
override fun onStartCompress(
|
||||
context: Context?,
|
||||
source: ArrayList<Uri?>?,
|
||||
call: OnKeyValueResultCallbackListener?
|
||||
) {
|
||||
Luban.with(context)
|
||||
.load(source)
|
||||
.ignoreBy(100)
|
||||
.setCompressListener(object : OnNewCompressListener {
|
||||
override fun onStart() {
|
||||
|
||||
}
|
||||
|
||||
override fun onSuccess(
|
||||
source: String?,
|
||||
compressFile: File?
|
||||
) {
|
||||
call?.onCallback(source, compressFile?.absolutePath)
|
||||
}
|
||||
|
||||
override fun onError(source: String?, e: Throwable?) {
|
||||
call?.onCallback(source, null)
|
||||
}
|
||||
})
|
||||
.launch()
|
||||
}
|
||||
})
|
||||
.setEditMediaInterceptListener(object : OnMediaEditInterceptListener {
|
||||
override fun onStartMediaEdit(
|
||||
fragment: Fragment, currentLocalMedia: LocalMedia, requestCode: Int
|
||||
) {
|
||||
val currentEditPath = currentLocalMedia.getAvailablePath()
|
||||
val inputUri = if (PictureMimeType.isContent(currentEditPath)) {
|
||||
currentEditPath.toUri()
|
||||
} else {
|
||||
Uri.fromFile(File(currentEditPath))
|
||||
}
|
||||
val destinationUri = Uri.fromFile(
|
||||
File(
|
||||
getSandboxPath(), DateUtils.getCreateFileName("CROP_") + ".jpeg"
|
||||
)
|
||||
)
|
||||
val uCrop = UCrop.of<Any>(inputUri, destinationUri)
|
||||
val buildOptions = UCrop.Options().apply {
|
||||
isDarkStatusBarBlack(true)
|
||||
}
|
||||
uCrop.withOptions(buildOptions)
|
||||
uCrop.start(requireActivity(), fragment, requestCode)
|
||||
}
|
||||
|
||||
}).forResult(object : OnResultCallbackListener<LocalMedia> {
|
||||
override fun onResult(result: ArrayList<LocalMedia>) {
|
||||
logDebug("forResult ->${result.size}")
|
||||
if (result.isNotEmpty()) {
|
||||
// result 中可能有带裁剪的 Uri 或原图 Uri
|
||||
// 取出路径列表
|
||||
val paths = result.mapNotNull { media ->
|
||||
media.availablePath
|
||||
}
|
||||
if (paths.isEmpty()) {
|
||||
return
|
||||
}
|
||||
val intent = PdfResultActivity.createIntentInputFile(
|
||||
requireActivity(),
|
||||
ArrayList(paths),
|
||||
PdfPickerSource.IMAGES_TO_PDF
|
||||
)
|
||||
startActivity(intent)
|
||||
}
|
||||
}
|
||||
|
||||
override fun onCancel() {
|
||||
logDebug("onCancel")
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
fun getSandboxPath(): String {
|
||||
val dir = File(PRApp.getContext().externalCacheDir, "SandboxPdfPro")
|
||||
if (!dir.exists()) dir.mkdirs()
|
||||
return dir.absolutePath
|
||||
}
|
||||
}
|
||||
29
app/src/main/res/layout/act_picture_selector.xml
Normal file
29
app/src/main/res/layout/act_picture_selector.xml
Normal file
@ -0,0 +1,29 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="#393a3e"
|
||||
android:orientation="vertical">
|
||||
|
||||
<View
|
||||
android:id="@+id/view"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp" />
|
||||
|
||||
<FrameLayout
|
||||
android:id="@+id/fragment_container"
|
||||
android:layout_above="@+id/rootBottomLayout"
|
||||
android:layout_below="@+id/view"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent" />
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/rootBottomLayout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentBottom="true"
|
||||
android:orientation="horizontal">
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</RelativeLayout>
|
||||
@ -1,5 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@color/white"
|
||||
@ -10,6 +10,13 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_above="@+id/rootBottomLayout"
|
||||
android:layout_below="@+id/view"
|
||||
android:orientation="vertical">
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/statusLayout"
|
||||
android:layout_width="match_parent"
|
||||
@ -69,3 +76,14 @@
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/rootBottomLayout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentBottom="true"
|
||||
android:orientation="horizontal">
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</RelativeLayout>
|
||||
@ -1,5 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@color/white"
|
||||
@ -10,6 +10,13 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_above="@+id/rootBottomLayout"
|
||||
android:layout_below="@+id/view"
|
||||
android:orientation="vertical">
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/statusLayout"
|
||||
android:layout_width="match_parent"
|
||||
@ -197,8 +204,8 @@
|
||||
style="@style/TextViewFont_PopSemiBold"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="10dp"
|
||||
android:layout_marginTop="24dp"
|
||||
android:layout_marginBottom="10dp"
|
||||
android:text="@string/file_viewing"
|
||||
android:textColor="@color/icon_on"
|
||||
android:textSize="20sp" />
|
||||
@ -248,5 +255,15 @@
|
||||
</LinearLayout>
|
||||
|
||||
</ScrollView>
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/rootBottomLayout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentBottom="true"
|
||||
android:orientation="horizontal">
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</RelativeLayout>
|
||||
@ -454,6 +454,14 @@
|
||||
android:textSize="12sp" />
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/rootBottomLayout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal">
|
||||
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
<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"
|
||||
@ -11,6 +11,13 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_above="@+id/rootBottomLayout"
|
||||
android:layout_below="@+id/view"
|
||||
android:orientation="vertical">
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/statusLayout"
|
||||
android:layout_width="match_parent"
|
||||
@ -84,7 +91,6 @@
|
||||
android:textSize="20sp" />
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
@ -122,5 +128,15 @@
|
||||
android:textSize="16sp" />
|
||||
</LinearLayout>
|
||||
</RelativeLayout>
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/rootBottomLayout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentBottom="true"
|
||||
android:orientation="horizontal">
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
<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"
|
||||
@ -11,6 +11,13 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_below="@+id/view"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_above="@+id/rootBottomLayout"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical">
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/statusLayout"
|
||||
android:layout_width="match_parent"
|
||||
@ -96,8 +103,8 @@
|
||||
android:id="@+id/recyclerView"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginTop="10dp"
|
||||
android:layout_above="@+id/continue_now_btn"
|
||||
android:layout_marginTop="10dp"
|
||||
android:overScrollMode="never"
|
||||
android:scrollbars="none" />
|
||||
|
||||
@ -122,5 +129,16 @@
|
||||
android:textSize="16sp" />
|
||||
</LinearLayout>
|
||||
</RelativeLayout>
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/rootBottomLayout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@color/white"
|
||||
android:layout_alignParentBottom="true"
|
||||
android:orientation="horizontal">
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
<RelativeLayout 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"
|
||||
@ -12,6 +12,13 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_above="@+id/rootBottomLayout"
|
||||
android:layout_below="@+id/view"
|
||||
android:orientation="vertical">
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/statusLayout"
|
||||
android:layout_width="match_parent"
|
||||
@ -52,8 +59,8 @@
|
||||
android:layout_width="44dp"
|
||||
android:layout_height="44dp"
|
||||
android:layout_marginStart="8dp"
|
||||
android:background="@drawable/dr_click_effect_oval_transparent"
|
||||
android:layout_marginEnd="8dp"
|
||||
android:background="@drawable/dr_click_effect_oval_transparent"
|
||||
android:gravity="center">
|
||||
|
||||
<ImageView
|
||||
@ -68,9 +75,9 @@
|
||||
android:id="@+id/addBtn"
|
||||
android:layout_width="44dp"
|
||||
android:layout_height="44dp"
|
||||
android:background="@drawable/dr_click_effect_oval_transparent"
|
||||
android:layout_marginStart="8dp"
|
||||
android:layout_marginEnd="8dp"
|
||||
android:background="@drawable/dr_click_effect_oval_transparent"
|
||||
android:gravity="center">
|
||||
|
||||
<ImageView
|
||||
@ -90,9 +97,9 @@
|
||||
|
||||
<RelativeLayout
|
||||
android:id="@+id/splitListLayout"
|
||||
android:background="@color/bg_color"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@color/bg_color"
|
||||
android:visibility="visible">
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
@ -133,8 +140,8 @@
|
||||
<RelativeLayout
|
||||
android:id="@+id/splitSelectLayout"
|
||||
android:layout_width="match_parent"
|
||||
android:background="@color/bg_color"
|
||||
android:layout_height="match_parent">
|
||||
android:layout_height="match_parent"
|
||||
android:background="@color/bg_color">
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/splitSelectRv"
|
||||
@ -167,5 +174,17 @@
|
||||
android:textSize="16sp" />
|
||||
</LinearLayout>
|
||||
</RelativeLayout>
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/rootBottomLayout"
|
||||
android:layout_width="match_parent"
|
||||
android:background="@color/bg_color"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentBottom="true"
|
||||
android:orientation="horizontal">
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
<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"
|
||||
@ -11,6 +11,13 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_above="@+id/rootBottomLayout"
|
||||
android:layout_below="@+id/view"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical">
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/processingLayout"
|
||||
android:layout_width="match_parent"
|
||||
@ -227,15 +234,18 @@
|
||||
android:layout_margin="16dp"
|
||||
android:gravity="center"
|
||||
android:orientation="vertical">
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="92dp"
|
||||
android:layout_height="110dp">
|
||||
|
||||
<View
|
||||
android:layout_width="82dp"
|
||||
android:layout_height="100dp"
|
||||
android:layout_centerInParent="true"
|
||||
android:rotation="5"
|
||||
android:background="@drawable/dr_placeholder_bg"/>
|
||||
android:background="@drawable/dr_placeholder_bg"
|
||||
android:rotation="5" />
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="82dp"
|
||||
android:layout_height="100dp"
|
||||
@ -358,3 +368,13 @@
|
||||
|
||||
</androidx.core.widget.NestedScrollView>
|
||||
</LinearLayout>
|
||||
<LinearLayout
|
||||
android:id="@+id/rootBottomLayout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentBottom="true"
|
||||
android:orientation="horizontal">
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
<RelativeLayout 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"
|
||||
@ -12,6 +12,13 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_above="@+id/rootBottomLayout"
|
||||
android:layout_below="@+id/view"
|
||||
android:orientation="vertical">
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/statusLayout"
|
||||
android:layout_width="match_parent"
|
||||
@ -74,8 +81,8 @@
|
||||
<RelativeLayout
|
||||
android:id="@+id/splitListLayout"
|
||||
android:layout_width="match_parent"
|
||||
android:background="@color/bg_color"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@color/bg_color"
|
||||
android:visibility="visible">
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
@ -113,3 +120,14 @@
|
||||
</LinearLayout>
|
||||
</RelativeLayout>
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/rootBottomLayout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentBottom="true"
|
||||
android:background="@color/bg_color"
|
||||
android:orientation="horizontal">
|
||||
|
||||
</LinearLayout>
|
||||
</RelativeLayout>
|
||||
|
||||
@ -333,6 +333,15 @@
|
||||
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
<LinearLayout
|
||||
android:id="@+id/rootBottomLayout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@color/white"
|
||||
android:orientation="horizontal">
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<!-- 护眼模式覆盖层 -->
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
@ -11,6 +11,13 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_above="@+id/rootBottomLayout"
|
||||
android:layout_below="@+id/view"
|
||||
android:orientation="vertical">
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/statusLayout"
|
||||
android:layout_width="match_parent"
|
||||
@ -171,4 +178,17 @@
|
||||
android:paddingBottom="32dp" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/rootBottomLayout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@color/white"
|
||||
android:layout_alignParentBottom="true"
|
||||
android:orientation="horizontal">
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
@ -1,14 +1,7 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
|
||||
<style name="Theme.PDFReaderPro" parent="Theme.AppCompat.Light.NoActionBar">
|
||||
<!-- Customize your theme here. -->
|
||||
<item name="colorPrimary">@color/colorPrimary</item>
|
||||
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
|
||||
<item name="colorAccent">@color/colorAccent</item>
|
||||
<item name="android:windowContentOverlay">@null</item>
|
||||
<item name="android:windowBackground">@android:color/white</item>
|
||||
</style>
|
||||
<style name="Theme.PDFReaderPro" parent="Theme.AppCompat.Light.NoActionBar"/>
|
||||
|
||||
<!-- PermissionActivity Dialog theme -->
|
||||
<style name="Theme.PDFReaderPro.Dialog" parent="Theme.PDFReaderPro">
|
||||
|
||||
@ -13,8 +13,8 @@ junit = "4.13.2"
|
||||
junitVersion = "1.3.0"
|
||||
espressoCore = "3.7.0"
|
||||
lifecycleRuntimeKtx = "2.9.2"
|
||||
immersionbar = "3.2.2"
|
||||
immersionbarKtx = "3.2.2"
|
||||
immersionbar = "3.4.0"
|
||||
immersionbarKtx = "3.4.0"
|
||||
pdfboxAndroid = "2.0.27.0"
|
||||
pictureselector = "v3.11.2"
|
||||
room_version = "2.7.2"
|
||||
@ -40,8 +40,8 @@ junit = { group = "junit", name = "junit", version.ref = "junit" }
|
||||
androidx-junit = { group = "androidx.test.ext", name = "junit", version.ref = "junitVersion" }
|
||||
androidx-espresso-core = { group = "androidx.test.espresso", name = "espresso-core", version.ref = "espressoCore" }
|
||||
androidx-lifecycle-runtime-ktx = { group = "androidx.lifecycle", name = "lifecycle-runtime-ktx", version.ref = "lifecycleRuntimeKtx" }
|
||||
immersionbar = { group = "com.geyifeng.immersionbar", name = "immersionbar", version.ref = "immersionbar" }
|
||||
immersionbar-ktx = { group = "com.geyifeng.immersionbar", name = "immersionbar-ktx", version.ref = "immersionbarKtx" }
|
||||
immersionbar = { group = "com.github.OCNYang.ImmersionBar", name = "immersionbar", version.ref = "immersionbar" }
|
||||
immersionbar-ktx = { group = "com.github.OCNYang.ImmersionBar", name = "immersionbar-ktx", version.ref = "immersionbarKtx" }
|
||||
androidx-swiperefreshlayout = { group = "androidx.swiperefreshlayout", name = "swiperefreshlayout", version.ref = "swiperefreshlayout" }
|
||||
androidx-recyclerview = { group = "androidx.recyclerview", name = "recyclerview", version.ref = "recyclerview" }
|
||||
pdfbox-android = { module = "com.tom-roush:pdfbox-android", version.ref = "pdfboxAndroid" }
|
||||
|
||||
Loading…
Reference in New Issue
Block a user