|
|
@@ -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;
|
|
|
+ }
|
|
|
}
|
|
|
|