瀏覽代碼

Feature: Stamp tab UI

cooperku_kdanmobile 5 年之前
父節點
當前提交
c8364ce7e0
共有 30 個文件被更改,包括 484 次插入4 次删除
  1. 7 4
      reader/src/main/java/com/kdanmobile/reader/screen/view/ViewerEditView.kt
  2. 66 0
      reader/src/main/java/com/kdanmobile/reader/screen/view/edit/CustomStampAdapter.kt
  3. 19 0
      reader/src/main/java/com/kdanmobile/reader/screen/view/edit/CustomStampType.kt
  4. 5 0
      reader/src/main/java/com/kdanmobile/reader/screen/view/edit/OnStampClickListener.kt
  5. 131 0
      reader/src/main/java/com/kdanmobile/reader/screen/view/edit/StampTabView.kt
  6. 45 0
      reader/src/main/java/com/kdanmobile/reader/screen/view/edit/StandardStampAdapter.kt
  7. 二進制
      reader/src/main/res/drawable-hdpi/stamp_blue_left_arrow.webp
  8. 二進制
      reader/src/main/res/drawable-hdpi/stamp_blue_rect.webp
  9. 二進制
      reader/src/main/res/drawable-hdpi/stamp_blue_right_arrow.webp
  10. 二進制
      reader/src/main/res/drawable-hdpi/stamp_green_left_arrow.webp
  11. 二進制
      reader/src/main/res/drawable-hdpi/stamp_green_rect.webp
  12. 二進制
      reader/src/main/res/drawable-hdpi/stamp_green_right_arrow.webp
  13. 二進制
      reader/src/main/res/drawable-hdpi/stamp_red_left_arrow.webp
  14. 二進制
      reader/src/main/res/drawable-hdpi/stamp_red_rect.webp
  15. 二進制
      reader/src/main/res/drawable-hdpi/stamp_red_right_arrow.webp
  16. 二進制
      reader/src/main/res/drawable-xhdpi/stamp_blue_left_arrow.webp
  17. 二進制
      reader/src/main/res/drawable-xhdpi/stamp_blue_rect.webp
  18. 二進制
      reader/src/main/res/drawable-xhdpi/stamp_blue_right_arrow.webp
  19. 二進制
      reader/src/main/res/drawable-xhdpi/stamp_green_left_arrow.webp
  20. 二進制
      reader/src/main/res/drawable-xhdpi/stamp_green_rect.webp
  21. 二進制
      reader/src/main/res/drawable-xhdpi/stamp_green_right_arrow.webp
  22. 二進制
      reader/src/main/res/drawable-xhdpi/stamp_red_left_arrow.webp
  23. 二進制
      reader/src/main/res/drawable-xhdpi/stamp_red_rect.webp
  24. 二進制
      reader/src/main/res/drawable-xhdpi/stamp_red_right_arrow.webp
  25. 10 0
      reader/src/main/res/drawable/shape_selected_stamp_border.xml
  26. 10 0
      reader/src/main/res/drawable/shape_selected_stamp_triangle.xml
  27. 73 0
      reader/src/main/res/layout/view_viewer_edit_item_stamp_custom.xml
  28. 56 0
      reader/src/main/res/layout/view_viewer_edit_item_stamp_custom_viewholder.xml
  29. 19 0
      reader/src/main/res/layout/view_viewer_edit_item_stamp_standard.xml
  30. 43 0
      reader/src/main/res/layout/view_viewer_edit_tab_stamp.xml

+ 7 - 4
reader/src/main/java/com/kdanmobile/reader/screen/view/ViewerEditView.kt

@@ -9,8 +9,10 @@ import android.view.View
 import android.widget.ImageButton
 import com.kdanmobile.reader.R
 import com.kdanmobile.reader.screen.view.edit.ShapeTabView
+import com.kdanmobile.reader.screen.view.edit.StampTabView
 import com.kdanmobile.reader.screen.view.edit.TextBoxTabView
 import kotlinx.android.synthetic.main.view_viewer_edit.view.*
