|
@@ -123,8 +123,8 @@ public class PriceFragment extends BaseFragment implements View.OnClickListener
|
|
@Override
|
|
@Override
|
|
public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) {
|
|
public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) {
|
|
super.onViewCreated(view, savedInstanceState);
|
|
super.onViewCreated(view, savedInstanceState);
|
|
-// if (Global.isVersions == 1) {
|
|
|
|
- if (Global.isGetProductName == 0&&Global.isVersions==1) {
|
|
|
|
|
|
+ if (Global.isVersions == 1) {
|
|
|
|
+// if (Global.isGetProductName == 0 && Global.isVersions == 1) {
|
|
getproducts();
|
|
getproducts();
|
|
}
|
|
}
|
|
btnConfirmName = view.findViewById(R.id.btn_confirm_name);
|
|
btnConfirmName = view.findViewById(R.id.btn_confirm_name);
|
|
@@ -346,7 +346,7 @@ public class PriceFragment extends BaseFragment implements View.OnClickListener
|
|
|
|
|
|
private int currentPosition = -1;
|
|
private int currentPosition = -1;
|
|
String oldProductName;
|
|
String oldProductName;
|
|
- List<String> oldProductNames = new ArrayList<>(5);
|
|
|
|
|
|
+ List<String> oldProductNames;
|
|
|
|
|
|
|
|
|
|
class PriceAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder> implements View.OnClickListener {
|
|
class PriceAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder> implements View.OnClickListener {
|
|
@@ -360,7 +360,7 @@ public class PriceFragment extends BaseFragment implements View.OnClickListener
|
|
PriceAdapter(ArrayList<PriceBean> list, Context context) {
|
|
PriceAdapter(ArrayList<PriceBean> list, Context context) {
|
|
this.inflater = LayoutInflater.from(context);
|
|
this.inflater = LayoutInflater.from(context);
|
|
this.list = list;
|
|
this.list = list;
|
|
-
|
|
|
|
|
|
+ oldProductNames = new ArrayList<>();
|
|
for (int i = 0; i < list.size(); i++) {
|
|
for (int i = 0; i < list.size(); i++) {
|
|
Log.d(TAG, "PriceAdapter2: " + SPUtils.getInstance(App.app).getString(list.get(i).getNameKey(), getString(ProductAbout.defaultName[i])));
|
|
Log.d(TAG, "PriceAdapter2: " + SPUtils.getInstance(App.app).getString(list.get(i).getNameKey(), getString(ProductAbout.defaultName[i])));
|
|
Log.d(TAG, "PriceAdapter4: " + SPUtils.getInstance(App.app).getString(list.get(i).getPriceKey(), ProductAbout.priceDefault[i]));
|
|
Log.d(TAG, "PriceAdapter4: " + SPUtils.getInstance(App.app).getString(list.get(i).getPriceKey(), ProductAbout.priceDefault[i]));
|
|
@@ -368,9 +368,11 @@ public class PriceFragment extends BaseFragment implements View.OnClickListener
|
|
// oldProductNames.add(oldProductName);
|
|
// oldProductNames.add(oldProductName);
|
|
if (Global.isGetProductName == 0) {
|
|
if (Global.isGetProductName == 0) {
|
|
oldProductName = SPUtils.getInstance(App.app).getString(UiUtil.getStringRes(list.get(i).getTitle()), ProductAbout.chineseName[i]);
|
|
oldProductName = SPUtils.getInstance(App.app).getString(UiUtil.getStringRes(list.get(i).getTitle()), ProductAbout.chineseName[i]);
|
|
- oldProductNames.add(oldProductName);
|
|
|
|
|
|
+ Global.isGetProductName = 1;
|
|
|
|
+ } else {
|
|
|
|
+ oldProductName = SPUtils.getInstance(App.app).getString(PriceFragment.ProductAbout.nameKey[i], ProductAbout.chineseName[i]);
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+ oldProductNames.add(oldProductName);
|
|
}
|
|
}
|
|
Log.d(TAG, "PriceAdapter刚开始: " + oldProductNames);
|
|
Log.d(TAG, "PriceAdapter刚开始: " + oldProductNames);
|
|
// nameListener = (v, hasFocus) -> {
|
|
// nameListener = (v, hasFocus) -> {
|