mirror of
https://github.com/pppscn/SmsForwarder
synced 2025-08-03 17:37:40 +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,10 +1,12 @@
|
||||
<?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="match_parent">
|
||||
|
||||
<LinearLayout
|
||||
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">
|
||||
@ -72,3 +74,4 @@
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
</ScrollView>
|
Loading…
x
Reference in New Issue
Block a user