Browse Source

[공통][New] 메인 프로모션 다이얼로그 구현

Hasemi 7 năm trước cách đây
mục cha
commit
6bdbcbedef

+ 2 - 1
app/src/main/java/kr/co/zumo/app/lifeplus/view/dialog/DialogID.java

@@ -25,9 +25,10 @@ public class DialogID {
   public final static int WEB = 3;
   public final static int ADD_REGISTRATION = 4;
   public static final int ALERT = 5;
+  public static final int PROMOTION = 6;
 
   @Retention(RetentionPolicy.SOURCE)
-  @IntDef({NONE, CONFIRM, /*INPUT_PIN,*/ WEB, ADD_REGISTRATION, ALERT})
+  @IntDef({NONE, CONFIRM, /*INPUT_PIN,*/ WEB, ADD_REGISTRATION, ALERT, PROMOTION})
   public @interface ID {}
 
 }

+ 64 - 0
app/src/main/java/kr/co/zumo/app/lifeplus/view/dialog/PromotionDialog.java

@@ -0,0 +1,64 @@
+package kr.co.zumo.app.lifeplus.view.dialog;
+
+import android.os.Bundle;
+import android.support.annotation.NonNull;
+import android.support.annotation.Nullable;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
+import android.widget.CheckBox;
+import android.widget.ImageView;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import kr.co.zumo.app.R;
+import kr.co.zumo.app.lifeplus.bean.TextImageBean;
+import kr.co.zumo.app.lifeplus.view.custom.main.banner.MainBannerView;
+
+/**
+ * PromotionPopUpDialog
+ * <pre>
+ * </pre>
+ *
+ * @author 하세미
+ * @version 1.0
+ * @history 하세미   [2018-10-25]   [최초 작성]
+ * @since 2018-10-25
+ */
+public class PromotionPopUpDialog extends DialogBase{
+
+  private List<TextImageBean> textImageBeanList;
+  private MainBannerView mainBannerView;
+  private ImageView imageViewCancel;
+  private CheckBox checkBoxNotShowing;
+
+  @Nullable
+  @Override
+  public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
+    return inflater.inflate(R.layout.promotion_pop_up, container, false);
+  }
+
+  @Override
+  public void onActivityCreated(Bundle savedInstanceState) {
+    super.onActivityCreated(savedInstanceState);
+    doDataSetting();
+    mainBannerView = getView().findViewById(R.id.promotion_banner);
+    imageViewCancel = getView().findViewById(R.id.image_view_cancel);
+    imageViewCancel.setOnClickListener(view -> {
+      dismiss();
+    });
+    checkBoxNotShowing = getView().findViewById(R.id.check_box_not_show);
+    mainBannerView.init(getActivity(), textImageBeanList, 4);
+
+  }
+
+  public void doDataSetting() {
+    textImageBeanList = new ArrayList<>();
+    textImageBeanList.add(new TextImageBean(R.drawable.img_bestbucket_banner_1, R.string.my_coin));
+    textImageBeanList.add(new TextImageBean(R.drawable.img_bestbucket_banner_2, R.string.my_coin));
+    textImageBeanList.add(new TextImageBean(R.drawable.img_bestbucket_banner_3, R.string.my_coin));
+    textImageBeanList.add(new TextImageBean(R.drawable.img_bestbucket_banner_4, R.string.my_coin));
+
+  }
+}

+ 4 - 0
app/src/main/java/kr/co/zumo/app/lifeplus/view/dialog/factory/BasicDialogFactory.java

@@ -8,6 +8,7 @@ import kr.co.zumo.app.lifeplus.view.dialog.ConfirmDialog;
 import kr.co.zumo.app.lifeplus.view.dialog.CustomAlertDialog;
 import kr.co.zumo.app.lifeplus.view.dialog.DialogBase;
 import kr.co.zumo.app.lifeplus.view.dialog.DialogID;
