Browse Source

Add front cover editor layout(xml)

Wayne 6 năm trước cách đây
mục cha
commit
5060c7f4b6

+ 29 - 0
src/main/res/layout/dialog_cover_editor.xml

@@ -0,0 +1,29 @@
+<?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="800dp"
+    android:layout_height="544dp"
+    android:background="@drawable/bg_rounded_8dp"
+    android:elevation="8dp">
+
+    <android.support.design.widget.TabLayout
+        android:id="@+id/tabLayout_coverEditorDialog_header"
+        android:layout_width="0dp"
+        android:layout_height="64dp"
+        android:background="@color/pale_peach"
+        app:layout_constraintLeft_toLeftOf="parent"
+        app:layout_constraintRight_toRightOf="parent"
+        app:layout_constraintTop_toTopOf="parent" />
+
+    <android.support.v4.view.ViewPager
+        android:id="@+id/viewPager_coverEditorDialog_content"
+        android:layout_width="0dp"
+        android:layout_height="0dp"
+        app:layout_constraintBottom_toBottomOf="parent"
+        app:layout_constraintLeft_toLeftOf="parent"
+        app:layout_constraintRight_toRightOf="parent"
+        app:layout_constraintTop_toBottomOf="@id/tabLayout_coverEditorDialog_header">
+
+    </android.support.v4.view.ViewPager>
+
+</android.support.constraint.ConstraintLayout>

+ 221 - 0
src/main/res/layout/view_fron_cover_editor.xml

