|
|
@@ -2,7 +2,6 @@ package kr.co.zumo.app.lifeplus.view.fragment.setting;
|
|
|
|
|
|
import android.content.Context;
|
|
|
import android.view.View;
|
|
|
-import android.widget.CompoundButton;
|
|
|
import android.widget.ImageView;
|
|
|
import android.widget.RelativeLayout;
|
|
|
import android.widget.Switch;
|
|
|
@@ -38,44 +37,17 @@ public class PushAndLocationSettingViewHolder extends SettingViewHolder {
|
|
|
switchPushOnOff = itemView.findViewById(R.id.switch_push_on_off);
|
|
|
switchMarketingOnOff = itemView.findViewById(R.id.switch_marketing_on_off);
|
|
|
switchLocationOnOff = itemView.findViewById(R.id.switch_location_on_off);
|
|
|
- switchPushOnOff.setTrackDrawable(new SwitchTrackTextDrawable(context, R.string.on, R.string.off, false));
|
|
|
- switchPushOnOff.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
|
|
|
- @Override
|
|
|
- public void onCheckedChanged(CompoundButton compoundButton, boolean isChecked) {
|
|
|
- if (isChecked) {
|
|
|
- switchPushOnOff.setTrackDrawable(new SwitchTrackTextDrawable(context, R.string.on, R.string.off, true));
|
|
|
- }
|
|
|
- else {
|
|
|
- switchPushOnOff.setTrackDrawable(new SwitchTrackTextDrawable(context, R.string.on, R.string.off, false));
|
|
|
- }
|
|
|
- }
|
|
|
+
|
|
|
+ switchPushOnOff.setOnCheckedChangeListener((buttonView, isChecked) -> {
|
|
|
+
|
|
|
});
|
|
|
|
|
|
- switchMarketingOnOff.setTrackDrawable(new SwitchTrackTextDrawable(context, R.string.on, R.string.off, false));
|
|
|
- switchMarketingOnOff.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
|
|
|
- @Override
|
|
|
- public void onCheckedChanged(CompoundButton compoundButton, boolean isChecked) {
|
|
|
- if (isChecked) {
|
|
|
- switchMarketingOnOff.setTrackDrawable(new SwitchTrackTextDrawable(context, R.string.on, R.string.off, true));
|
|
|
- }
|
|
|
- else {
|
|
|
- switchMarketingOnOff.setTrackDrawable(new SwitchTrackTextDrawable(context, R.string.on, R.string.off, false));
|
|
|
- }
|
|
|
- }
|
|
|
+ switchMarketingOnOff.setOnCheckedChangeListener((buttonView, isChecked) -> {
|
|
|
+
|
|
|
});
|
|
|
|
|
|
+ switchLocationOnOff.setOnCheckedChangeListener((buttonView, isChecked) -> {
|
|
|
|
|
|
- switchLocationOnOff.setTrackDrawable(new SwitchTrackTextDrawable(context, R.string.on, R.string.off, false));
|
|
|
- switchLocationOnOff.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
|
|
|
- @Override
|
|
|
- public void onCheckedChanged(CompoundButton compoundButton, boolean isChecked) {
|
|
|
- if (isChecked) {
|
|
|
- switchLocationOnOff.setTrackDrawable(new SwitchTrackTextDrawable(context, R.string.on, R.string.off, true));
|
|
|
- }
|
|
|
- else {
|
|
|
- switchLocationOnOff.setTrackDrawable(new SwitchTrackTextDrawable(context, R.string.on, R.string.off, false));
|
|
|
- }
|
|
|
- }
|
|
|
});
|
|
|
}
|
|
|
|