diff --git a/app/src/main/java/com/arpa/hndahesudintocctmsdriver/ui/login/LoginActivity.java b/app/src/main/java/com/arpa/hndahesudintocctmsdriver/ui/login/LoginActivity.java index 501a1a0..66b8de2 100644 --- a/app/src/main/java/com/arpa/hndahesudintocctmsdriver/ui/login/LoginActivity.java +++ b/app/src/main/java/com/arpa/hndahesudintocctmsdriver/ui/login/LoginActivity.java @@ -16,6 +16,8 @@ import android.text.style.ClickableSpan; import android.util.Log; import android.view.View; import android.widget.Button; +import android.widget.CheckBox; +import android.widget.CompoundButton; import android.widget.EditText; import android.widget.ImageButton; import android.widget.TextView; @@ -71,8 +73,7 @@ public class LoginActivity extends BaseActivity { private LoginBean loginBean; private TimerTask tt; private int timer_sum = 60; - private ImageButton agree_btn; - private CardView no_btn; + private CheckBox cb; private UserRequset ur; @Override @@ -125,8 +126,7 @@ public class LoginActivity extends BaseActivity { input_phone = findViewById(R.id.input_phone); input_code = findViewById(R.id.input_code); getCode = findViewById(R.id.getCode); - agree_btn = findViewById(R.id.agree_btn); - no_btn = findViewById(R.id.no_btn); + cb = findViewById(R.id.cb); ur = new UserRequset(con, hd); initView(null); } @@ -139,17 +139,14 @@ public class LoginActivity extends BaseActivity { @Override public void initView(Object obj) { super.initView(obj); - agree_btn.setOnClickListener(v -> { - agree_btn.setVisibility(View.GONE); - no_btn.setVisibility(View.VISIBLE); - key = false; + cb.setOnCheckedChangeListener((buttonView, isChecked) -> { + if (isChecked) { + key = true; + } else { + key = false; + } }); - no_btn.setOnClickListener(v -> { - agree_btn.setVisibility(View.VISIBLE); - no_btn.setVisibility(View.GONE); - key = true; - }); ConfigBean cb = ConfigParts.getConfigParts(con); if (cb != null) { url1 = cb.getData().getUserUrl(); diff --git a/app/src/main/res/drawable-xxhdpi/read_nor.png b/app/src/main/res/drawable-xxhdpi/read_nor.png new file mode 100644 index 0000000..5091cff Binary files /dev/null and b/app/src/main/res/drawable-xxhdpi/read_nor.png differ diff --git a/app/src/main/res/drawable-xxhdpi/read_select.png b/app/src/main/res/drawable-xxhdpi/read_select.png new file mode 100644 index 0000000..b9b0be7 Binary files /dev/null and b/app/src/main/res/drawable-xxhdpi/read_select.png differ diff --git a/app/src/main/res/drawable/select_read.xml b/app/src/main/res/drawable/select_read.xml new file mode 100644 index 0000000..db24025 --- /dev/null +++ b/app/src/main/res/drawable/select_read.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/app/src/main/res/layout/activity_login.xml b/app/src/main/res/layout/activity_login.xml index b161b80..99ae066 100644 --- a/app/src/main/res/layout/activity_login.xml +++ b/app/src/main/res/layout/activity_login.xml @@ -104,35 +104,15 @@ android:layout_width="match_parent" android:layout_height="wrap_content" android:orientation="horizontal"> - - - - - + +