private void initViewPage() {
myAdapter = new FragmentAdapter(getSupportFragmentManager(), getLifecycle());
myViewPager2.setAdapter(myAdapter);
- myViewPager2.setCurrentItem(1);
+ myViewPager2.postDelayed(() -> {
+ myViewPager2.setCurrentItem(1);
+ }, 500);
myViewPager2.registerOnPageChangeCallback(currentItemUpdater);
}
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;
super(fragmentManager, lifecycle);
arrayList.add(PedSetupFragment.newInstance());
arrayList.add(PedMainFragment.newInstance());
- arrayList.add(PedRecordFragment.newInstance());
+ //李峰军的不需要显示记录,这是个独立的分支,放心修改
+ //arrayList.add(PedRecordFragment.newInstance());
}
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;
stateList[index] = true;
stateList[oldCheckIndex] =false;
oldCheckIndex = index;
-
notifyDataSetChanged();
}
}
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,
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);
}
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