Bladeren bron

Merge branches 'develop' and 'develop' of https://github.com/swict/LifePlusAndroid into develop

hyodong.min 7 jaren geleden
bovenliggende
commit
2791495e9b

+ 0 - 1
app/src/main/java/kr/co/zumo/app/lifeplus/activity/WebActivity.java

@@ -21,7 +21,6 @@ public class WebActivity extends ActivityBaseScreen {
   @Override
   protected void render() {
     ActivityDeliveryHelper.getInstance().shipTo(getHelper(DeliveryHelper.class));
-
     launchScreen(ScreenID.WEB);
   }
 

+ 52 - 26
app/src/main/java/kr/co/zumo/app/lifeplus/view/dialog/MoreInfoDialog.java

@@ -3,7 +3,6 @@ package kr.co.zumo.app.lifeplus.view.dialog;
 import android.os.Bundle;
 import android.support.annotation.NonNull;
 import android.support.annotation.Nullable;
-import android.util.Log;
 import android.view.LayoutInflater;
 import android.view.View;
 import android.view.ViewGroup;
@@ -12,6 +11,7 @@ import android.widget.LinearLayout;
 import java.util.List;
 
 import kr.co.zumo.app.R;
+import kr.co.zumo.app.lifeplus.bean.api.ContentsButtonInfoBean;
 import kr.co.zumo.app.lifeplus.bean.api.ContentsMoreInfoBean;
 import kr.co.zumo.app.lifeplus.model.SuperModel;
 import kr.co.zumo.app.lifeplus.util.AppUtil;
@@ -46,6 +46,7 @@ public class MoreInfoDialog extends DialogBottomBase<ICustomDialogListener<MoreI
 
   private String phoneNumber = null;
   private List<ContentsMoreInfoBean> contentsMoreInfoBeanList;
+  private ContentsButtonInfoBean contentsButtonInfo;
   private LinearLayout layoutMoreInfoContainer;
 
   @Nullable
@@ -79,7 +80,6 @@ public class MoreInfoDialog extends DialogBottomBase<ICustomDialogListener<MoreI
     for (int i = 0; i < contentsMoreInfoBeanList.size(); i++) {
       CustomMoreInfoView customMoreInfoView = null;
       ContentsMoreInfoBean contentsMoreInfoBean = contentsMoreInfoBeanList.get(i);
-      Log.e("APP#  MoreInfoDialog | onActivityCreatedInternal", "|" + "moreinfo " + contentsMoreInfoBean.getMoreInfo() + ", " + contentsMoreInfoBean.getDetailType());
       if (null != contentsMoreInfoBean.getMoreInfo() && StringUtil.isFull(contentsMoreInfoBean.getMoreInfo())) {
         switch (contentsMoreInfoBean.getDetailType()) {
           case PERIOD_INFO:
@@ -88,6 +88,9 @@ public class MoreInfoDialog extends DialogBottomBase<ICustomDialogListener<MoreI
           case ORGANIZATION_INFO:
             customMoreInfoView = new CustomMoreInfoView(getActivity(), R.drawable.icon_info_info, contentsMoreInfoBean.getMoreInfo());
             break;
+          case MENU_INFO:
+            customMoreInfoView = new CustomMoreInfoView(getActivity(), R.drawable.icon_info_price, contentsMoreInfoBean.getMoreInfo());
+            break;
           case AGE_INFO:
             customMoreInfoView = new CustomMoreInfoView(getActivity(), R.drawable.icon_info_info, contentsMoreInfoBean.getMoreInfo());
             break;
@@ -112,7 +115,6 @@ public class MoreInfoDialog extends DialogBottomBase<ICustomDialogListener<MoreI
             customMoreInfoView = new CustomMoreInfoView(getActivity(), R.drawable.icon_info_audience, contentsMoreInfoBean.getMoreInfo());
             break;
           default:
-            customMoreInfoView = new CustomMoreInfoView(getActivity(), R.drawable.icon_info_info, contentsMoreInfoBean.getMoreInfo());
             break;
         }
       }
@@ -121,11 +123,8 @@ public class MoreInfoDialog extends DialogBottomBase<ICustomDialogListener<MoreI
       }
     }
 
-    getView().findViewById(R.id.layout_more_info_dialog).setOnClickListener(v -> {
-
-    });
 
-    getView().findViewById(R.id.layout_more_info_pop_up).setOnClickListener(view -> {
+    getView().findViewById(R.id.layout_more_info_dialog).setOnClickListener(view -> {
       getCustomListener().onDialogCanceled(MoreInfoDialog.this);
     });
 
@@ -134,32 +133,59 @@ public class MoreInfoDialog extends DialogBottomBase<ICustomDialogListener<MoreI
     });
 
     /*하단 버튼 클릭 이벤트*/
