Bläddra i källkod

[공통][New] 네비바 텍스트 터치 영역 수정

hyodong.min 6 år sedan
förälder
incheckning
a0a5608e42

+ 1 - 5
app/src/main/java/kr/co/zumo/app/lifeplus/helper/ActionBarBuilder.java

@@ -129,11 +129,7 @@ public class ActionBarBuilder {
     isVisibleCategory = true;
     selectedCategoryIndex = index;
     this.categoryListener = categoryListener;
-    navigationBarBuilder.arrow(navigationBar -> {
-      if (null != arrowListener) {
-        arrowListener.onClick(navigationBar);
-      }
-    });
+    navigationBarBuilder.arrow();
     return this;
   }
 

+ 1 - 0
app/src/main/java/kr/co/zumo/app/lifeplus/helper/ActionBarHelper.java

@@ -89,6 +89,7 @@ public class ActionBarHelper extends Helper {
     toolbar.setContentInsetsAbsolute(0, 0);
 
     progressBar = appBarLayout.findViewById(R.id.progress_bar);
+
     layoutCategoryTab = appBarLayout.findViewById(R.id.layout_category_main_tab);
     categoryMainTab = appBarLayout.findViewById(R.id.category_main_tab);
 

+ 6 - 13
app/src/main/java/kr/co/zumo/app/lifeplus/helper/NavigationBar.java

@@ -35,6 +35,7 @@ import kr.co.zumo.app.lifeplus.view.animation.NotiAnimation;
 public class NavigationBar {
   private View navigationView;
 
+  private View layoutTitleHitArea;
   private TextView actionBarTitle;
   private ImageView imageBi;
   private ImageView buttonBack;
@@ -82,6 +83,7 @@ public class NavigationBar {
     imageBi = navigationView.findViewById(R.id.image_bi);
     viewUnderline = navigationView.findViewById(R.id.view_underline);
 
+    layoutTitleHitArea = navigationView.findViewById(R.id.layout_title_hit_area);
     actionBarTitle = navigationView.findViewById(R.id.action_bar_title);
     buttonArrow = navigationView.findViewById(R.id.image_view_open_arrow);
     buttonSearch = navigationView.findViewById(R.id.image_view_search);
@@ -104,7 +106,7 @@ public class NavigationBar {
     setClickListener(buttonBack);
     setClickListener(buttonSearch);
     setClickListener(buttonMenu);
-    setClickListener(actionBarTitle);
+    setClickListener(layoutTitleHitArea);
     setClickListener(buttonHome);
     setClickListener(buttonNotification);
     setClickListener(buttonSetting);
@@ -160,7 +162,7 @@ public class NavigationBar {
   }
 
   private void setTitleVisible(boolean isVisible) {
-    setViewVisible(actionBarTitle, isVisible);
+    setViewVisible(layoutTitleHitArea, isVisible);
   }
 
   private void setBackVisible(boolean isVisible) {
@@ -299,7 +301,7 @@ public class NavigationBar {
 
     setTitleVisible(newBuilder.isVisibleTitle);
     setTitleString(newBuilder.title);
-    mapClickListener(actionBarTitle, v -> {
+    mapClickListener(layoutTitleHitArea, v -> {
       toggleArrow();
       if (null != newBuilder.titleListener) {
         newBuilder.titleListener.onClick(NavigationBar.this);
@@ -325,12 +327,6 @@ public class NavigationBar {
     mapClickListener(textButton, newBuilder.textButtonListener);
 
     setArrowVisible(newBuilder.isVisibleArrow);
-    mapClickListener(buttonArrow, v -> {
-      toggleArrowInternal();
-      if (null != newBuilder.arrowListener) {
-        newBuilder.arrowListener.onClick(NavigationBar.this);
-      }
-    });
 
     setUnderlineVisible(newBuilder.isVisibleUnderline);
 
@@ -695,7 +691,6 @@ public class NavigationBar {
     protected INavigationBarListener settingListener = null;
     protected INavigationBarListener closeListener = null;
     protected INavigationBarListener textButtonListener = null;
-    protected INavigationBarListener arrowListener = null;
     protected INavigationBarListener editListener = null;
     protected INavigationBarListener trashListener = null;
     protected INavigationBarListener confirmListener = null;
@@ -858,12 +853,10 @@ public class NavigationBar {
     /**
      * arrow (타이틀 옆)
      *
-     * @param arrowListener
      * @return Builder
      */
-    public Builder arrow(INavigationBarListener arrowListener) {
+    public Builder arrow() {
       isVisibleArrow = true;
-      this.arrowListener = arrowListener;
       return this;
     }
 

+ 45 - 30
app/src/main/res/layout/action_bar.xml

@@ -85,43 +85,58 @@
       app:layout_constraintTop_toTopOf="parent"
       app:srcCompat="@drawable/bi_header_black"/>
 
-    <TextView
-      android:id="@+id/action_bar_title"
+    <LinearLayout
+      android:id="@+id/layout_title_hit_area"
       android:layout_width="wrap_content"
       android:layout_height="wrap_content"
       android:layout_marginStart="50dp"
-      android:background="?android:attr/selectableItemBackground"
-      android:gravity="center"
-      android:maxLines="1"
-      android:paddingTop="7dp"
-      android:paddingBottom="7dp"
-      android:textColor="@color/C000000"
-      android:textSize="16dp"
-      app:layout_constrainedWidth="true"
-      app:layout_constraintBottom_toBottomOf="parent"
-      app:layout_constraintEnd_toStartOf="@+id/image_view_open_arrow"
-      app:layout_constraintHorizontal_chainStyle="packed"
-      app:layout_constraintStart_toStartOf="parent"
-      app:layout_constraintTop_toTopOf="parent"
-      app:layout_goneMarginEnd="50dp"
-      tools:text="VVVVVVVVVVVVVVVVVVV"/>
-    <!-- 타이틀 옆에 아이콘 자리 -->
-    <ImageView
-      android:id="@+id/image_view_open_arrow"
-      android:layout_width="wrap_content"
-      android:layout_height="wrap_content"
       android:layout_marginEnd="50dp"
       android:background="?android:attr/selectableItemBackground"
-      android:paddingStart="3dp"
-      android:paddingTop="13dp"
-      android:paddingEnd="3dp"
-      android:paddingBottom="8dp"
+      android:orientation="horizontal"
+      android:paddingStart="9dp"
+      android:paddingEnd="6dp"
       app:layout_constraintBottom_toBottomOf="parent"
       app:layout_constraintEnd_toEndOf="parent"
-      app:layout_constraintStart_toEndOf="@+id/action_bar_title"
-      app:layout_constraintTop_toTopOf="parent"
-      app:srcCompat="@drawable/icon_h_down"
-      tools:visibility="visible"/>
+      app:layout_constraintStart_toStartOf="parent"
+      app:layout_constraintTop_toTopOf="parent">
+
+      <TextView
+        android:id="@+id/action_bar_title"
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:clickable="false"
+        android:gravity="center"
+        android:maxLines="1"
+        android:paddingTop="7dp"
+        android:paddingBottom="7dp"
+        android:textColor="@color/C000000"
+        android:textSize="16dp"
+        app:layout_constrainedWidth="true"
+        app:layout_constraintBottom_toBottomOf="parent"
+        app:layout_constraintEnd_toStartOf="@+id/image_view_open_arrow"
+        app:layout_constraintHorizontal_chainStyle="packed"
+        app:layout_constraintStart_toStartOf="parent"
+        app:layout_constraintTop_toTopOf="parent"
+        app:layout_goneMarginEnd="50dp"
+        tools:text="VVVVVVVVVVVVVVVVVVV"/>
+      <!-- 타이틀 옆에 아이콘 자리 -->
+      <ImageView
+        android:id="@+id/image_view_open_arrow"
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:clickable="false"
+        android:paddingStart="3dp"
+        android:paddingTop="13dp"
+        android:paddingEnd="3dp"
+        android:paddingBottom="8dp"
+        app:layout_constraintBottom_toBottomOf="parent"
+        app:layout_constraintEnd_toEndOf="parent"
+        app:layout_constraintStart_toEndOf="@+id/action_bar_title"
+        app:layout_constraintTop_toTopOf="parent"
+        app:srcCompat="@drawable/icon_h_down"
+        tools:visibility="visible"/>
+
+    </LinearLayout>
 
     <TextView
       android:id="@+id/text_sub"