|
@@ -1,6 +1,7 @@
|
|
|
package com.emato.ich.fragment;
|
|
|
|
|
|
import android.annotation.SuppressLint;
|
|
|
+import android.graphics.drawable.ColorDrawable;
|
|
|
import android.os.Bundle;
|
|
|
import android.os.CountDownTimer;
|
|
|
import android.util.Log;
|
|
@@ -8,6 +9,7 @@ import android.view.LayoutInflater;
|
|
|
import android.view.View;
|
|
|
import android.view.ViewGroup;
|
|
|
import android.widget.Button;
|
|
|
+import android.widget.TextView;
|
|
|
|
|
|
import androidx.annotation.NonNull;
|
|
|
import androidx.annotation.Nullable;
|
|
@@ -51,11 +53,12 @@ public class ChooseCabinetFragment extends Fragment {
|
|
|
private FragmentChooseCabinetBinding binding;
|
|
|
private CountDownTimer timer;
|
|
|
|
|
|
- private void isDisable(Integer available, Button button){
|
|
|
+ @SuppressLint("ResourceAsColor")
|
|
|
+ private void isDisable(Integer available, Button button, TextView textView){
|
|
|
if (available <= 0) {
|
|
|
button.setEnabled(false);
|
|
|
} else {
|
|
|
- button.setBackgroundColor(500156);
|
|
|
+ textView.setBackgroundColor(android.graphics.Color.parseColor("#44CE3B"));
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -110,19 +113,19 @@ public class ChooseCabinetFragment extends Fragment {
|
|
|
switch (cabinetInfoVo.getType()) {
|
|
|
case "mini":
|
|
|
binding.tinyCabinet.append("可用" + cabinetInfoVo.getAvailable() + "个");
|
|
|
- isDisable(cabinetInfoVo.getAvailable(), binding.tinyCabinetBtn);
|
|
|
+ isDisable(cabinetInfoVo.getAvailable(), binding.tinyCabinetBtn, binding.tinyCabinetBg);
|
|
|
break;
|
|
|
case "small":
|
|
|
binding.smallCabinet.append("可用" + cabinetInfoVo.getAvailable() + "个");
|
|
|
- isDisable(cabinetInfoVo.getAvailable(), binding.smallCabinetBtn);
|
|
|
+ isDisable(cabinetInfoVo.getAvailable(), binding.smallCabinetBtn, binding.smallCabinetBg);
|
|
|
break;
|
|
|
case "medium":
|
|
|
binding.mediumCabinet.append("可用" + cabinetInfoVo.getAvailable() + "个");
|
|
|
- isDisable(cabinetInfoVo.getAvailable(), binding.mediumCabinetBtn);
|
|
|
+ isDisable(cabinetInfoVo.getAvailable(), binding.mediumCabinetBtn, binding.mediumCabinetBg);
|
|
|
break;
|
|
|
case "large":
|
|
|
binding.bigCabinet.append("可用" + cabinetInfoVo.getAvailable() + "个");
|
|
|
- isDisable(cabinetInfoVo.getAvailable(), binding.bigCabinetBtn);
|
|
|
+ isDisable(cabinetInfoVo.getAvailable(), binding.bigCabinetBtn, binding.bigCabinetBg);
|
|
|
break;
|
|
|
default:
|
|
|
break;
|