+import kotlinx.android.synthetic.main.view_viewer_edit_tab.view.*
 
 class ViewerEditView : ConstraintLayout {
 
@@ -45,6 +47,8 @@ class ViewerEditView : ConstraintLayout {
         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 {
@@ -77,7 +81,6 @@ class ViewerEditView : ConstraintLayout {
     }
 
     private fun setupTextBoxView(view: View) {
-        //TODO implements tab view and add to viewEdit_layout_tab_content
         val changed = setupContent(view as ImageButton, ViewerEditTabType.TEXT_BOX)
         if (changed) {
             val textBoxTabView = TextBoxTabView(context)
@@ -95,15 +98,15 @@ class ViewerEditView : ConstraintLayout {
     }
 
     private fun setupStampView(view: View) {
-        //TODO implements tab view and add to viewEdit_layout_tab_content
         val changed = setupContent(view as ImageButton, ViewerEditTabType.STAMP)
         if (changed) {
-            LayoutInflater.from(context).inflate(R.layout.view_viewer_edit_tab, viewEdit_layout_tab_content)
+            val stampTabView = StampTabView(context)
+            val params = ConstraintLayout.LayoutParams(ConstraintLayout.LayoutParams.MATCH_PARENT, ConstraintLayout.LayoutParams.MATCH_PARENT)
+            viewEdit_layout_tab_content.addView(stampTabView, params)
         }
     }
 
     private fun setupShapeView(view: View) {
-        //TODO implements tab view and add to viewEdit_layout_tab_content
         val changed = setupContent(view as ImageButton, ViewerEditTabType.SHAPE)
         if (changed) {
             val shapeTabView = ShapeTabView(context)

+ 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/OnStampClickListener.kt

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

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

@@ -0,0 +1,131 @@
+package com.kdanmobile.reader.screen.view.edit
+
+import android.content.Context
+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.reader.R
+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
+
+    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)
+
+        titleButton_stamp.onButtonClickListener = OnClickListener { _ ->
+            println("onButtonClick\tpage = ${viewPager.currentItem}\tselectedIndex = ${when(viewPager.currentItem == 0) { true -> selectedCustomStampIndex; false -> selectedStandardStampIndex }}")
+
+
+        }
+
+        viewPager.adapter = StampViewPagerAdapter(arrayListOf("Custom", "Standard"))
+        tabLayout.setupWithViewPager(viewPager)
+    }
+
+    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 resourceIds = arrayOf(
+                            STANDARD_STAMP_RES.PDF_STAMP_APPROVED.resId,
+                            STANDARD_STAMP_RES.PDF_STAMP_NOTAPPROVED.resId,
+                            STANDARD_STAMP_RES.PDF_STAMP_DRAFT.resId,
+                            STANDARD_STAMP_RES.PDF_STAMP_FINAL.resId,
+                            STANDARD_STAMP_RES.PDF_STAMP_COMPLETED.resId,
+                            STANDARD_STAMP_RES.PDF_STAMP_CONFIDENTIAL.resId,
+                            STANDARD_STAMP_RES.PDF_STAMP_FORPUBLICRELEASE.resId,
+                            STANDARD_STAMP_RES.PDF_STAMP_NOTFORPUBLICRELEASE.resId,
+                            STANDARD_STAMP_RES.PDF_STAMP_FORCOMMENT.resId,
+                            STANDARD_STAMP_RES.PDF_STAMP_VOID.resId,
+                            STANDARD_STAMP_RES.PDF_STAMP_PRELIMINARYRESULTS.resId,
+                            STANDARD_STAMP_RES.PDF_STAMP_INFORMATIONONLY.resId,
+                            STANDARD_STAMP_RES.PDF_STAMP_WITNESS.resId,
+                            STANDARD_STAMP_RES.PDF_STAMP_INITIALHERE.resId,
+                            STANDARD_STAMP_RES.PDF_STAMP_SIGNHERE.resId,
+                            STANDARD_STAMP_RES.PDF_STAMP_REVISED.resId,
+                            STANDARD_STAMP_RES.PDF_STAMP_ACCEPTED.resId,
+                            STANDARD_STAMP_RES.PDF_STAMP_REJECTED.resId,
+                            STANDARD_STAMP_RES.PDF_STAMP_PRIVATEACCEPTED.resId,
+                            STANDARD_STAMP_RES.PDF_STAMP_PRIVATEREJECTED.resId,
+                            STANDARD_STAMP_RES.PDF_STAMP_PRIVATERADIOMARK.resId)
+                    val adapter = StandardStampAdapter(context, resourceIds)
+                    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]
+        }
+    }
+}

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

@@ -0,0 +1,45 @@
+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
+
+class StandardStampAdapter(private val context: Context, private val resourceIds: Array<Int>): 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])
+        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)

二進制
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-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


+ 10 - 0
reader/src/main/res/drawable/shape_selected_stamp_border.xml

@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="utf-8"?>
+<shape xmlns:android="http://schemas.android.com/apk/res/android"
+    android:shape="rectangle">
+
+    <stroke
+        android:width="2dp"
+        android:color="#0077fd" />
+
+    <corners android:radius="4dp"/>
+</shape>

+ 10 - 0
reader/src/main/res/drawable/shape_selected_stamp_triangle.xml

