Explorar el Código

[마이][Common] 버킷리스트 사각형 모듈 간 간격 동일하게 조정

Hasemi hace 7 años
padre
commit
d26959d8c0

+ 11 - 0
app/src/main/java/kr/co/zumo/app/lifeplus/view/screen/my/bucketlist/MyBucketListFragment.java

@@ -1,5 +1,6 @@
 package kr.co.zumo.app.lifeplus.view.screen.my.bucketlist;
 
+import android.graphics.Rect;
 import android.os.Bundle;
 import android.support.annotation.NonNull;
 import android.support.annotation.Nullable;
@@ -21,6 +22,7 @@ import kr.co.zumo.app.lifeplus.bean.api.BucketBean;
 import kr.co.zumo.app.lifeplus.bean.api.BucketWithTagBean;
 import kr.co.zumo.app.lifeplus.helper.ActionBarHelper;
 import kr.co.zumo.app.lifeplus.helper.ActionButtonHelper;
+import kr.co.zumo.app.lifeplus.util.ResourceUtil;
 import kr.co.zumo.app.lifeplus.view.Event;
 import kr.co.zumo.app.lifeplus.view.screen.FragmentBase;
 
@@ -120,6 +122,15 @@ public class MyBucketListFragment extends FragmentBase<MyBucketListPresenter> im
       }
     });
     recyclerViewMyBucketList.setNestedScrollingEnabled(false);
+    recyclerViewMyBucketList.addItemDecoration(new RecyclerView.ItemDecoration() {
+      @Override
+      public void getItemOffsets(Rect outRect, View view, RecyclerView parent, RecyclerView.State state) {
+        outRect.right = ResourceUtil.dpToPx(8);
+        outRect.left = ResourceUtil.dpToPx(8);
+        outRect.top = ResourceUtil.dpToPx(8);
+        outRect.bottom = ResourceUtil.dpToPx(8);
+      }
+    });
     recyclerViewMyBucketList.setLayoutManager(new GridLayoutManager(getActivity(), 2));
     recyclerViewMyBucketList.setAdapter(adapter);
   }

+ 5 - 5
app/src/main/res/layout/fragment_my_bucket_list.xml

@@ -92,15 +92,15 @@
     android:layout_width="match_parent"
     android:layout_height="wrap_content"
     android:layout_gravity="center"
-    android:layout_marginStart="25dp"
-    android:layout_marginTop="28dp"
-    android:layout_marginEnd="25dp"
-    android:layout_marginBottom="22dp"
+    android:layout_marginStart="17dp"
+    android:layout_marginTop="20dp"
+    android:layout_marginEnd="17dp"
+    android:layout_marginBottom="14dp"
     android:orientation="vertical">
 
     <android.support.v7.widget.RecyclerView
       android:id="@+id/recycler_view_my_bucket_list"
-      android:layout_gravity="center_horizontal"
+      android:layout_gravity="center"
       android:layout_width="match_parent"
       android:layout_height="wrap_content">
     </android.support.v7.widget.RecyclerView>

+ 2 - 3
app/src/main/res/layout/my_bucket_list_card_view.xml

@@ -3,16 +3,15 @@
   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="wrap_content"
+  android:layout_width="match_parent"
   android:layout_height="wrap_content"
-  android:layout_marginBottom="16dp"
   android:background="@drawable/faq_text_border"
   android:orientation="vertical"
   >
 
   <RelativeLayout
     android:id="@+id/my_bucket_list_card_view"
-    android:layout_width="148dp"
+    android:layout_width="match_parent"
     android:layout_height="148dp">
 
     <TextView