mirror of
https://github.com/pppscn/SmsForwarder
synced 2025-08-03 01:17:41 +08:00
优化:隐私协议授权弹窗自适应分辨率(避免老年人模式下点不到按钮)
This commit is contained in:
parent
c9ed5e40b9
commit
3b3c9ea626
@ -17,6 +17,7 @@ import android.view.Menu;
|
||||
import android.view.MenuItem;
|
||||
import android.view.View;
|
||||
import android.view.Window;
|
||||
import android.view.WindowManager;
|
||||
import android.widget.RadioButton;
|
||||
import android.widget.RadioGroup;
|
||||
import android.widget.TextView;
|
||||
@ -539,6 +540,12 @@ public class MainActivity extends AppCompatActivity implements RefreshListView.I
|
||||
Window dialogWindow = dialog.getWindow();
|
||||
dialogWindow.setGravity(Gravity.CENTER);
|
||||
|
||||
//自适应大小
|
||||
WindowManager.LayoutParams dialogParams = dialogWindow.getAttributes();
|
||||
dialogParams.width = (int) (context.getResources().getDisplayMetrics().widthPixels * 0.85);
|
||||
//dialogParams.height = (int) (context.getResources().getDisplayMetrics().heightPixels * 0.7);
|
||||
dialogWindow.setAttributes(dialogParams);
|
||||
|
||||
dialog.setCancelable(false);
|
||||
dialog.show();
|
||||
}
|
||||
|
@ -1,74 +1,77 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="20dp"
|
||||
android:layout_marginEnd="20dp"
|
||||
android:background="#fff"
|
||||
android:orientation="vertical"
|
||||
tools:ignore="Overdraw">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_horizontal"
|
||||
android:layout_marginTop="10dp"
|
||||
android:layout_marginBottom="10dp"
|
||||
android:text="@string/privacy_policy"
|
||||
android:textColor="#000"
|
||||
android:textSize="17sp" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="5dp"
|
||||
android:layout_marginEnd="5dp"
|
||||
android:layout_marginBottom="10dp"
|
||||
android:text="@string/privacy_policy_text"
|
||||
android:textColor="#000"
|
||||
android:textSize="17sp" />
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical">
|
||||
android:background="#fff"
|
||||
android:orientation="vertical"
|
||||
tools:ignore="Overdraw">
|
||||
|
||||
<View
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="1dp"
|
||||
android:background="#514E4E" />
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_horizontal"
|
||||
android:layout_marginTop="10dp"
|
||||
android:layout_marginBottom="10dp"
|
||||
android:text="@string/privacy_policy"
|
||||
android:textColor="#000"
|
||||
android:textSize="17sp" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="5dp"
|
||||
android:layout_marginEnd="5dp"
|
||||
android:layout_marginBottom="10dp"
|
||||
android:text="@string/privacy_policy_text"
|
||||
android:textColor="#000"
|
||||
android:textSize="17sp" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="50dp"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/succsebtn"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"
|
||||
android:gravity="center"
|
||||
android:text="@string/agree"
|
||||
android:textColor="#000"
|
||||
android:textSize="20sp" />
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical">
|
||||
|
||||
<View
|
||||
android:layout_width="0.5dp"
|
||||
android:layout_height="match_parent"
|
||||
android:background="#5F6063" />
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="1dp"
|
||||
android:background="#514E4E" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/caclebtn"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"
|
||||
android:gravity="center"
|
||||
android:text="@string/disagree"
|
||||
android:textColor="#000"
|
||||
android:textSize="20sp" />
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="50dp"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/succsebtn"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"
|
||||
android:gravity="center"
|
||||
android:text="@string/agree"
|
||||
android:textColor="#000"
|
||||
android:textSize="20sp" />
|
||||
|
||||
<View
|
||||
android:layout_width="0.5dp"
|
||||
android:layout_height="match_parent"
|
||||
android:background="#5F6063" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/caclebtn"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"
|
||||
android:gravity="center"
|
||||
android:text="@string/disagree"
|
||||
android:textColor="#000"
|
||||
android:textSize="20sp" />
|
||||
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
</ScrollView>
|
Loading…
x
Reference in New Issue
Block a user