feat: pdf viewer
This commit is contained in:
86
module_base/src/main/res/layout/activity_pdf_preview.xml
Normal file
86
module_base/src/main/res/layout/activity_pdf_preview.xml
Normal file
@@ -0,0 +1,86 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<layout xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
|
||||
<data>
|
||||
<variable
|
||||
name="viewModel"
|
||||
type="com.lukouguoji.module_base.impl.EmptyViewModel" />
|
||||
</data>
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@color/black">
|
||||
|
||||
<!-- PDF视图 -->
|
||||
<com.github.barteksc.pdfviewer.PDFView
|
||||
android:id="@+id/pdfView"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent" />
|
||||
|
||||
<!-- Loading蒙层 (下载时显示) -->
|
||||
<RelativeLayout
|
||||
android:id="@+id/loadingLayout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@color/black_tran50"
|
||||
android:visibility="gone">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_centerInParent="true"
|
||||
android:background="@color/black_tran70"
|
||||
android:gravity="center"
|
||||
android:orientation="vertical"
|
||||
android:padding="20dp">
|
||||
|
||||
<ProgressBar
|
||||
android:layout_width="50dp"
|
||||
android:layout_height="50dp"
|
||||
android:indeterminateTint="@color/white" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvLoadingTip"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="10dp"
|
||||
android:text="正在加载PDF..."
|
||||
android:textColor="@color/white"
|
||||
android:textSize="14sp" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
<!-- 页码指示器 -->
|
||||
<TextView
|
||||
android:id="@+id/tvPageIndicator"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentBottom="true"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:layout_marginBottom="30dp"
|
||||
android:background="@color/black_tran50"
|
||||
android:paddingLeft="15dp"
|
||||
android:paddingTop="5dp"
|
||||
android:paddingRight="15dp"
|
||||
android:paddingBottom="5dp"
|
||||
android:text="1 / 10"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="16sp" />
|
||||
|
||||
<!-- 关闭按钮 -->
|
||||
<androidx.appcompat.widget.AppCompatImageView
|
||||
android:id="@+id/ivClose"
|
||||
android:layout_width="50dp"
|
||||
android:layout_height="50dp"
|
||||
android:layout_alignParentRight="true"
|
||||
android:layout_marginTop="60dp"
|
||||
android:layout_marginRight="30dp"
|
||||
android:background="@color/black_tran30"
|
||||
android:padding="4dp"
|
||||
android:src="@drawable/img_close" />
|
||||
|
||||
</RelativeLayout>
|
||||
</layout>
|
||||
@@ -41,4 +41,9 @@
|
||||
|
||||
<color name="bottom_tool_tips_text_color">#797979</color>
|
||||
|
||||
<!-- 半透明黑色 (用于PDF预览) -->
|
||||
<color name="black_tran30">#4D000000</color> <!-- 30%透明度 -->
|
||||
<color name="black_tran50">#80000000</color> <!-- 50%透明度 -->
|
||||
<color name="black_tran70">#B3000000</color> <!-- 70%透明度 -->
|
||||
|
||||
</resources>
|
||||
Reference in New Issue
Block a user