Browse Source

修复沉浸栏模式下底部输入框 被系统盘隐藏的bug!!!

Arison 8 years ago
parent
commit
9455da5e56

+ 8 - 4
WeiChat/src/main/java/com/xzjmyk/pm/activity/ui/me/MeFragment.java

@@ -533,6 +533,9 @@ public class MeFragment extends SupportToolBarFragment implements View.OnClickLi
                 Master master = mList.get(i);
                 if (master.getMa_user().equals(en_master)) {
                     master_tv.setText(master.getMa_function());
+                    if (adapter!=null) {
+                        selectId=i;
+                    }
                     CommonUtil.setSharedPreferences(ct, "Master_ch", master.getMa_function());
                 }
             }
@@ -664,20 +667,21 @@ public class MeFragment extends SupportToolBarFragment implements View.OnClickLi
 
 
     public PopupWindow popupWindow = null;
-    public int selectId;
+    public int selectId=0;
     public ItemPopListAdapter adapter;
     public void  showPopDialog(final Activity ct, List<ItemsSelectType1> itemsSelectType1s){
         View view = null;
+        popupWindow=null;
         WindowManager windowManager = (WindowManager)ct. getSystemService(Context.WINDOW_SERVICE);
         if (popupWindow == null) {
             LayoutInflater layoutInflater = (LayoutInflater) ct.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
             view = layoutInflater.inflate(com.core.app.R.layout.pop_dialog_list, null);
             ListView plist = view.findViewById(com.core.app.R.id.mList);
             List<ItemsSelectType1> datas =itemsSelectType1s;
-            if (adapter==null) {
-                adapter = new ItemPopListAdapter(ct, datas);
-            }
+            adapter = new ItemPopListAdapter(ct, datas);
+            adapter.setSelectId(selectId);
             plist.setAdapter(adapter);
+            plist.setSelection(selectId);
             Drawable drawable = ct.getResources().getDrawable(com.core.app.R.drawable.selector_check_items);
             plist.setSelector(drawable);
             plist.setOnItemClickListener(new AdapterView.OnItemClickListener() {

+ 3 - 3
WeiChat/version.properties

@@ -1,5 +1,5 @@
-#Mon May 21 15:33:43 CST 2018
-debugName=290
+#Mon May 21 16:53:56 CST 2018
+debugName=298
 versionName=630
-debugCode=290
+debugCode=298
 versionCode=170

+ 4 - 4
app_core/common/src/main/java/com/core/net/http/ViewUtil.java

@@ -770,7 +770,7 @@ public class ViewUtil {
 
 
     public static PopupWindow popupWindow = null;
-    public static int selectId;
+    public static int selectId=0;
     public static ItemPopListAdapter adapter;
     public static void  showPopDialog(final Activity ct, List<ItemsSelectType1> itemsSelectType1s
     , final String phone, final String password){
@@ -786,10 +786,10 @@ public class ViewUtil {
             view = layoutInflater.inflate(R.layout.pop_dialog_list, null);
             ListView plist = view.findViewById(R.id.mList);
             List<ItemsSelectType1> datas =itemsSelectType1s;
-            if (adapter==null) {
-                adapter = new ItemPopListAdapter(ct, datas);
-            }
+            adapter = new ItemPopListAdapter(ct, datas);
+            adapter.setSelectId(selectId);
             plist.setAdapter(adapter);
+            plist.setSelection(selectId);
             Drawable drawable = ct.getResources().getDrawable(R.drawable.selector_check_items);
             plist.setSelector(drawable);
             plist.setOnItemClickListener(new AdapterView.OnItemClickListener() {

+ 0 - 1
app_core/common/src/main/res/layout/pop_dialog_list.xml

@@ -25,7 +25,6 @@
             android:id="@+id/mList"
             style="@style/ListViewBasic"
             android:layout_height="300dp"
-            android:layout_marginBottom="20dp"
             android:dividerHeight="0dp">
         </ListView>
 </LinearLayout>