@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="utf-8"?>
+<layer-list xmlns:android="http://schemas.android.com/apk/res/android" >
+    <item>
+        <rotate android:fromDegrees="45" android:toDegrees="45" android:pivotX="-40%" android:pivotY="87%" >
+            <shape android:shape="rectangle" >
+                <solid android:color="#0077fd" />
+            </shape>
+        </rotate>
+    </item>
+</layer-list>

+ 73 - 0
reader/src/main/res/layout/view_viewer_edit_item_stamp_custom.xml

@@ -0,0 +1,73 @@
+<?xml version="1.0" encoding="utf-8"?>
+<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    xmlns:app="http://schemas.android.com/apk/res-auto"
+    android:layout_width="match_parent"
+    android:layout_height="match_parent"
+    android:clickable="true"
+    android:focusable="true"
+    android:background="#FFFFFFFF">
+
+    <android.support.constraint.ConstraintLayout
+        android:id="@+id/editTextView_stampCustom"
+        android:layout_width="match_parent"
+        android:layout_height="64dp"
+        android:orientation="vertical"
+        android:background="#14000000"
+        app:layout_constraintLeft_toLeftOf="parent"
+        app:layout_constraintRight_toRightOf="parent"
+        app:layout_constraintTop_toTopOf="parent" >
+
+        <EditText
+            android:id="@+id/et_input"
+            style="@style/Base.TextAppearance.Widget.AppCompat.Toolbar.Subtitle"
+            android:layout_width="match_parent"
+            android:layout_height="wrap_content"
+            android:layout_marginLeft="16dp"
+            android:layout_marginStart="16dp"
+            android:layout_marginRight="16dp"
+            android:layout_marginEnd="16dp"
+            android:gravity="start"
+            android:textColor="#f5a623"
+            android:textSize="16sp"
+            android:hint="Enter Text"
+            app:layout_constraintTop_toTopOf="parent"
+            app:layout_constraintBottom_toBottomOf="parent" />
+    </android.support.constraint.ConstraintLayout>
+
+    <CheckBox
+        android:id="@+id/cb_date"
+        android:layout_width="0dp"
+        android:layout_height="48dp"
+        android:layout_marginTop="8dp"
+        android:layout_marginBottom="20dp"
+        android:gravity="center_vertical"
+        android:textSize="14sp"
+        android:text="2018/12/31"
+        app:layout_constraintBottom_toTopOf="@+id/recyclerView_shapeCustom"
+        app:layout_constraintLeft_toLeftOf="parent"
+        app:layout_constraintRight_toLeftOf="@+id/cb_time"
+        app:layout_constraintTop_toBottomOf="@+id/editTextView_stampCustom" />
+
+    <CheckBox
+        android:id="@+id/cb_time"
+        android:layout_width="0dp"
+        android:layout_height="48dp"
+        android:layout_marginBottom="12dp"
+        android:gravity="center_vertical"
+        android:textSize="14sp"
+        android:text="10:59:00 am"
+        app:layout_constraintBottom_toTopOf="@+id/recyclerView_shapeCustom"
+        app:layout_constraintLeft_toRightOf="@+id/cb_date"
+        app:layout_constraintRight_toRightOf="parent"
+        app:layout_constraintTop_toBottomOf="@+id/editTextView_stampCustom" />
+
+    <android.support.v7.widget.RecyclerView
+        android:id="@+id/recyclerView_shapeCustom"
+        android:layout_width="match_parent"
+        android:layout_height="0dp"
+        app:layout_constraintBottom_toBottomOf="parent"
+        app:layout_constraintLeft_toLeftOf="parent"
+        app:layout_constraintRight_toRightOf="parent"
+        app:layout_constraintTop_toBottomOf="@+id/cb_date" />
+
+</android.support.constraint.ConstraintLayout>

+ 56 - 0
reader/src/main/res/layout/view_viewer_edit_item_stamp_custom_viewholder.xml

