Browse Source

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

hyodong.min 7 years ago
parent
commit
ea5d4fb991

+ 3 - 1
app/src/main/java/kr/co/zumo/app/lifeplus/view/Event.java

@@ -94,6 +94,8 @@ public class Event {
   public static final int MY_FAQ = 66;
   public static final int UPDATE = 67;
   public static final int CLOSE = 68;
+  public static final int FILTER = 69;
+
 
   @Retention(RetentionPolicy.SOURCE)
   @IntDef({
@@ -104,7 +106,7 @@ public class Event {
     ACTION_BAR_HOME, ACTION_BAR_NOTIFICATION, ACTION_BAR_SETTING, ACTION_BAR_CLOSE, ACTION_BAR_BACK,
     ACTION_BAR_SEARCH, ACTION_BAR_MENU, ACTION_BAR_TITLE, FIRST_CATEGORY, SECOND_CATEGORY, THIRD_CATEGORY, FOURTH_CATEGORY, FIFTH_CATEGORY,
     SWITCH, BOOK_MARK_DEFAULT, BOOK_MARK_LIST, ADD, MY_COIN_MAIN, MY_PURCHASE_HISTORY, GUIDE, ADD_BUCKET, MY_MAIN_GUEST, COUPON_MALL, CATEGORY_CLICK,
-    MY_FAQ, UPDATE, CLOSE
+    MY_FAQ, UPDATE, FILTER, CLOSE
   })
   public @interface ID {}
 

+ 1 - 1
app/src/main/java/kr/co/zumo/app/lifeplus/view/screen/main/category/banner/MainBannerAdapter.java

@@ -1,4 +1,4 @@
-package kr.co.zumo.app.lifeplus.view.screen.main.category.banner;
+package kr.co.zumo.app.lifeplus.view.custom.main.banner;
 
 import android.content.Context;
 import android.support.annotation.NonNull;

+ 1 - 1
app/src/main/java/kr/co/zumo/app/lifeplus/view/custom/main/banner/MainBannerView.java

@@ -23,7 +23,6 @@ import java.util.List;
 
 import kr.co.zumo.app.R;
 import kr.co.zumo.app.lifeplus.bean.TextImageBean;
-import kr.co.zumo.app.lifeplus.view.screen.main.category.banner.MainBannerAdapter;
 
 /**
  * MainBannerView
@@ -63,6 +62,7 @@ public class MainBannerView extends ConstraintLayout {
     recyclerView.setOnFlingListener(null);
     snapHelper.attachToRecyclerView(recyclerView);
     recyclerView.setAdapter(mainBannerAdapter);
+    recyclerView.addItemDecoration(new MainBannerViewItemDotIndicator());
 
   }
 

+ 1 - 1
app/src/main/java/kr/co/zumo/app/lifeplus/view/screen/main/category/banner/MainBannerViewHolder.java

@@ -1,4 +1,4 @@
-package kr.co.zumo.app.lifeplus.view.screen.main.category.banner;
+package kr.co.zumo.app.lifeplus.view.custom.main.banner;
 
 import android.support.v7.widget.RecyclerView;
 import android.view.View;

+ 136 - 0
app/src/main/java/kr/co/zumo/app/lifeplus/view/custom/main/banner/MainBannerViewItemDotIndicator.java

@@ -0,0 +1,136 @@
+package kr.co.zumo.app.lifeplus.view.custom.main.banner;
+
+import android.content.Context;
+import android.content.res.Resources;
+import android.graphics.Canvas;
+import android.graphics.Paint;
+import android.support.v7.widget.LinearLayoutManager;
+import android.support.v7.widget.RecyclerView;
+import android.view.View;
+
+/**
+ * MainBannerViewItemDotIndicator
+ * <pre>
+ * </pre>
+ *
+ * @author 하세미
+ * @version 1.0
+ * @history 하세미   [2018-11-01]   [최초 작성]
+ * @since 2018-11-01
+ */
+public class MainBannerViewItemDotIndicator extends RecyclerView.ItemDecoration {
+
+  private Context context;
+  private int colorActive = 0xFFFFFFFF;
+  private int colorInactive = 0x4DFFFFFF;
+  private static final float DP = Resources.getSystem().getDisplayMetrics().density;
+
+  /**
+   * Height of the space the indicator takes up at the bottom of the view.
+   */
+  private final int mIndicatorHeight = (int) (DP * 16);
+
+  /**
+   * Indicator stroke width.
+   */
+  private final float mIndicatorStrokeWidth = DP * 4;
+
+  /**
+   * Indicator width.
+   */
+  private final float mIndicatorItemLength = DP * 4;
+  /**
+   * Padding between indicators.
+   */
+  private final float mIndicatorItemPadding = DP * 8;
+
+
+  /**
+   * Some more natural animation interpolation
+   */
+  //private final Interpolator mInterpolator = new AccelerateDecelerateInterpolator();
+
+  private final Paint mPaint = new Paint();
+
+  public MainBannerViewItemDotIndicator() {
+    //this.context = context;
+    mPaint.setStrokeCap(Paint.Cap.ROUND);
+    mPaint.setStrokeWidth(mIndicatorStrokeWidth);
+    mPaint.setStyle(Paint.Style.STROKE);
+    mPaint.setAntiAlias(true);
+  }
+
+  @Override
+  public void onDrawOver(Canvas c, RecyclerView parent, RecyclerView.State state) {
+    super.onDrawOver(c, parent, state);
+
+    int itemCount = parent.getAdapter().getItemCount();
+
+    // center horizontally, calculate width and subtract half from center
+    float totalLength = mIndicatorItemLength * itemCount;
+    float paddingBetweenItems = Math.max(0, itemCount - 1) * mIndicatorItemPadding;
+    float indicatorTotalWidth = totalLength + paddingBetweenItems;
+    float indicatorStartX = (parent.getWidth() - indicatorTotalWidth) / 2F;
+
+    // center vertically in the allotted space
+    float indicatorPosY = parent.getHeight() - mIndicatorHeight / 2F;
+
+    drawInactiveIndicators(c, indicatorStartX, indicatorPosY, itemCount);
+
+
+    // find active page (which should be highlighted)
+    LinearLayoutManager layoutManager = (LinearLayoutManager) parent.getLayoutManager();
+    int activePosition = layoutManager.findFirstVisibleItemPosition();
+    if (activePosition == RecyclerView.NO_POSITION) {
+      return;
+    }
+
+    // find offset of active page (if the user is scrolling)
+    final View activeChild = layoutManager.findViewByPosition(activePosition);
+    int left = activeChild.getLeft();
+    int width = activeChild.getWidth();
+
+    // on swipe the active item will be positioned from [-width, 0]
+    // interpolate offset for smooth animation
+    //float progress = mInterpolator.getInterpolation(left * -1 / (float) width);
+
+    drawHighlights(c, indicatorStartX, indicatorPosY, activePosition, itemCount);
+  }
+
+  private void drawInactiveIndicators(Canvas c, float indicatorStartX, float indicatorPosY, int itemCount) {
+    mPaint.setColor(colorInactive);
+
+    // width of item indicator including padding
+    final float itemWidth = mIndicatorItemLength + mIndicatorItemPadding;
+
+    float start = indicatorStartX;
+    for (int i = 0; i < itemCount; i++) {
+      // draw the line for every item
+      if (itemCount != 1) {
+        c.drawCircle(start, indicatorPosY, mIndicatorItemLength / 2F, mPaint);
+
+        start += itemWidth;
+      }
+    }
+  }
+
+  private void drawHighlights(Canvas c, float indicatorStartX, float indicatorPosY,
+                              int highlightPosition, int itemCount) {
+    mPaint.setColor(colorActive);
+
+    // width of item indicator including padding
+    final float itemWidth = mIndicatorItemLength + mIndicatorItemPadding;
+
+
+      // no swipe, draw a normal indicator
+      float highlightStart = indicatorStartX + itemWidth * highlightPosition;
+     c.drawCircle(highlightStart, indicatorPosY, mIndicatorItemLength / 2F, mPaint);
+
+      // draw the highlight overlapping to the next item as well
+      if (highlightPosition < itemCount - 1) {
+        highlightStart += itemWidth;
+        c.drawCircle(highlightStart, indicatorPosY, mIndicatorItemLength / 2F, mPaint);
+      }
+
+  }
+}

+ 1 - 2
app/src/main/java/kr/co/zumo/app/lifeplus/view/screen/main/category/series/CustomImageTextAdapter.java

@@ -1,4 +1,4 @@
-package kr.co.zumo.app.lifeplus.view.screen.main.category.series;
+package kr.co.zumo.app.lifeplus.view.custom.main.series;
 
 import android.content.Context;
 import android.support.annotation.NonNull;
@@ -11,7 +11,6 @@ import java.util.List;
 
 import kr.co.zumo.app.R;
 import kr.co.zumo.app.lifeplus.bean.TextImageBean;
-import kr.co.zumo.app.lifeplus.view.custom.main.series.IMainSeriesContract;
 
 /**
  * CustomImageTextAdapter

+ 1 - 2
app/src/main/java/kr/co/zumo/app/lifeplus/view/screen/main/category/series/CustomImageTextViewHolder.java

@@ -1,4 +1,4 @@
-package kr.co.zumo.app.lifeplus.view.screen.main.category.series;
+package kr.co.zumo.app.lifeplus.view.custom.main.series;
 
 import android.support.v7.widget.RecyclerView;
 import android.view.View;
@@ -7,7 +7,6 @@ import android.widget.TextView;
 
 import kr.co.zumo.app.R;
 import kr.co.zumo.app.lifeplus.bean.TextImageBean;
-import kr.co.zumo.app.lifeplus.view.custom.main.series.IMainSeriesContract;
 
 /**
  * CustomImageTextViewHolder

+ 0 - 1
app/src/main/java/kr/co/zumo/app/lifeplus/view/custom/main/series/MainSeriesView.java

@@ -11,7 +11,6 @@ import java.util.List;
 
 import kr.co.zumo.app.R;
 import kr.co.zumo.app.lifeplus.bean.TextImageBean;
-import kr.co.zumo.app.lifeplus.view.screen.main.category.series.CustomImageTextAdapter;
 
 /**
  * CustomRecyclerView

+ 2 - 2
app/src/main/java/kr/co/zumo/app/lifeplus/view/custom/pin/CustomPinView.java

@@ -197,10 +197,10 @@ public class CustomPinView extends ConstraintLayout implements IPinContract.View
     for (int i = 0; i < imageList.size(); ++i) {
       ImageView imageView = imageList.get(i);
       if (i < passwordSize) {
-        imageView.setImageResource(R.drawable.circle_full);
+        imageView.setImageResource(R.drawable.circle_c000000);
       }
       else {
-        imageView.setImageResource(R.drawable.circle_empty);
+        imageView.setImageResource(R.drawable.circle_ce5e5e5);
       }
     }
   }

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

@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="utf-8"?>
+<shape xmlns:android="http://schemas.android.com/apk/res/android"
+       android:shape="oval">
+<solid
+  android:color="@color/C000000"/>
+</shape>

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

@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="utf-8"?>
+<shape xmlns:android="http://schemas.android.com/apk/res/android"
+       android:shape="oval">
+<solid
+  android:color="@color/C4DFFFFFF"/>
+</shape>

+ 1 - 1
app/src/main/res/drawable/circle_empty.xml

@@ -2,5 +2,5 @@
 <shape xmlns:android="http://schemas.android.com/apk/res/android"
        android:shape="oval">
   <solid
-    android:color="#e5e5e5"/>
+    android:color="@color/CE5E5E5"/>
 </shape>

+ 1 - 1
app/src/main/res/drawable/circle_full.xml

@@ -2,5 +2,5 @@
 <shape xmlns:android="http://schemas.android.com/apk/res/android"
        android:shape="oval">
   <solid
-    android:color="#000000"/>
+    android:color="@color/CFFFFFF"/>
 </shape>

+ 4 - 4
app/src/main/res/layout/dialog_current_page_share.xml

@@ -33,7 +33,7 @@
       android:layout_width="35dp"
       android:layout_height="35dp"
       android:layout_marginTop="20dp"
-      android:src="@drawable/circle_full"
+      android:src="@drawable/circle_c000000"
       app:layout_constraintHorizontal_chainStyle="packed"
       app:layout_constraintEnd_toStartOf="@+id/image_view_facebook"
       app:layout_constraintHorizontal_bias="0.5"
@@ -46,7 +46,7 @@
       android:layout_height="35dp"
       android:layout_marginStart="33dp"
       android:layout_marginTop="20dp"
-      android:src="@drawable/circle_full"
+      android:src="@drawable/circle_c000000"
       app:layout_constraintEnd_toStartOf="@+id/image_view_email"
       app:layout_constraintHorizontal_bias="0.5"
       app:layout_constraintStart_toEndOf="@+id/image_view_kakao"
@@ -58,7 +58,7 @@
       android:layout_height="35dp"
       android:layout_marginStart="32dp"
       android:layout_marginTop="20dp"
-      android:src="@drawable/circle_full"
+      android:src="@drawable/circle_c000000"
       app:layout_constraintEnd_toStartOf="@+id/image_view_url"
       app:layout_constraintHorizontal_bias="0.5"
       app:layout_constraintStart_toEndOf="@+id/image_view_facebook"
@@ -70,7 +70,7 @@
       android:layout_height="35dp"
       android:layout_marginStart="32dp"
       android:layout_marginTop="20dp"
-      android:src="@drawable/circle_full"
+      android:src="@drawable/circle_c000000"
       app:layout_constraintEnd_toEndOf="parent"
       app:layout_constraintHorizontal_bias="0.5"
       app:layout_constraintStart_toEndOf="@+id/image_view_email"

+ 4 - 4
app/src/main/res/layout/main_banner_view.xml

@@ -4,8 +4,8 @@
   xmlns:app="http://schemas.android.com/apk/res-auto"
   android:layout_width="match_parent"
   android:layout_height="match_parent">
-  <android.support.v7.widget.RecyclerView
-    android:id="@+id/recycler_view_main_banner_view"
-    android:layout_width="match_parent"
-    android:layout_height="match_parent"/>
+    <android.support.v7.widget.RecyclerView
+      android:id="@+id/recycler_view_main_banner_view"
+      android:layout_width="match_parent"
+      android:layout_height="match_parent"/>
 </android.support.constraint.ConstraintLayout>

+ 4 - 4
app/src/main/res/layout/pin_view.xml

@@ -76,7 +76,7 @@
       android:layout_height="10dp"
       android:layout_marginStart="12dp"
       android:layout_marginEnd="12dp"
-      android:src="@drawable/circle_empty"
+      android:src="@drawable/circle_ce5e5e5"
       />
 
     <ImageView
@@ -85,7 +85,7 @@
       android:layout_height="10dp"
       android:layout_marginStart="12dp"
       android:layout_marginEnd="12dp"
-      android:src="@drawable/circle_empty"
+      android:src="@drawable/circle_ce5e5e5"
       />
 
     <ImageView
@@ -94,7 +94,7 @@
       android:layout_height="10dp"
       android:layout_marginStart="12dp"
       android:layout_marginEnd="12dp"
-      android:src="@drawable/circle_empty"
+      android:src="@drawable/circle_ce5e5e5"
       />
 
     <ImageView
@@ -103,7 +103,7 @@
       android:layout_height="10dp"
       android:layout_marginStart="12dp"
       android:layout_marginEnd="12dp"
-      android:src="@drawable/circle_empty"
+      android:src="@drawable/circle_ce5e5e5"
       />
 
   </LinearLayout>

+ 3 - 0
app/src/main/res/values/colors.xml

@@ -11,6 +11,9 @@
   <color name="C66000000">#66000000</color>
  <!--opacity 60%-->
   <color name="C99000000">#99000000</color>
+  <!--opacity 30%-->
+  <color name="C4DFFFFFF">#4DFFFFFF</color>
+
   <color name="CF44336">#F44336</color>
   <color name="C999999">#999999</color>
   <color name="CF12815">#f12815</color>