-    getView().findViewById(R.id.image_view_call_info).setOnClickListener(view -> {
-      if (null != phoneNumber) {
-        getCustomListener().onDialogResult(MoreInfoDialog.this, new Event.Builder(Event.CALL_INFO).string(phoneNumber).build());
+
+    if (null != contentsButtonInfo) {
+      if (null != contentsButtonInfo.getAddress() && StringUtil.isFull(contentsButtonInfo.getAddress())) {
+        getView().findViewById(R.id.image_view_address).setVisibility(View.VISIBLE);
+        getView().findViewById(R.id.image_view_address).setOnClickListener(view -> {
+          getCustomListener().onDialogResult(MoreInfoDialog.this, new Event.Builder(Event.ADDRESS).string(contentsButtonInfo.getAddress()).build());
+        });
+      }
+      if (null != contentsButtonInfo.getFacebook() && StringUtil.isFull(contentsButtonInfo.getFacebook())) {
+        getView().findViewById(R.id.image_view_facebook).setVisibility(View.VISIBLE);
+        getView().findViewById(R.id.image_view_facebook).setOnClickListener(view -> {
+          getCustomListener().onDialogResult(MoreInfoDialog.this, new Event.Builder(Event.FACE_BOOK).string(contentsButtonInfo.getFacebook()).build());
+        });
+      }
+      if (null != contentsButtonInfo.getHomepage() && StringUtil.isFull(contentsButtonInfo.getHomepage())) {
+        getView().findViewById(R.id.image_view_home_page).setVisibility(View.VISIBLE);
+        getView().findViewById(R.id.image_view_home_page).setOnClickListener(view -> {
+          getCustomListener().onDialogResult(MoreInfoDialog.this, new Event.Builder(Event.HOME_PAGE).string(contentsButtonInfo.getHomepage()).build());
+        });
+      }
+      if (null != contentsButtonInfo.getPhoneNumber() && StringUtil.isFull(contentsButtonInfo.getPhoneNumber())) {
+        getView().findViewById(R.id.image_view_call_info).setVisibility(View.VISIBLE);
+        getView().findViewById(R.id.image_view_call_info).setOnClickListener(view -> {
+          getCustomListener().onDialogResult(MoreInfoDialog.this, new Event.Builder(Event.CALL_INFO).string(phoneNumber).build());
+
+        });
+      }
+      if (null != contentsButtonInfo.getLink() && StringUtil.isFull(contentsButtonInfo.getLink())) {
+        getView().findViewById(R.id.image_view_link).setVisibility(View.VISIBLE);
+        getView().findViewById(R.id.image_view_link).setOnClickListener(view -> {
+          getCustomListener().onDialogResult(MoreInfoDialog.this, new Event.Builder(Event.LINK).string(contentsButtonInfo.getLink()).build());
+        });
       }
-    });
-    getView().findViewById(R.id.image_view_link).setOnClickListener(view -> {
-      getCustomListener().onDialogResult(MoreInfoDialog.this, new Event.Builder(Event.LINK).build());
-    });
-    getView().findViewById(R.id.image_view_home_page).setOnClickListener(view -> {
-      getCustomListener().onDialogResult(MoreInfoDialog.this, new Event.Builder(Event.HOME_PAGE).build());
-    });
-    getView().findViewById(R.id.image_view_instagram).setOnClickListener(view -> {
-      getCustomListener().onDialogResult(MoreInfoDialog.this, new Event.Builder(Event.INSTAGRAM).build());
-    });
-    getView().findViewById(R.id.image_view_facebook).setOnClickListener(view -> {
-      getCustomListener().onDialogResult(MoreInfoDialog.this, new Event.Builder(Event.FACE_BOOK).build());
-    });
-    getView().findViewById(R.id.image_view_address).setOnClickListener(view -> {
-      getCustomListener().onDialogResult(MoreInfoDialog.this, new Event.Builder(Event.ADDRESS).build());
-    });
+
+      if (null != contentsButtonInfo.getInstagram() && StringUtil.isFull(contentsButtonInfo.getInstagram())) {
+        getView().findViewById(R.id.image_view_instagram).setVisibility(View.VISIBLE);
+        getView().findViewById(R.id.image_view_instagram).setOnClickListener(view -> {
+          getCustomListener().onDialogResult(MoreInfoDialog.this, new Event.Builder(Event.INSTAGRAM).string(contentsButtonInfo.getInstagram()).build());
+        });
+      }
+
+    }
 
   }
 
