浏览代码

[마이][Common] 좋아요 북마크 애니메이션 리팩토링

Hasemi 6 年之前
父节点
当前提交
62268627d9

+ 3 - 8
app/src/main/java/kr/co/zumo/app/lifeplus/helper/NavigationBar.java

@@ -465,12 +465,7 @@ public class NavigationBar {
    * @param isChecked
    */
   public void setCompleted(boolean isChecked) {
-    if (isChecked) {
-      buttonConfirm.setImageResource(R.drawable.ic_icon_bucket_complet_on);
-    }
-    else {
-      buttonConfirm.setImageResource(R.drawable.ic_icon_bucket_complet_default);
-    }
+    setCompleted(isChecked, false);
   }
 
   public void setCompleted(boolean isChecked, boolean isAnim) {
@@ -495,7 +490,7 @@ public class NavigationBar {
    */
   public void setLiked(boolean isChecked, boolean isAnim) {
     if (isChecked) {
-      if (false == isAnim) {
+      if (isAnim) {
         LikeAnimation likeAnimation = new LikeAnimation();
         likeAnimation.show(buttonLike);
       }
@@ -520,7 +515,7 @@ public class NavigationBar {
    */
   public void setBookmarked(boolean isChecked, boolean isAnim) {
     if (isChecked) {
-      if (false == isAnim) {
+      if (isAnim) {
         BookmarkAnimation bookmarkAnimation = new BookmarkAnimation();
         bookmarkAnimation.show(buttonBookmark);
       }

+ 2 - 2
app/src/main/java/kr/co/zumo/app/lifeplus/view/screen/contents/ContentsBasePresenter.java

@@ -121,10 +121,10 @@ public abstract class ContentsBasePresenter<M extends ContentsBaseModel, V exten
     switch (event.getEventId()) {
       case Event.SUCCESS:
         if (subId == Event.CONTENTS_LIKE) {
-          view.setLiked(requestedChecked, false);
+          view.setLiked(requestedChecked, true);
         }
         else if (subId == Event.CONTENTS_BOOKMARK) {
-          view.setBookmarked(requestedChecked, false);
+          view.setBookmarked(requestedChecked, true);
         }
         else if (subId == Event.COIN) {
           model.getCoin(e -> {

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

@@ -61,8 +61,8 @@ public class ContentsPresenter extends ContentsBasePresenter<ContentsModel, ICon
           view.setScrollToPosition(model.getCurrentPageIndex());
         }
         else {
-          view.setLiked(model.isItemLiked(), true);
-          view.setBookmarked(model.isItemBookmarked(), true);
+          view.setLiked(model.isItemLiked(), false);
+          view.setBookmarked(model.isItemBookmarked(), false);
         }
 
       }
@@ -343,8 +343,8 @@ public class ContentsPresenter extends ContentsBasePresenter<ContentsModel, ICon
           view.setVisibleDotDotDot(currentIndex > 0);
         }
 
-        view.setLiked(model.isItemLiked() , true);
-        view.setBookmarked(model.isItemBookmarked() , true);
+        view.setLiked(model.isItemLiked() , false);
+        view.setBookmarked(model.isItemBookmarked() , false);
       });
     }
 

+ 16 - 16
app/src/main/res/drawable/animation_bucket.xml

@@ -1,19 +1,19 @@
 <?xml version="1.0" encoding="utf-8"?>
 <animation-list xmlns:android="http://schemas.android.com/apk/res/android" android:oneshot="true">
-  <item android:drawable="@drawable/check_00000" android:duration="40"/>
-  <item android:drawable="@drawable/check_00001" android:duration="40"/>
-  <item android:drawable="@drawable/check_00002" android:duration="40"/>
-  <item android:drawable="@drawable/check_00003" android:duration="40"/>
-  <item android:drawable="@drawable/check_00004" android:duration="40"/>
-  <item android:drawable="@drawable/check_00005" android:duration="40"/>
-  <item android:drawable="@drawable/check_00006" android:duration="40"/>
-  <item android:drawable="@drawable/check_00007" android:duration="40"/>
-  <item android:drawable="@drawable/check_00008" android:duration="40"/>
-  <item android:drawable="@drawable/check_00009" android:duration="40"/>
-  <item android:drawable="@drawable/check_00010" android:duration="40"/>
-  <item android:drawable="@drawable/check_00011" android:duration="40"/>
-  <item android:drawable="@drawable/check_00012" android:duration="40"/>
-  <item android:drawable="@drawable/check_00013" android:duration="40"/>
-  <item android:drawable="@drawable/check_00014" android:duration="40"/>
-  <item android:drawable="@drawable/ic_icon_bucket_complet_on" android:duration="40"/>
+  <item android:drawable="@drawable/check_00000" android:duration="30"/>
+  <item android:drawable="@drawable/check_00001" android:duration="30"/>
+  <item android:drawable="@drawable/check_00002" android:duration="30"/>
+  <item android:drawable="@drawable/check_00003" android:duration="30"/>
+  <item android:drawable="@drawable/check_00004" android:duration="30"/>
+  <item android:drawable="@drawable/check_00005" android:duration="30"/>
+  <item android:drawable="@drawable/check_00006" android:duration="30"/>
+  <item android:drawable="@drawable/check_00007" android:duration="30"/>
+  <item android:drawable="@drawable/check_00008" android:duration="30"/>
+  <item android:drawable="@drawable/check_00009" android:duration="30"/>
+  <item android:drawable="@drawable/check_00010" android:duration="30"/>
+  <item android:drawable="@drawable/check_00011" android:duration="30"/>
+  <item android:drawable="@drawable/check_00012" android:duration="30"/>
+  <item android:drawable="@drawable/check_00013" android:duration="30"/>
+  <item android:drawable="@drawable/check_00014" android:duration="30"/>
+  <item android:drawable="@drawable/ic_icon_bucket_complet_on" android:duration="30"/>
 </animation-list>

+ 27 - 10
app/src/main/res/drawable/ic_icon_bucket_complet_default.xml

@@ -1,11 +1,28 @@
-<vector android:height="24dp" android:viewportHeight="77"
-    android:viewportWidth="76" android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android">
-    <path android:fillAlpha="0.5" android:fillColor="#FFFFFF"
-        android:fillType="nonZero"
-        android:pathData="M13.9565,20.3913L47.9574,20.3913L47.9574,13.4348L10.5106,13.4348C8.5718,13.4348 7,15.0065 7,16.9454L7,64.9241C7,66.863 8.5718,68.4348 10.5106,68.4348L58.4894,68.4348C60.4282,68.4348 62,66.863 62,64.9241L62,45.0305L55.0435,45.0305L55.0435,61.4783L13.9565,61.4783L13.9565,20.3913Z"
-        android:strokeAlpha="0.5" android:strokeColor="#00000000" android:strokeWidth="1"/>
-    <path android:fillAlpha="0.5" android:fillColor="#FFFFFF"
-        android:fillType="nonZero"
-        android:pathData="M36.193,43.52L65.4533,12.0657C66.7617,10.6592 68.9626,10.5797 70.3691,11.8881C71.7756,13.1965 71.8551,15.3973 70.5467,16.8039L38.9184,50.8039C37.6103,52.21 35.4103,52.2899 34.0036,50.9825L20.632,38.5538C19.2249,37.2459 19.1445,35.0451 20.4523,33.6381C21.7601,32.231 23.961,32.1506 25.368,33.4584L36.193,43.52Z"
-        android:strokeAlpha="0.5" android:strokeColor="#00000000" android:strokeWidth="1"/>
+<vector xmlns:android="http://schemas.android.com/apk/res/android"
+        android:width="24dp"
+        android:height="24dp"
+        android:viewportWidth="76"
+        android:viewportHeight="77">
+  <group
+    android:pivotX="38"
+    android:pivotY="39"
+    android:scaleX="0.92"
+    android:scaleY="0.92">
+  <path
+    android:fillAlpha="0.5"
+    android:fillColor="#FFFFFF"
+    android:fillType="nonZero"
+    android:pathData="M13.9565,20.3913L47.9574,20.3913L47.9574,13.4348L10.5106,13.4348C8.5718,13.4348 7,15.0065 7,16.9454L7,64.9241C7,66.863 8.5718,68.4348 10.5106,68.4348L58.4894,68.4348C60.4282,68.4348 62,66.863 62,64.9241L62,45.0305L55.0435,45.0305L55.0435,61.4783L13.9565,61.4783L13.9565,20.3913Z"
+    android:strokeWidth="1"
+    android:strokeAlpha="0.5"
+    android:strokeColor="#00000000"/>
+  <path
+    android:fillAlpha="0.5"
+    android:fillColor="#FFFFFF"
+    android:fillType="nonZero"
+    android:pathData="M36.193,43.52L65.4533,12.0657C66.7617,10.6592 68.9626,10.5797 70.3691,11.8881C71.7756,13.1965 71.8551,15.3973 70.5467,16.8039L38.9184,50.8039C37.6103,52.21 35.4103,52.2899 34.0036,50.9825L20.632,38.5538C19.2249,37.2459 19.1445,35.0451 20.4523,33.6381C21.7601,32.231 23.961,32.1506 25.368,33.4584L36.193,43.52Z"
+    android:strokeWidth="1"
+    android:strokeAlpha="0.5"
+    android:strokeColor="#00000000"/>
+  </group>
 </vector>

+ 36 - 14
app/src/main/res/drawable/ic_icon_bucket_complet_on.xml

@@ -1,15 +1,37 @@
-<vector android:height="24dp" android:viewportHeight="77"
-    android:viewportWidth="76" android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android">
-    <path android:fillColor="#FFFFFF" android:fillType="nonZero"
-        android:pathData="M13.9565,20.3913L47.9574,20.3913L47.9574,13.4348L10.5106,13.4348C8.5718,13.4348 7,15.0065 7,16.9454L7,64.9241C7,66.863 8.5718,68.4348 10.5106,68.4348L58.4894,68.4348C60.4282,68.4348 62,66.863 62,64.9241L62,45.0305L55.0435,45.0305L55.0435,61.4783L13.9565,61.4783L13.9565,20.3913Z"
-        android:strokeColor="#00000000" android:strokeWidth="1"/>
-    <path android:fillColor="#FFFFFF" android:fillType="nonZero"
-        android:pathData="M47.5,16.9348m-3.5,0a3.5,3.5 0,1 1,7 0a3.5,3.5 0,1 1,-7 0"
-        android:strokeColor="#00000000" android:strokeWidth="1"/>
-    <path android:fillColor="#FFFFFF" android:fillType="nonZero"
-        android:pathData="M58.5,44.9348m-3.5,0a3.5,3.5 0,1 1,7 0a3.5,3.5 0,1 1,-7 0"
-        android:strokeColor="#00000000" android:strokeWidth="1"/>
-    <path android:fillColor="#F27824" android:fillType="nonZero"
-        android:pathData="M36.193,43.52L65.4533,12.0657C66.7617,10.6592 68.9626,10.5797 70.3691,11.8881C71.7756,13.1965 71.8551,15.3973 70.5467,16.8039L38.9184,50.8039C37.6103,52.21 35.4103,52.2899 34.0036,50.9825L20.632,38.5538C19.2249,37.2459 19.1445,35.0451 20.4523,33.6381C21.7601,32.231 23.961,32.1506 25.368,33.4584L36.193,43.52Z"
-        android:strokeColor="#00000000" android:strokeWidth="1"/>
+<vector xmlns:android="http://schemas.android.com/apk/res/android"
+        android:width="24dp"
+        android:height="24dp"
+        android:viewportWidth="76"
+        android:viewportHeight="77">
+  <group
+    android:pivotX="38"
+    android:pivotY="39"
+    android:scaleX="0.92"
+    android:scaleY="0.92">
+
+    <path
+      android:fillColor="#FFFFFF"
+      android:fillType="nonZero"
+      android:pathData="M13.9565,20.3913L47.9574,20.3913L47.9574,13.4348L10.5106,13.4348C8.5718,13.4348 7,15.0065 7,16.9454L7,64.9241C7,66.863 8.5718,68.4348 10.5106,68.4348L58.4894,68.4348C60.4282,68.4348 62,66.863 62,64.9241L62,45.0305L55.0435,45.0305L55.0435,61.4783L13.9565,61.4783L13.9565,20.3913Z"
+      android:strokeWidth="1"
+      android:strokeColor="#00000000"/>
+    <path
+      android:fillColor="#FFFFFF"
+      android:fillType="nonZero"
+      android:pathData="M47.5,16.9348m-3.5,0a3.5,3.5 0,1 1,7 0a3.5,3.5 0,1 1,-7 0"
+      android:strokeWidth="1"
+      android:strokeColor="#00000000"/>
+    <path
+      android:fillColor="#FFFFFF"
+      android:fillType="nonZero"
+      android:pathData="M58.5,44.9348m-3.5,0a3.5,3.5 0,1 1,7 0a3.5,3.5 0,1 1,-7 0"
+      android:strokeWidth="1"
+      android:strokeColor="#00000000"/>
+    <path
+      android:fillColor="#F27824"
+      android:fillType="nonZero"
+      android:pathData="M36.193,43.52L65.4533,12.0657C66.7617,10.6592 68.9626,10.5797 70.3691,11.8881C71.7756,13.1965 71.8551,15.3973 70.5467,16.8039L38.9184,50.8039C37.6103,52.21 35.4103,52.2899 34.0036,50.9825L20.632,38.5538C19.2249,37.2459 19.1445,35.0451 20.4523,33.6381C21.7601,32.231 23.961,32.1506 25.368,33.4584L36.193,43.52Z"
+      android:strokeWidth="1"
+      android:strokeColor="#00000000"/>
+  </group>
 </vector>