package com.ic.sport;
+import android.os.Bundle;
+
import androidx.appcompat.app.AppCompatActivity;
import androidx.lifecycle.ViewModelProvider;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import androidx.viewpager2.widget.ViewPager2;
-import android.os.Bundle;
-
+import com.ic.iclooger.ICLogger;
import com.ic.sport.adapter.FragmentAdapter;
import com.ic.sport.adapter.IndicatorAdapter;
import com.ic.sport.fragment.pedometer.PedMainFragment;
@Override
public void onDialogUpdate(int type, int value) {
- ((PedSetupFragment) myAdapter.getFragment(0)).updateSetuUpValue(type, value);
+ ICLogger.d("type ==> " + type + " value ==> " + value);
+ ((PedSetupFragment) myAdapter.getFragment(0)).updateSetUpValue(type, value);
switch (type) {
case 0:
pedometerModel.syncPedHeightSetting(value);
SPUtils.setPedHeightSP(getApplicationContext(), value);
+ break;
case 1:
pedometerModel.syncPedWeightSetting(value);
- SPUtils.setPedWighttSP(getApplicationContext(), value);
+ SPUtils.setPedWeightSP(getApplicationContext(), value);
break;
}
}
setupArray = new PedSetupEntity[3];
int[] valueArray = new int[]{
SPUtils.getPedHeightSP(context),
- SPUtils.getPedWighttSP(context),
+ SPUtils.getPedWightSP(context),
SPUtils.getPedTargetSP(context)
};
import android.view.View;
import android.view.ViewGroup;
import android.view.Window;
-import android.widget.ImageButton;
import android.widget.ImageView;
import androidx.annotation.NonNull;
}
VALUE_CURR[0] = SPUtils.getPedHeightSP(mContext);
- VALUE_CURR[1] = SPUtils.getPedWighttSP(mContext);
+ VALUE_CURR[1] = SPUtils.getPedWightSP(mContext);
UNIT_RES[0] = getString(R.string.tips_height_unit);
UNIT_RES[1] = getString(R.string.tips_weight_unit);
import android.content.Context;
import android.graphics.Rect;
import android.os.Bundle;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
import androidx.annotation.NonNull;
import androidx.fragment.app.Fragment;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
-import android.view.LayoutInflater;
-import android.view.View;
-import android.view.ViewGroup;
-
import com.ic.sport.R;
import com.ic.sport.adapter.PedSetupAdapter;
alertDialog.show(fm, "PedSetupDialog");
};
- public void updateSetuUpValue(int type, int value) {
+ public void updateSetUpValue(int type, int value) {
setupAdapter.notifyUpdateValue(type, value);
}
import android.content.Context;
import android.content.SharedPreferences;
+import com.ic.iclooger.ICLogger;
+
public class SPUtils {
private static final String Ped_Height = "Ped_Height";
}
public static int getPedHeightSP(Context context) {
- return getSp(context).getInt(Ped_Height, 170);
+ int getHeight = getSp(context).getInt(Ped_Height, 170);
+ ICLogger.d("getHeight == > " + getHeight);
+ return getHeight;
}
- public static int getPedWighttSP(Context context) {
- return getSp(context).getInt(Ped_Weight, 75);
+ public static int getPedWightSP(Context context) {
+ int getWeight = getSp(context).getInt(Ped_Weight, 75);
+ ICLogger.d("getWeight == > " + getWeight);
+ return getWeight;
}
public static int getPedTargetSP(Context context) {
return getSp(context).getInt(Ped_Target, 10000);
}
- public static void setPedHeightSP(Context context,int height) {
+ public static void setPedHeightSP(Context context, int height) {
+ ICLogger.d("setHeight == > " + height);
SharedPreferences.Editor editor = getSp(context).edit();
if (editor != null) {
- editor.putInt(Ped_Weight, height);
+ editor.putInt(Ped_Height, height);
editor.apply();
}
}
- public static void setPedWighttSP(Context context,int weight) {
+ public static void setPedWeightSP(Context context, int weight) {
+ ICLogger.d("setWeight == > " + weight);
SharedPreferences.Editor editor = getSp(context).edit();
if (editor != null) {
editor.putInt(Ped_Weight, weight);
}
}
- public static void setPedTargetSP(Context context,int target) {
+ public static void setPedTargetSP(Context context, int target) {
SharedPreferences.Editor editor = getSp(context).edit();
if (editor != null) {
editor.putInt(Ped_Target, target);