Page 130 - MDP2022-2
P. 130
}
});
lock.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
if(lock_cnt==0){
lock.setImageResource(R.drawable.unlocked);
GetData task = new GetData();
task.execute(String.valueOf(temperature_want), "20",ID);
lock_cnt=1;
handler.postDelayed(new Runnable() {
@Override
public void run() {
GetData task = new GetData();
task.execute(String.valueOf(temperature_want), "30",ID);
}
}, 4000);
}
else if(lock_cnt==1){
lock.setImageResource(R.drawable.padlock);
GetData task = new GetData();
task.execute(String.valueOf(temperature_want), "10",ID);
lock_cnt=0;
}
}
});
setting.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
setting.setBackgroundColor(Color.parseColor("#c8c8c8"));
informa.setBackgroundColor(Color.parseColor("#FFFFFF"));
inforframe.setVisibility(View.INVISIBLE);
setframe.setVisibility(View.VISIBLE);
}
});
informa.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
informa.setBackgroundColor(Color.parseColor("#c8c8c8"));
setting.setBackgroundColor(Color.parseColor("#FFFFFF"));
inforframe.setVisibility(View.VISIBLE);
setframe.setVisibility(View.INVISIBLE);
}