Browse Source

Merge branch 'develop' of https://github.com/swict/LifeplusAndroid into develop

hyodong.min 6 năm trước cách đây
mục cha
commit
86aa578712

+ 4 - 0
app/src/main/java/kr/co/zumo/app/lifeplus/activity/ActivityBase.java

@@ -407,6 +407,10 @@ public abstract class ActivityBase extends AppCompatActivity implements IHelperP
     return null != drawerLayout && drawerLayout.isDrawerOpen(Gravity.END);
   }
 
+
+  public void setJoined(boolean isJoined){
+    allMenuDriver.setJoined(isJoined);
+  }
   /**
    * drawer 애니메이션 적용
    */

+ 24 - 8
app/src/main/java/kr/co/zumo/app/lifeplus/activity/AllMenuDriver.java

@@ -38,6 +38,7 @@ public class AllMenuDriver implements PushMessageBroker.IPushMessageListener {
   private ConstraintLayout drawerView;
   private ConstraintLayout menuContainer;
   private ConstraintLayout container;
+  private ViewGroup layoutNavigationBar;
   private TextView textViewCategory0;
   private TextView textViewCategory1;
   private TextView textViewCategory2;
@@ -46,6 +47,8 @@ public class AllMenuDriver implements PushMessageBroker.IPushMessageListener {
   private List<TextView> categoryList;
   private IEventListener listener;
   private NavigationBar navigationBar;
+  private boolean isJoined;
+  private NavigationBar.Builder builder;
 
   AllMenuDriver(Context context, ConstraintLayout drawerView, IEventListener listener) {
     this.context = context;
@@ -69,11 +72,12 @@ public class AllMenuDriver implements PushMessageBroker.IPushMessageListener {
 
     container = this.drawerView.findViewById(R.id.layout_animate);
     menuContainer = this.drawerView.findViewById(R.id.layout_container);
+    layoutNavigationBar = this.drawerView.findViewById(R.id.container_navigation_bar);
 
     ((ViewGroup.MarginLayoutParams) this.drawerView.getLayoutParams()).topMargin = ResourceUtil.getStatusBarHeightManual();
     ((ViewGroup.MarginLayoutParams) this.menuContainer.getLayoutParams()).topMargin = ResourceUtil.getDimension(R.dimen.action_bar_height);
     this.drawerView.setClickable(true);
-    setNavigationBar();
+
 
     textViewCategory0 = this.drawerView.findViewById(R.id.text_view_category_0);
     textViewCategory1 = this.drawerView.findViewById(R.id.text_view_category_1);
@@ -132,17 +136,24 @@ public class AllMenuDriver implements PushMessageBroker.IPushMessageListener {
   }
 
   private void setNavigationBar() {
-    navigationBar = new NavigationBar.Builder(context)
+
+    layoutNavigationBar.removeAllViews();
+
+    builder = new NavigationBar.Builder(context)
       .home(actionBar -> listener.onEvent(new Event.Builder(Event.HOME_PAGE).build()))
       .notification(actionBar -> listener.onEvent(new Event.Builder(Event.NOTICE).build()))
       .setting(actionBar -> listener.onEvent(new Event.Builder(Event.SETTING).build()))
-      .close(actionBar -> listener.onEvent(new Event.Builder(Event.CLOSE).build()))
-      .build();
+      .close(actionBar -> listener.onEvent(new Event.Builder(Event.CLOSE).build()));
+
+    if (isJoined) {
+      builder.build();
+    }
+    else {
+      builder.textButton(R.string.member_confirm_underline, actionBar -> listener.onEvent(new Event.Builder(Event.SIGN_UP).build())).build();
+    }
 
-    ((ViewGroup) this.drawerView.findViewById(R.id.container_navigation_bar))
-      .addView(
-        navigationBar.getView()
-      );
+    navigationBar = builder.build();
+    layoutNavigationBar.addView(navigationBar.getView());
   }
 
   void onOpen() {
@@ -177,4 +188,9 @@ public class AllMenuDriver implements PushMessageBroker.IPushMessageListener {
     pushMessageManager = manager;
     new Handler(Looper.getMainLooper()).post(this::dispatchMessage);
   }
+
+  public void setJoined(boolean isJoined) {
+    this.isJoined = isJoined;
+    setNavigationBar();
+  }
 }

+ 5 - 0
app/src/main/java/kr/co/zumo/app/lifeplus/view/presenter/Presenter.java

@@ -86,6 +86,7 @@ public abstract class Presenter<M extends Model, V extends IView> implements ILi
   private DialogBase pinDialog;
   private LoadingDriver waiter;
   private ActivityBase activityBase;
+  private boolean isJoined;
 
   private boolean resumed = false;
 
@@ -236,6 +237,9 @@ public abstract class Presenter<M extends Model, V extends IView> implements ILi
       case Event.SETTING:
         goViaMenu(ScreenID.SETTING);
         break;
+      case Event.SIGN_UP:
+        goViaMenu(ScreenID.SIGN_UP_START);
+        break;
       case Event.CLOSE:
         closeMenu();
         break;
@@ -943,6 +947,7 @@ public abstract class Presenter<M extends Model, V extends IView> implements ILi
     firebaseAnalyticsHelper.click(getAnalyticsScreenName(), R.string.fa_button_all_menu);
 
     ((ActivityBase) view.getActivity()).openDrawer();
+    ((ActivityBase) view.getActivity()).setJoined(model.isActiveMember());
 
     //model.setDeliveryPackaging(model.getScreenId());
     // go(ScreenID.ALL_MENU);

+ 2 - 0
app/src/main/java/kr/co/zumo/app/lifeplus/view/screen/search/ISearchResultView.java

@@ -30,4 +30,6 @@ interface ISearchResultView extends IView {
   void drawCategory(List<CategoryCheckBean> tagBeans);
 
   void setFilterIcon(boolean isFiliterApplied);
+
+  void showKeyboard();
 }

+ 5 - 0
app/src/main/java/kr/co/zumo/app/lifeplus/view/screen/search/SearchResultFragment.java

@@ -23,6 +23,7 @@ import kr.co.zumo.app.lifeplus.bean.api.TagCheckBean;
 import kr.co.zumo.app.lifeplus.helper.ActionBarHelper;
 import kr.co.zumo.app.lifeplus.helper.NavigationBar;
 import kr.co.zumo.app.lifeplus.util.ResourceUtil;
+import kr.co.zumo.app.lifeplus.util.SoftKeyboardUtil;
 import kr.co.zumo.app.lifeplus.view.Event;
 import kr.co.zumo.app.lifeplus.view.screen.FragmentBase;
 import me.everything.android.ui.overscroll.OverScrollDecoratorHelper;
@@ -175,4 +176,8 @@ public class SearchResultFragment extends FragmentBase<SearchResultPresenter> im
     imageFilter.setImageResource(isFilterApplied ? R.drawable.icon_filter_success : R.drawable.icon_filter);
   }
 
+  @Override
+  public void showKeyboard() {
+    SoftKeyboardUtil.showKeyboard(getActivity());
+  }
 }

+ 6 - 0
app/src/main/java/kr/co/zumo/app/lifeplus/view/screen/search/SearchResultPresenter.java

@@ -119,6 +119,12 @@ public class SearchResultPresenter extends Presenter<SearchResultModel, ISearchR
 
   }
 
+  @Override
+  protected boolean onBackPressedInternal() {
+    view.showKeyboard();
+    return super.onBackPressedInternal();
+  }
+
   @Override
   protected void onEventInternal(Event event) {
     int index;

+ 7 - 0
app/src/main/res/anim/category_tab_close.xml

@@ -0,0 +1,7 @@
+<set xmlns:android="http://schemas.android.com/apk/res/android"
+     android:interpolator="@android:anim/linear_interpolator">
+  <scale
+    android:duration="500"
+    android:fromYScale="1.0"
+    android:toYScale="0.0"/>
+</set>

+ 7 - 0
app/src/main/res/anim/category_tab_open.xml

@@ -0,0 +1,7 @@
+<set xmlns:android="http://schemas.android.com/apk/res/android"
+     android:interpolator="@android:anim/linear_interpolator">
+  <scale
+    android:duration="500"
+    android:fromYScale="0.0"
+    android:toYScale="1.0"/>
+</set>

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

@@ -65,9 +65,9 @@
           android:id="@+id/layout_select_bucket"
           android:layout_width="wrap_content"
           android:layout_height="208dp"
+          android:layout_gravity="center"
           android:paddingStart="10dp"
           android:paddingEnd="10dp"
-          android:layout_gravity="center"
           app:layout_collapseMode="parallax"
           tools:paddingTop="100dp">
 
@@ -76,6 +76,8 @@
             android:id="@+id/text_view_event_title"
             android:layout_width="wrap_content"
             android:layout_height="wrap_content"
+            android:layout_marginStart="10dp"
+            android:layout_marginEnd="10dp"
             android:layout_marginBottom="8dp"
             android:lineSpacingExtra="8sp"
             android:textColor="@color/CFFFFFF"