@@ -0,0 +1,221 @@
+<?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"
+    xmlns:tools="http://schemas.android.com/tools"
+    android:layout_width="800dp"
+    android:layout_height="480dp">
+
+    <ImageView
+        android:id="@+id/iv_frontCoverEditor_cover"
+        android:layout_width="360dp"
+        android:layout_height="360dp"
+        android:layout_marginLeft="40dp"
+        android:layout_marginTop="24dp"
+        android:layout_marginBottom="96dp"
+        app:layout_constraintBottom_toBottomOf="parent"
+        app:layout_constraintLeft_toLeftOf="parent"
+        app:layout_constraintTop_toTopOf="parent"
+        tools:src="#faa600" />
+
+    <ImageView
+        android:id="@+id/iv_frontCoverEditor_coverMask"
+        android:layout_width="0dp"
+        android:layout_height="112dp"
+        android:layout_marginBottom="16dp"
+        android:src="#66ffffff"
+        app:layout_constraintBottom_toBottomOf="@id/iv_frontCoverEditor_cover"
+        app:layout_constraintLeft_toLeftOf="@id/iv_frontCoverEditor_cover"
+        app:layout_constraintRight_toRightOf="@id/iv_frontCoverEditor_cover" />
+
+    <TextView
+        android:id="@+id/tv_frontCoverEditor_coverTitle"
+        android:layout_width="0dp"
+        android:layout_height="wrap_content"
+        android:layout_marginTop="16dp"
+        android:ellipsize="middle"
+        android:fontFamily="sans-serif-medium"
+        android:gravity="center"
+        android:singleLine="true"
+        android:textColor="#ffffff"
+        android:textSize="40sp"
+        app:layout_constraintLeft_toLeftOf="@id/iv_frontCoverEditor_coverMask"
+        app:layout_constraintRight_toRightOf="@id/iv_frontCoverEditor_coverMask"
+        app:layout_constraintTop_toTopOf="@id/iv_frontCoverEditor_coverMask"
+        tools:text="Story Name" />
+
+    <TextView
+        android:id="@+id/tv_frontCoverEditor_coverAuthor"
+        android:layout_width="0dp"
+        android:layout_height="wrap_content"
+        android:layout_marginTop="9dp"
+        android:ellipsize="middle"
+        android:fontFamily="sans-serif-medium"
+        android:gravity="center"
+        android:singleLine="true"
+        android:textColor="#ffffff"
+        android:textSize="20sp"
+        app:layout_constraintLeft_toLeftOf="@id/iv_frontCoverEditor_coverMask"
+        app:layout_constraintRight_toRightOf="@id/iv_frontCoverEditor_coverMask"
+        app:layout_constraintTop_toBottomOf="@id/tv_frontCoverEditor_coverTitle"
+        tools:text="Author" />
+
+    <EditText
+        android:id="@+id/et_frontCoverEditor_projectName"
+        style="@style/BomoEditText"
+        android:layout_width="320dp"
+        android:layout_height="56dp"
+        android:layout_marginLeft="40dp"
+        android:layout_marginTop="32dp"
+        android:layout_marginRight="40dp"
+        android:hint="@string/front_cover_editor_dialog_project_name_hint"
+        app:layout_constraintLeft_toRightOf="@id/iv_frontCoverEditor_cover"
+        app:layout_constraintRight_toRightOf="parent"
+        app:layout_constraintTop_toTopOf="parent" />
+
+    <EditText
+        android:id="@+id/et_frontCoverEditor_author"
+        style="@style/BomoEditText"
+        android:layout_width="0dp"
+        android:layout_height="56dp"
+        android:layout_marginTop="24dp"
+        android:hint="@string/front_cover_editor_dialog_author_hint"
+        app:layout_constraintLeft_toLeftOf="@id/et_frontCoverEditor_projectName"
+        app:layout_constraintRight_toRightOf="@id/et_frontCoverEditor_projectName"
+        app:layout_constraintTop_toBottomOf="@id/et_frontCoverEditor_projectName" />
+
+    <Spinner
+        android:id="@+id/spinner_frontCoverEditor_category"
+        android:layout_width="0dp"
+        android:layout_height="56dp"
+        android:layout_marginTop="24dp"
+        android:foreground="@drawable/bg_bomo_spinner"
+        app:layout_constraintLeft_toLeftOf="@id/et_frontCoverEditor_projectName"
+        app:layout_constraintRight_toRightOf="@id/et_frontCoverEditor_projectName"
+        app:layout_constraintTop_toBottomOf="@id/et_frontCoverEditor_author" />
+
+    <LinearLayout
+        android:id="@+id/viewGroup_frontCoverEditor_colorGroup1"
+        android:layout_width="0dp"
+        android:layout_height="wrap_content"
+        android:layout_marginTop="16dp"
+        app:layout_constraintLeft_toLeftOf="@id/et_frontCoverEditor_projectName"
+        app:layout_constraintRight_toRightOf="@id/et_frontCoverEditor_projectName"
+        app:layout_constraintTop_toBottomOf="@id/spinner_frontCoverEditor_category">
+
+        <ImageView
+            android:id="@+id/iv_frontCoverEditor_color1"
+            android:layout_width="48dp"
+            android:layout_height="48dp"
+            android:layout_margin="8dp"
+            android:src="#f5a623"
+            tools:padding="8dp" />
+
+        <ImageView
+            android:id="@+id/iv_frontCoverEditor_color2"
+            android:layout_width="48dp"
+            android:layout_height="48dp"
+            android:layout_margin="8dp"
+            android:src="#c82185" />
+
+        <ImageView
+            android:id="@+id/iv_frontCoverEditor_color3"
+            android:layout_width="48dp"
+            android:layout_height="48dp"
+            android:layout_margin="8dp"
+            android:src="#de0007" />
+
+        <ImageView
+            android:id="@+id/iv_frontCoverEditor_color4"
+            android:layout_width="48dp"
+            android:layout_height="48dp"
+            android:layout_margin="8dp"
+            android:src="#008cbf" />
+
+        <ImageView
+            android:id="@+id/iv_frontCoverEditor_color5"
+            android:layout_width="48dp"
+            android:layout_height="48dp"
+            android:layout_margin="8dp"
+            android:src="#33691e" />
+    </LinearLayout>
+
+    <LinearLayout
+        android:id="@+id/viewGroup_frontCoverEditor_colorGroup2"
+        android:layout_width="0dp"
+        android:layout_height="wrap_content"
+        app:layout_constraintLeft_toLeftOf="@id/viewGroup_frontCoverEditor_colorGroup1"
+        app:layout_constraintRight_toRightOf="@id/viewGroup_frontCoverEditor_colorGroup1"
+        app:layout_constraintTop_toBottomOf="@id/viewGroup_frontCoverEditor_colorGroup1">
+
+        <ImageView
+            android:id="@+id/iv_frontCoverEditor_color6"
+            android:layout_width="48dp"
+            android:layout_height="48dp"
+            android:layout_margin="8dp"
+            android:src="#827717" />
+
+        <ImageView
+            android:id="@+id/iv_frontCoverEditor_color7"
+            android:layout_width="48dp"
+            android:layout_height="48dp"
+            android:layout_margin="8dp"
+            android:src="#ba5f43" />
+
+        <ImageView
+            android:id="@+id/iv_frontCoverEditor_color8"
+            android:layout_width="48dp"
+            android:layout_height="48dp"
+            android:layout_margin="8dp"
+            android:src="#4e342e" />
+
+        <ImageView
+            android:id="@+id/iv_frontCoverEditor_color9"
+            android:layout_width="48dp"
+            android:layout_height="48dp"
+            android:layout_margin="8dp"
+            android:src="#424242" />
+
+        <ImageView
+            android:id="@+id/iv_frontCoverEditor_color10"
+            android:layout_width="48dp"
+            android:layout_height="48dp"
+            android:layout_margin="8dp"
+            android:src="#37474f" />
+    </LinearLayout>
+
+    <Button
+        android:id="@+id/btn_frontCoverEditor_save"
+        style="@style/Widget.AppCompat.Button.Borderless.Colored"
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:layout_marginTop="28dp"
+        android:layout_marginBottom="24dp"
+        android:text="@string/front_cover_editor_dialog_save_btn"
+        android:textColor="@color/cocoa"
+        app:layout_constraintBottom_toBottomOf="parent"
+        app:layout_constraintRight_toRightOf="parent"
+        app:layout_constraintTop_toBottomOf="@id/viewGroup_frontCoverEditor_colorGroup2" />
+
+    <Button
+        android:id="@+id/btn_frontCoverEditor_chooseScene"
+        style="@style/Widget.AppCompat.Button.Borderless.Colored"
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:text="@string/front_cover_editor_dialog_choose_a_scene_btn"
+        android:textColor="@color/cocoa"
+        app:layout_constraintBottom_toBottomOf="@id/btn_frontCoverEditor_save"
+        app:layout_constraintRight_toLeftOf="@id/btn_frontCoverEditor_save"
+        app:layout_constraintTop_toTopOf="@id/btn_frontCoverEditor_save" />
+
+    <Button
+        android:id="@+id/btn_frontCoverEditor_cancel"
+        style="@style/Widget.AppCompat.Button.Borderless.Colored"
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:text="@string/front_cover_editor_dialog_cancel_btn"
+        android:textColor="@color/cocoa"
+        app:layout_constraintBottom_toBottomOf="@id/btn_frontCoverEditor_chooseScene"
+        app:layout_constraintRight_toLeftOf="@id/btn_frontCoverEditor_chooseScene"
+        app:layout_constraintTop_toTopOf="@id/btn_frontCoverEditor_chooseScene" />
+
+</android.support.constraint.ConstraintLayout>

+ 6 - 0
src/main/res/values/strings.xml

@@ -25,4 +25,10 @@
 
     <string name="share_dialog_upload_suc">Upload success!</string>
     <string name="share_dialog_upload_failed">Upload failed</string>
+
+    <string name="front_cover_editor_dialog_project_name_hint">(Project) Story Name</string>
+    <string name="front_cover_editor_dialog_author_hint">Author</string>
+    <string name="front_cover_editor_dialog_save_btn">Save</string>
+    <string name="front_cover_editor_dialog_choose_a_scene_btn">Choose a scene</string>
+    <string name="front_cover_editor_dialog_cancel_btn">Cancel</string>
 </resources>