浏览代码

Moved book image to the right

sirekanyan 8 年之前
父节点
当前提交
73a5d1a06b
共有 1 个文件被更改,包括 21 次插入13 次删除
  1. 21 13
      app/src/main/res/layout/book_edit.xml

+ 21 - 13
app/src/main/res/layout/book_edit.xml

@@ -23,9 +23,11 @@
 
     <android.support.design.widget.TextInputLayout
         android:id="@+id/book_title_input"
-        android:layout_width="match_parent"
+        android:layout_width="0dp"
         android:layout_height="wrap_content"
         android:layout_margin="16dp"
+        app:layout_constraintLeft_toLeftOf="parent"
+        app:layout_constraintRight_toLeftOf="@id/cover_image_views"
         app:layout_constraintTop_toBottomOf="@id/app_bar_layout">
 
         <EditText
@@ -40,9 +42,11 @@
 
     <android.support.design.widget.TextInputLayout
         android:id="@+id/book_author_input"
-        android:layout_width="match_parent"
+        android:layout_width="0dp"
         android:layout_height="wrap_content"
         android:layout_margin="16dp"
+        app:layout_constraintLeft_toLeftOf="parent"
+        app:layout_constraintRight_toLeftOf="@id/cover_image_views"
         app:layout_constraintTop_toBottomOf="@id/book_title_input">
 
         <EditText
@@ -55,12 +59,27 @@
 
     </android.support.design.widget.TextInputLayout>
 
+    <android.support.v4.view.ViewPager
+        android:id="@+id/cover_image_views"
+        android:layout_width="0dp"
+        android:layout_height="0dp"
+        android:layout_marginEnd="16dp"
+        android:layout_marginStart="16dp"
+        android:visibility="gone"
+        app:layout_constraintBottom_toBottomOf="@id/book_author_input"
+        app:layout_constraintDimensionRatio="3:4"
+        app:layout_constraintRight_toRightOf="parent"
+        app:layout_constraintTop_toTopOf="@id/book_title_input"
+        tools:background="@color/colorAccent"
+        tools:visibility="visible" />
+
     <android.support.design.widget.TextInputLayout
         android:id="@+id/book_year_input"
         android:layout_width="0dp"
         android:layout_height="wrap_content"
         android:layout_margin="16dp"
         android:visibility="gone"
+        app:layout_constraintHorizontal_chainStyle="packed"
         app:layout_constraintLeft_toLeftOf="parent"
         app:layout_constraintRight_toLeftOf="@+id/book_month_input"
         app:layout_constraintTop_toBottomOf="@id/book_author_input"
@@ -145,15 +164,4 @@
 
     </android.support.design.widget.TextInputLayout>
 
-    <android.support.v4.view.ViewPager
-        android:id="@+id/cover_image_views"
-        android:layout_width="0dp"
-        android:layout_height="0dp"
-        android:layout_margin="16dp"
-        app:layout_constraintBottom_toBottomOf="parent"
-        app:layout_constraintLeft_toLeftOf="parent"
-        app:layout_constraintRight_toRightOf="parent"
-        app:layout_constraintTop_toBottomOf="@id/notes_text_input"
-        tools:background="@color/colorAccent" />
-
 </android.support.constraint.ConstraintLayout>