Browse Source

修改个人设置页pad适配效果

Pq 1 year ago
parent
commit
2b591cc4b6

+ 28 - 1
BaseLibrary/src/main/java/com/cooleshow/base/utils/PopupUtil.java

@@ -41,7 +41,7 @@ public class PopupUtil {
     /*底部显示PopupWindow*/
     public static void showInBottom(Activity activity, int resourcesId, ShowListener showListener) {
         View popupView = LayoutInflater.from(Utils.getApp()).inflate(resourcesId, null);
-        PopupWindow popupWindow = createPopupWindow(popupView, activity, true);
+        PopupWindow popupWindow = createMatchWidthPopupWindow(popupView, activity, true);
         popupWindow.showAtLocation(activity.getWindow().getDecorView(), Gravity.BOTTOM, 0, 0);
         showListener.onShow(popupView, popupWindow);
     }
@@ -157,6 +157,33 @@ public class PopupUtil {
 
     }
 
+    /*创建PopupWindow*/
+    public static PopupWindow createMatchWidthPopupWindow(View popupView, Context activity, boolean touchable) {
+        CommonPopupWindow popupWindow = new CommonPopupWindow.Builder(activity)
+                //设置PopupWindow布局
+                .setView(popupView)
+                .setOutsideTouchable(touchable)
+                //设置宽高
+                .setWidthAndHeight(ViewGroup.LayoutParams.MATCH_PARENT,
+                        ViewGroup.LayoutParams.WRAP_CONTENT)
+                //设置动画
+                //设置背景颜色,取值范围0.0f-1.0f 值越小越暗 1.0f为透明
+                .setBackGroundLevel(0.5f)
+                //设置PopupWindow里的子View及点击事件
+                .setViewOnclickListener(new CommonPopupWindow.ViewInterface() {
+                    @Override
+                    public void getChildView(View view, int layoutResId) {
+
+                    }
+                })
+                //设置外部是否可点击 默认是true
+                .setOutsideTouchable(true)
+                //开始构建
+                .create();
+        return popupWindow;
+
+    } /*创建PopupWindow*/
+
     public static PopupWindow createNoBackPopupWindow(View popupView, Context activity, int width, int height, boolean touchable) {
         CommonPopupWindow popupWindow = new CommonPopupWindow.Builder(activity)
                 //设置PopupWindow布局

BIN
BaseLibrary/src/main/res/drawable-sw600dp-hdpi/icon_mine_vip_bg.png


+ 2 - 0
institution/src/main/res/layout/jg_pop_modify_header.xml

@@ -6,6 +6,8 @@
     android:layout_height="wrap_content">
     <androidx.constraintlayout.widget.ConstraintLayout
         android:layout_width="match_parent"
+        android:layout_marginStart="12dp"
+        android:layout_marginEnd="12dp"
         android:layout_height="wrap_content">
 
         <androidx.constraintlayout.widget.ConstraintLayout

+ 2 - 0
institution/src/main/res/layout/jg_pop_modify_sex.xml

@@ -5,6 +5,8 @@
     android:layout_height="wrap_content">
     <androidx.constraintlayout.widget.ConstraintLayout
         android:layout_width="match_parent"
+        android:layout_marginStart="12dp"
+        android:layout_marginEnd="12dp"
         android:layout_height="wrap_content">
 
         <androidx.constraintlayout.widget.ConstraintLayout

BIN
musicMerge/src/main/res/drawable-sw600dp-hdpi/bg_my_work_top.png


+ 2 - 0
student/src/main/res/layout/pop_modify_header.xml

@@ -6,6 +6,8 @@
     android:layout_height="wrap_content">
     <androidx.constraintlayout.widget.ConstraintLayout
         android:layout_width="match_parent"
+        android:layout_marginStart="12dp"
+        android:layout_marginEnd="12dp"
         android:layout_height="wrap_content">
 
         <androidx.constraintlayout.widget.ConstraintLayout

+ 2 - 0
student/src/main/res/layout/pop_modify_sex.xml

@@ -5,6 +5,8 @@
     android:layout_height="wrap_content">
     <androidx.constraintlayout.widget.ConstraintLayout
         android:layout_width="match_parent"
+        android:layout_marginStart="12dp"
+        android:layout_marginEnd="12dp"
         android:layout_height="wrap_content">
 
         <androidx.constraintlayout.widget.ConstraintLayout

+ 2 - 0
teacher/src/main/res/layout/pop_modify_header.xml

@@ -6,6 +6,8 @@
     android:layout_height="wrap_content">
     <androidx.constraintlayout.widget.ConstraintLayout
         android:layout_width="match_parent"
+        android:layout_marginStart="12dp"
+        android:layout_marginEnd="12dp"
         android:layout_height="wrap_content">
 
         <androidx.constraintlayout.widget.ConstraintLayout

+ 2 - 0
teacher/src/main/res/layout/pop_modify_sex.xml

@@ -5,6 +5,8 @@
     android:layout_height="wrap_content">
     <androidx.constraintlayout.widget.ConstraintLayout
         android:layout_width="match_parent"
+        android:layout_marginStart="12dp"
+        android:layout_marginEnd="12dp"
         android:layout_height="wrap_content">
 
         <androidx.constraintlayout.widget.ConstraintLayout