Commit e92104a6640a55e4839b9d3c05ad26ceb67cc1e0
1 parent
fa55eab0
Exists in
yxb_dev
and in
2 other branches
no message
Showing
4 changed files
with
27 additions
and
3 deletions
Show diff stats
app/src/main/java/com/shunzhi/parent/adapter/SchoolListAdapter.java
| ... | ... | @@ -2,6 +2,7 @@ package com.shunzhi.parent.adapter; |
| 2 | 2 | |
| 3 | 3 | |
| 4 | 4 | import android.content.Context; |
| 5 | +import android.util.Log; | |
| 5 | 6 | import android.view.LayoutInflater; |
| 6 | 7 | import android.view.View; |
| 7 | 8 | import android.view.ViewGroup; |
| ... | ... | @@ -31,6 +32,7 @@ public class SchoolListAdapter extends BaseRecyclerViewAdapter<SortBean> { |
| 31 | 32 | public SchoolListAdapter(Context context, List<SortBean> list) { |
| 32 | 33 | this.context = context; |
| 33 | 34 | this.list = list; |
| 35 | + Log.e("sss-===",list.size()+""); | |
| 34 | 36 | ischeck = new boolean[list.size()]; |
| 35 | 37 | for (int i=0;i<ischeck.length;i++){ |
| 36 | 38 | ischeck[i]=false; |
| ... | ... | @@ -38,6 +40,15 @@ public class SchoolListAdapter extends BaseRecyclerViewAdapter<SortBean> { |
| 38 | 40 | |
| 39 | 41 | } |
| 40 | 42 | |
| 43 | + @Override | |
| 44 | + public void addAll(List<SortBean> data) { | |
| 45 | + super.addAll(data); | |
| 46 | + this.list = data; | |
| 47 | + ischeck = new boolean[data.size()]; | |
| 48 | + for (int i=0;i<ischeck.length;i++){ | |
| 49 | + ischeck[i]=false; | |
| 50 | + } | |
| 51 | + } | |
| 41 | 52 | |
| 42 | 53 | @Override |
| 43 | 54 | public BaseRecyclerViewHolder onCreateViewHolder(ViewGroup parent, int viewType) { |
| ... | ... | @@ -62,6 +73,7 @@ public class SchoolListAdapter extends BaseRecyclerViewAdapter<SortBean> { |
| 62 | 73 | @Override |
| 63 | 74 | public void onBindViewHolder(final SortBean object, final int position) { |
| 64 | 75 | select_school.setVisibility(View.INVISIBLE); |
| 76 | + Log.e("1111-===",position+""); | |
| 65 | 77 | if (ischeck[position] ==true) { |
| 66 | 78 | select_school.setVisibility(View.VISIBLE); |
| 67 | 79 | } |
| ... | ... | @@ -122,4 +134,6 @@ public class SchoolListAdapter extends BaseRecyclerViewAdapter<SortBean> { |
| 122 | 134 | public static SortBean getCurrentSortBean() { |
| 123 | 135 | return currentSortBean; |
| 124 | 136 | } |
| 137 | + | |
| 138 | + | |
| 125 | 139 | } | ... | ... |
app/src/main/java/com/shunzhi/parent/presenter/loginandregister/LoginAndRegisterPresenter.java
| ... | ... | @@ -73,7 +73,7 @@ public class LoginAndRegisterPresenter extends LoginAndRegisterContract.LoginPre |
| 73 | 73 | if (responseBody == null) return; |
| 74 | 74 | try { |
| 75 | 75 | JSONObject json = new JSONObject(responseBody.string()); |
| 76 | -// ToastUtils.showToast(json.optString("message")+"json="+json); | |
| 76 | + ToastUtils.showToast(json.optString("message")+"json="+json); | |
| 77 | 77 | if (TextUtils.isEmpty(json.optString("error"))) { |
| 78 | 78 | mIView.showerror(json.optString("message")); |
| 79 | 79 | return; | ... | ... |
app/src/main/java/com/shunzhi/parent/ui/fragment/loginandregistfragment/LoginAndRegistFragment.java
| ... | ... | @@ -11,6 +11,7 @@ import android.view.Gravity; |
| 11 | 11 | import android.view.LayoutInflater; |
| 12 | 12 | import android.view.View; |
| 13 | 13 | import android.view.ViewGroup; |
| 14 | +import android.view.WindowManager; | |
| 14 | 15 | import android.widget.EditText; |
| 15 | 16 | import android.widget.ImageView; |
| 16 | 17 | import android.widget.LinearLayout; |
| ... | ... | @@ -143,6 +144,7 @@ public class LoginAndRegistFragment extends BaseMVPCompatFragment<LoginAndRegist |
| 143 | 144 | PopupWindow popupWindow = new PopupWindow(); |
| 144 | 145 | popupWindow.setWidth(ViewGroup.LayoutParams.WRAP_CONTENT); |
| 145 | 146 | popupWindow.setHeight(ViewGroup.LayoutParams.WRAP_CONTENT); |
| 147 | + backgroundAlpha(0.5f); | |
| 146 | 148 | View view = LayoutInflater.from(getActivity()).inflate(R.layout.dialog_view, null); |
| 147 | 149 | TextView dialogInfo = view.findViewById(R.id.dialog_info); |
| 148 | 150 | dialogInfo.setText("注册成功"); |
| ... | ... | @@ -178,8 +180,9 @@ public class LoginAndRegistFragment extends BaseMVPCompatFragment<LoginAndRegist |
| 178 | 180 | |
| 179 | 181 | @Override |
| 180 | 182 | public void showerror(String error) { |
| 183 | + backgroundAlpha(1f); | |
| 181 | 184 | progressDialog.dismiss(); |
| 182 | -// ToastUtils.showToast(error); | |
| 185 | + ToastUtils.showToast(error); | |
| 183 | 186 | } |
| 184 | 187 | |
| 185 | 188 | @Override |
| ... | ... | @@ -287,4 +290,11 @@ public class LoginAndRegistFragment extends BaseMVPCompatFragment<LoginAndRegist |
| 287 | 290 | } |
| 288 | 291 | }; |
| 289 | 292 | |
| 293 | + | |
| 294 | + public void backgroundAlpha(float bgAlpha) { | |
| 295 | + WindowManager.LayoutParams lp = getActivity().getWindow().getAttributes(); | |
| 296 | + lp.alpha = bgAlpha; //0.0-1.0 | |
| 297 | + getActivity().getWindow().setAttributes(lp); | |
| 298 | + } | |
| 299 | + | |
| 290 | 300 | } | ... | ... |
app/src/main/res/layout/activity_select_school.xml
| ... | ... | @@ -19,7 +19,7 @@ |
| 19 | 19 | android:layout_width="wrap_content" |
| 20 | 20 | android:layout_height="wrap_content" |
| 21 | 21 | android:drawablePadding="@dimen/size_dp_5" |
| 22 | - android:drawableRight="@drawable/pull" | |
| 22 | + android:drawableRight="@drawable/pull_black" | |
| 23 | 23 | android:gravity="center" |
| 24 | 24 | android:paddingLeft="@dimen/size_dp_15" |
| 25 | 25 | android:text="杭州" | ... | ... |