+import kr.co.zumo.app.lifeplus.view.dialog.PromotionPopUpDialog;
 import kr.co.zumo.app.lifeplus.view.dialog.WebDialog;
 
 /**
@@ -38,6 +39,9 @@ public class BasicDialogFactory implements IDialogFactory {
       case DialogID.ALERT:
         dialog = new CustomAlertDialog();
         break;
+      case DialogID.PROMOTION:
+        dialog = new PromotionPopUpDialog();
+        break;
       default:
         throw new Error("Unsupported dialog.");
     }

+ 2 - 0
app/src/main/java/kr/co/zumo/app/lifeplus/view/fragment/main/MainFragment.java

@@ -75,6 +75,8 @@ public class MainFragment extends FragmentBase<MainPresenter> implements IMainVi
 
     ActionBarManager.getInstance().setScrollListener(actionBarScrollListener);
 
+
+
     // --------------- test ------------------
 
     View button;

+ 20 - 0
app/src/main/java/kr/co/zumo/app/lifeplus/view/presenter/MainPresenter.java

@@ -15,6 +15,7 @@ import kr.co.zumo.app.lifeplus.view.dialog.DialogBuilder;
 import kr.co.zumo.app.lifeplus.view.dialog.DialogID;
 import kr.co.zumo.app.lifeplus.view.dialog.IAttribute;
 import kr.co.zumo.app.lifeplus.view.dialog.IDialogResultListener;
+import kr.co.zumo.app.lifeplus.view.dialog.PromotionPopUpDialog;
 import kr.co.zumo.app.lifeplus.view.fragment.factory.BasicFragmentFactory;
 import kr.co.zumo.app.lifeplus.view.fragment.factory.SignUpZumoFragmentFactory;
 
@@ -31,6 +32,7 @@ import kr.co.zumo.app.lifeplus.view.fragment.factory.SignUpZumoFragmentFactory;
 public class MainPresenter extends Presenter<MainModel, IMainView> {
 
   DialogBase alertDialog;
+  DialogBase promotionDialog;
 
   public MainPresenter(MainModel model, IMainView view) {
     super(model, view);
@@ -38,6 +40,24 @@ public class MainPresenter extends Presenter<MainModel, IMainView> {
 
   @Override
   protected void startInternal() {
+    //프로모션 팝업
+
+    promotionDialog = DialogBuilder.create(DialogID.PROMOTION)
+      .listener(new IDialogResultListener() {
+        @Override
+        public void onDialogResult(DialogBase dialog, Event event) {
+
+        }
+
+        @Override
+        public void onDialogCanceled(DialogBase dialog) {
+
+        }
+      })
+      .attribute((IAttribute<PromotionPopUpDialog>) dialog -> {
+      })
+      .show();
+
   }
 
   @Override

+ 1 - 3
app/src/main/res/layout/main_banner_view.xml

@@ -3,9 +3,7 @@
   xmlns:android="http://schemas.android.com/apk/res/android"
   xmlns:app="http://schemas.android.com/apk/res-auto"
   android:layout_width="match_parent"
-  android:layout_marginTop="26dp"
-  android:layout_marginBottom="26dp"
-  android:layout_height="wrap_content">
+  android:layout_height="match_parent">
   <android.support.v7.widget.RecyclerView
     android:id="@+id/recycler_view_main_banner_view"
     android:layout_width="match_parent"

+ 5 - 7
app/src/main/res/layout/main_banner_view_item.xml

@@ -4,15 +4,13 @@
   xmlns:app="http://schemas.android.com/apk/res-auto"
   xmlns:tools="http://schemas.android.com/tools"
   android:layout_width="match_parent"
-  android:layout_marginTop="26dp"
-  android:layout_marginBottom="26dp"
-  android:layout_height="wrap_content">
+  android:layout_height="match_parent">
 
   <ImageView
     android:id="@+id/image_view_banner_item"
     android:layout_width="match_parent"
-    android:layout_height="122dp"
-    android:scaleType="fitXY"
+    android:layout_height="match_parent"
+    android:scaleType="centerCrop"
     app:layout_constraintStart_toStartOf="parent"
     app:layout_constraintEnd_toEndOf="parent"
     app:srcCompat="@drawable/img_bestbucket_banner_5"/>
@@ -24,8 +22,8 @@
     android:layout_marginStart="8dp"
     android:layout_marginEnd="8dp"
     android:gravity="center_horizontal"
-    android:lineSpacingExtra="7.5sp"
-    android:textColor="#ffffff"
+    android:lineSpacingExtra="8sp"
+    android:textColor="@color/CFFFFFF"
     android:textSize="19sp"
     app:layout_constraintTop_toTopOf="@+id/image_view_banner_item"
     app:layout_constraintEnd_toEndOf="parent"

+ 3 - 3
app/src/main/res/layout/main_first_category_linear_view.xml

@@ -1,12 +1,12 @@
 <?xml version="1.0" encoding="utf-8"?>
 <android.support.constraint.ConstraintLayout
   xmlns:android="http://schemas.android.com/apk/res/android"
-  android:layout_width="match_parent"
+  android:layout_width="wrap_content"
   android:layout_height="wrap_content">
 
 <kr.co.zumo.app.lifeplus.view.custom.main.banner.MainBannerView
   android:id="@+id/main_banner_view_first_category"
-  android:layout_width="match_parent"
-  android:layout_height="wrap_content"/>
+  android:layout_width="311dp"
+  android:layout_height="122dp"/>
 
 </android.support.constraint.ConstraintLayout>

+ 2 - 2
app/src/main/res/layout/main_fourth_category_banner_view.xml

@@ -6,7 +6,7 @@
 
   <kr.co.zumo.app.lifeplus.view.custom.main.banner.MainBannerView
     android:id="@+id/main_banner_view_first_category"
-    android:layout_width="match_parent"
-    android:layout_height="wrap_content"/>
+    android:layout_width="311dp"
+    android:layout_height="122dp"/>
 
 </android.support.constraint.ConstraintLayout>

+ 2 - 2
app/src/main/res/layout/main_third_category_linear_view.xml

@@ -6,7 +6,7 @@
 
   <kr.co.zumo.app.lifeplus.view.custom.main.banner.MainBannerView
     android:id="@+id/main_banner_view_first_category"
-    android:layout_width="match_parent"
-    android:layout_height="wrap_content"/>
+    android:layout_width="311dp"
+    android:layout_height="122dp"/>
 
 </android.support.constraint.ConstraintLayout>

+ 68 - 0
app/src/main/res/layout/promotion_pop_up.xml

@@ -0,0 +1,68 @@
+<?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="match_parent"
+  android:layout_height="match_parent">
+
+  <android.support.constraint.ConstraintLayout
+    android:id="@+id/constraintLayout"
+    android:layout_width="wrap_content"
+    android:layout_height="wrap_content"
+    app:layout_constraintBottom_toBottomOf="parent"
+    app:layout_constraintEnd_toEndOf="parent"
+    app:layout_constraintStart_toStartOf="parent"
+    app:layout_constraintTop_toTopOf="parent">
+
+    <kr.co.zumo.app.lifeplus.view.custom.main.banner.MainBannerView
+      android:id="@+id/promotion_banner"
+      android:layout_width="261dp"
+      android:layout_height="342dp"
+      android:background="@color/C999999"
+      />
+
+    <ImageView
+      android:id="@+id/image_view_cancel"
+      android:layout_width="18dp"
+      android:layout_height="18dp"
+      android:layout_marginTop="25dp"
+      android:layout_marginEnd="25dp"
+      app:layout_constraintEnd_toEndOf="@id/promotion_banner"
+      app:layout_constraintTop_toTopOf="@+id/promotion_banner"
+      app:srcCompat="@drawable/icon_header_close"/>
+
+    <android.support.constraint.ConstraintLayout
+      android:id="@+id/constraintLayout2"
+      android:layout_width="262dp"
+      android:layout_height="wrap_content"
+      android:background="@color/CFFFFFF"
+      app:layout_constraintEnd_toEndOf="@id/promotion_banner"
+      app:layout_constraintTop_toBottomOf="@id/promotion_banner"
+      >
+
+      <CheckBox
+        android:id="@+id/check_box_not_show"
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content"
+        android:layout_marginStart="18dp"
+        android:layout_marginTop="16dp"
+        android:layout_marginBottom="16dp"
+        android:background="@null"
+        android:button="@null"
+        android:drawableStart="@drawable/custom_check_box"
+        android:drawablePadding="8dp"
+        android:lineSpacingExtra="5sp"
+        android:text="@string/not_show"
+        android:textColor="@color/C999999"
+        android:textSize="14sp"
+        app:layout_constraintBottom_toBottomOf="parent"
+        app:layout_constraintEnd_toEndOf="parent"
+        app:layout_constraintStart_toStartOf="parent"
+        app:layout_constraintTop_toTopOf="parent"
+        />
+
+
+    </android.support.constraint.ConstraintLayout>
+  </android.support.constraint.ConstraintLayout>
+</android.support.constraint.ConstraintLayout>

+ 1 - 1
app/src/main/res/values/strings.xml

@@ -419,6 +419,6 @@
   <string name="menu_check_date">일시 : 2018년 5월 27일(일) 04:00~07:00</string>
   <string name="menu_check_message1">보다 안정적인 서비스로 찾아 뵙겠습니다.\nLifeplus 운영팀 드림</string>
   <string name="menu_check_message2">상황에 따라 점검 시간이 단축/연장될 수 있습니다.</string>
-
+  <string name="not_show">다시 보지 않기</string>
 
 </resources>