+  //more info description
   public void setMoreInfoContents(List<ContentsMoreInfoBean> contentsMoreInfoBeanList) {
     this.contentsMoreInfoBeanList = contentsMoreInfoBeanList;
   }
 
+  //more info button information
+  public void setContentsButtonInfo(ContentsButtonInfoBean contentsButtonInfo) {
+    this.contentsButtonInfo = contentsButtonInfo;
+  }
 }
 

+ 11 - 6
app/src/main/java/kr/co/zumo/app/lifeplus/view/screen/contents/ContentsPresenter.java

@@ -417,7 +417,6 @@ public class ContentsPresenter extends ContentsBasePresenter<ContentsModel, ICon
   }
 
   private void showMoreInfoPopup(int index) {
-
 //    BottomSheetDialog dialog = new BottomSheetDialog();
 //
 //    dialog.setMoreInfoContents(model.getContentsDetailListBean().getItemDetailList().get(index).getMoreInfoList());
@@ -437,26 +436,31 @@ public class ContentsPresenter extends ContentsBasePresenter<ContentsModel, ICon
                 phoneNumber = phoneNumber.trim().replaceAll("-", "");
                 phoneNumber = "tel:" + phoneNumber;
                 view.setPhoneNumberInCall(phoneNumber);
-
                 break;
               case Event.LINK:
-                showErrorDialog(R.string.ready_comment);
+                model.setDeliveryPackaging(event.getString());
+                go(ScreenID.WEB);
                 break;
               case Event.HOME_PAGE:
-                showErrorDialog(R.string.ready_comment);
+                model.setDeliveryPackaging(event.getString());
+                go(ScreenID.WEB);
                 break;
               case Event.INSTAGRAM:
-                showErrorDialog(R.string.ready_comment);
+                model.setDeliveryPackaging(event.getString());
+                go(ScreenID.WEB);
                 break;
               case Event.FACE_BOOK:
-                showErrorDialog(R.string.ready_comment);
+                model.setDeliveryPackaging(event.getString());
+                go(ScreenID.WEB);
                 break;
               case Event.ADDRESS:
+                // TODO: 지도 구현
                 showErrorDialog(R.string.ready_comment);
                 break;
               default:
                 break;
             }
+
           }
 
           @Override
@@ -467,6 +471,7 @@ public class ContentsPresenter extends ContentsBasePresenter<ContentsModel, ICon
         })
         .attribute(dialog -> {
           dialog.setMoreInfoContents(model.getContentsDetailListBean().getItemDetailList().get(index).getMoreInfoList());
+          dialog.setContentsButtonInfo(model.getContentsDetailListBean().getItemDetailList().get(index).getButtonInfo());
         })
         .show();
     }

+ 0 - 1
app/src/main/java/kr/co/zumo/app/lifeplus/view/screen/web/WebPresenter.java

