瀏覽代碼

Merge branch 'media-box'

Wayne 5 年之前
父節點
當前提交
eef903190c
共有 100 個文件被更改,包括 1901 次插入28 次删除
  1. 二進制
      app/src/main/jniLibs/arm64-v8a/libkmpdf.so
  2. 二進制
      app/src/main/jniLibs/armeabi-v7a/libkmpdf.so
  3. 二進制
      app/src/main/jniLibs/armeabi/libkmpdf.so
  4. 二進制
      app/src/main/jniLibs/mips/libkmpdf.so
  5. 二進制
      app/src/main/jniLibs/x86/libkmpdf.so
  6. 1 1
      reader/build.gradle
  7. 二進制
      reader/libs/kmpdfkit-1.0.8.aar
  8. 4 0
      reader/src/main/AndroidManifest.xml
  9. 9 0
      reader/src/main/java/com/kdanmobile/reader/Config.kt
  10. 56 16
      reader/src/main/java/com/kdanmobile/reader/ReaderActivity.kt
  11. 68 0
      reader/src/main/java/com/kdanmobile/reader/ReaderViewModel.kt
  12. 146 0
      reader/src/main/java/com/kdanmobile/reader/screen/SignatureActivity.kt
  13. 5 0
      reader/src/main/java/com/kdanmobile/reader/screen/data/ShapeAttribute.kt
  14. 3 0
      reader/src/main/java/com/kdanmobile/reader/screen/data/SignatureAttribute.kt
  15. 11 0
      reader/src/main/java/com/kdanmobile/reader/screen/data/StampAttribute.kt
  16. 3 0
      reader/src/main/java/com/kdanmobile/reader/screen/data/TextBoxAttribute.kt
  17. 62 0
      reader/src/main/java/com/kdanmobile/reader/screen/view/ColorOvalView.kt
  18. 91 0
      reader/src/main/java/com/kdanmobile/reader/screen/view/ColorSelectView.kt
  19. 1 1
      reader/src/main/java/com/kdanmobile/reader/screen/view/ViewerEditTabView.kt
  20. 227 10
      reader/src/main/java/com/kdanmobile/reader/screen/view/ViewerEditView.kt
  21. 66 0
      reader/src/main/java/com/kdanmobile/reader/screen/view/edit/CustomStampAdapter.kt
  22. 19 0
      reader/src/main/java/com/kdanmobile/reader/screen/view/edit/CustomStampType.kt
  23. 5 0
      reader/src/main/java/com/kdanmobile/reader/screen/view/edit/OnSignatureAddListener.kt
  24. 5 0
      reader/src/main/java/com/kdanmobile/reader/screen/view/edit/OnSignatureClickListener.kt
  25. 5 0
      reader/src/main/java/com/kdanmobile/reader/screen/view/edit/OnSignatureRemoveListener.kt
  26. 5 0
      reader/src/main/java/com/kdanmobile/reader/screen/view/edit/OnStampClickListener.kt
  27. 138 0
      reader/src/main/java/com/kdanmobile/reader/screen/view/edit/ShapeTabView.kt
  28. 127 0
      reader/src/main/java/com/kdanmobile/reader/screen/view/edit/SignatureAdapter.kt
  29. 103 0
      reader/src/main/java/com/kdanmobile/reader/screen/view/edit/SignatureDrawView.kt
  30. 18 0
      reader/src/main/java/com/kdanmobile/reader/screen/view/edit/SignatureRecyclerViewItemDecoration.kt
  31. 101 0
      reader/src/main/java/com/kdanmobile/reader/screen/view/edit/SignatureTabView.kt
  32. 147 0
      reader/src/main/java/com/kdanmobile/reader/screen/view/edit/StampTabView.kt
  33. 46 0
      reader/src/main/java/com/kdanmobile/reader/screen/view/edit/StandardStampAdapter.kt
  34. 104 0
      reader/src/main/java/com/kdanmobile/reader/screen/view/edit/TextAttrView.kt
  35. 95 0
      reader/src/main/java/com/kdanmobile/reader/screen/view/edit/TextBoxTabView.kt
  36. 90 0
      reader/src/main/java/com/kdanmobile/reader/screen/view/edit/TextSeekBar.kt
  37. 51 0
      reader/src/main/java/com/kdanmobile/reader/screen/view/edit/TitleButton.kt
  38. 二進制
      reader/src/main/res/drawable-hdpi/ic_chevron_left.png
  39. 二進制
      reader/src/main/res/drawable-hdpi/ic_chevron_right.png
  40. 二進制
      reader/src/main/res/drawable-hdpi/ic_kdan_cloud.png
  41. 二進制
      reader/src/main/res/drawable-hdpi/ic_view_all.png
  42. 二進制
      reader/src/main/res/drawable-hdpi/rectangle_pic_arrow.webp
  43. 二進制
      reader/src/main/res/drawable-hdpi/rectangle_pic_circular.webp
  44. 二進制
      reader/src/main/res/drawable-hdpi/rectangle_pic_line.webp
  45. 二進制
      reader/src/main/res/drawable-hdpi/rectangle_pic_rectangle.webp
  46. 二進制
      reader/src/main/res/drawable-hdpi/signature_ic_add.webp
  47. 二進制
      reader/src/main/res/drawable-hdpi/stamp_blue_left_arrow.webp
  48. 二進制
      reader/src/main/res/drawable-hdpi/stamp_blue_rect.webp
  49. 二進制
      reader/src/main/res/drawable-hdpi/stamp_blue_right_arrow.webp
  50. 二進制
      reader/src/main/res/drawable-hdpi/stamp_green_left_arrow.webp
  51. 二進制
      reader/src/main/res/drawable-hdpi/stamp_green_rect.webp
  52. 二進制
      reader/src/main/res/drawable-hdpi/stamp_green_right_arrow.webp
  53. 二進制
      reader/src/main/res/drawable-hdpi/stamp_red_left_arrow.webp
  54. 二進制
      reader/src/main/res/drawable-hdpi/stamp_red_rect.webp
  55. 二進制
      reader/src/main/res/drawable-hdpi/stamp_red_right_arrow.webp
  56. 二進制
      reader/src/main/res/drawable-mdpi/rectangle_pic_arrow.webp
  57. 二進制
      reader/src/main/res/drawable-mdpi/rectangle_pic_circular.webp
  58. 二進制
      reader/src/main/res/drawable-mdpi/rectangle_pic_line.webp
  59. 二進制
      reader/src/main/res/drawable-mdpi/rectangle_pic_rectangle.webp
  60. 二進制
      reader/src/main/res/drawable-mdpi/signature_ic_add.webp
  61. 二進制
      reader/src/main/res/drawable-xhdpi/ic_chevron_left.png
  62. 二進制
      reader/src/main/res/drawable-xhdpi/ic_chevron_right.png
  63. 二進制
      reader/src/main/res/drawable-xhdpi/ic_kdan_cloud.png
  64. 二進制
      reader/src/main/res/drawable-xhdpi/ic_view_all.png
  65. 二進制
      reader/src/main/res/drawable-xhdpi/rectangle_pic_arrow.webp
  66. 二進制
      reader/src/main/res/drawable-xhdpi/rectangle_pic_circular.webp
  67. 二進制
      reader/src/main/res/drawable-xhdpi/rectangle_pic_line.webp
  68. 二進制
      reader/src/main/res/drawable-xhdpi/rectangle_pic_rectangle.webp
  69. 二進制
      reader/src/main/res/drawable-xhdpi/signature_ic_add.webp
  70. 二進制
      reader/src/main/res/drawable-xhdpi/stamp_blue_left_arrow.webp
  71. 二進制
      reader/src/main/res/drawable-xhdpi/stamp_blue_rect.webp
  72. 二進制
      reader/src/main/res/drawable-xhdpi/stamp_blue_right_arrow.webp
  73. 二進制
      reader/src/main/res/drawable-xhdpi/stamp_green_left_arrow.webp
  74. 二進制
      reader/src/main/res/drawable-xhdpi/stamp_green_rect.webp
  75. 二進制
      reader/src/main/res/drawable-xhdpi/stamp_green_right_arrow.webp
  76. 二進制
      reader/src/main/res/drawable-xhdpi/stamp_red_left_arrow.webp
  77. 二進制
      reader/src/main/res/drawable-xhdpi/stamp_red_rect.webp
  78. 二進制
      reader/src/main/res/drawable-xhdpi/stamp_red_right_arrow.webp
  79. 二進制
      reader/src/main/res/drawable-xxhdpi/ic_chevron_left.png
  80. 二進制
      reader/src/main/res/drawable-xxhdpi/ic_chevron_right.png
  81. 二進制
      reader/src/main/res/drawable-xxhdpi/ic_kdan_cloud.png
  82. 二進制
      reader/src/main/res/drawable-xxhdpi/ic_view_all.png
  83. 二進制
      reader/src/main/res/drawable-xxhdpi/rectangle_pic_arrow.webp
  84. 二進制
      reader/src/main/res/drawable-xxhdpi/rectangle_pic_circular.webp
  85. 二進制
      reader/src/main/res/drawable-xxhdpi/rectangle_pic_line.webp
  86. 二進制
      reader/src/main/res/drawable-xxhdpi/rectangle_pic_rectangle.webp
  87. 二進制
      reader/src/main/res/drawable-xxhdpi/signature_ic_add.webp
  88. 二進制
      reader/src/main/res/drawable-xxxhdpi/rectangle_pic_arrow.webp
  89. 二進制
      reader/src/main/res/drawable-xxxhdpi/rectangle_pic_circular.webp
  90. 二進制
      reader/src/main/res/drawable-xxxhdpi/rectangle_pic_line.webp
  91. 二進制
      reader/src/main/res/drawable-xxxhdpi/rectangle_pic_rectangle.webp
  92. 二進制
      reader/src/main/res/drawable-xxxhdpi/signature_ic_add.webp
  93. 17 0
      reader/src/main/res/drawable/blue_seekbar_progress.xml
  94. 12 0
      reader/src/main/res/drawable/ic_aligncenter.xml
  95. 12 0
      reader/src/main/res/drawable/ic_aligncenter_selected.xml
  96. 12 0
      reader/src/main/res/drawable/ic_alignleft_accent.xml
  97. 12 0
      reader/src/main/res/drawable/ic_alignleft_accent_selected.xml
  98. 12 0
      reader/src/main/res/drawable/ic_alignright.xml
  99. 12 0
      reader/src/main/res/drawable/ic_alignright_selected.xml
  100. 0 0
      reader/src/main/res/drawable/ic_bold.xml

二進制
app/src/main/jniLibs/arm64-v8a/libkmpdf.so


二進制
app/src/main/jniLibs/armeabi-v7a/libkmpdf.so


二進制
app/src/main/jniLibs/armeabi/libkmpdf.so


二進制
app/src/main/jniLibs/mips/libkmpdf.so


二進制
app/src/main/jniLibs/x86/libkmpdf.so


+ 1 - 1
reader/build.gradle

@@ -46,5 +46,5 @@ dependencies {
 
     testImplementation 'junit:junit:4.12'
 
-    api(name: 'kmpdfkit-1.0.8', ext: 'aar')
+    api(name: 'kmpdfkit-1.0.8.1', ext: 'aar')
 }

二進制
reader/libs/kmpdfkit-1.0.8.aar


+ 4 - 0
reader/src/main/AndroidManifest.xml

@@ -9,6 +9,10 @@
         <activity
             android:name=".screen.ViewerSettingActivity"
             android:theme="@style/ReaderActivityNoActionBarNoTitle" />
+        <activity
+            android:name=".screen.SignatureActivity"
+            android:screenOrientation="landscape"
+            android:theme="@style/ReaderActivityNoActionBarNoTitle" />
     </application>
 
 </manifest>

+ 9 - 0
reader/src/main/java/com/kdanmobile/reader/Config.kt

@@ -1,6 +1,15 @@
 package com.kdanmobile.reader
 
+import android.content.Context
+import java.io.File
+
 object Config {
     var PDF_SDK_LICENSE = ""
     var PDF_SDK_RSA_MSG = ""
+
+    const val SIGNATURE_FOLDER = "Signature"
+
+    fun getSignatureDirectoryPath(context: Context) : String {
+        return "${context.filesDir.absolutePath}${File.separator}$SIGNATURE_FOLDER"
+    }
 }

+ 56 - 16
reader/src/main/java/com/kdanmobile/reader/ReaderActivity.kt

@@ -6,7 +6,6 @@ import android.arch.lifecycle.ViewModelProviders
 import android.content.Intent
 import android.net.Uri
 import android.os.Build
-import android.support.v7.app.AppCompatActivity
 import android.os.Bundle
 import android.support.constraint.ConstraintLayout
 import android.support.constraint.ConstraintSet
@@ -17,9 +16,10 @@ import com.kdanmobile.reader.view.AnnotationAttributeView
 import com.kdanmobile.reader.view.AnnotationAttributeWindow
 import android.support.v4.content.ContextCompat
 import android.support.v7.app.AlertDialog
+import android.support.v7.app.AppCompatActivity
+import android.util.DisplayMetrics
 import android.view.Menu
 import android.view.MenuItem
-import android.util.DisplayMetrics
 import android.view.MotionEvent
 import android.view.View
 import android.widget.EditText
@@ -32,11 +32,15 @@ import com.kdanmobile.reader.screen.view.BookmarkView
 import com.kdanmobile.reader.screen.view.OutlineView
 import com.kdanmobile.reader.screen.view.SearchView
 import com.kdanmobile.reader.screen.view.ThumbnailView
