登录也优化点击范围
This commit is contained in:
parent
ef6247fc22
commit
ba031f075c
@ -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();
|
||||
|
BIN
app/src/main/res/drawable-xxhdpi/read_nor.png
Normal file
BIN
app/src/main/res/drawable-xxhdpi/read_nor.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.5 KiB |
BIN
app/src/main/res/drawable-xxhdpi/read_select.png
Normal file
BIN
app/src/main/res/drawable-xxhdpi/read_select.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.7 KiB |
6
app/src/main/res/drawable/select_read.xml
Normal file
6
app/src/main/res/drawable/select_read.xml
Normal file
@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item android:drawable="@drawable/read_select" android:state_checked="true"></item>
|
||||
<item android:drawable="@drawable/read_nor" android:state_checked="false"></item>
|
||||
<item android:drawable="@drawable/read_nor"></item>
|
||||
</selector>
|
@ -104,35 +104,15 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal">
|
||||
<androidx.cardview.widget.CardView
|
||||
android:padding="@dimen/dp_7"
|
||||
android:layout_marginTop="@dimen/dp_2"
|
||||
android:layout_width="@dimen/dp_14"
|
||||
android:layout_height="@dimen/dp_14"
|
||||
app:cardCornerRadius="@dimen/dp_7"
|
||||
app:cardBackgroundColor="@color/theme_color"
|
||||
app:cardElevation="@dimen/dp_0">
|
||||
<androidx.cardview.widget.CardView
|
||||
android:padding="@dimen/dp_7"
|
||||
android:id="@+id/no_btn"
|
||||
android:layout_width="@dimen/dp_12"
|
||||
android:layout_height="@dimen/dp_12"
|
||||
app:cardCornerRadius="@dimen/dp_6"
|
||||
app:cardBackgroundColor="#fff"
|
||||
android:layout_gravity="center"
|
||||
app:cardElevation="@dimen/dp_0">
|
||||
</androidx.cardview.widget.CardView>
|
||||
<ImageButton
|
||||
android:id="@+id/agree_btn"
|
||||
android:layout_width="@dimen/dp_14"
|
||||
android:layout_height="@dimen/dp_14"
|
||||
android:src="@mipmap/choice"
|
||||
android:scaleType="fitXY"
|
||||
android:background="#fff"
|
||||
android:layout_gravity="center"
|
||||
android:visibility="gone"
|
||||
/>
|
||||
</androidx.cardview.widget.CardView>
|
||||
|
||||
<CheckBox
|
||||
android:layout_marginTop="@dimen/dp_3"
|
||||
android:id="@+id/cb"
|
||||
android:layout_width="@dimen/dp_28"
|
||||
android:layout_height="@dimen/dp_34"
|
||||
android:button="@null"
|
||||
android:checked="false"
|
||||
android:drawableStart="@drawable/select_read"/>
|
||||
<TextView
|
||||
android:id="@+id/tv_content"
|
||||
android:layout_width="wrap_content"
|
||||
|
Loading…
Reference in New Issue
Block a user