Commit a56a1555 authored by wanglei's avatar wanglei

初始化

parent 26adfff5
...@@ -16,7 +16,7 @@ object AdDialog { ...@@ -16,7 +16,7 @@ object AdDialog {
val dialog = AlertDialog.Builder(this).create() val dialog = AlertDialog.Builder(this).create()
dialog.setView(binding.root) dialog.setView(binding.root)
dialog.setCancelable(false) dialog.setCancelable(false)
dialog.setCanceledOnTouchOutside(false) dialog.setCanceledOnTouchOutside(true)
dialog.show() dialog.show()
val params = dialog.window?.attributes val params = dialog.window?.attributes
......
...@@ -25,6 +25,7 @@ import com.base.pdfreaderallpdfreader.ui.main.getPptDocument ...@@ -25,6 +25,7 @@ import com.base.pdfreaderallpdfreader.ui.main.getPptDocument
import com.base.pdfreaderallpdfreader.ui.main.getWordDocument import com.base.pdfreaderallpdfreader.ui.main.getWordDocument
import com.base.pdfreaderallpdfreader.ui.pdf.PdfActivity import com.base.pdfreaderallpdfreader.ui.pdf.PdfActivity
import com.base.pdfreaderallpdfreader.ui.ppt.PptActivity import com.base.pdfreaderallpdfreader.ui.ppt.PptActivity
import com.base.pdfreaderallpdfreader.ui.view.DocumentDialog.showDocumentHomeMoreDialog
import com.base.pdfreaderallpdfreader.ui.word.WordActivity import com.base.pdfreaderallpdfreader.ui.word.WordActivity
import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.launch import kotlinx.coroutines.launch
...@@ -60,6 +61,9 @@ class DocumentFragment() : Fragment() { ...@@ -60,6 +61,9 @@ class DocumentFragment() : Fragment() {
requireActivity().jumpOtherDocument(item) requireActivity().jumpOtherDocument(item)
} }
} }
adapter?.moreAction = { item: DocumentBean ->
requireContext().showDocumentHomeMoreDialog(item, this)
}
binding.rv.adapter = adapter binding.rv.adapter = adapter
} }
......
...@@ -68,6 +68,28 @@ class HomeFragment : Fragment() { ...@@ -68,6 +68,28 @@ class HomeFragment : Fragment() {
putExtra("doWhat", DO_LOCK_PDF) putExtra("doWhat", DO_LOCK_PDF)
}) })
} }
binding.llWord.setOnClickListener {
startActivity(Intent(requireContext(), DocumentActivity::class.java).apply {
putExtra("initTab", 2)
})
}
binding.llExcel.setOnClickListener {
startActivity(Intent(requireContext(), DocumentActivity::class.java).apply {
putExtra("initTab", 3)
})
}
binding.llPpt.setOnClickListener {
startActivity(Intent(requireContext(), DocumentActivity::class.java).apply {
putExtra("initTab", 4)
})
}
binding.llOther.setOnClickListener {
startActivity(Intent(requireContext(), DocumentActivity::class.java).apply {
putExtra("initTab", 0)
})
}
if (requireContext().checkStorePermission()) { if (requireContext().checkStorePermission()) {
lifecycleScope.launch(Dispatchers.IO) { lifecycleScope.launch(Dispatchers.IO) {
......
...@@ -14,7 +14,7 @@ object DialogView { ...@@ -14,7 +14,7 @@ object DialogView {
val dialog = BottomSheetDialog(this, R.style.BottomSheetDialog) val dialog = BottomSheetDialog(this, R.style.BottomSheetDialog)
val binding = DialogDeleteBinding.inflate(LayoutInflater.from(this)) val binding = DialogDeleteBinding.inflate(LayoutInflater.from(this))
dialog.setContentView(binding.root) dialog.setContentView(binding.root)
dialog.setCanceledOnTouchOutside(false) dialog.setCanceledOnTouchOutside(true)
dialog.show() dialog.show()
......
...@@ -42,7 +42,7 @@ object DocumentDialog { ...@@ -42,7 +42,7 @@ object DocumentDialog {
val dialog = BottomSheetDialog(this, R.style.BottomSheetDialog) val dialog = BottomSheetDialog(this, R.style.BottomSheetDialog)
val binding = DialogDocumentHomeMoreBinding.inflate(LayoutInflater.from(this)) val binding = DialogDocumentHomeMoreBinding.inflate(LayoutInflater.from(this))
dialog.setContentView(binding.root) dialog.setContentView(binding.root)
dialog.setCanceledOnTouchOutside(false) dialog.setCanceledOnTouchOutside(true)
dialog.show() dialog.show()
...@@ -97,7 +97,7 @@ object DocumentDialog { ...@@ -97,7 +97,7 @@ object DocumentDialog {
val dialog = BottomSheetDialog(this, R.style.BottomSheetDialog) val dialog = BottomSheetDialog(this, R.style.BottomSheetDialog)
val binding = DialogDocumentDetailBinding.inflate(LayoutInflater.from(this)) val binding = DialogDocumentDetailBinding.inflate(LayoutInflater.from(this))
dialog.setContentView(binding.root) dialog.setContentView(binding.root)
dialog.setCanceledOnTouchOutside(false) dialog.setCanceledOnTouchOutside(true)
dialog.show() dialog.show()
...@@ -133,7 +133,7 @@ object DocumentDialog { ...@@ -133,7 +133,7 @@ object DocumentDialog {
val dialog = BottomSheetDialog(this, R.style.BottomSheetDialog) val dialog = BottomSheetDialog(this, R.style.BottomSheetDialog)
val binding = DialogDocumentMoreBinding.inflate(LayoutInflater.from(this)) val binding = DialogDocumentMoreBinding.inflate(LayoutInflater.from(this))
dialog.setContentView(binding.root) dialog.setContentView(binding.root)
dialog.setCanceledOnTouchOutside(false) dialog.setCanceledOnTouchOutside(true)
dialog.show() dialog.show()
...@@ -182,7 +182,7 @@ object DocumentDialog { ...@@ -182,7 +182,7 @@ object DocumentDialog {
val dialog = BottomSheetDialog(this, R.style.BottomSheetDialog) val dialog = BottomSheetDialog(this, R.style.BottomSheetDialog)
val binding = DialogPageNumberBinding.inflate(LayoutInflater.from(this)) val binding = DialogPageNumberBinding.inflate(LayoutInflater.from(this))
dialog.setContentView(binding.root) dialog.setContentView(binding.root)
dialog.setCanceledOnTouchOutside(false) dialog.setCanceledOnTouchOutside(true)
val window = dialog.window val window = dialog.window
window?.setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_ADJUST_RESIZE) window?.setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_ADJUST_RESIZE)
......
...@@ -25,7 +25,7 @@ object NameDialog { ...@@ -25,7 +25,7 @@ object NameDialog {
val dialog = BottomSheetDialog(this, R.style.BottomSheetDialog) val dialog = BottomSheetDialog(this, R.style.BottomSheetDialog)
val binding = DialogDocumentRenameBinding.inflate(LayoutInflater.from(this)) val binding = DialogDocumentRenameBinding.inflate(LayoutInflater.from(this))
dialog.setContentView(binding.root) dialog.setContentView(binding.root)
dialog.setCanceledOnTouchOutside(false) dialog.setCanceledOnTouchOutside(true)
val window = dialog.window val window = dialog.window
window?.setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_ADJUST_RESIZE) window?.setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_ADJUST_RESIZE)
......
...@@ -308,7 +308,7 @@ object PdfDialog { ...@@ -308,7 +308,7 @@ object PdfDialog {
val dialog = BottomSheetDialog(this, R.style.BottomSheetDialog) val dialog = BottomSheetDialog(this, R.style.BottomSheetDialog)
val binding = DialogPageNumberBinding.inflate(LayoutInflater.from(this)) val binding = DialogPageNumberBinding.inflate(LayoutInflater.from(this))
dialog.setContentView(binding.root) dialog.setContentView(binding.root)
dialog.setCanceledOnTouchOutside(false) dialog.setCanceledOnTouchOutside(true)
val window = dialog.window val window = dialog.window
window?.setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_ADJUST_RESIZE) window?.setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_ADJUST_RESIZE)
......
...@@ -34,7 +34,7 @@ object PwdDialog { ...@@ -34,7 +34,7 @@ object PwdDialog {
val dialog = BottomSheetDialog(this, R.style.BottomSheetDialog) val dialog = BottomSheetDialog(this, R.style.BottomSheetDialog)
val binding = DialogPdfPasswordBinding.inflate(LayoutInflater.from(this)) val binding = DialogPdfPasswordBinding.inflate(LayoutInflater.from(this))
dialog.setContentView(binding.root) dialog.setContentView(binding.root)
dialog.setCanceledOnTouchOutside(false) dialog.setCanceledOnTouchOutside(true)
val window = dialog.window val window = dialog.window
window?.setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_ADJUST_RESIZE) window?.setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_ADJUST_RESIZE)
......
...@@ -204,14 +204,12 @@ ...@@ -204,14 +204,12 @@
android:orientation="horizontal"> android:orientation="horizontal">
<!-- todo-->
<!-- android:src="@mipmap/delete"-->
<ImageView <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_vertical" android:layout_gravity="center_vertical"
android:layout_marginStart="13dp" android:layout_marginStart="13dp"
android:src="@mipmap/pdf_delete"
tools:ignore="ContentDescription" /> tools:ignore="ContentDescription" />
<TextView <TextView
......
...@@ -134,14 +134,13 @@ ...@@ -134,14 +134,13 @@
android:background="?android:selectableItemBackground" android:background="?android:selectableItemBackground"
android:orientation="horizontal"> android:orientation="horizontal">
<!-- todo-->
<!-- android:src="@mipmap/jump"-->
<ImageView <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_vertical" android:layout_gravity="center_vertical"
android:layout_marginStart="13dp" android:layout_marginStart="13dp"
android:src="@mipmap/pdf_jump"
tools:ignore="ContentDescription" /> tools:ignore="ContentDescription" />
<TextView <TextView
......
...@@ -215,6 +215,7 @@ ...@@ -215,6 +215,7 @@
<LinearLayout <LinearLayout
android:id="@+id/ll_word"
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="108dp" android:layout_height="108dp"
android:layout_marginEnd="6dp" android:layout_marginEnd="6dp"
...@@ -253,6 +254,7 @@ ...@@ -253,6 +254,7 @@
</LinearLayout> </LinearLayout>
<LinearLayout <LinearLayout
android:id="@+id/ll_ppt"
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="108dp" android:layout_height="108dp"
android:layout_marginStart="6dp" android:layout_marginStart="6dp"
...@@ -302,6 +304,7 @@ ...@@ -302,6 +304,7 @@
<LinearLayout <LinearLayout
android:id="@+id/ll_excel"
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="108dp" android:layout_height="108dp"
android:layout_marginEnd="6dp" android:layout_marginEnd="6dp"
...@@ -340,6 +343,7 @@ ...@@ -340,6 +343,7 @@
</LinearLayout> </LinearLayout>
<LinearLayout <LinearLayout
android:id="@+id/ll_other"
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="108dp" android:layout_height="108dp"
android:layout_marginStart="6dp" android:layout_marginStart="6dp"
......
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