+import com.kdanmobile.reader.screen.ViewerSettingActivity
+import com.kdanmobile.reader.screen.view.*
+import com.kdanmobile.reader.screen.view.edit.ShapeTabView
+import com.kdanmobile.reader.screen.view.edit.SignatureTabView
+import com.kdanmobile.reader.screen.view.edit.StampTabView
+import com.kdanmobile.reader.screen.view.edit.TextBoxTabView
 import com.kdanmobile.reader.utils.AnimationUtil
 import com.kdanmobile.reader.utils.DensityUtil
-import com.kdanmobile.reader.screen.ViewerSettingActivity
 import kotlinx.android.synthetic.main.activity_reader.*
-import kotlin.Exception
 
 abstract class ReaderActivity : AppCompatActivity() {
 
@@ -88,6 +92,7 @@ abstract class ReaderActivity : AppCompatActivity() {
         setupLeftToolbar()
         setupRightSideToolbar()
         setupBottomToolbar()
+        setupViewerEditView()
 
         val factory = ReaderViewModelFactory()
         viewModel = ViewModelProviders.of(this, factory).get(ReaderViewModel::class.java)
@@ -110,6 +115,13 @@ abstract class ReaderActivity : AppCompatActivity() {
         viewModel.isPageInBookmarksLiveData.observe(this, Observer(this::onIsPageInBookmarksChanged))
     }
 
+    override fun onBackPressed() {
+        when {
+            viewerEditView.isShown -> viewerEditView.dismiss()
+            else -> super.onBackPressed()
+        }
+    }
+
     override fun onCreateOptionsMenu(menu: Menu?): Boolean {
         menuInflater.inflate(R.menu.reader_more, menu)
         menuItemBookmark = menu?.findItem(R.id.item_reader_bookmark)
@@ -262,9 +274,9 @@ abstract class ReaderActivity : AppCompatActivity() {
                 isHideToolbar = !isHideToolbar
             }
 
-            override fun onMoveToChild(p0: Int) {
-                super.onMoveToChild(p0)
-                viewModel.setPageIndex(p0)
+            override fun onMoveToChild(pageIndex: Int) {
+                super.onMoveToChild(pageIndex)
+                viewModel.setPageIndex(pageIndex)
                 updateThumbnailViewSelectedPage()
             }
 
@@ -451,15 +463,35 @@ abstract class ReaderActivity : AppCompatActivity() {
     }
 
     private fun setupBottomToolbar() {
-        val context = this
-        /** Set buttons color **/
-        val normalColor = R.color.reader_bottom_toolbar_bottom_color_normal
-        val pressColor = R.color.reader_bottom_toolbar_bottom_color_press
-        Utils.setTintDrawableList(context, ib_readerActivity_bottomToolbarPrevious, R.drawable.ic_chevron_left, normalColor, pressColor)
-        Utils.setTintDrawableList(context, ib_readerActivity_bottomToolbarNext, R.drawable.ic_chevron_right, normalColor, pressColor)
-        Utils.setTintDrawableList(context, ib_readerActivity_bottomToolbarBookmark, R.drawable.ic_bookmark_border, normalColor, pressColor)
-        Utils.setTintDrawableList(context, ib_readerActivity_bottomToolbarViewAll, R.drawable.ic_view_all, normalColor, pressColor)
-        Utils.setTintDrawableList(context, ib_readerActivity_bottomToolbarKdanCloud, R.drawable.ic_kdan_cloud, normalColor, pressColor)
+        ib_readerActivity_bottomToolbarMediaBox.setOnClickListener { viewerEditView.show() }
+    }
+
+    private fun setupViewerEditView() {
+        viewerEditView.apply {
+            onShowListener = Runnable { onMediaBoxShown() }
+            onDismissListener = Runnable { onMediaBoxDismissed() }
+            onViewerEditTabAddButtonClickListener = object : ViewerEditView.OnViewerEditTabAddButtonClickListener {
+                override fun onTabTextBoxAddButtonClick(textBoxTabView: TextBoxTabView) {
+                    hideAllToolbars()
+                    viewModel.setTextBoxAttribute(textBoxTabView.getTextBoxAttribute())
+                }
+
+                override fun onTabSignatureAddButtonClick(signatureTabView: SignatureTabView) {
+                    hideAllToolbars()
+                    viewModel.setSignatureAttribute(signatureTabView.getSignatureAttribute())
+                }
+
+                override fun onTabStampAddButtonClick(stampTabView: StampTabView) {
+                    hideAllToolbars()
+                    viewModel.setStampAttribute(stampTabView.getStampAttribute())
+                }
+
+                override fun onTabShapeAddButtonClick(shapeTabView: ShapeTabView) {
+                    hideAllToolbars()
+                    viewModel.setShapeAttribute(shapeTabView.getShapeAttribute())
+                }
+            }
+        }
     }
 
     private fun setupRightToolbar() {
@@ -606,6 +638,14 @@ abstract class ReaderActivity : AppCompatActivity() {
         cloneOriginConstraintSet()
     }
 
+    private fun onMediaBoxShown() {
+        hideAllToolbars()
+    }
+
+    private fun onMediaBoxDismissed() {
+        showAllToolbars()
+    }
+
     private fun onThumbnailClick() {
         val type = LeftToolbarType.THUMBNAIL
         changeLeftToolbarType(type)

+ 68 - 0
reader/src/main/java/com/kdanmobile/reader/ReaderViewModel.kt

@@ -8,8 +8,11 @@ import android.graphics.Color
 import android.graphics.Bitmap
 import android.graphics.RectF
 import android.net.Uri
+import com.kdanmobile.kmpdfkit.annotation.Annotation
 import com.kdanmobile.kmpdfkit.annotation.bean.*
+import com.kdanmobile.kmpdfkit.globaldata.AnnotConfig
 import com.kdanmobile.kmpdfkit.globaldata.Config
+import com.kdanmobile.kmpdfkit.globaldata.KMPDFAnnotEditMode
 import com.kdanmobile.kmpdfkit.manager.KMPDFFactory
 import com.kdanmobile.kmpdfkit.manager.controller.KMPDFDocumentController
 import com.kdanmobile.kmpdfkit.pdfcommon.KMPDFReaderView
@@ -17,6 +20,13 @@ import com.kdanmobile.reader.annotationattribute.AnnotationAttribute
 import com.kdanmobile.reader.annotationattribute.InkAttribute
 import com.kdanmobile.kmpdfkit.pdfcommon.*
 import com.kdanmobile.reader.annotationattribute.Brush
+import com.kdanmobile.kmpdfkit.manager.controller.*
+import com.kdanmobile.kmpdfkit.manager.listener.KMPDFAddAnnotCallback
+import com.kdanmobile.kmpdfkit.pdfcommon.*
+import com.kdanmobile.reader.screen.data.ShapeAttribute
+import com.kdanmobile.reader.screen.data.SignatureAttribute
+import com.kdanmobile.reader.screen.data.StampAttribute
+import com.kdanmobile.reader.screen.data.TextBoxAttribute
 import com.kdanmobile.reader.screen.handler.*
 
 class ReaderViewModel(private val pdfSdkLicense: String, private val pdfSdkRsaMsg: String) : ViewModel() {
@@ -253,6 +263,26 @@ class ReaderViewModel(private val pdfSdkLicense: String, private val pdfSdkRsaMs
         kmpdfFactory?.readerView = readerView
         kmpdfDocumentController = kmpdfFactory?.getController(KMPDFFactory.ControllerType.DOCUMENT) as KMPDFDocumentController
         updateViewDirection()
+
+        kmpdfFactory?.kmpdfAddAnnotCallback = object : KMPDFAddAnnotCallback {
+
+            override fun onSaveAnnotFinished(type: Annotation.Type, result: Boolean, message: String) {
+                println("KMPDFAddAnnotCallback::onSaveAnnotFinished")
+            }
+
+            override fun onAttachAnnotWidgetFinished(type: Annotation.Type) {
+                println("KMPDFAddAnnotCallback::onAttachAnnotWidgetFinished")
+                val mode = when (type) {
+                    Annotation.Type.FREETEXT -> KMPDFAnnotEditMode.Mode.FREETEXT_MODIFY
+                    Annotation.Type.STAMP -> KMPDFAnnotEditMode.Mode.STAMP_MODIFY
+                    Annotation.Type.CIRCLE, Annotation.Type.SQUARE, Annotation.Type.LINE -> KMPDFAnnotEditMode.Mode.SHAPE_MODIFY
+                    else -> KMPDFAnnotEditMode.Mode.NULL
+                }
+                if (mode != KMPDFAnnotEditMode.Mode.NULL) {
+                    kmpdfFactory?.kmpdfAnnotEditMode?.pdfAnnotEditMode = mode
+                }
+            }
+        }
     }
 
     fun setPageIndex(pageIndex: Int){
@@ -305,6 +335,44 @@ class ReaderViewModel(private val pdfSdkLicense: String, private val pdfSdkRsaMs
         }
     }
 
+    fun setTextBoxAttribute(attr: TextBoxAttribute) {
+
+        val kmpdfFreetextAnnotationBean = KMPDFFreetextAnnotationBean("", attr.textColor, attr.textSize, 255, "Courier", attr.isBold, attr.isItalic)
+        kmpdfFactory?.setAnnotationAttribute(kmpdfFreetextAnnotationBean)
+        kmpdfFactory?.setAnnotationEditMode(KMPDFAnnotationBean.AnnotationType.FREETEXT)
+    }
+
+    fun setSignatureAttribute(attr: SignatureAttribute) {
+
+        val kmpdfSignatureAnnotationBean = KMPDFSignatureAnnotationBean("", attr.path, KMPDFSignatureController.OnSignImageCreateListener {
+            println("onSignImageCreated")
+        })
+        kmpdfFactory?.setAnnotationAttribute(kmpdfSignatureAnnotationBean)
+        kmpdfFactory?.setAnnotationEditMode(KMPDFAnnotationBean.AnnotationType.SIGNATURE)
+    }
+
+    fun setStampAttribute(attr: StampAttribute) {
+
+        val kmpdfStampAnnotationBean = when (attr.isStandardStamp()) {
+            true -> KMPDFStampAnnotationBean("", KMPDFStampAnnotationBean.StampType.STANDARD, KMPDFStampAnnotationBean.StandardStamp(attr.resId))
+            false -> KMPDFStampAnnotationBean("", KMPDFStampAnnotationBean.StampType.TEXT, KMPDFStampAnnotationBean.TextStamp(attr.rect, attr.config))
+        }
+        kmpdfFactory?.setAnnotationAttribute(kmpdfStampAnnotationBean)
+        kmpdfFactory?.setAnnotationEditMode(KMPDFAnnotationBean.AnnotationType.STAMP)
+    }
+
+    fun setShapeAttribute(attr: ShapeAttribute) {
+
+        val kmpdfShapeAnnotationBean = when (attr.shapeType) {
+            AnnotConfig.ShapeAnnotationType.LINE -> KMPDFLineAnnotationBean("", attr.lineColor, attr.lineWidth, attr.lineAlpha)
+            AnnotConfig.ShapeAnnotationType.ARROW -> KMPDFArrowAnnotationBean("", attr.lineColor, attr.lineWidth, attr.lineAlpha)
+            AnnotConfig.ShapeAnnotationType.CIRCLE -> KMPDFCircleAnnotationBean("", attr.lineColor, attr.lineWidth, attr.lineAlpha, attr.fillColor, attr.fillAlpha)
+            AnnotConfig.ShapeAnnotationType.SQUARE -> KMPDFSquareAnnotationBean("", attr.lineColor, attr.lineWidth, attr.lineAlpha, attr.fillColor, attr.fillAlpha)
+        }
+        kmpdfFactory?.setAnnotationAttribute(kmpdfShapeAnnotationBean)
+        kmpdfFactory?.setAnnotationEditMode(kmpdfShapeAnnotationBean.type)
+    }
+
     val pdfInfoHandler = object : PdfInfoHandler {
         override fun getOpenPdfFilename(): String {
             return kmpdfFactory?.fileName ?: ""

+ 146 - 0
reader/src/main/java/com/kdanmobile/reader/screen/SignatureActivity.kt

@@ -0,0 +1,146 @@
+package com.kdanmobile.reader.screen
+
+import android.support.v7.app.AppCompatActivity
+import android.os.Bundle
+import android.view.MenuItem
+import android.view.View
+import android.widget.SeekBar
+import com.kdanmobile.reader.R
+import com.kdanmobile.reader.screen.view.ColorSelectView
+import com.kdanmobile.reader.screen.view.edit.SignatureDrawView
+import kotlinx.android.synthetic.main.activity_view_signature_create.*
+import android.graphics.Bitmap
+import android.support.v4.content.ContextCompat
+import com.kdanmobile.reader.Config
+import com.kdanmobile.reader.screen.view.edit.OnSignatureAddListener
+import java.io.File
+import java.io.FileOutputStream
+import java.io.IOException
+
+class SignatureActivity : AppCompatActivity() {
+
+    companion object {
+        var signatureAddNotifyManager: OnSignatureAddListener? = null
+    }
+
+    private var onSignatureAddListener: OnSignatureAddListener? = null
+    private var noSignature = true
+        set(value) {
+            field = value
+            when (field) {
+                true -> {
+                    tv_writeHere.visibility = View.VISIBLE
+                    btn_save_signature.setTextColor(ContextCompat.getColor(baseContext, android.R.color.darker_gray))
+                    btn_save_signature.isClickable = false
+                }
+                false -> {
+                    tv_writeHere.visibility = View.INVISIBLE
+                    btn_save_signature.setTextColor(ContextCompat.getColor(baseContext, android.R.color.white))
+                    btn_save_signature.isClickable = true
+                }
+            }
+        }
+
+    override fun onCreate(savedInstanceState: Bundle?) {
+        super.onCreate(savedInstanceState)
+        setContentView(R.layout.activity_view_signature_create)
+
+        onSignatureAddListener = signatureAddNotifyManager
+        signatureAddNotifyManager = null
+
+        setupToolbar()
+
+        colorChooser_signature.onColorSelectedListener = object : ColorSelectView.OnColorSelectedListener {
+            override fun onColorSelected(color: Int) {
+                drawView.paintColor = color
+            }
+        }
+        drawView.paintColor = colorChooser_signature.getSelectedColor()
+
+        seekBar_signature.onSeekBarChangeListener = object : SeekBar.OnSeekBarChangeListener {
+            override fun onProgressChanged(seekBar: SeekBar?, progress: Int, fromUser: Boolean) {
+                drawView.strokeWidth = seekBar_signature.currentValue.toFloat()
+            }
+
+            override fun onStartTrackingTouch(seekBar: SeekBar?) {}
+
+            override fun onStopTrackingTouch(seekBar: SeekBar?) {
+                drawView.strokeWidth = seekBar_signature.currentValue.toFloat()
+            }
+        }
+        drawView.strokeWidth = seekBar_signature.currentValue.toFloat()
+
+        btn_save_signature.setOnClickListener {
+            if (!noSignature) {
+                val bitmap = drawView.getBitmap()
+
+                val argb = IntArray(bitmap.width * bitmap.height)
+                bitmap.getPixels(argb, 0, bitmap.width, 0, 0, bitmap.width, bitmap.height)
+                var minX = bitmap.width
+                var maxX = 0
+                var minY = bitmap.height
+                var maxY = 0
+                var index = 0
+                for (y in 0 until bitmap.height) {
+                    for (x in 0 until bitmap.width) {
+                        val alpha = (argb[index] shr 24) and 0xff
+                        if (alpha > 10) {
+                            minX = Math.min(x, minX)
+                            maxX = Math.max(x, maxX)
+                            minY = Math.min(y, minY)
+                            maxY = Math.max(y, maxY)
+                        }
+                        index++
+                    }
+                }
+
+                val cropBitmap = Bitmap.createBitmap(bitmap, minX, minY, maxX - minX + 1, maxY - minY + 1)
+
+                val path = Config.getSignatureDirectoryPath(baseContext)
+                val dir = File(path)
+                if (!dir.exists() || !dir.isDirectory) {
+                    dir.mkdirs()
+                }
+                val filename = "$path${File.separator}Signature${System.currentTimeMillis()}.png"
+                try {
+                    val fileOutputStream = FileOutputStream(filename)
+                    cropBitmap.compress(Bitmap.CompressFormat.PNG, 100, fileOutputStream)
+                    fileOutputStream.close()
+                } catch (e: IOException) {
+                    e.printStackTrace()
+                }
+
+                onSignatureAddListener?.onSignatureAdd(filename)
+                finish()
+            }
+        }
+
+        btn_clear_signature.setOnClickListener {
+            drawView.clear()
+        }
+
+        drawView.onSignatureDrawListener = object : SignatureDrawView.OnSignatureDrawListener {
+            override fun onClearSignature() {
+                noSignature = true
+            }
+
+            override fun onStartSignature() {
+                noSignature = false
+            }
+        }
+        noSignature = true
+    }
+
+    private fun setupToolbar() {
+        setSupportActionBar(toolbar_signature)
+        supportActionBar?.setHomeAsUpIndicator(R.drawable.ic_close)
+        supportActionBar?.setDisplayHomeAsUpEnabled(true)
+    }
+
+    override fun onOptionsItemSelected(item: MenuItem?): Boolean {
+        when (item?.itemId) {
+            android.R.id.home -> finish()
+        }
+        return super.onOptionsItemSelected(item)
+    }
+}

+ 5 - 0
reader/src/main/java/com/kdanmobile/reader/screen/data/ShapeAttribute.kt

@@ -0,0 +1,5 @@
+package com.kdanmobile.reader.screen.data
+
+import com.kdanmobile.kmpdfkit.globaldata.AnnotConfig
+
+data class ShapeAttribute(val shapeType: AnnotConfig.ShapeAnnotationType, val lineColor: Int, val lineWidth: Float, val lineAlpha: Int, val fillColor: Int, val fillAlpha: Int)

+ 3 - 0
reader/src/main/java/com/kdanmobile/reader/screen/data/SignatureAttribute.kt

@@ -0,0 +1,3 @@
+package com.kdanmobile.reader.screen.data
+
+data class SignatureAttribute(val path: String)

+ 11 - 0
reader/src/main/java/com/kdanmobile/reader/screen/data/StampAttribute.kt

@@ -0,0 +1,11 @@
+package com.kdanmobile.reader.screen.data
+
+import android.graphics.Rect
+import com.kdanmobile.kmpdfkit.annotation.stamp.StampConfig
+import com.kdanmobile.kmpdfkit.annotation.stamp.TextStampConfig
+
+data class StampAttribute(val resId: StampConfig.STANDARD_STAMP_RES? = null, val rect: Rect? = null, val config: TextStampConfig? = null) {
+    fun isStandardStamp(): Boolean {
+        return null != resId
+    }
+}

+ 3 - 0
reader/src/main/java/com/kdanmobile/reader/screen/data/TextBoxAttribute.kt

@@ -0,0 +1,3 @@
+package com.kdanmobile.reader.screen.data
+
+data class TextBoxAttribute(val isBold: Boolean, val isItalic: Boolean, val textAlignment: Int, val textColor: Int, val textSize: Int)

+ 62 - 0
reader/src/main/java/com/kdanmobile/reader/screen/view/ColorOvalView.kt

@@ -0,0 +1,62 @@
+package com.kdanmobile.reader.screen.view
+
+import android.content.Context
+import android.graphics.drawable.GradientDrawable
+import android.graphics.drawable.LayerDrawable
+import android.graphics.drawable.StateListDrawable
+import android.support.constraint.ConstraintLayout
+import android.support.v4.content.ContextCompat
+import android.util.AttributeSet
+import android.view.LayoutInflater
+import com.kdanmobile.reader.R
+import kotlinx.android.synthetic.main.view_color_oval.view.*
+
+class ColorOvalView : ConstraintLayout {
+
+    var color: Int = android.R.color.black
+        set(value) {
+            field = value
+
+            initColor(value)
+        }
+
+    constructor(context: Context) : super(context) {
+        initView()
+    }
+
+    constructor(context: Context, attrs: AttributeSet) : super(context, attrs) {
+        initAttr(attrs)
+        initView()
+    }
+
+    constructor(context: Context, attrs: AttributeSet, defStyle: Int) : super(context, attrs, defStyle) {
+        initAttr(attrs)
+        initView()
+    }
+
+    private fun initAttr(attributeSet: AttributeSet) {
+        val typedArray = context.theme.obtainStyledAttributes(attributeSet, R.styleable.ColorOvalView, 0, 0)
+        color = typedArray.getColor(R.styleable.ColorOvalView_color, ContextCompat.getColor(context, android.R.color.black))
+    }
+
+    private fun initView() {
+        LayoutInflater.from(context).inflate(R.layout.view_color_oval, this)
+        initColor(color)
+    }
+
+    override fun setSelected(selected: Boolean) {
+        super.setSelected(selected)
+
+        colorOval.isSelected = selected
+        initColor(color)
+    }
+
+    private fun initColor(color: Int) {
+        colorOval?.apply {
+            val stateListDrawable = background.mutate() as StateListDrawable
+            val layerDrawable = stateListDrawable.current.mutate() as LayerDrawable
+            val gradientDrawable = layerDrawable.findDrawableByLayerId(R.id.ovalColor).mutate() as GradientDrawable
+            gradientDrawable.setColor(color)
+        }
+    }
+}

+ 91 - 0
reader/src/main/java/com/kdanmobile/reader/screen/view/ColorSelectView.kt

@@ -0,0 +1,91 @@
+package com.kdanmobile.reader.screen.view
+
+import android.content.Context
+import android.support.constraint.ConstraintLayout
+import android.util.AttributeSet
+import android.view.LayoutInflater
+import android.view.View
+import com.kdanmobile.reader.R
+import kotlinx.android.synthetic.main.view_color_select.view.*
+
+class ColorSelectView : ConstraintLayout {
+
+    interface OnColorSelectedListener {
+        fun onColorSelected(color: Int)
+    }
+
+    var onColorSelectedListener: OnColorSelectedListener? = null
+
+    private var selectedColor: Int = android.R.color.black
+
+    constructor(context: Context) : super(context) {
+        initView()
+    }
+
+    constructor(context: Context, attrs: AttributeSet) : super(context, attrs) {
+        initView()
+    }
+
+    constructor(context: Context, attrs: AttributeSet, defStyle: Int) : super(context, attrs, defStyle) {
+        initView()
+    }
+
+    private fun initView() {
+        LayoutInflater.from(context).inflate(R.layout.view_color_select, this)
+
+        colorSelect_column1.setOnClickListener(this::setColorSelect)
+        colorSelect_column2.setOnClickListener(this::setColorSelect)
+        colorSelect_column3.setOnClickListener(this::setColorSelect)
+        colorSelect_column4.setOnClickListener(this::setColorSelect)
+        colorSelect_column5.setOnClickListener(this::setColorSelect)
+        colorSelect_column6.setOnClickListener(this::setColorSelect)
+        colorSelect_column7.setOnClickListener(this::setColorSelect)
+        colorSelect_column8.setOnClickListener(this::setColorSelect)
+
+        setColorSelect(colorSelect_column1)
+    }
+
+    private fun setColorSelect(view: View) {
+        val colorOvalView = view as ColorOvalView
+
+        colorSelect_column1.isSelected = (colorOvalView == colorSelect_column1)
+        colorSelect_column2.isSelected = (colorOvalView == colorSelect_column2)
+        colorSelect_column3.isSelected = (colorOvalView == colorSelect_column3)
+        colorSelect_column4.isSelected = (colorOvalView == colorSelect_column4)
+        colorSelect_column5.isSelected = (colorOvalView == colorSelect_column5)
+        colorSelect_column6.isSelected = (colorOvalView == colorSelect_column6)
+        colorSelect_column7.isSelected = (colorOvalView == colorSelect_column7)
+        colorSelect_column8.isSelected = (colorOvalView == colorSelect_column8)
+
+        onColorSelectedListener?.onColorSelected(colorOvalView.color)
+        selectedColor = colorOvalView.color
+    }
+
+    fun getSelectedColor() : Int {
+        return selectedColor
+    }
+
+    fun setSelectedColor(color: Int) : Boolean {
+        val columnArray = arrayOf(colorSelect_column1, colorSelect_column2, colorSelect_column3, colorSelect_column4, colorSelect_column5, colorSelect_column6, colorSelect_column7, colorSelect_column8)
+        for (column in columnArray) {
+            if (column.color == color) {
+                setColorSelect(column)
+                return true
+            }
+        }
+        return false
+    }
+
+    fun getColor(index: Int) : Int {
+        return when (index) {
+            0 -> colorSelect_column1.color
+            1 -> colorSelect_column2.color
+            2 -> colorSelect_column3.color
+            3 -> colorSelect_column4.color
+            4 -> colorSelect_column5.color
+            5 -> colorSelect_column6.color
+            6 -> colorSelect_column7.color
+            else -> colorSelect_column8.color
+        }
+    }
+}

+ 1 - 1
reader/src/main/java/com/kdanmobile/reader/screen/view/ViewerEditTabView.kt

@@ -15,7 +15,7 @@ class ViewerEditTabView : ConstraintLayout {
             viewerEdit_tab_textBox?.setOnClickListener(value)
         }
 
-    var onClickListenerTabSignture: OnClickListener? = null
+    var onClickListenerTabSignature: OnClickListener? = null
         set(value) {
             field = value
             viewerEdit_tab_signature?.setOnClickListener(value)

+ 227 - 10
reader/src/main/java/com/kdanmobile/reader/screen/view/ViewerEditView.kt

@@ -1,38 +1,255 @@
 package com.kdanmobile.reader.screen.view
 
+import android.animation.*
 import android.content.Context
+import android.graphics.Color
 import android.support.constraint.ConstraintLayout
+import android.support.v4.content.ContextCompat
 import android.util.AttributeSet
 import android.view.LayoutInflater
 import android.view.View
+import android.view.View.OnClickListener
+import android.view.animation.AccelerateDecelerateInterpolator
+import android.widget.ImageButton
 import com.kdanmobile.reader.R
+import com.kdanmobile.reader.screen.view.edit.*
 import kotlinx.android.synthetic.main.view_viewer_edit.view.*
+import kotlinx.android.synthetic.main.view_viewer_edit_tab.view.*
 
-class ViewerEditView : ConstraintLayout {
+class ViewerEditView @JvmOverloads constructor(
+        context: Context,
+        attrs: AttributeSet? = null,
+        defStyleAttr: Int = 0
+): ConstraintLayout(context, attrs, defStyleAttr) {
 
-    constructor(context: Context) : super(context) {
-        initView()
+    private companion object {
+        const val COLOR_DISMISS = Color.TRANSPARENT
+        val COLOR_SHOW = Color.parseColor("#42000000")
+        const val DEFAULT_DURATION_ANIMATION = 300L
     }
 
-    constructor(context: Context, attrs: AttributeSet) : super(context, attrs) {
-        initView()
+    private enum class ViewerEditTabType {
+        NONE, TEXT_BOX, SIGNATURE, STAMP, SHAPE, FORM
     }
 
-    constructor(context: Context, attrs: AttributeSet, defStyle: Int) : super(context, attrs, defStyle) {
-        initView()
-    }
+    var onShowListener: Runnable? = null
+    var onDismissListener: Runnable? = null
+    var animationDuration = DEFAULT_DURATION_ANIMATION
 
-    private fun initView() {
-        LayoutInflater.from(context).inflate(R.layout.view_viewer_edit, this)
+    private var mediaBoxAnimator: ObjectAnimator? = null
+    private var maskAnimator: ValueAnimator? = null
+    private var tabType = ViewerEditTabType.NONE
+    private var selected: ImageButton? = null
+    var onViewerEditTabAddButtonClickListener: OnViewerEditTabAddButtonClickListener? = null
 
+    init {
+        LayoutInflater.from(context).inflate(R.layout.view_viewer_edit, this)
+        visibility = View.INVISIBLE
         setupTabView()
+
+        /** Set empty listener to prevent dismissing by clicking box **/
+        view_viewEdit_content.setOnClickListener {}
+
+        /** Move media box view to bottom of parent(hide it) **/
+        val size = View.MeasureSpec.makeMeasureSpec(0, View.MeasureSpec.UNSPECIFIED)
+        val v = view_viewEdit_content
+        v.measure(size, size)
+        v.y = v.top + v.measuredHeight.toFloat()
+    }
+
+    fun show() {
+        visibility = View.VISIBLE
+        setOnClickListener { dismiss() }
+        post {
+            showMaskWithAnimation()
+            showMediaBoxWithAnimation()
+        }
+        onShowListener?.run()
+    }
+
+    fun dismiss() {
+        setOnClickListener(null)
+        hideMaskWithAnimation()
+        hideMediaBoxWithAnimation()
+        onDismissListener?.run()
+    }
+
+    private fun showMaskWithAnimation() {
+        maskAnimator?.cancel()
+        val from = maskAnimator?.animatedValue ?: COLOR_DISMISS
+        val to = COLOR_SHOW
+        maskAnimator = ValueAnimator.ofObject(ArgbEvaluator(), from, to).apply {
+            duration = DEFAULT_DURATION_ANIMATION
+            interpolator = AccelerateDecelerateInterpolator()
+            addUpdateListener {
+                setBackgroundColor(it.animatedValue as Int)
+            }
+            start()
+        }
+    }
+
+    private fun hideMaskWithAnimation() {
+        maskAnimator?.cancel()
+        val from = maskAnimator?.animatedValue ?: COLOR_SHOW
+        val to = COLOR_DISMISS
+        maskAnimator = ValueAnimator.ofObject(ArgbEvaluator(), from, to).apply {
+            duration = DEFAULT_DURATION_ANIMATION
+            interpolator = AccelerateDecelerateInterpolator()
+            addUpdateListener {
+                setBackgroundColor(it.animatedValue as Int)
+            }
+            start()
+        }
+    }
+
+    private fun showMediaBoxWithAnimation() {
+        mediaBoxAnimator?.cancel()
+        val v = view_viewEdit_content
+        v.visibility = View.VISIBLE
+        val from = v.y
+        val to = v.top.toFloat()
+        val holder = PropertyValuesHolder.ofFloat("Y", from, to)
+        mediaBoxAnimator = ObjectAnimator.ofPropertyValuesHolder(v, holder).apply {
+            interpolator = AccelerateDecelerateInterpolator()
+            duration = animationDuration
+            addListener(object : AnimatorListenerAdapter() {
+                override fun onAnimationEnd(animation: Animator?) {
+                    super.onAnimationEnd(animation)
+                    removeListener(this)
+                }
+            })
+            start()
+        }
+    }
+
+    private fun hideMediaBoxWithAnimation() {
+        mediaBoxAnimator?.cancel()
+        val v = view_viewEdit_content
+        val from = v.y
+        val to = v.top.toFloat() + v.height
+        val holder = PropertyValuesHolder.ofFloat("Y", from, to)
+        mediaBoxAnimator = ObjectAnimator.ofPropertyValuesHolder(v, holder).apply {
+            interpolator = AccelerateDecelerateInterpolator()
+            duration = animationDuration
+            addListener(object : AnimatorListenerAdapter() {
+                override fun onAnimationEnd(animation: Animator?) {
+                    super.onAnimationEnd(animation)
+                    removeListener(this)
+                    v.visibility = View.INVISIBLE
+                    this@ViewerEditView.visibility = View.GONE
+                }
+            })
+            start()
+        }
     }
 
     private fun setupTabView() {
         viewerEdit_tab.onClickListenerTabTextBox = OnClickListener(this::setupTextBoxView)
+        viewerEdit_tab.onClickListenerTabSignature = OnClickListener(this::setupSignatureView)
+        viewerEdit_tab.onClickListenerTabStamp = OnClickListener(this::setupStampView)
+        viewerEdit_tab.onClickListenerTabShape = OnClickListener(this::setupShapeView)
+        viewerEdit_tab.onClickListenerTabForm = OnClickListener(this::setupFormView)
+
+        setupTextBoxView(viewerEdit_tab_textBox)
+    }
+
+    private fun getButtonDrawable(tabType: ViewerEditTabType, isSelected: Boolean): Int {
+        return when (tabType) {
+            ViewerEditTabType.NONE, ViewerEditTabType.TEXT_BOX ->
+                if (isSelected) R.drawable.ic_textbox_selected else R.drawable.ic_textbox
+            ViewerEditTabType.SIGNATURE ->
+                if (isSelected) R.drawable.ic_signature_selected else R.drawable.ic_signature
+            ViewerEditTabType.STAMP ->
+                if (isSelected) R.drawable.ic_stamp_selected else R.drawable.ic_stamp
+            ViewerEditTabType.SHAPE ->
+                if (isSelected) R.drawable.ic_shape_selected else R.drawable.ic_shape
+            ViewerEditTabType.FORM ->
+                if (isSelected) R.drawable.ic_form_selected else R.drawable.ic_form
+        }
+    }
+
+    private fun setupContent(button: ImageButton, tabType: ViewerEditTabType): Boolean {
+        var changed = false
+        if (this.tabType != tabType) {
+            selected?.setImageDrawable(ContextCompat.getDrawable(context, getButtonDrawable(this.tabType, false)))
+            this.tabType = tabType
+            selected = button
+            button.setImageDrawable(ContextCompat.getDrawable(context, getButtonDrawable(this.tabType, true)))
+
+            viewEdit_layout_tab_content.removeAllViews()
+            changed = true
+        }
+        return changed
     }
 
     private fun setupTextBoxView(view: View) {
+        val changed = setupContent(view as ImageButton, ViewerEditTabType.TEXT_BOX)
+        if (changed) {
+            val textBoxTabView = TextBoxTabView(context)
+            val params = ConstraintLayout.LayoutParams(ConstraintLayout.LayoutParams.MATCH_PARENT, ConstraintLayout.LayoutParams.MATCH_PARENT)
+            viewEdit_layout_tab_content.addView(textBoxTabView, params)
+            textBoxTabView.onTitleButtonClickListener = object: TitleButton.OnTitleButtonClickListener {
+                override fun onTitleButtonClick() {
+                    onViewerEditTabAddButtonClickListener?.onTabTextBoxAddButtonClick(textBoxTabView)
+                }
+            }
+        }
+    }
+
+    private fun setupSignatureView(view: View) {
+        val changed = setupContent(view as ImageButton, ViewerEditTabType.SIGNATURE)
+        if (changed) {
+            val signatureTabView = SignatureTabView(context)
+            val params = ConstraintLayout.LayoutParams(ConstraintLayout.LayoutParams.MATCH_PARENT, ConstraintLayout.LayoutParams.MATCH_PARENT)
+            viewEdit_layout_tab_content.addView(signatureTabView, params)
+            signatureTabView.onTitleButtonClickListener = object: TitleButton.OnTitleButtonClickListener {
+                override fun onTitleButtonClick() {
+                    onViewerEditTabAddButtonClickListener?.onTabSignatureAddButtonClick(signatureTabView)
+                }
+            }
+        }
+    }
+
+    private fun setupStampView(view: View) {
+        val changed = setupContent(view as ImageButton, ViewerEditTabType.STAMP)
+        if (changed) {
+            val stampTabView = StampTabView(context)
+            val params = ConstraintLayout.LayoutParams(ConstraintLayout.LayoutParams.MATCH_PARENT, ConstraintLayout.LayoutParams.MATCH_PARENT)
+            viewEdit_layout_tab_content.addView(stampTabView, params)
+            stampTabView.onTitleButtonClickListener = object: TitleButton.OnTitleButtonClickListener {
+                override fun onTitleButtonClick() {
+                    onViewerEditTabAddButtonClickListener?.onTabStampAddButtonClick(stampTabView)
+                }
+            }
+        }
+    }
+
+    private fun setupShapeView(view: View) {
+        val changed = setupContent(view as ImageButton, ViewerEditTabType.SHAPE)
+        if (changed) {
+            val shapeTabView = ShapeTabView(context)
+            val params = ConstraintLayout.LayoutParams(ConstraintLayout.LayoutParams.MATCH_PARENT, ConstraintLayout.LayoutParams.MATCH_PARENT)
+            viewEdit_layout_tab_content.addView(shapeTabView, params)
+            shapeTabView.onTitleButtonClickListener = object: TitleButton.OnTitleButtonClickListener {
+                override fun onTitleButtonClick() {
+                    onViewerEditTabAddButtonClickListener?.onTabShapeAddButtonClick(shapeTabView)
+                }
+            }
+        }
+    }
+
+    private fun setupFormView(view: View) {
         //TODO implements tab view and add to viewEdit_layout_tab_content
+        val changed = setupContent(view as ImageButton, ViewerEditTabType.FORM)
+        if (changed) {
+            LayoutInflater.from(context).inflate(R.layout.view_viewer_edit_tab, viewEdit_layout_tab_content)
+        }
+    }
+
+    interface OnViewerEditTabAddButtonClickListener {
+        fun onTabTextBoxAddButtonClick(textBoxTabView: TextBoxTabView)
+        fun onTabSignatureAddButtonClick(signatureTabView: SignatureTabView)
+        fun onTabStampAddButtonClick(stampTabView: StampTabView)
+        fun onTabShapeAddButtonClick(shapeTabView: ShapeTabView)
     }
 }

+ 66 - 0
reader/src/main/java/com/kdanmobile/reader/screen/view/edit/CustomStampAdapter.kt

@@ -0,0 +1,66 @@
+package com.kdanmobile.reader.screen.view.edit
+
+import android.content.Context
+import android.support.v7.widget.RecyclerView
+import android.view.LayoutInflater
+import android.view.View
+import android.view.ViewGroup
+import android.widget.ImageView
+import com.kdanmobile.reader.R
+import kotlinx.android.synthetic.main.view_viewer_edit_item_stamp_custom_viewholder.view.*
+
+class CustomStampAdapter(private val context: Context, private val stampTypes: Array<CustomStampType>): RecyclerView.Adapter<CustomStampViewHolder>() {
+
+    private var selectedIndex = 0
+    private var onStampClickListener: OnStampClickListener? = null
+
+    override fun onBindViewHolder(holder: CustomStampViewHolder, position: Int) {
+        val stampType = stampTypes[position]
+//            val stampTextView = holder.kmpdfStampTextView
+//            stampTextView.content = "a"
+//            stampTextView.shape = stampType.shape
+//            stampTextView.bgColor = stampType.backgroundColor
+//            stampTextView.textColor = stampType.textColor
+//            stampTextView.lineColor = stampType.lineColor
+//            stampTextView.lineWidth = 2f
+        holder.view.setOnClickListener {
+            if (position != selectedIndex) {
+                val oldSelectedIndex = selectedIndex
+                selectedIndex = position
+                notifyItemChanged(selectedIndex)
+                notifyItemChanged(oldSelectedIndex)
+                onStampClickListener?.onStampClick(selectedIndex)
+            }
+        }
+        holder.ivStamp.setImageResource(stampType.resourceId)
+        holder.ivSelectedBorder.visibility = when (position == selectedIndex) {
+            true -> View.VISIBLE
+            false -> View.INVISIBLE
+        }
+        holder.ivSelectedArrow.visibility = when (position == selectedIndex) {
+            true -> View.VISIBLE
+            false -> View.INVISIBLE
+        }
+    }
+
+    override fun getItemCount(): Int {
+        return stampTypes.size
+    }
+
+    override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): CustomStampViewHolder {
+        val view = LayoutInflater.from(context).inflate(R.layout.view_viewer_edit_item_stamp_custom_viewholder, null)
+//            val view = ImageView(context)
+        return CustomStampViewHolder(view)
+    }
+
+    fun setOnStampClickListener(onStampClickListener: OnStampClickListener?) {
+        this.onStampClickListener = onStampClickListener
+    }
+}
+
+class CustomStampViewHolder(val view: View): RecyclerView.ViewHolder(view) {
+//        val kmpdfStampTextView: KMPDFStampTextView = view.findViewById(R.id.kmpdfStampTextView)
+    val ivStamp: ImageView = view.iv_stamp
+    val ivSelectedBorder: View = view.iv_selectedBorder
+    val ivSelectedArrow: ImageView = view.iv_selectedArrow
+}

+ 19 - 0
reader/src/main/java/com/kdanmobile/reader/screen/view/edit/CustomStampType.kt

@@ -0,0 +1,19 @@
+package com.kdanmobile.reader.screen.view.edit
+
+import com.kdanmobile.kmpdfkit.annotation.stamp.StampConfig
+import com.kdanmobile.kmpdfkit.annotation.stamp.view.KMPDFStampTextView
+import com.kdanmobile.reader.R
+
+enum class CustomStampType(val shape: KMPDFStampTextView.Shape, val backgroundColor: Int, val textColor: Int, val lineColor: Int, val resourceId: Int) {
+//        GREEN_LEFT_ARROW    (Shape.LEFT_RECT,   Color.parseColor("#ff0000"), StandardColor.text_green,   StandardColor.line_green),
+    GREEN_LEFT_ARROW    (KMPDFStampTextView.Shape.LEFT_RECT,   StampConfig.StandardColor.bg_green, StampConfig.StandardColor.text_green,   StampConfig.StandardColor.line_green,   R.drawable.stamp_green_left_arrow),
+    GREEN_RECTANGLE     (KMPDFStampTextView.Shape.RECT,        StampConfig.StandardColor.bg_green, StampConfig.StandardColor.text_green,   StampConfig.StandardColor.line_green,   R.drawable.stamp_green_rect),
+    GREEN_RIGHT_ARROW   (KMPDFStampTextView.Shape.RIGHT_RECT,  StampConfig.StandardColor.bg_green, StampConfig.StandardColor.text_green,   StampConfig.StandardColor.line_green,   R.drawable.stamp_green_right_arrow),
+    BLUE_LEFT_ARROW     (KMPDFStampTextView.Shape.LEFT_RECT,   StampConfig.StandardColor.bg_blue,  StampConfig.StandardColor.text_blue,    StampConfig.StandardColor.line_blue,    R.drawable.stamp_blue_left_arrow),
+    BLUE_RECTANGLE      (KMPDFStampTextView.Shape.RECT,        StampConfig.StandardColor.bg_blue,  StampConfig.StandardColor.text_blue,    StampConfig.StandardColor.line_blue,    R.drawable.stamp_blue_rect),
+    BLUE_RIGHT_ARROW    (KMPDFStampTextView.Shape.RIGHT_RECT,  StampConfig.StandardColor.bg_blue,  StampConfig.StandardColor.text_blue,    StampConfig.StandardColor.line_blue,    R.drawable.stamp_blue_right_arrow),
+    RED_LEFT_ARROW      (KMPDFStampTextView.Shape.LEFT_RECT,   StampConfig.StandardColor.bg_red,   StampConfig.StandardColor.text_red,     StampConfig.StandardColor.line_red,     R.drawable.stamp_red_left_arrow),
+    RED_RECTANGLE       (KMPDFStampTextView.Shape.RECT,        StampConfig.StandardColor.bg_red,   StampConfig.StandardColor.text_red,     StampConfig.StandardColor.line_red,     R.drawable.stamp_red_rect),
+    RED_RIGHT_ARROW     (KMPDFStampTextView.Shape.RIGHT_RECT,  StampConfig.StandardColor.bg_red,   StampConfig.StandardColor.text_red,     StampConfig.StandardColor.line_red,     R.drawable.stamp_red_right_arrow),
+//        NO_BORDER           (Shape.RECT,        StandardColor.bg_white, StandardColor.text_black,   StandardColor.line_white)
+}

+ 5 - 0
reader/src/main/java/com/kdanmobile/reader/screen/view/edit/OnSignatureAddListener.kt

@@ -0,0 +1,5 @@
+package com.kdanmobile.reader.screen.view.edit
+
+interface OnSignatureAddListener {
+    fun onSignatureAdd(path: String)
+}

+ 5 - 0
reader/src/main/java/com/kdanmobile/reader/screen/view/edit/OnSignatureClickListener.kt

@@ -0,0 +1,5 @@
+package com.kdanmobile.reader.screen.view.edit
+
+interface OnSignatureClickListener {
+    fun onSignatureClick(path: String)
+}

+ 5 - 0
reader/src/main/java/com/kdanmobile/reader/screen/view/edit/OnSignatureRemoveListener.kt

@@ -0,0 +1,5 @@
+package com.kdanmobile.reader.screen.view.edit
+
+interface OnSignatureRemoveListener {
+    fun onSignatureRemove(path: String)
+}

+ 5 - 0
reader/src/main/java/com/kdanmobile/reader/screen/view/edit/OnStampClickListener.kt

@@ -0,0 +1,5 @@
+package com.kdanmobile.reader.screen.view.edit
+
+interface OnStampClickListener {
+    fun onStampClick(index: Int)
+}

+ 138 - 0
reader/src/main/java/com/kdanmobile/reader/screen/view/edit/ShapeTabView.kt

@@ -0,0 +1,138 @@
+package com.kdanmobile.reader.screen.view.edit
+
+import android.content.Context
+import android.graphics.Color
+import android.graphics.PorterDuff
+import android.support.constraint.ConstraintLayout
+import android.support.v4.view.PagerAdapter
+import android.util.AttributeSet
+import android.view.LayoutInflater
+import android.view.View
+import android.view.ViewGroup
+import com.kdanmobile.kmpdfkit.globaldata.AnnotConfig
+import com.kdanmobile.reader.R
+import com.kdanmobile.reader.screen.data.ShapeAttribute
+import kotlinx.android.synthetic.main.view_viewer_edit_item_shape_border.view.*
+import kotlinx.android.synthetic.main.view_viewer_edit_item_shape_fill.view.*
+import kotlinx.android.synthetic.main.view_viewer_edit_tab_shape.view.*
+
+class ShapeTabView : ConstraintLayout {
+
+    var onTitleButtonClickListener: TitleButton.OnTitleButtonClickListener? = null
+        set(value) {
+            field = value
+            titleButton_shape?.onTitleButtonClickListener = field
+        }
+
+    var shapeType = AnnotConfig.ShapeAnnotationType.CIRCLE
+        set(value) {
+            field = value
+
+            btn_circle?.clearColorFilter()
+            btn_square?.clearColorFilter()
+            btn_line?.clearColorFilter()
+            btn_arrow?.clearColorFilter()
+            when (shapeType) {
+                AnnotConfig.ShapeAnnotationType.CIRCLE -> {
+                    btn_circle?.setColorFilter(Color.BLUE, PorterDuff.Mode.SRC_IN)
+                }
+                AnnotConfig.ShapeAnnotationType.SQUARE -> {
+                    btn_square?.setColorFilter(Color.BLUE, PorterDuff.Mode.SRC_IN)
+                }
+                AnnotConfig.ShapeAnnotationType.LINE -> {
+                    btn_line?.setColorFilter(Color.BLUE, PorterDuff.Mode.SRC_IN)
+                }
+                AnnotConfig.ShapeAnnotationType.ARROW -> {
+                    btn_arrow?.setColorFilter(Color.BLUE, PorterDuff.Mode.SRC_IN)
+                }
+            }
+        }
+
+    constructor(context: Context) : super(context) {
+        initView()
+    }
+
+    constructor(context: Context, attrs: AttributeSet) : super(context, attrs) {
+        initView()
+    }
+
+    constructor(context: Context, attrs: AttributeSet, defStyle: Int) : super(context, attrs, defStyle) {
+        initView()
+    }
+
+    private fun initView() {
+        LayoutInflater.from(context).inflate(R.layout.view_viewer_edit_tab_shape, this)
+
+        btn_circle.setOnClickListener { _ ->
+            shapeType = AnnotConfig.ShapeAnnotationType.CIRCLE
+        }
+
+        btn_square.setOnClickListener { _ ->
+            shapeType = AnnotConfig.ShapeAnnotationType.SQUARE
+        }
+
+        btn_line.setOnClickListener { _ ->
+            shapeType = AnnotConfig.ShapeAnnotationType.LINE
+        }
+
+        btn_arrow.setOnClickListener { _ ->
+            shapeType = AnnotConfig.ShapeAnnotationType.ARROW
+        }
+        shapeType = AnnotConfig.ShapeAnnotationType.CIRCLE
+
+        viewPager.adapter = ViewPagerAdapter(context, arrayListOf("Border", "Fill"))
+        tabLayout.setupWithViewPager(viewPager)
+    }
+
+    fun getShapeAttribute() : ShapeAttribute {
+        val lineColor = colorChooser_shapeBorder.getSelectedColor()
+        val lineWidth = seekBar_shapeBorder_thickness.currentValue.toFloat()
+        val lineAlpha = seekBar_shapeBorder_opacity.currentValue
+        val fillColor = colorChooser_shapeFill.getSelectedColor()
+        val fillAlpha = seekBar_shapeFill_opacity.currentValue
+        return ShapeAttribute(shapeType, lineColor, lineWidth, lineAlpha, fillColor, fillAlpha)
+    }
+
+    private inner class ViewPagerAdapter(context: Context, private val tabs: ArrayList<String>) : PagerAdapter() {
+        private val layoutInflater = LayoutInflater.from(context)
+
+        override fun instantiateItem(container: ViewGroup, position: Int): Any {
+            val resourceId = when (position == 0) {
+                true -> R.layout.view_viewer_edit_item_shape_border
+                false -> R.layout.view_viewer_edit_item_shape_fill
+            }
+            val view = layoutInflater.inflate(resourceId, container, false)
+            if (position == 0) {
+                view.seekBar_shapeBorder_opacity.formatter = object : TextSeekBar.SeekBarFormatter {
+                    override fun format(value: Int): String {
+                        return Math.round(value / 2.55).toInt().toString()
+                    }
+                }
+            } else {
+                view.seekBar_shapeFill_opacity.formatter = object : TextSeekBar.SeekBarFormatter {
+                    override fun format(value: Int): String {
+                        return Math.round(value / 2.55).toInt().toString()
+                    }
+                }
+            }
+            container.addView(view)
+            return view
+        }
+
+        override fun destroyItem(container: ViewGroup, position: Int, obj: Any) {
+            container.removeView(obj as View)
+        }
+
+        override fun getCount(): Int {
+            return tabs.size
+        }
+
+        override fun isViewFromObject(view: View, obj: Any): Boolean {
+            return view == obj
+        }
+
+        override fun getPageTitle(position: Int): CharSequence? {
+            return tabs[position]
+        }
+    }
+}

+ 127 - 0
reader/src/main/java/com/kdanmobile/reader/screen/view/edit/SignatureAdapter.kt

@@ -0,0 +1,127 @@
+package com.kdanmobile.reader.screen.view.edit
+
+import android.content.Context
+import android.graphics.Bitmap
+import android.graphics.BitmapFactory
+import android.graphics.Color
+import android.graphics.Matrix
+import android.support.v4.util.LruCache
+import android.support.v7.widget.RecyclerView
+import android.view.LayoutInflater
+import android.view.View
+import android.view.ViewGroup
+import android.widget.ImageView
+import com.kdanmobile.reader.R
+import io.reactivex.Observable
+import io.reactivex.android.schedulers.AndroidSchedulers
+import io.reactivex.disposables.Disposable
+import io.reactivex.schedulers.Schedulers
+import kotlinx.android.synthetic.main.view_viewer_edit_item_signature.view.*
+
+class SignatureAdapter(private val context: Context, private var signaturePaths: ArrayList<String>): RecyclerView.Adapter<SignatureViewHolder>() {
+
+    companion object {
+        val maxMemory = Runtime.getRuntime().maxMemory() / 16
+
+        val mMemoryCache: LruCache<String, Bitmap> = object: LruCache<String, Bitmap>(maxMemory.toInt()) {
+            override fun sizeOf(key: String, value: Bitmap): Int {
+                return value.byteCount
+            }
+        }
+    }
+
+    private var onSignatureClickListener: OnSignatureClickListener? = null
+    private var onSignatureRemoveListener: OnSignatureRemoveListener? = null
+
+    override fun onBindViewHolder(holder: SignatureViewHolder, position: Int) {
+        holder.filename = signaturePaths[position]
+        holder.loadThumbSync()
+        holder.ivSignature.setOnClickListener {
+            onSignatureClickListener?.onSignatureClick(holder.filename)
+        }
+        holder.btnClose.setOnClickListener {
+            onSignatureRemoveListener?.onSignatureRemove(signaturePaths[holder.adapterPosition])
+        }
+    }
+
+    override fun getItemCount(): Int {
+        return signaturePaths.size
+    }
+
+    override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): SignatureViewHolder {
+        val view = LayoutInflater.from(context).inflate(R.layout.view_viewer_edit_item_signature, null)
+        return SignatureViewHolder(view)
+    }
+
+    override fun onViewRecycled(holder: SignatureViewHolder) {
+        super.onViewRecycled(holder)
+        holder.stopLoadThumbSync()
+    }
+
+    fun setOnSignatureClickListener(onSignatureClickListener: OnSignatureClickListener?) {
+        this.onSignatureClickListener = onSignatureClickListener
+    }
+
+    fun setOnSignatureRemoveListener(onSignatureRemoveListener: OnSignatureRemoveListener?) {
+        this.onSignatureRemoveListener = onSignatureRemoveListener
+    }
+}
+
+class SignatureViewHolder(view: View): RecyclerView.ViewHolder(view) {
+    val ivSignature: ImageView = view.iv_signature
+    val btnClose: View = view.btn_close
+    var filename: String = ""
+    private var disposable: Disposable? = null
+
+    fun loadThumbSync() {
+        stopLoadThumbSync()
+
+        disposable = Observable.create<Bitmap> { emitter ->
+            val bitmap: Bitmap
+            val value = SignatureAdapter.mMemoryCache[filename]
+            if (null != value) {
+                bitmap = value
+            } else {
+                bitmap = BitmapFactory.decodeFile(filename)
+                SignatureAdapter.mMemoryCache.put(filename, bitmap)
+            }
+            emitter.onNext(bitmap)
+            emitter.onComplete()
+        }
+                .subscribeOn(Schedulers.io())
+                .observeOn(AndroidSchedulers.mainThread())
+                .subscribe({
+                    ivSignature.setImageBitmap(it)
+                    ivSignature.invalidate()
+                    setScaleTypeFixLeft(ivSignature)
+                }, {
+                    it.printStackTrace()
+                })
+    }
+
+    private fun setScaleTypeFixLeft(imageView: ImageView) {
+
+        val drawableWidth = imageView.drawable.intrinsicWidth
+        val drawableHeight = imageView.drawable.intrinsicHeight
+        if (drawableWidth != 0 && drawableHeight != 0) {
+            val matrix = Matrix()
+            val viewWidth = imageView.width - imageView.paddingLeft - imageView.paddingRight
+            val viewHeight = imageView.height - imageView.paddingTop - imageView.paddingBottom
+            val scaleRatioX = viewWidth.toFloat() / drawableWidth
+            val scaleRatioY = viewHeight.toFloat() / drawableHeight
+            val scaleFactor = Math.min(scaleRatioX, scaleRatioY)
+            matrix.setScale(scaleFactor, scaleFactor)
+            matrix.postTranslate(0f, (viewHeight - drawableHeight * scaleFactor) * 0.5f)
+            imageView.imageMatrix = matrix
+        }
+    }
+
+    internal fun stopLoadThumbSync() {
+        if (null != disposable && !disposable!!.isDisposed) {
+            disposable?.dispose()
+            disposable = null
+            ivSignature.setImageBitmap(null)
+            ivSignature.invalidate()
+        }
+    }
+}

+ 103 - 0
reader/src/main/java/com/kdanmobile/reader/screen/view/edit/SignatureDrawView.kt

@@ -0,0 +1,103 @@
+package com.kdanmobile.reader.screen.view.edit
+
+import android.content.Context
+import android.graphics.Bitmap
+import android.graphics.Canvas
+import android.graphics.Paint
+import android.graphics.Path
+import android.util.AttributeSet
+import android.view.View
+import android.graphics.Paint.Cap
+import android.support.v4.content.ContextCompat
+import android.view.MotionEvent
+
+
+
+class SignatureDrawView : View {
+
+    private lateinit var paint: Paint
+    private var currentPath: Path? = null
+    private val datas = ArrayList<SignaturePathData>()
+    var onSignatureDrawListener: OnSignatureDrawListener? = null
+
+    var paintColor: Int = android.R.color.black
+    var strokeWidth: Float = 10f
+
+    constructor(context: Context) : super(context) {
+        initView()
+    }
+
+    constructor(context: Context, attrs: AttributeSet) : super(context, attrs) {
+        initView()
+    }
+
+    constructor(context: Context, attrs: AttributeSet, defStyle: Int) : super(context, attrs, defStyle) {
+        initView()
+    }
+
+    private fun initView() {
+        paint = Paint()
+        paint.isAntiAlias = true
+        paint.style = Paint.Style.STROKE
+        paint.strokeCap = Cap.ROUND
+        paint.color = ContextCompat.getColor(context, paintColor)
+        paint.strokeWidth = strokeWidth
+    }
+
+    fun clear() {
+        datas.clear()
+        invalidate()
+        onSignatureDrawListener?.onClearSignature()
+    }
+
+    fun getBitmap(): Bitmap {
+        val bitmap = Bitmap.createBitmap(measuredWidth, measuredHeight, Bitmap.Config.ARGB_8888)
+        draw(Canvas(bitmap))
+        return bitmap
+    }
+
+    override fun onDraw(canvas: Canvas?) {
+        super.onDraw(canvas)
+
+        for (data in datas) {
+            paint.color = data.color
+            paint.strokeWidth = data.strokeWidth
+            canvas?.drawPath(data.path, paint)
+        }
+    }
+
+    override fun onTouchEvent(event: MotionEvent?): Boolean {
+        if (null != event) {
+            val actionIndex = event.actionIndex
+            val pointerId = event.getPointerId(actionIndex)
+            if (pointerId == 0) {
+                val x = event.getX(actionIndex)
+                val y = event.getY(actionIndex)
+                when (event.action) {
+                    MotionEvent.ACTION_DOWN -> {
+                        currentPath = Path()
+                        datas.add(SignaturePathData(currentPath!!, paintColor, strokeWidth))
+                        currentPath?.moveTo(x, y)
+                        onSignatureDrawListener?.onStartSignature()
+                    }
+                    MotionEvent.ACTION_MOVE -> {
+                        currentPath?.lineTo(x, y)
+                    }
+                    MotionEvent.ACTION_UP -> {
+                    }
+                }
+                invalidate()
+            }
+        }
+
+        return true
+    }
+
+    interface OnSignatureDrawListener {
+        fun onClearSignature()
+
+        fun onStartSignature()
+    }
+
+    data class SignaturePathData(val path: Path, val color: Int, val strokeWidth: Float)
+}

+ 18 - 0
reader/src/main/java/com/kdanmobile/reader/screen/view/edit/SignatureRecyclerViewItemDecoration.kt

@@ -0,0 +1,18 @@
+package com.kdanmobile.reader.screen.view.edit
+
+import android.graphics.Rect
+import android.view.View
+import android.support.v7.widget.RecyclerView
+
+
+class SignatureRecyclerViewItemDecoration(private val space: Int, private val additionalPadding: Int) : RecyclerView.ItemDecoration() {
+
+    override fun getItemOffsets(outRect: Rect, view: View, parent: RecyclerView, state: RecyclerView.State) {
+        val position = parent.getChildAdapterPosition(view)
+        val childCount = parent.adapter?.itemCount ?: 0
+        outRect.bottom = when (position == childCount - 1) {
+            true -> space + additionalPadding
+            false -> space
+        }
+    }
+}

+ 101 - 0
reader/src/main/java/com/kdanmobile/reader/screen/view/edit/SignatureTabView.kt

@@ -0,0 +1,101 @@
+package com.kdanmobile.reader.screen.view.edit
+
+import android.content.Context
+import android.content.Intent
+import android.support.constraint.ConstraintLayout
+import android.support.v7.widget.GridLayoutManager
+import android.util.AttributeSet
+import android.view.LayoutInflater
+import android.view.View
+import com.kdanmobile.reader.Config
+import com.kdanmobile.reader.R
+import com.kdanmobile.reader.screen.SignatureActivity
+import com.kdanmobile.reader.screen.data.SignatureAttribute
+import kotlinx.android.synthetic.main.view_viewer_edit_tab_signature.view.*
+import java.io.File
+import java.util.*
+import android.support.v7.widget.DividerItemDecoration
+import com.kdanmobile.reader.utils.DensityUtil
+
+
+class SignatureTabView : ConstraintLayout {
+
+    var onTitleButtonClickListener: TitleButton.OnTitleButtonClickListener? = null
+
+    private lateinit var signaturePaths: ArrayList<String>
+    private lateinit var selectedSignaturePath: String
+
+    constructor(context: Context) : super(context) {
+        initView()
+    }
+
+    constructor(context: Context, attrs: AttributeSet) : super(context, attrs) {
+        initView()
+    }
+
+    constructor(context: Context, attrs: AttributeSet, defStyle: Int) : super(context, attrs, defStyle) {
+        initView()
+    }
+
+    private fun initView() {
+        LayoutInflater.from(context).inflate(R.layout.view_viewer_edit_tab_signature, this)
+
+        updateSignaturePaths()
+        updateSignatureMessage()
+
+        recyclerView_signature.layoutManager = GridLayoutManager(context, 1)
+        val adapter = SignatureAdapter(context, signaturePaths)
+        adapter.setOnSignatureClickListener(object : OnSignatureClickListener {
+            override fun onSignatureClick(path: String) {
+                selectedSignaturePath = path
+                onTitleButtonClickListener?.onTitleButtonClick()
+            }
+        })
+        adapter.setOnSignatureRemoveListener(object : OnSignatureRemoveListener {
+            override fun onSignatureRemove(path: String) {
+                val position = signaturePaths.indexOf(path)
+                signaturePaths.removeAt(position)
+                adapter.notifyItemRemoved(position)
+                File(path).delete()
+                updateSignatureMessage()
+            }
+        })
+        btn_add_signature.setOnClickListener {
+            SignatureActivity.signatureAddNotifyManager = object : OnSignatureAddListener {
+                override fun onSignatureAdd(path: String) {
+                    signaturePaths.add(path)
+                    adapter.notifyDataSetChanged()
+                    recyclerView_signature.smoothScrollToPosition(signaturePaths.size - 1)
+                    updateSignatureMessage()
+                }
+            }
+            context.startActivity(Intent(context, SignatureActivity::class.java))
+        }
+        recyclerView_signature.adapter = adapter
+        recyclerView_signature.setHasFixedSize(true)
+
+        recyclerView_signature.addItemDecoration(SignatureRecyclerViewItemDecoration(DensityUtil.dp2px(context, 8f), DensityUtil.dp2px(context, 88f)))
+    }
+
+    fun getSignatureAttribute() : SignatureAttribute {
+        return SignatureAttribute(selectedSignaturePath)
+    }
+
+    private fun updateSignaturePaths() {
+        val path = Config.getSignatureDirectoryPath(context)
+        val array = File(path).list { _, name -> name.toLowerCase(Locale.US).endsWith(".png") }
+        signaturePaths = when (null != array) {
+            true -> array.toCollection(ArrayList())
+            false -> arrayListOf()
+        }
+        signaturePaths.sort()
+        for (i in 0 until signaturePaths.size) {
+            signaturePaths[i] = "$path${File.separator}${signaturePaths[i]}"
+        }
+    }
+
+    private fun updateSignatureMessage() {
+        tv_noSignature.visibility = if (signaturePaths.size == 0) View.VISIBLE else View.INVISIBLE
+        recyclerView_signature.visibility = if (signaturePaths.size == 0) View.INVISIBLE else View.VISIBLE
+    }
+}

+ 147 - 0
reader/src/main/java/com/kdanmobile/reader/screen/view/edit/StampTabView.kt

@@ -0,0 +1,147 @@
+package com.kdanmobile.reader.screen.view.edit
+
+import android.content.Context
+import android.graphics.Rect
+import android.support.constraint.ConstraintLayout
+import android.support.v4.view.PagerAdapter
+import android.support.v7.widget.GridLayoutManager
+import android.support.v7.widget.LinearLayoutManager
+import android.util.AttributeSet
+import android.view.LayoutInflater
+import android.view.View
+import android.view.ViewGroup
+import com.kdanmobile.kmpdfkit.annotation.stamp.StampConfig.STANDARD_STAMP_RES
+import com.kdanmobile.kmpdfkit.annotation.stamp.TextStampConfig
+import com.kdanmobile.kmpdfkit.annotation.stamp.view.KMPDFStampTextView
+import com.kdanmobile.reader.R
+import com.kdanmobile.reader.screen.data.StampAttribute
+import kotlinx.android.synthetic.main.view_viewer_edit_item_stamp_custom.view.*
+import kotlinx.android.synthetic.main.view_viewer_edit_item_stamp_standard.view.*
+import kotlinx.android.synthetic.main.view_viewer_edit_tab_stamp.view.*
+import java.text.SimpleDateFormat
+import java.util.*
+
+class StampTabView : ConstraintLayout {
+
+    private var selectedCustomStampIndex = 0
+    private var selectedStandardStampIndex = 0
+
+    var onTitleButtonClickListener: TitleButton.OnTitleButtonClickListener? = null
+        set(value) {
+            field = value
+            titleButton_stamp?.onTitleButtonClickListener = field
+        }
+
+    constructor(context: Context) : super(context) {
+        initView()
+    }
+
+    constructor(context: Context, attrs: AttributeSet) : super(context, attrs) {
+        initView()
+    }
+
+    constructor(context: Context, attrs: AttributeSet, defStyle: Int) : super(context, attrs, defStyle) {
+        initView()
+    }
+
+    private fun initView() {
+        LayoutInflater.from(context).inflate(R.layout.view_viewer_edit_tab_stamp, this)
+
+        viewPager.adapter = StampViewPagerAdapter(arrayListOf("Custom", "Standard"))
+        tabLayout.setupWithViewPager(viewPager)
+    }
+
+    fun getStampAttribute() : StampAttribute {
+        return when (viewPager.currentItem == 0) {
+            true -> {
+                val stampType = CustomStampType.values()[selectedCustomStampIndex]
+                //  not work?
+                val rect = Rect(0, 0, 100, 100)
+//                val timeText = "${cb_date.text}${if (cb_date.text.isNotEmpty()) " " else ""}${cb_time.text}"
+                val timeText: String
+                //  not work?
+                val timeType = if (cb_time.isChecked) {
+                    if (cb_date.isChecked) {
+                        timeText = "${cb_date.text} ${cb_time.text}"
+                        KMPDFStampTextView.TimeType.TIME_AND_DATE
+                    } else {
+                        timeText = "${cb_time.text}"
+                        KMPDFStampTextView.TimeType.TIME
+                    }
+                } else {
+                    if (cb_date.isChecked) {
+                        timeText = "${cb_date.text}"
+                        KMPDFStampTextView.TimeType.DATE
+                    } else {
+                        timeText = ""
+                        KMPDFStampTextView.TimeType.NULL
+                    }
+                }
+                StampAttribute(rect = rect, config = TextStampConfig(stampType.lineColor, stampType.backgroundColor, stampType.textColor, et_input.text.toString(), timeText, stampType.shape, timeType))
+            }
+            false -> {
+                StampAttribute(STANDARD_STAMP_RES.values()[selectedStandardStampIndex])
+            }
+        }
+    }
+
+    private inner class StampViewPagerAdapter(private val tabs: ArrayList<String>): PagerAdapter() {
+        private val layoutInflater = LayoutInflater.from(context)
+
+        override fun instantiateItem(container: ViewGroup, position: Int): Any {
+            val view = when (position) {
+                0 -> {
+                    val customStampView = layoutInflater.inflate(R.layout.view_viewer_edit_item_stamp_custom, container, false)
+
+                    val date = Date()
+                    customStampView.cb_date.text = SimpleDateFormat("yyyy/MM/dd").format(date)
+                    customStampView.cb_time.text = SimpleDateFormat("hh:mm:ss a").format(date).toLowerCase(Locale.US)
+
+                    val recyclerView = customStampView.recyclerView_shapeCustom
+                    recyclerView.layoutManager = LinearLayoutManager(context, LinearLayoutManager.HORIZONTAL, false)
+                    val adapter = CustomStampAdapter(context, CustomStampType.values())
+                    adapter.setOnStampClickListener(object : OnStampClickListener {
+                        override fun onStampClick(index: Int) {
+                            selectedCustomStampIndex = index
+                        }
+                    })
+                    recyclerView.adapter = adapter
+                    recyclerView.setHasFixedSize(true)
+                    customStampView
+                }
+                else -> {
+                    val standardStampView = layoutInflater.inflate(R.layout.view_viewer_edit_item_stamp_standard, container, false)
+                    val recyclerView = standardStampView.recyclerView_shapeStandard
+                    recyclerView.layoutManager = GridLayoutManager(context, 3)
+                    val adapter = StandardStampAdapter(context, STANDARD_STAMP_RES.values())
+                    adapter.setOnStampClickListener(object : OnStampClickListener {
+                        override fun onStampClick(index: Int) {
+                            selectedStandardStampIndex = index
+                        }
+                    })
+                    recyclerView.adapter = adapter
+                    recyclerView.setHasFixedSize(true)
+                    standardStampView
+                }
+            }
+            container.addView(view)
+            return view
+        }
+
+        override fun destroyItem(container: ViewGroup, position: Int, obj: Any) {
+            container.removeView(obj as View)
+        }
+
+        override fun getCount(): Int {
+            return tabs.size
+        }
+
+        override fun isViewFromObject(view: View, obj: Any): Boolean {
+            return view == obj
+        }
+
+        override fun getPageTitle(position: Int): CharSequence? {
+            return tabs[position]
+        }
+    }
+}

+ 46 - 0
reader/src/main/java/com/kdanmobile/reader/screen/view/edit/StandardStampAdapter.kt

@@ -0,0 +1,46 @@
+package com.kdanmobile.reader.screen.view.edit
+
+import android.content.Context
+import android.support.v7.widget.RecyclerView
+import android.view.ViewGroup
+import android.widget.ImageView
+import com.kdanmobile.kmpdfkit.annotation.stamp.StampConfig
+
+class StandardStampAdapter(private val context: Context, private val resourceIds: Array<StampConfig.STANDARD_STAMP_RES>): RecyclerView.Adapter<StandardStampViewHolder>() {
+
+    private var selectedIndex = 0
+    private var onStampClickListener: OnStampClickListener? = null
+
+    override fun onBindViewHolder(holder: StandardStampViewHolder, position: Int) {
+
+        holder.imageView.setOnClickListener {
+            if (position != selectedIndex) {
+                val oldSelectedIndex = selectedIndex
+                selectedIndex = position
+                notifyItemChanged(selectedIndex)
+                notifyItemChanged(oldSelectedIndex)
+                onStampClickListener?.onStampClick(selectedIndex)
+            }
+        }
+        holder.imageView.setImageResource(resourceIds[position].resId)
+        holder.imageView.setBackgroundColor(when (position == selectedIndex) {
+            true -> 0xff80ffff.toInt()
+            false -> 0xffffffff.toInt()
+        })
+    }
+
+    override fun getItemCount(): Int {
+        return resourceIds.size
+    }
+
+    override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): StandardStampViewHolder {
+        val view = ImageView(context)
+        return StandardStampViewHolder(view)
+    }
+
+    fun setOnStampClickListener(onStampClickListener: OnStampClickListener?) {
+        this.onStampClickListener = onStampClickListener
+    }
+}
+
+class StandardStampViewHolder(val imageView: ImageView): RecyclerView.ViewHolder(imageView)

+ 104 - 0
reader/src/main/java/com/kdanmobile/reader/screen/view/edit/TextAttrView.kt

@@ -0,0 +1,104 @@
+package com.kdanmobile.reader.screen.view.edit
+
+import android.content.Context
+import android.graphics.PorterDuff
+import android.support.constraint.ConstraintLayout
+import android.support.v4.content.ContextCompat
+import android.util.AttributeSet
+import android.view.Gravity
+import android.view.LayoutInflater
+import com.kdanmobile.reader.R
+import kotlinx.android.synthetic.main.view_viewer_edit_item_text_attr.view.*
+
+class TextAttrView : ConstraintLayout {
+
+    interface OnTextAttrClickListener {
+        fun onBoldClick(isSelected: Boolean)
+
+        fun onItalicClick(isSelected: Boolean)
+
+        fun onAlignmentClick(gravity: Int)
+    }
+    var onTextAttrClickListener: OnTextAttrClickListener? = null
+
+    var isTextBold = false
+        set(value) {
+            field = value
+            when (value) {
+                true -> btn_text_bold?.setColorFilter(selectedColor, PorterDuff.Mode.SRC_IN)
+                false -> btn_text_bold?.clearColorFilter()
+            }
+        }
+    var isTextItalic = false
+        set(value) {
+            field = value
+            when (value) {
+                true -> btn_text_italic?.setColorFilter(selectedColor, PorterDuff.Mode.SRC_IN)
+                false -> btn_text_italic?.clearColorFilter()
+            }
+        }
+    var alignment = Gravity.LEFT
+        set(value) {
+            field = value
+            when (value) {
+                Gravity.LEFT -> {
+                    btn_text_align_left.setColorFilter(selectedColor, PorterDuff.Mode.SRC_IN)
+                    btn_text_align_center.clearColorFilter()
+                    btn_text_align_right.clearColorFilter()
+                }
+                Gravity.CENTER -> {
+                    btn_text_align_left.clearColorFilter()
+                    btn_text_align_center.setColorFilter(selectedColor, PorterDuff.Mode.SRC_IN)
+                    btn_text_align_right.clearColorFilter()
+                }
+                Gravity.RIGHT -> {
+                    btn_text_align_left.clearColorFilter()
+                    btn_text_align_center.clearColorFilter()
+                    btn_text_align_right.setColorFilter(selectedColor, PorterDuff.Mode.SRC_IN)
+                }
+            }
+        }
+    private val selectedColor = ContextCompat.getColor(context, R.color.reader_viewer_edit_tab_color_selected)
+
+    constructor(context: Context) : super(context) {
+        initView()
+    }
+
+    constructor(context: Context, attrs: AttributeSet) : super(context, attrs) {
+        initView()
+    }
+
+    constructor(context: Context, attrs: AttributeSet, defStyle: Int) : super(context, attrs, defStyle) {
+        initView()
+    }
+
+    private fun initView() {
+        LayoutInflater.from(context).inflate(R.layout.view_viewer_edit_item_text_attr, this)
+
+        btn_text_bold.setOnClickListener {
+            isTextBold = !isTextBold
+            onTextAttrClickListener?.onBoldClick(isTextBold)
+        }
+        btn_text_italic.setOnClickListener {
+            isTextItalic = !isTextItalic
+            onTextAttrClickListener?.onItalicClick(isTextItalic)
+        }
+
+        btn_text_align_left.setOnClickListener {
+            alignment = Gravity.LEFT
+            onTextAttrClickListener?.onAlignmentClick(alignment)
+        }
+        btn_text_align_center.setOnClickListener {
+            alignment = Gravity.CENTER
+            onTextAttrClickListener?.onAlignmentClick(alignment)
+        }
+        btn_text_align_right.setOnClickListener {
+            alignment = Gravity.RIGHT
+            onTextAttrClickListener?.onAlignmentClick(alignment)
+        }
+
+        isTextBold = false
+        isTextItalic = false
+        alignment = Gravity.LEFT
+    }
+}

+ 95 - 0
reader/src/main/java/com/kdanmobile/reader/screen/view/edit/TextBoxTabView.kt

@@ -0,0 +1,95 @@
+package com.kdanmobile.reader.screen.view.edit
+
+import android.content.Context
+import android.graphics.Typeface
+import android.support.constraint.ConstraintLayout
+import android.util.AttributeSet
+import android.view.LayoutInflater
+import android.widget.SeekBar
+import com.kdanmobile.reader.R
+import com.kdanmobile.reader.screen.data.TextBoxAttribute
+import com.kdanmobile.reader.screen.view.ColorSelectView
+import kotlinx.android.synthetic.main.view_viewer_edit_tab_text_box.view.*
+
+class TextBoxTabView : ConstraintLayout {
+
+    var onTitleButtonClickListener: TitleButton.OnTitleButtonClickListener? = null
+        set(value) {
+            field = value
+            titleButton_textBox?.onTitleButtonClickListener = field
+        }
+
+    constructor(context: Context) : super(context) {
+        initView()
+    }
+
+    constructor(context: Context, attrs: AttributeSet) : super(context, attrs) {
+        initView()
+    }
+
+    constructor(context: Context, attrs: AttributeSet, defStyle: Int) : super(context, attrs, defStyle) {
+        initView()
+    }
+
+    private fun initView() {
+        LayoutInflater.from(context).inflate(R.layout.view_viewer_edit_tab_text_box, this)
+
+        textAttrView_textBox.onTextAttrClickListener = object : TextAttrView.OnTextAttrClickListener {
+
+            private fun getTypeface(): Int {
+                return when (textAttrView_textBox.isTextBold) {
+                    true -> when (textAttrView_textBox.isTextItalic) {
+                        true -> Typeface.BOLD_ITALIC
+                        false -> Typeface.BOLD
+                    }
+                    false -> when (textAttrView_textBox.isTextItalic) {
+                        true -> Typeface.ITALIC
+                        false -> Typeface.NORMAL
+                    }
+                }
+            }
+
+            override fun onBoldClick(isSelected: Boolean) {
+                tv_preview.setTypeface(null, getTypeface())
+            }
+
+            override fun onItalicClick(isSelected: Boolean) {
+                tv_preview.setTypeface(null, getTypeface())
+            }
+
+            override fun onAlignmentClick(gravity: Int) {
+                tv_preview.gravity = gravity
+            }
+        }
+
+        colorChooser_textBox.onColorSelectedListener = object : ColorSelectView.OnColorSelectedListener {
+            override fun onColorSelected(color: Int) {
+                tv_preview.setTextColor(color)
+            }
+        }
+
+        seekBar_textBox_textSize.onSeekBarChangeListener = object : SeekBar.OnSeekBarChangeListener {
+            override fun onProgressChanged(seekBar: SeekBar, progress: Int, fromUser: Boolean) {
+//                tv_preview.textSize = seekBar_textBox_textSize.currentValue.toFloat()
+            }
+
+            override fun onStartTrackingTouch(seekBar: SeekBar) {
+            }
+
+            override fun onStopTrackingTouch(seekBar: SeekBar) {
+//                tv_preview.textSize = seekBar_textBox_textSize.currentValue.toFloat()
+            }
+        }
+
+        tv_preview.setTextColor(colorChooser_textBox.getSelectedColor())
+    }
+
+    fun getTextBoxAttribute(): TextBoxAttribute {
+        val isBold = textAttrView_textBox.isTextBold
+        val isItalic = textAttrView_textBox.isTextItalic
+        val textAlignment = textAttrView_textBox.alignment
+        val textColor = tv_preview.currentTextColor
+        val textSize = seekBar_textBox_textSize.currentValue
+        return TextBoxAttribute(isBold, isItalic, textAlignment, textColor, textSize)
+    }
+}

+ 90 - 0
reader/src/main/java/com/kdanmobile/reader/screen/view/edit/TextSeekBar.kt

@@ -0,0 +1,90 @@
+package com.kdanmobile.reader.screen.view.edit
+
+import android.content.Context
+import android.support.constraint.ConstraintLayout
+import android.util.AttributeSet
+import android.view.LayoutInflater
+import android.widget.SeekBar
+import com.kdanmobile.reader.R
+import kotlinx.android.synthetic.main.view_viewer_edit_item_seekbar.view.*
+
+class TextSeekBar : ConstraintLayout {
+
+    private var title = ""
+    private var unit = ""
+    private var maxValue = 100
+    private var minValue = 0
+    private var initValue = 0
+
+    private val defaultFormatter = object : SeekBarFormatter {
+        override fun format(value: Int): String {
+            return value.toString()
+        }
+    }
+
+    var formatter = defaultFormatter
+        set(value) {
+            field = value
+            tv_seekBarValue?.text = "${formatter.format(currentValue)}$unit"
+        }
+
+    interface SeekBarFormatter {
+        fun format(value: Int): String
+    }
+
+    var currentValue = 0
+        set(value) {
+            field = Math.max(Math.min(value, maxValue), minValue)
+            tv_seekBarValue?.text = "${formatter.format(currentValue)}$unit"
+            seekBar?.progress = field - minValue
+        }
+    var onSeekBarChangeListener: SeekBar.OnSeekBarChangeListener? = null
+
+    constructor(context: Context) : super(context) {
+        initView()
+    }
+
+    constructor(context: Context, attrs: AttributeSet) : super(context, attrs) {
+        initAttr(attrs)
+        initView()
+    }
+
+    constructor(context: Context, attrs: AttributeSet, defStyle: Int) : super(context, attrs, defStyle) {
+        initAttr(attrs)
+        initView()
+    }
+
+    private fun initAttr(attributeSet: AttributeSet) {
+        val typedArray = context.theme.obtainStyledAttributes(attributeSet, R.styleable.TextSeekBar, 0, 0)
+        title = typedArray.getString(R.styleable.TextSeekBar_title) ?: ""
+        unit = typedArray.getString(R.styleable.TextSeekBar_unit) ?: ""
+        maxValue = typedArray.getInteger(R.styleable.TextSeekBar_maxValue, 100)
+        minValue = typedArray.getInteger(R.styleable.TextSeekBar_minValue, 0)
+        if (maxValue < minValue)
+            maxValue = minValue
+        initValue = typedArray.getInteger(R.styleable.TextSeekBar_initValue, 0)
+        initValue = Math.max(Math.min(initValue, maxValue), minValue)
+    }
+
+    private fun initView() {
+        LayoutInflater.from(context).inflate(R.layout.view_viewer_edit_item_seekbar, this)
+
+        tv_seekBarTitle.text = title
+        seekBar.max = maxValue - minValue
+        seekBar.setOnSeekBarChangeListener(object: SeekBar.OnSeekBarChangeListener {
+            override fun onProgressChanged(seekBar: SeekBar, progress: Int, fromUser: Boolean) {
+                currentValue = progress + minValue
+                onSeekBarChangeListener?.onProgressChanged(seekBar, currentValue, fromUser)
+            }
+
+            override fun onStartTrackingTouch(seekBar: SeekBar) {
+                onSeekBarChangeListener?.onStartTrackingTouch(seekBar)
+            }
+
+            override fun onStopTrackingTouch(seekBar: SeekBar) {
+                onSeekBarChangeListener?.onStopTrackingTouch(seekBar)
+            }
+        })
+        currentValue = initValue
+    }
+}

+ 51 - 0
reader/src/main/java/com/kdanmobile/reader/screen/view/edit/TitleButton.kt

@@ -0,0 +1,51 @@
+package com.kdanmobile.reader.screen.view.edit
+
+import android.content.Context
+import android.support.constraint.ConstraintLayout
+import android.util.AttributeSet
+import android.view.LayoutInflater
+import com.kdanmobile.reader.R
+import kotlinx.android.synthetic.main.view_viewer_edit_item_title_button.view.*
+
+class TitleButton : ConstraintLayout {
+
+    private var title = ""
+    private var buttonText = ""
+
+    var onTitleButtonClickListener: OnTitleButtonClickListener? = null
+        set(value) {
+            field = value
+            btn_add?.setOnClickListener{field?.onTitleButtonClick()}
+        }
+
+    constructor(context: Context) : super(context) {
+        initView()
+    }
+
+    constructor(context: Context, attrs: AttributeSet) : super(context, attrs) {
+        initAttr(attrs)
+        initView()
+    }
+
+    constructor(context: Context, attrs: AttributeSet, defStyle: Int) : super(context, attrs, defStyle) {
+        initAttr(attrs)
+        initView()
+    }
+
+    private fun initAttr(attributeSet: AttributeSet) {
+        val typedArray = context.theme.obtainStyledAttributes(attributeSet, R.styleable.TitleButton, 0, 0)
+        title = typedArray.getString(R.styleable.TitleButton_title) ?: ""
+        buttonText = typedArray.getString(R.styleable.TitleButton_buttonText) ?: ""
+    }
+
+    private fun initView() {
+        LayoutInflater.from(context).inflate(R.layout.view_viewer_edit_item_title_button, this)
+
+        tv_title.text = title
+        btn_add.text = buttonText
+    }
+
+    interface OnTitleButtonClickListener {
+        fun onTitleButtonClick()
+    }
+}

二進制
reader/src/main/res/drawable-hdpi/ic_chevron_left.png


二進制
reader/src/main/res/drawable-hdpi/ic_chevron_right.png


二進制
reader/src/main/res/drawable-hdpi/ic_kdan_cloud.png


二進制
reader/src/main/res/drawable-hdpi/ic_view_all.png


二進制
reader/src/main/res/drawable-hdpi/rectangle_pic_arrow.webp


二進制
reader/src/main/res/drawable-hdpi/rectangle_pic_circular.webp


二進制
reader/src/main/res/drawable-hdpi/rectangle_pic_line.webp


二進制
reader/src/main/res/drawable-hdpi/rectangle_pic_rectangle.webp


二進制
reader/src/main/res/drawable-hdpi/signature_ic_add.webp


二進制
reader/src/main/res/drawable-hdpi/stamp_blue_left_arrow.webp


二進制
reader/src/main/res/drawable-hdpi/stamp_blue_rect.webp


二進制
reader/src/main/res/drawable-hdpi/stamp_blue_right_arrow.webp


二進制
reader/src/main/res/drawable-hdpi/stamp_green_left_arrow.webp


二進制
reader/src/main/res/drawable-hdpi/stamp_green_rect.webp


二進制
reader/src/main/res/drawable-hdpi/stamp_green_right_arrow.webp


二進制
reader/src/main/res/drawable-hdpi/stamp_red_left_arrow.webp


二進制
reader/src/main/res/drawable-hdpi/stamp_red_rect.webp


二進制
reader/src/main/res/drawable-hdpi/stamp_red_right_arrow.webp


二進制
reader/src/main/res/drawable-mdpi/rectangle_pic_arrow.webp


二進制
reader/src/main/res/drawable-mdpi/rectangle_pic_circular.webp


二進制
reader/src/main/res/drawable-mdpi/rectangle_pic_line.webp


二進制
reader/src/main/res/drawable-mdpi/rectangle_pic_rectangle.webp


二進制
reader/src/main/res/drawable-mdpi/signature_ic_add.webp


二進制
reader/src/main/res/drawable-xhdpi/ic_chevron_left.png


二進制
reader/src/main/res/drawable-xhdpi/ic_chevron_right.png


二進制
reader/src/main/res/drawable-xhdpi/ic_kdan_cloud.png


二進制
reader/src/main/res/drawable-xhdpi/ic_view_all.png


二進制
reader/src/main/res/drawable-xhdpi/rectangle_pic_arrow.webp


二進制
reader/src/main/res/drawable-xhdpi/rectangle_pic_circular.webp


二進制
reader/src/main/res/drawable-xhdpi/rectangle_pic_line.webp


二進制
reader/src/main/res/drawable-xhdpi/rectangle_pic_rectangle.webp


二進制
reader/src/main/res/drawable-xhdpi/signature_ic_add.webp


二進制
reader/src/main/res/drawable-xhdpi/stamp_blue_left_arrow.webp


二進制
reader/src/main/res/drawable-xhdpi/stamp_blue_rect.webp


二進制
reader/src/main/res/drawable-xhdpi/stamp_blue_right_arrow.webp


二進制
reader/src/main/res/drawable-xhdpi/stamp_green_left_arrow.webp


二進制
reader/src/main/res/drawable-xhdpi/stamp_green_rect.webp


二進制
reader/src/main/res/drawable-xhdpi/stamp_green_right_arrow.webp


二進制
reader/src/main/res/drawable-xhdpi/stamp_red_left_arrow.webp


二進制
reader/src/main/res/drawable-xhdpi/stamp_red_rect.webp


二進制
reader/src/main/res/drawable-xhdpi/stamp_red_right_arrow.webp


二進制
reader/src/main/res/drawable-xxhdpi/ic_chevron_left.png


二進制
reader/src/main/res/drawable-xxhdpi/ic_chevron_right.png


二進制
reader/src/main/res/drawable-xxhdpi/ic_kdan_cloud.png


二進制
reader/src/main/res/drawable-xxhdpi/ic_view_all.png


二進制
reader/src/main/res/drawable-xxhdpi/rectangle_pic_arrow.webp


二進制
reader/src/main/res/drawable-xxhdpi/rectangle_pic_circular.webp


二進制
reader/src/main/res/drawable-xxhdpi/rectangle_pic_line.webp


二進制
reader/src/main/res/drawable-xxhdpi/rectangle_pic_rectangle.webp


二進制
reader/src/main/res/drawable-xxhdpi/signature_ic_add.webp


二進制
reader/src/main/res/drawable-xxxhdpi/rectangle_pic_arrow.webp


二進制
reader/src/main/res/drawable-xxxhdpi/rectangle_pic_circular.webp


二進制
reader/src/main/res/drawable-xxxhdpi/rectangle_pic_line.webp


二進制
reader/src/main/res/drawable-xxxhdpi/rectangle_pic_rectangle.webp


二進制
reader/src/main/res/drawable-xxxhdpi/signature_ic_add.webp


+ 17 - 0
reader/src/main/res/drawable/blue_seekbar_progress.xml

@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="utf-8"?>
+<layer-list xmlns:android="http://schemas.android.com/apk/res/android" >
+    <item android:id="@android:id/background">
+        <shape android:shape="rectangle" >
+            <solid
+                android:color="#30AFFD" />
+        </shape>
+    </item>
+    <item android:id="@android:id/progress">
+        <clip>
+            <shape android:shape="rectangle" >
+                <solid
+                    android:color="#0077fd" />
+            </shape>
+        </clip>
+    </item>
+</layer-list>

+ 12 - 0
reader/src/main/res/drawable/ic_aligncenter.xml

@@ -0,0 +1,12 @@
+<vector xmlns:android="http://schemas.android.com/apk/res/android"
+    android:width="24dp"
+    android:height="24dp"
+    android:viewportWidth="24"
+    android:viewportHeight="24">
+  <path
+      android:pathData="M7,15L7,17L17,17L17,15L7,15ZM3,21L21,21L21,19L3,19L3,21ZM3,13L21,13L21,11L3,11L3,13ZM7,7L7,9L17,9L17,7L7,7ZM3,3L3,5L21,5L21,3L3,3Z"
+      android:strokeWidth="1"
+      android:fillColor="#000000"
+      android:fillType="nonZero"
+      android:strokeColor="#00000000"/>
+</vector>

+ 12 - 0
reader/src/main/res/drawable/ic_aligncenter_selected.xml

@@ -0,0 +1,12 @@
+<vector xmlns:android="http://schemas.android.com/apk/res/android"
+    android:width="24dp"
+    android:height="24dp"
+    android:viewportWidth="24"
+    android:viewportHeight="24">
+  <path
+      android:pathData="M7,15L7,17L17,17L17,15L7,15ZM3,21L21,21L21,19L3,19L3,21ZM3,13L21,13L21,11L3,11L3,13ZM7,7L7,9L17,9L17,7L7,7ZM3,3L3,5L21,5L21,3L3,3Z"
+      android:strokeWidth="1"
+      android:fillColor="#0077FD"
+      android:fillType="nonZero"
+      android:strokeColor="#00000000"/>
+</vector>

+ 12 - 0
reader/src/main/res/drawable/ic_alignleft_accent.xml

@@ -0,0 +1,12 @@
+<vector xmlns:android="http://schemas.android.com/apk/res/android"
+    android:width="24dp"
+    android:height="24dp"
+    android:viewportWidth="24"
+    android:viewportHeight="24">
+  <path
+      android:pathData="M15,15L3,15L3,17L15,17L15,15ZM15,7L3,7L3,9L15,9L15,7ZM3,13L21,13L21,11L3,11L3,13ZM3,21L21,21L21,19L3,19L3,21ZM3,3L3,5L21,5L21,3L3,3Z"
+      android:strokeWidth="1"
+      android:fillColor="#000000"
+      android:fillType="nonZero"
+      android:strokeColor="#00000000"/>
+</vector>

+ 12 - 0
reader/src/main/res/drawable/ic_alignleft_accent_selected.xml

@@ -0,0 +1,12 @@
+<vector xmlns:android="http://schemas.android.com/apk/res/android"
+    android:width="24dp"
+    android:height="24dp"
+    android:viewportWidth="24"
+    android:viewportHeight="24">
+  <path
+      android:pathData="M15,15L3,15L3,17L15,17L15,15ZM15,7L3,7L3,9L15,9L15,7ZM3,13L21,13L21,11L3,11L3,13ZM3,21L21,21L21,19L3,19L3,21ZM3,3L3,5L21,5L21,3L3,3Z"
+      android:strokeWidth="1"
+      android:fillColor="#0077FD"
+      android:fillType="nonZero"
+      android:strokeColor="#00000000"/>
+</vector>

+ 12 - 0
reader/src/main/res/drawable/ic_alignright.xml

@@ -0,0 +1,12 @@
+<vector xmlns:android="http://schemas.android.com/apk/res/android"
+    android:width="24dp"
+    android:height="24dp"
+    android:viewportWidth="24"
+    android:viewportHeight="24">
+  <path
+      android:pathData="M3,21L21,21L21,19L3,19L3,21ZM9,17L21,17L21,15L9,15L9,17ZM3,13L21,13L21,11L3,11L3,13ZM9,9L21,9L21,7L9,7L9,9ZM3,3L3,5L21,5L21,3L3,3Z"
+      android:strokeWidth="1"
+      android:fillColor="#000000"
+      android:fillType="nonZero"
+      android:strokeColor="#00000000"/>
+</vector>

+ 12 - 0
reader/src/main/res/drawable/ic_alignright_selected.xml

@@ -0,0 +1,12 @@
+<vector xmlns:android="http://schemas.android.com/apk/res/android"
+    android:width="24dp"
+    android:height="24dp"
+    android:viewportWidth="24"
+    android:viewportHeight="24">
+  <path
+      android:pathData="M3,21L21,21L21,19L3,19L3,21ZM9,17L21,17L21,15L9,15L9,17ZM3,13L21,13L21,11L3,11L3,13ZM9,9L21,9L21,7L9,7L9,9ZM3,3L3,5L21,5L21,3L3,3Z"
+      android:strokeWidth="1"
+      android:fillColor="#0077FD"
+      android:fillType="nonZero"
+      android:strokeColor="#00000000"/>
+</vector>

+ 0 - 0
reader/src/main/res/drawable/ic_bold.xml


Some files were not shown because too many files changed in this diff