@@ -0,0 +1,56 @@
+<?xml version="1.0" encoding="utf-8"?>
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    xmlns:app="http://schemas.android.com/apk/res-auto"
+    android:layout_width="wrap_content"
+    android:layout_height="wrap_content"
+    android:orientation="horizontal" >
+
+    <!-- Size of ViewHolder in RecyclerView -->
+    <android.support.constraint.ConstraintLayout
+        android:layout_width="64dp"
+        android:layout_height="wrap_content" >
+
+        <!--<com.kdanmobile.kmpdfkit.annotation.stamp.view.KMPDFStampTextView-->
+            <!--android:id="@+id/kmpdfStampTextView"-->
+            <!--android:layout_width="46dp"-->
+            <!--android:layout_height="43dp"-->
+            <!--app:max_TextSize="32"-->
+            <!--app:max_Width="46"-->
+            <!--app:layout_constraintTop_toTopOf="parent"-->
+            <!--app:layout_constraintBottom_toBottomOf="parent"-->
+            <!--app:layout_constraintLeft_toLeftOf="parent"-->
+            <!--app:layout_constraintRight_toRightOf="parent" />-->
+
+        <View
+            android:id="@+id/iv_selectedBorder"
+            android:layout_width="62dp"
+            android:layout_height="54dp"
+            android:foreground="@drawable/shape_selected_stamp_border"
+            app:layout_constraintTop_toTopOf="parent"
+            app:layout_constraintLeft_toLeftOf="parent"
+            app:layout_constraintRight_toRightOf="parent" />
+
+        <ImageView
+            android:id="@+id/iv_stamp"
+            android:layout_width="0dp"
+            android:layout_height="42dp"
+            android:layout_margin="6dp"
+            android:src="@drawable/stamp_green_rect"
+            app:layout_constraintTop_toTopOf="parent"
+            app:layout_constraintBottom_toTopOf="@+id/iv_selectedArrow"
+            app:layout_constraintLeft_toLeftOf="parent"
+            app:layout_constraintRight_toRightOf="parent" />
+
+        <ImageView
+            android:id="@+id/iv_selectedArrow"
+            android:layout_width="12dp"
+            android:layout_height="12dp"
+            android:layout_centerInParent="true"
+            android:src="@drawable/shape_selected_stamp_triangle"
+            app:layout_constraintTop_toBottomOf="@+id/iv_stamp"
+            app:layout_constraintBottom_toBottomOf="parent"
+            app:layout_constraintLeft_toLeftOf="parent"
+            app:layout_constraintRight_toRightOf="parent" />
+    </android.support.constraint.ConstraintLayout>
+
+</LinearLayout>

+ 19 - 0
reader/src/main/res/layout/view_viewer_edit_item_stamp_standard.xml

@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="utf-8"?>
+<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    xmlns:app="http://schemas.android.com/apk/res-auto"
+    android:layout_width="match_parent"
+    android:layout_height="match_parent"
+    android:clickable="true"
+    android:focusable="true"
+    android:background="#FFFFFFFF">
+
+    <android.support.v7.widget.RecyclerView
+        android:id="@+id/recyclerView_shapeStandard"
+        android:layout_width="match_parent"
+        android:layout_height="0dp"
+        app:layout_constraintLeft_toLeftOf="parent"
+        app:layout_constraintRight_toRightOf="parent"
+        app:layout_constraintTop_toTopOf="parent"
+        app:layout_constraintBottom_toBottomOf="parent"/>
+
+</android.support.constraint.ConstraintLayout>

+ 43 - 0
reader/src/main/res/layout/view_viewer_edit_tab_stamp.xml

@@ -0,0 +1,43 @@
+<?xml version="1.0" encoding="utf-8"?>
+<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    xmlns:app="http://schemas.android.com/apk/res-auto"
+    android:layout_width="match_parent"
+    android:layout_height="match_parent"
+    android:clickable="true"
+    android:focusable="true"
+    android:background="#FFFFFFFF">
+
+    <com.kdanmobile.reader.screen.view.edit.TitleButton
+        android:layout_width="match_parent"
+        android:layout_height="56dp"
+        android:id="@+id/titleButton_stamp"
+        app:title="Stamp"
+        app:buttonText="ADD"
+        app:layout_constraintLeft_toLeftOf="parent"
+        app:layout_constraintRight_toRightOf="parent"
+        app:layout_constraintTop_toTopOf="parent"
+        app:layout_constraintBottom_toTopOf="@+id/tabLayout" />
+
+    <android.support.design.widget.TabLayout
+        android:id="@+id/tabLayout"
+        android:layout_width="match_parent"
+        android:layout_height="48dp"
+        app:tabIndicatorHeight="2dp"
+        app:tabIndicatorColor="#0077fd"
+        app:tabSelectedTextColor="#0077fd"
+        app:tabTextColor="#99000000"
+        app:layout_constraintLeft_toLeftOf="parent"
+        app:layout_constraintRight_toRightOf="parent"
+        app:layout_constraintTop_toBottomOf="@+id/titleButton_stamp"
+        app:layout_constraintBottom_toTopOf="@+id/viewPager" />
+
+    <android.support.v4.view.ViewPager
+        android:id="@+id/viewPager"
+        android:layout_width="match_parent"
+        android:layout_height="0dp"
+        app:layout_constraintLeft_toLeftOf="parent"
+        app:layout_constraintRight_toRightOf="parent"
+        app:layout_constraintTop_toBottomOf="@+id/tabLayout"
+        app:layout_constraintBottom_toBottomOf="parent" />
+
+</android.support.constraint.ConstraintLayout>