Parcourir la source

Change stamp input text style

Wayne il y a 5 ans
Parent
commit
9b9e4a76a3

+ 1 - 1
reader/src/main/java/com/kdanmobile/reader/screen/reader/mediabox/stamp/StampTabView.kt

@@ -78,7 +78,7 @@ class StampTabView : ConstraintLayout {
                         KMPDFStampTextView.TimeType.NULL
                     }
                 }
-                StampAttribute(rect = rect, config = TextStampConfig(stampType.lineColor, stampType.backgroundColor, stampType.textColor, et_input.text.toString(), timeText, stampType.shape, timeType))
+                StampAttribute(rect = rect, config = TextStampConfig(stampType.lineColor, stampType.backgroundColor, stampType.textColor, et_mediaBoxItemStampCustom_text.text.toString(), timeText, stampType.shape, timeType))
             }
             false -> {
                 StampAttribute(STANDARD_STAMP_RES.values()[selectedStandardStampIndex])

+ 8 - 0
reader/src/main/res/drawable/bg_media_box_stamp_custom_edittext.xml

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

+ 18 - 29
reader/src/main/res/layout/view_media_box_item_stamp_custom.xml

@@ -7,32 +7,21 @@
     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"
+    <EditText
+        android:id="@+id/et_mediaBoxItemStampCustom_text"
+        android:background="@drawable/bg_media_box_stamp_custom_edittext"
+        android:textSize="16sp"
+        android:singleLine="true"
+        android:maxLines="1"
+        android:layout_margin="16dp"
+        android:padding="8dp"
+        android:hint="@string/mediaBox_stamp_hintEditText"
         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="@string/mediaBox_stamp_hintEditText"
-            app:layout_constraintTop_toTopOf="parent"
-            app:layout_constraintBottom_toBottomOf="parent" />
-    </android.support.constraint.ConstraintLayout>
+        app:layout_constraintTop_toTopOf="parent"
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content"
+        />
 
     <CheckBox
         android:id="@+id/cb_date"
@@ -43,9 +32,9 @@
         android:gravity="center_vertical"
         android:textSize="14sp"
         app:layout_constraintBottom_toTopOf="@+id/recyclerView_shapeCustom"
-        app:layout_constraintLeft_toLeftOf="parent"
+        app:layout_constraintLeft_toLeftOf="@id/et_mediaBoxItemStampCustom_text"
         app:layout_constraintRight_toLeftOf="@+id/cb_time"
-        app:layout_constraintTop_toBottomOf="@+id/editTextView_stampCustom" />
+        app:layout_constraintTop_toBottomOf="@+id/et_mediaBoxItemStampCustom_text" />
 
     <CheckBox
         android:id="@+id/cb_time"
@@ -57,14 +46,14 @@
         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" />
+        app:layout_constraintTop_toBottomOf="@+id/et_mediaBoxItemStampCustom_text" />
 
     <android.support.v7.widget.RecyclerView
         android:id="@+id/recyclerView_shapeCustom"
-        android:layout_width="wrap_content"
+        android:layout_width="0dp"
         android:layout_height="0dp"
         app:layout_constraintBottom_toBottomOf="parent"
-        app:layout_constraintLeft_toLeftOf="parent"
+        app:layout_constraintLeft_toLeftOf="@id/et_mediaBoxItemStampCustom_text"
         app:layout_constraintRight_toRightOf="parent"
         app:layout_constraintTop_toBottomOf="@+id/cb_date" />