@@ -21,7 +21,6 @@ import kr.co.zumo.app.lifeplus.view.presenter.Presenter;
 public class WebPresenter extends Presenter<WebModel, IWebView> {
   public WebPresenter(WebModel model, IWebView view) {
     super(model, view);
-
     String targetUrl = model.getDeliveryPackaging(String.class);
     model.setUrl(targetUrl);
   }

+ 3 - 5
app/src/main/res/drawable/icon_link.xml

@@ -1,9 +1,7 @@
 <vector android:height="17dp" android:viewportHeight="66"
-    android:viewportWidth="66" android:width="17dp" xmlns:android="http://schemas.android.com/apk/res/android">
+    android:viewportWidth="67" android:width="17dp" xmlns:android="http://schemas.android.com/apk/res/android">
     <path android:fillColor="#00000000" android:fillType="evenOdd"
-        android:pathData="M12,24a1,1 0,0 0,-1 1v25a1,1 0,0 0,1 1h33a1,1 0,0 0,1 -1V25a1,1 0,0 0,-1 -1H12z"
-        android:strokeColor="#FFF" android:strokeWidth="4"/>
-    <path android:fillColor="#00000000" android:fillType="evenOdd"
-        android:pathData="M19,19.006L50.672,43H52c1.302,0 2,-0.7 2,-2V18c0,-1.3 -0.698,-2 -2,-2H21c-1.302,0 -2,0.7 -2,2v1.006z"
+        android:pathData="M13,24a1,1 0,0 0,-1 1v25a1,1 0,0 0,1 1h33a1,1 0,0 0,1 -1V25a1,1 0,0 0,-1 -1H13z"
         android:strokeColor="#FFF" android:strokeWidth="4"/>
+    <path android:fillColor="#FFF" android:fillType="nonZero" android:pathData="M53,41V18H22v2h-4v-2c0,-2.399 1.587,-4 4,-4h31c2.413,0 4,1.601 4,4v23c0,2.399 -1.587,4 -4,4h-2v-4h2z"/>
 </vector>

+ 11 - 3
app/src/main/res/layout/dialog_contents_more_info.xml

@@ -131,12 +131,14 @@
         android:layout_marginEnd="5dp"
         android:background="@drawable/circle_c000000"
         android:scaleType="center"
+        android:visibility="gone"
         app:layout_constraintBottom_toBottomOf="parent"
         app:layout_constraintEnd_toStartOf="@+id/image_view_home_page"
         app:layout_constraintHorizontal_bias="1"
         app:layout_constraintStart_toEndOf="@+id/image_view_call_info"
         app:layout_constraintTop_toTopOf="parent"
-        app:srcCompat="@drawable/icon_link"/>
+        app:srcCompat="@drawable/icon_link"
+        tools:visibility="visible"/>
 
       <ImageView
         android:id="@+id/image_view_home_page"
@@ -146,6 +148,7 @@
         android:layout_marginEnd="5dp"
         android:background="@drawable/circle_c000000"
         android:scaleType="center"
+        android:visibility="gone"
         app:layout_constraintBottom_toBottomOf="parent"
         app:layout_constraintEnd_toStartOf="@+id/image_view_instagram"
         app:layout_constraintHorizontal_bias="1"
@@ -162,12 +165,14 @@
         android:layout_marginEnd="5dp"
         android:background="@drawable/circle_c000000"
         android:scaleType="center"
+        android:visibility="gone"
         app:layout_constraintBottom_toBottomOf="parent"
         app:layout_constraintEnd_toStartOf="@+id/image_view_facebook"
         app:layout_constraintHorizontal_bias="1"
         app:layout_constraintStart_toEndOf="@+id/image_view_home_page"
         app:layout_constraintTop_toTopOf="parent"
-        app:srcCompat="@drawable/icon_info_instagram_wh"/>
+        app:srcCompat="@drawable/icon_info_instagram_wh"
+        tools:visibility="visible"/>
 
       <ImageView
         android:id="@+id/image_view_facebook"
@@ -177,12 +182,14 @@
         android:layout_marginEnd="5dp"
         android:background="@drawable/circle_c000000"
         android:scaleType="center"
+        android:visibility="gone"
         app:layout_constraintBottom_toBottomOf="parent"
         app:layout_constraintEnd_toStartOf="@+id/image_view_address"
         app:layout_constraintHorizontal_bias="1"
         app:layout_constraintStart_toEndOf="@+id/image_view_instagram"
         app:layout_constraintTop_toTopOf="parent"
-        app:srcCompat="@drawable/icon_info_facebook_wh"/>
+        app:srcCompat="@drawable/icon_info_facebook_wh"
+        tools:visibility="visible"/>
 
       <ImageView
         android:id="@+id/image_view_address"
@@ -192,6 +199,7 @@
         android:layout_marginEnd="5dp"
         android:background="@drawable/circle_c000000"
         android:scaleType="center"
+        android:visibility="gone"
         app:layout_constraintBottom_toBottomOf="parent"
         app:layout_constraintEnd_toEndOf="parent"
         app:layout_constraintHorizontal_bias="1"

+ 3 - 4
app/src/main/res/layout/fragment_my_bucket_list.xml

@@ -33,8 +33,8 @@
 
       <android.support.design.widget.TabLayout
         android:id="@+id/tab_layout_bucket_list"
-        android:layout_width="match_parent"
-        android:layout_height="5dp"
+        android:layout_width="42dp"
+        android:layout_height="wrap_content"
         android:layout_alignBottom="@+id/view_pager_best_bucket_list"
         android:layout_alignParentStart="true"
         android:layout_marginBottom="10dp"
@@ -42,9 +42,8 @@
         app:layout_constraintEnd_toEndOf="@+id/view_pager_best_bucket_list"
         app:layout_constraintStart_toStartOf="@+id/view_pager_best_bucket_list"
         app:tabBackground="@drawable/best_bucket_tab_selector"
-        app:tabGravity="center"
         app:tabIndicatorHeight="0dp"
-   />
+        />
     </android.support.constraint.ConstraintLayout>
 
     <android.support.constraint.ConstraintLayout