浏览代码

[메인][New] 1카테고리 등장 시간 및 변환 길이 수정

hyodong.min 7 年之前
父节点
当前提交
73eba80651

+ 1 - 0
app/src/main/java/kr/co/zumo/app/lifeplus/model/SuperModelInit.java

@@ -6,6 +6,7 @@ package kr.co.zumo.app.lifeplus.model;
 import android.content.Context;
 import android.graphics.Point;
 import android.preference.PreferenceManager;
+import android.util.DisplayMetrics;
 import android.util.Log;
 import android.view.Display;
 import android.view.WindowManager;

+ 9 - 4
app/src/main/java/kr/co/zumo/app/lifeplus/view/screen/main/MainContentsSnapper.java

@@ -244,7 +244,7 @@ public class MainContentsSnapper extends RecyclerView.OnFlingListener {
       return;
     }
 
-    SmoothScroller smoothScroller = createScroller(layoutManager);
+    SmoothScroller smoothScroller = createScroller(layoutManager, 200f);
     if (smoothScroller == null) {
       return;
     }
@@ -261,7 +261,12 @@ public class MainContentsSnapper extends RecyclerView.OnFlingListener {
    */
   @Nullable
   protected SmoothScroller createScroller(LayoutManager layoutManager) {
-    return createSnapScroller(layoutManager);
+    return createSnapScroller(layoutManager, MILLISECONDS_PER_INCH);
+  }
+
+  @Nullable
+  protected SmoothScroller createScroller(LayoutManager layoutManager, float millsPerInch) {
+    return createSnapScroller(layoutManager, millsPerInch);
   }
 
   /**
@@ -274,7 +279,7 @@ public class MainContentsSnapper extends RecyclerView.OnFlingListener {
    */
   @Nullable
   @Deprecated
-  protected LinearSmoothScroller createSnapScroller(LayoutManager layoutManager) {
+  protected LinearSmoothScroller createSnapScroller(LayoutManager layoutManager, float millsPerInch) {
     if (!(layoutManager instanceof ScrollVectorProvider)) {
       return null;
     }
@@ -337,7 +342,7 @@ public class MainContentsSnapper extends RecyclerView.OnFlingListener {
 
       @Override
       protected float calculateSpeedPerPixel(DisplayMetrics displayMetrics) {
-        return MILLISECONDS_PER_INCH / displayMetrics.densityDpi;
+        return millsPerInch / displayMetrics.densityDpi;
       }
     };
   }

+ 6 - 2
app/src/main/java/kr/co/zumo/app/lifeplus/view/screen/main/MainFragment.java

@@ -213,7 +213,12 @@ public class MainFragment extends FragmentBase<MainPresenter> implements IMainVi
         presenter.onEvent(event);
       });
 
-      contentsRecyclerView.setLayoutManager(new LinearLayoutManager(getContext(), LinearLayoutManager.VERTICAL, false));
+      contentsRecyclerView.setLayoutManager(new LinearLayoutManager(getContext(), LinearLayoutManager.VERTICAL, false) {
+        @Override
+        protected int getExtraLayoutSpace(RecyclerView.State state) {
+          return contentsRecyclerView.getLayoutManager().getHeight() * 2;
+        }
+      });
       contentsRecyclerView.setAdapter(adapter);
     }
     else {
@@ -223,7 +228,6 @@ public class MainFragment extends FragmentBase<MainPresenter> implements IMainVi
   }
 
 
-
   /***********************************
    * debug
    ***********************************/

+ 1 - 1
app/src/main/java/kr/co/zumo/app/lifeplus/view/screen/main/MainPresenter.java

@@ -146,7 +146,7 @@ public class MainPresenter extends Presenter<MainModel, IMainView> {
    * 2초 동안 사용자 입력이 없으면 카테고리 1로 스크롤 시킴.
    */
   private void setTimer() {
-    disposable = Completable.timer(2000, TimeUnit.MILLISECONDS, AndroidSchedulers.mainThread())
+    disposable = Completable.timer(5500, TimeUnit.MILLISECONDS, AndroidSchedulers.mainThread())
       .subscribe(() -> {
         if (false == isTouched) {
           // 첫 번째 카테고리로 이동