version:
fix: update:优化类名,准备修复闹钟问题
This commit is contained in:
@@ -21,11 +21,12 @@ import com.bumptech.glide.Glide;
|
||||
import com.bumptech.glide.load.resource.bitmap.RoundedCorners;
|
||||
import com.bumptech.glide.request.RequestOptions;
|
||||
import com.xxpatx.os.R;
|
||||
import com.xxpatx.os.activity.alarmclock.edit.AlarmClockEditActivity;
|
||||
import com.xxpatx.os.activity.alarm.edit.AlarmEditActivity;
|
||||
import com.xxpatx.os.utils.FFmpegUtils;
|
||||
import com.xxpatx.os.utils.ScreenUtils;
|
||||
import com.xxpatx.os.utils.Utils;
|
||||
import com.xxpatx.os.view.JzvdStdRound;
|
||||
import com.xxpatx.os.view.ToggleButton;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
@@ -61,7 +62,7 @@ public class AlarmAdapter extends RecyclerView.Adapter<AlarmAdapter.holder> {
|
||||
@Override
|
||||
public holder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
|
||||
mContext = (FragmentActivity) parent.getContext();
|
||||
return new AlarmAdapter.holder(LayoutInflater.from(parent.getContext()).inflate(R.layout.item_alarm_clock, parent, false));
|
||||
return new AlarmAdapter.holder(LayoutInflater.from(parent.getContext()).inflate(R.layout.item_alarm_port, parent, false));
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -104,6 +105,28 @@ public class AlarmAdapter extends RecyclerView.Adapter<AlarmAdapter.holder> {
|
||||
} else {
|
||||
holder.tv_title.setText(title);
|
||||
}
|
||||
int is_onoff = alarmClockData.getIs_onoff();
|
||||
holder.toggleButton2.setDisable(true);
|
||||
if (is_onoff == 1) {
|
||||
holder.tv_status.setText("已开启");
|
||||
holder.toggleButton2.setToggleOn(false);
|
||||
} else {
|
||||
holder.tv_status.setText("已关闭");
|
||||
holder.toggleButton2.setToggleOff(false);
|
||||
}
|
||||
int type = alarmClockData.getClazz();
|
||||
switch (type){
|
||||
case 1:
|
||||
default:
|
||||
holder.iv_type.setImageDrawable(mContext.getDrawable(R.drawable.icon_alarm_medicine_pressed));
|
||||
break;
|
||||
case 2:
|
||||
holder.iv_type.setImageDrawable(mContext.getDrawable(R.drawable.icon_alarm_look_pressed));
|
||||
break;
|
||||
case 3:
|
||||
holder.iv_type.setImageDrawable(mContext.getDrawable(R.drawable.icon_alarm_reserve_pressed));
|
||||
break;
|
||||
}
|
||||
String voice = alarmClockData.getVoice();
|
||||
if (TextUtils.isEmpty(voice)) {
|
||||
holder.cl_voice.setVisibility(View.GONE);
|
||||
@@ -218,7 +241,7 @@ public class AlarmAdapter extends RecyclerView.Adapter<AlarmAdapter.holder> {
|
||||
holder.root.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View view) {
|
||||
Intent intent = new Intent(mContext, AlarmClockEditActivity.class);
|
||||
Intent intent = new Intent(mContext, AlarmEditActivity.class);
|
||||
intent.putExtra("id", alarmClockData.getId());
|
||||
mContext.startActivity(intent);
|
||||
}
|
||||
@@ -241,10 +264,11 @@ public class AlarmAdapter extends RecyclerView.Adapter<AlarmAdapter.holder> {
|
||||
}
|
||||
|
||||
class holder extends RecyclerView.ViewHolder {
|
||||
TextView tv_time, tv_remind_type, tv_title, tv_voice;
|
||||
TextView tv_time, tv_remind_type, tv_title, tv_voice, tv_status;
|
||||
ConstraintLayout cl_voice, cl_vp, root;
|
||||
JzvdStdRound jz_video;
|
||||
ImageView imageView;
|
||||
ImageView imageView,iv_type;
|
||||
ToggleButton toggleButton2;
|
||||
|
||||
public holder(@NonNull View itemView) {
|
||||
super(itemView);
|
||||
@@ -257,7 +281,9 @@ public class AlarmAdapter extends RecyclerView.Adapter<AlarmAdapter.holder> {
|
||||
root = itemView.findViewById(R.id.root);
|
||||
jz_video = itemView.findViewById(R.id.jz_video);
|
||||
imageView = itemView.findViewById(R.id.imageView);
|
||||
iv_type = itemView.findViewById(R.id.iv_type);
|
||||
tv_status = itemView.findViewById(R.id.tv_status);
|
||||
toggleButton2 = itemView.findViewById(R.id.toggleButton2);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user