浏览代码

[마이코인][Common] 클릭 이벤트 영역 터치 이벤트 통일함

Hasemi 6 年之前
父节点
当前提交
6963c76631

+ 3 - 1
app/src/main/java/kr/co/zumo/app/lifeplus/view/screen/my/coin/CoopRecommendGoodsHolder.java

@@ -35,8 +35,10 @@ public class CoopRecommendGoodsHolder {
   private ImageView imageViewDetailArrow;
   private ImageView imageViewCoin;
   private ImageView imageViewBackground;
+  private View viewCotainer;
 
   public CoopRecommendGoodsHolder(View itemView) {
+    viewCotainer = itemView.findViewById(R.id.layout_container);
     textViewTitle = itemView.findViewById(R.id.text_view_buy_text);
     imageViewCouponImage = itemView.findViewById(R.id.image_view_coupon_thumb);
     textViewStore = itemView.findViewById(R.id.text_view_store);
@@ -55,7 +57,7 @@ public class CoopRecommendGoodsHolder {
     textViewProduct.setText(bean.getName());
     textViewPrice.setText(StringUtil.toComma(bean.getPrice()));
 
-    imageViewBackground.setOnClickListener(view -> {
+    viewCotainer.setOnClickListener(view -> {
       listener.onEvent(new Event.Builder(Event.CLICK).build());
     });
 

+ 3 - 1
app/src/main/java/kr/co/zumo/app/lifeplus/view/screen/my/coin/MyCoinMainFragment.java

@@ -41,6 +41,7 @@ public class MyCoinMainFragment extends FragmentBase<MyCoinMainPresenter> implem
   private MainBannerView mainBannerViewCoin;
   private ConstraintLayout layoutMyCoin;
   private LinearLayout layoutCoopGoodsContainer;
+  private View viewTouchArea;
 
   @Override
   protected View onAfterCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
@@ -55,8 +56,9 @@ public class MyCoinMainFragment extends FragmentBase<MyCoinMainPresenter> implem
     imageViewArrowMyCoinDetail = findViewById(R.id.image_view_arrow_my_colin_detail);
     mainBannerViewCoin = findViewById(R.id.coin_banner_view);
     layoutCoopGoodsContainer = findViewById(R.id.layout_coops_recommend);
+    viewTouchArea = findViewById(R.id.layout_touch_area);
     layoutMyCoin = findViewById(R.id.layout_my_coin);
-    layoutMyCoin.setOnClickListener(view -> {presenter.onEvent(new Event.Builder(Event.MY_COIN_DETAIL).build());});
+    viewTouchArea.setOnClickListener(view -> {presenter.onEvent(new Event.Builder(Event.MY_COIN_DETAIL).build());});
 
   }
 

+ 19 - 2
app/src/main/res/layout/coop_good_layout.xml

@@ -25,20 +25,20 @@
   <android.support.constraint.ConstraintLayout
     android:id="@+id/layout_coops_recommend"
     android:layout_width="match_parent"
-
     android:layout_height="0dp"
     android:layout_marginTop="13dp"
     android:padding="0dp"
     app:layout_constraintHeight_default="wrap"
     app:layout_constraintTop_toBottomOf="@+id/text_view_buy_text">
 
+
     <ImageView
       android:id="@+id/image_view_coupon_shape"
       android:layout_width="match_parent"
       android:layout_height="125dp"
-      android:layout_marginBottom="15dp"
       android:layout_marginStart="25dp"
       android:layout_marginEnd="25dp"
+      android:layout_marginBottom="15dp"
       android:scaleType="fitXY"
       app:layout_constraintBottom_toBottomOf="parent"
       app:layout_constraintEnd_toEndOf="parent"
@@ -46,6 +46,7 @@
       app:layout_constraintTop_toTopOf="parent"
       app:srcCompat="@drawable/ic_coupon_shape"/>
 
+
     <ImageView
       android:id="@+id/image_view_coupon_thumb"
       android:layout_width="84dp"
@@ -131,5 +132,21 @@
       app:layout_constraintTop_toTopOf="@+id/image_view_coupon_shape"
       app:srcCompat="@drawable/icon_arrow_coupon"/>
 
+    <View
+      android:id="@+id/layout_container"
+      android:layout_width="match_parent"
+      android:layout_height="125dp"
+      android:layout_marginStart="25dp"
+      android:layout_marginEnd="25dp"
+      android:layout_marginBottom="15dp"
+      android:background="?android:attr/selectableItemBackground"
+      android:scaleType="fitXY"
+      app:layout_constraintBottom_toBottomOf="parent"
+      app:layout_constraintEnd_toEndOf="parent"
+      app:layout_constraintStart_toStartOf="parent"
+      app:layout_constraintTop_toTopOf="parent"
+      tools:background="@android:color/transparent"
+      />
+
   </android.support.constraint.ConstraintLayout>
 </android.support.constraint.ConstraintLayout>

+ 14 - 1
app/src/main/res/layout/fragment_my_coin_main.xml

@@ -33,12 +33,23 @@
         android:layout_marginTop="25dp"
         android:layout_marginEnd="30dp"
         android:layout_marginBottom="25dp"
-        android:background="@drawable/bucket_selector"
+        android:background="@drawable/rectangle_border_ce5e5e5_corner_2"
         app:layout_constraintBottom_toBottomOf="@+id/layout_container_my_coin"
         app:layout_constraintEnd_toEndOf="@+id/layout_container_my_coin"
         app:layout_constraintStart_toStartOf="@+id/layout_container_my_coin"
         app:layout_constraintTop_toTopOf="@+id/layout_container_my_coin">
 
+        <View
+          android:id="@+id/layout_touch_area"
+          android:layout_width="match_parent"
+          android:layout_height="0dp"
+          android:background="?android:attr/selectableItemBackground"
+          app:layout_constraintBottom_toBottomOf="parent"
+          app:layout_constraintEnd_toEndOf="parent"
+          app:layout_constraintStart_toStartOf="parent"
+          app:layout_constraintTop_toTopOf="parent"
+          tools:background="@color/CE5E5E5"/>
+
         <TextView
           android:id="@+id/text_view_coin_detail"
           android:layout_width="wrap_content"
@@ -108,7 +119,9 @@
           app:layout_constraintEnd_toEndOf="@+id/layout_my_coin"
           app:layout_constraintTop_toTopOf="@+id/text_view_my_coin_detail"
           app:srcCompat="@drawable/icon_arrow_coin"/>
+
       </android.support.constraint.ConstraintLayout>
+
     </android.support.constraint.ConstraintLayout>
 
     <LinearLayout