Jelajahi Sumber

[콘텐츠상세][Common] 웹뷰 화면 버튼 비활성화 추가

Hasemi 6 tahun lalu
induk
melakukan
7acb81de74

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

@@ -39,6 +39,7 @@ import kr.co.zumo.app.lifeplus.view.screen.FragmentBase;
 public class WebFromContentsFragment extends FragmentBase<WebFromContentsPresenter> implements IWebFromContentsView {
 
   private WebView webView;
+  private ImageView imageViewPrev;
   private ImageView imageViewNext;
   private View shareView;
 
@@ -69,6 +70,7 @@ public class WebFromContentsFragment extends FragmentBase<WebFromContentsPresent
         if (null != presenter) {
           presenter.onEvent(new Event.Builder(Event.COMPLETED).build());
         }
+
       }
 
     });
@@ -79,6 +81,7 @@ public class WebFromContentsFragment extends FragmentBase<WebFromContentsPresent
 
     webView.addJavascriptInterface(this, WebConstant.OBJECT_ID);
 
+    imageViewPrev = findViewById(R.id.image_view_prev);
     imageViewNext = findViewById(R.id.image_view_next);
 
     findViewById(R.id.image_view_prev).setOnClickListener(view -> {presenter.onEvent(new Event.Builder(Event.PREV).build());});
@@ -158,6 +161,7 @@ public class WebFromContentsFragment extends FragmentBase<WebFromContentsPresent
   public void onClickPrev() {
     if (webView.canGoBack()) {
       webView.goBack();
+      imageViewNext.setImageResource(R.drawable.icon_bottom_next);
     }
   }
 
@@ -165,6 +169,7 @@ public class WebFromContentsFragment extends FragmentBase<WebFromContentsPresent
   public void onClickNext() {
     if (webView.canGoForward()) {
       webView.goForward();
+      imageViewPrev.setImageResource(R.drawable.icon_bottom_prev);
     }
   }
 

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

@@ -9,7 +9,6 @@ import kr.co.zumo.app.R;
 import kr.co.zumo.app.lifeplus.bean.ContentsWebDeliveryBean;
 import kr.co.zumo.app.lifeplus.helper.FacebookHelper;
 import kr.co.zumo.app.lifeplus.helper.NavigationBar;
-import kr.co.zumo.app.lifeplus.supervisor.ScreenID;
 import kr.co.zumo.app.lifeplus.tool.IShareListener;
 import kr.co.zumo.app.lifeplus.tool.Share;
 import kr.co.zumo.app.lifeplus.tool.ShareClipBoard;

+ 6 - 0
app/src/main/res/drawable/icon_bottom_next_off.xml

@@ -0,0 +1,6 @@
+<vector android:height="18dp" android:viewportHeight="70"
+    android:viewportWidth="71" android:width="18dp" xmlns:android="http://schemas.android.com/apk/res/android">
+    <path android:fillColor="#00000000" android:fillType="nonZero"
+        android:pathData="M34.955,12l21.808,21.808a1.16,1.16 0,0 1,0 1.64L34.955,57.254"
+        android:strokeColor="#C5C5C5" android:strokeWidth="4"/>
+</vector>

+ 6 - 0
app/src/main/res/drawable/icon_bottom_prev_off.xml

@@ -0,0 +1,6 @@
+<vector android:height="18dp" android:viewportHeight="70"
+    android:viewportWidth="71" android:width="18dp" xmlns:android="http://schemas.android.com/apk/res/android">
+    <path android:fillColor="#00000000" android:fillType="nonZero"
+        android:pathData="M34.955,57.91L13.148,36.104a1.16,1.16 0,0 1,0 -1.64l21.807,-21.807"
+        android:strokeColor="#C5C5C5" android:strokeWidth="4"/>
+</vector>

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

@@ -32,10 +32,10 @@
       android:padding="5dp"
       app:layout_constraintBottom_toBottomOf="parent"
       app:layout_constraintEnd_toStartOf="@+id/image_view_next"
+      app:layout_constraintHorizontal_chainStyle="spread_inside"
       app:layout_constraintStart_toStartOf="parent"
       app:layout_constraintTop_toTopOf="parent"
-      app:srcCompat="@drawable/icon_bottom_prev"
-      />
+      app:srcCompat="@drawable/icon_bottom_prev_off"/>
 
     <ImageView
       android:id="@+id/image_view_next"
@@ -48,7 +48,7 @@
       app:layout_constraintEnd_toStartOf="@+id/image_view_refresh"
       app:layout_constraintStart_toEndOf="@+id/image_view_prev"
       app:layout_constraintTop_toTopOf="parent"
-      app:srcCompat="@drawable/icon_bottom_next"
+      app:srcCompat="@drawable/icon_bottom_next_off"
       />
 
     <ImageView