隐藏了历史记录页面
authorTrillGates <williamtrillgates@gmail.com>
Fri, 10 Dec 2021 07:32:43 +0000 (15:32 +0800)
committerTrillGates <williamtrillgates@gmail.com>
Fri, 10 Dec 2021 07:32:43 +0000 (15:32 +0800)
app/src/main/java/com/ic/sport/PedometerActivity.java
app/src/main/java/com/ic/sport/adapter/FragmentAdapter.java
app/src/main/java/com/ic/sport/adapter/IndicatorAdapter.java
app/src/main/java/com/ic/sport/widget/ring/RingProgress.java
app/src/main/res/layout/activity_pedometer.xml
app/src/main/res/mipmap-mdpi/icon_arrow.png

index b830e2d..087dc15 100644 (file)
@@ -118,7 +118,9 @@ public class PedometerActivity extends AppCompatActivity
     private void initViewPage() {
         myAdapter = new FragmentAdapter(getSupportFragmentManager(), getLifecycle());
         myViewPager2.setAdapter(myAdapter);
-        myViewPager2.setCurrentItem(1);
+        myViewPager2.postDelayed(() -> {
+            myViewPager2.setCurrentItem(1);
+        }, 500);
         myViewPager2.registerOnPageChangeCallback(currentItemUpdater);
     }
 
index b2f5d52..500e507 100644 (file)
@@ -7,7 +7,6 @@ import androidx.lifecycle.Lifecycle;
 import androidx.viewpager2.adapter.FragmentStateAdapter;
 
 import com.ic.sport.fragment.pedometer.PedMainFragment;
-import com.ic.sport.fragment.pedometer.PedRecordFragment;
 import com.ic.sport.fragment.pedometer.PedSetupFragment;
 
 import java.util.ArrayList;
@@ -21,7 +20,8 @@ public class FragmentAdapter extends FragmentStateAdapter {
         super(fragmentManager, lifecycle);
         arrayList.add(PedSetupFragment.newInstance());
         arrayList.add(PedMainFragment.newInstance());
-        arrayList.add(PedRecordFragment.newInstance());
+        //李峰军的不需要显示记录,这是个独立的分支,放心修改
+        //arrayList.add(PedRecordFragment.newInstance());
     }
 
 
index bd93c33..6af9c4c 100644 (file)
@@ -10,7 +10,7 @@ import com.ic.sport.databinding.ItemIndicatorLayoutBinding;
 
 public class IndicatorAdapter extends RecyclerView.Adapter<IndicatorAdapter.IndicatorHolder> {
 
-    private boolean[] stateList = new boolean[]{false, true, false};
+    private boolean[] stateList = new boolean[]{false, true};
 
     private int oldCheckIndex=1;
 
@@ -19,7 +19,6 @@ public class IndicatorAdapter extends RecyclerView.Adapter<IndicatorAdapter.Indi
             stateList[index] = true;
             stateList[oldCheckIndex] =false;
             oldCheckIndex = index;
-
             notifyDataSetChanged();
         }
     }
index d8a6274..917a6f2 100644 (file)
@@ -114,7 +114,7 @@ public class RingProgress extends View {
         TypedArray typedArray = getContext().obtainStyledAttributes(attrs, R.styleable.CircleProgress);
         neiYuanColor = typedArray.getColor(R.styleable.CircleProgress_neiYuanColor, getTransparentColor());
         ringRadius = (int) typedArray.getDimension(R.styleable.CircleProgress_ringRadius, -1);
-        ringWidth = (int) typedArray.getDimension(R.styleable.CircleProgress_ringWidth, 22);
+        ringWidth = (int) typedArray.getDimension(R.styleable.CircleProgress_ringWidth, 20);
         ringColor = typedArray.getColor(R.styleable.CircleProgress_ringColor,
                 ContextCompat.getColor(getContext(), R.color.top_color2));
         ringProgressColor = typedArray.getColor(R.styleable.CircleProgress_ringProgressColor,
@@ -229,7 +229,7 @@ public class RingProgress extends View {
 
     private void drawTopIcon(Canvas canvas) {
         int left = centerX - topIcon.getWidth() / 2;
-        int top = centerY - topIcon.getHeight() / 2 - ringRadius;
+        int top = centerY - topIcon.getHeight() / 2 - ringRadius + 2;
         canvas.drawBitmap(topIcon, left, top, mPaint);
     }
 
index 2f3e1d9..83810e4 100644 (file)
@@ -31,7 +31,7 @@
         android:id="@+id/ped_main_view_page"
         android:layout_width="match_parent"
         android:layout_height="match_parent"
-        android:layout_marginTop="40dp"
+        android:layout_marginTop="36dp"
         android:layout_marginBottom="20dp" />
 
     <androidx.recyclerview.widget.RecyclerView
index 24a6712..6142167 100644 (file)
Binary files a/app/src/main/res/mipmap-mdpi/icon_arrow.png and b/app/src/main/res/mipmap-mdpi/icon_arrow.png differ