Commit f552dcacf2f56ac4ccaafeb2803aa7922dea8b4b
1 parent
3163a156
Exists in
yxb_dev
and in
2 other branches
no message
Showing
6 changed files
with
52 additions
and
26 deletions
Show diff stats
app/src/main/java/com/shunzhi/parent/presenter/ceping/CePingPresenter.java
1 | 1 | package com.shunzhi.parent.presenter.ceping; |
2 | 2 | |
3 | -import android.content.res.TypedArray; | |
4 | -import android.util.TypedValue; | |
5 | 3 | import android.view.View; |
6 | 4 | import android.widget.LinearLayout; |
7 | 5 | |
... | ... | @@ -27,11 +25,6 @@ public class CePingPresenter extends CepingContract.CePingPresenter { |
27 | 25 | toolBeanList.add(new ToolBean(R.drawable.zycx+"","专业查询")); |
28 | 26 | toolBeanList.add(new ToolBean(R.drawable.cmyk+"","传媒艺考")); |
29 | 27 | toolBeanList.add(new ToolBean(R.drawable.phb+"","排行榜")); |
30 | - toolBeanList.add(new ToolBean(R.drawable.phb+"","排行榜")); | |
31 | - toolBeanList.add(new ToolBean(R.drawable.phb+"","排行榜")); | |
32 | - toolBeanList.add(new ToolBean(R.drawable.phb+"","排行榜")); | |
33 | - toolBeanList.add(new ToolBean(R.drawable.phb+"","排行榜")); | |
34 | - | |
35 | 28 | for (int i = 0; i < toolBeanList.size(); i++) { |
36 | 29 | TextAndImgShowView textAndImgShowView=new TextAndImgShowView(mIView.getBindActivity()); |
37 | 30 | textAndImgShowView.setTextColor(R.color.textColor); | ... | ... |
app/src/main/java/com/shunzhi/parent/ui/activity/binding/SelectSchoolActivity.java
... | ... | @@ -27,12 +27,15 @@ import java.util.Collections; |
27 | 27 | import java.util.Comparator; |
28 | 28 | import java.util.List; |
29 | 29 | |
30 | +import me.leefeng.citypicker.CityPicker; | |
31 | +import me.leefeng.citypicker.CityPickerListener; | |
32 | + | |
30 | 33 | /** |
31 | 34 | * Created by Administrator on 2018/3/12 0012. |
32 | 35 | */ |
33 | 36 | |
34 | 37 | public class SelectSchoolActivity extends BaseMVPCompatActivity<SchoolListContract.SchoolListPrasenter, SchoolListContract.ISchoolListModel> implements |
35 | - View.OnClickListener, SchoolListContract.ISchoolListView { | |
38 | + View.OnClickListener, SchoolListContract.ISchoolListView,CityPickerListener { | |
36 | 39 | |
37 | 40 | private SideBar sideBar; |
38 | 41 | private TextView dialog, go_next, tvLocalAddress; |
... | ... | @@ -40,6 +43,7 @@ public class SelectSchoolActivity extends BaseMVPCompatActivity<SchoolListContra |
40 | 43 | private List<String> list = new ArrayList<>(); |
41 | 44 | SchoolListAdapter schoolListAdapter; |
42 | 45 | |
46 | + CityPicker cityPicker=null; | |
43 | 47 | @NonNull |
44 | 48 | @Override |
45 | 49 | public BasePresenter initPresenter() { |
... | ... | @@ -53,6 +57,7 @@ public class SelectSchoolActivity extends BaseMVPCompatActivity<SchoolListContra |
53 | 57 | go_next = findViewById(R.id.go_next); |
54 | 58 | go_next.setOnClickListener(this); |
55 | 59 | tvLocalAddress = findViewById(R.id.tvLocalAddress); |
60 | + tvLocalAddress.setOnClickListener(this); | |
56 | 61 | tvLocalAddress.setText(AppContext.getInstance().cityName); |
57 | 62 | setSchoolList(); |
58 | 63 | |
... | ... | @@ -159,6 +164,10 @@ public class SelectSchoolActivity extends BaseMVPCompatActivity<SchoolListContra |
159 | 164 | } else { |
160 | 165 | ToastUtils.showToast("请选择学校"); |
161 | 166 | } |
167 | + }else if (v==tvLocalAddress){ | |
168 | + if (null==cityPicker)cityPicker=new CityPicker(SelectSchoolActivity.this,this); | |
169 | + if (cityPicker.isShow())cityPicker.close(); | |
170 | + else cityPicker.show(); | |
162 | 171 | } |
163 | 172 | |
164 | 173 | } |
... | ... | @@ -224,4 +233,15 @@ public class SelectSchoolActivity extends BaseMVPCompatActivity<SchoolListContra |
224 | 233 | schoolListAdapter.addAll(schoolList); |
225 | 234 | schoollist.setAdapter(schoolListAdapter); |
226 | 235 | } |
236 | + | |
237 | + @Override | |
238 | + protected void onDestroy() { | |
239 | + super.onDestroy(); | |
240 | + if (null!=cityPicker)cityPicker.cancle(); | |
241 | + } | |
242 | + | |
243 | + @Override | |
244 | + public void getCity(String name) { | |
245 | + | |
246 | + } | |
227 | 247 | } | ... | ... |
app/src/main/java/com/shunzhi/parent/ui/fragment/CePingFragment.java
... | ... | @@ -24,9 +24,12 @@ import com.shunzhi.parent.contract.ceping.CepingContract; |
24 | 24 | import com.shunzhi.parent.presenter.ceping.CePingPresenter; |
25 | 25 | import com.shunzhi.parent.views.TextAndImgShowView; |
26 | 26 | |
27 | +import me.leefeng.citypicker.CityPicker; | |
28 | +import me.leefeng.citypicker.CityPickerListener; | |
29 | + | |
27 | 30 | |
28 | 31 | public class CePingFragment extends BaseMVPCompatFragment<CepingContract.CePingPresenter,CepingContract.ICePingModel> implements CepingContract.ICePingView |
29 | - ,View.OnClickListener{ | |
32 | + ,View.OnClickListener,CityPickerListener{ | |
30 | 33 | |
31 | 34 | TextView tvLocalAddress; |
32 | 35 | |
... | ... | @@ -40,6 +43,8 @@ public class CePingFragment extends BaseMVPCompatFragment<CepingContract.CePingP |
40 | 43 | |
41 | 44 | LinearLayout layout_control; |
42 | 45 | |
46 | + CityPicker cityPicker=null; | |
47 | + | |
43 | 48 | @Override |
44 | 49 | public int getLayoutId() { |
45 | 50 | return R.layout.fragment_ce_ping; |
... | ... | @@ -122,6 +127,9 @@ public class CePingFragment extends BaseMVPCompatFragment<CepingContract.CePingP |
122 | 127 | break; |
123 | 128 | case R.id.tvLocalAddress: |
124 | 129 | AppContext.getInstance().startLocation(); |
130 | + if (null==cityPicker)cityPicker=new CityPicker(getActivity(),this); | |
131 | + if (cityPicker.isShow())cityPicker.close(); | |
132 | + else cityPicker.show(); | |
125 | 133 | break; |
126 | 134 | case R.id.ivCamera: |
127 | 135 | ToastUtils.showToast("功能暂未上线"); |
... | ... | @@ -142,10 +150,16 @@ public class CePingFragment extends BaseMVPCompatFragment<CepingContract.CePingP |
142 | 150 | public void onDestroy() { |
143 | 151 | super.onDestroy(); |
144 | 152 | if (null!=broadcastReceiver)getActivity().unregisterReceiver(broadcastReceiver); |
153 | + if (null!=cityPicker)cityPicker.cancle(); | |
145 | 154 | } |
146 | 155 | |
147 | 156 | @Override |
148 | 157 | public void getTools() { |
149 | 158 | |
150 | 159 | } |
160 | + | |
161 | + @Override | |
162 | + public void getCity(String name) { | |
163 | + ToastUtils.showToast(name); | |
164 | + } | |
151 | 165 | } | ... | ... |
app/src/main/java/com/shunzhi/parent/ui/fragment/ConsultFragment.java
... | ... | @@ -33,9 +33,11 @@ import java.util.ArrayList; |
33 | 33 | import java.util.List; |
34 | 34 | |
35 | 35 | import cn.jzvd.JZVideoPlayerStandard; |
36 | +import me.leefeng.citypicker.CityPicker; | |
37 | +import me.leefeng.citypicker.CityPickerListener; | |
36 | 38 | |
37 | 39 | public class ConsultFragment extends BaseMVPCompatFragment<ConsultContract.ConsultPresenter,ConsultContract.IConsultModel> implements View.OnClickListener |
38 | -,ConsultContract.IConsultView{ | |
40 | +,ConsultContract.IConsultView,CityPickerListener{ | |
39 | 41 | |
40 | 42 | ImageView ivSearch; |
41 | 43 | |
... | ... | @@ -48,6 +50,8 @@ public class ConsultFragment extends BaseMVPCompatFragment<ConsultContract.Consu |
48 | 50 | TextView tvLocalAddress; |
49 | 51 | |
50 | 52 | LinearLayout layout_control; |
53 | + | |
54 | + CityPicker cityPicker=null; | |
51 | 55 | @Override |
52 | 56 | public int getLayoutId() { |
53 | 57 | return R.layout.fragment_zi_xun; |
... | ... | @@ -136,6 +140,9 @@ public class ConsultFragment extends BaseMVPCompatFragment<ConsultContract.Consu |
136 | 140 | switch (view.getId()) { |
137 | 141 | case R.id.tvLocalAddress: |
138 | 142 | AppContext.getInstance().startLocation(); |
143 | + if (null==cityPicker)cityPicker=new CityPicker(getActivity(),this); | |
144 | + if (cityPicker.isShow())cityPicker.close(); | |
145 | + else cityPicker.show(); | |
139 | 146 | break; |
140 | 147 | case R.id.ivSearch://搜索按钮 |
141 | 148 | |
... | ... | @@ -165,10 +172,16 @@ public class ConsultFragment extends BaseMVPCompatFragment<ConsultContract.Consu |
165 | 172 | public void onDestroy() { |
166 | 173 | super.onDestroy(); |
167 | 174 | if (null!=broadcastReceiver)getActivity().unregisterReceiver(broadcastReceiver); |
175 | + if (null!=cityPicker)cityPicker.cancle(); | |
168 | 176 | } |
169 | 177 | |
170 | 178 | @Override |
171 | 179 | public void showTools() { |
172 | 180 | |
173 | 181 | } |
182 | + | |
183 | + @Override | |
184 | + public void getCity(String name) { | |
185 | + | |
186 | + } | |
174 | 187 | } | ... | ... |
app/src/main/java/com/shunzhi/parent/ui/fragment/consult/ConsultOneLevelFragment.java
1 | 1 | package com.shunzhi.parent.ui.fragment.consult; |
2 | 2 | |
3 | -import android.content.Context; | |
4 | -import android.net.Uri; | |
5 | 3 | import android.os.Bundle; |
6 | 4 | import android.support.annotation.NonNull; |
7 | 5 | import android.support.annotation.Nullable; |
8 | -import android.support.design.widget.TabLayout; | |
9 | -import android.support.v4.app.Fragment; | |
10 | 6 | import android.support.v7.widget.LinearLayoutManager; |
11 | 7 | import android.support.v7.widget.RecyclerView; |
12 | 8 | import android.util.Log; |
... | ... | @@ -18,27 +14,17 @@ import android.widget.ImageView; |
18 | 14 | import android.widget.LinearLayout; |
19 | 15 | import android.widget.TextView; |
20 | 16 | |
21 | -import com.bumptech.glide.Glide; | |
22 | 17 | import com.share.mvpsdk.base.BasePresenter; |
23 | 18 | import com.share.mvpsdk.base.adapter.BaseRecyclerViewAdapter; |
24 | 19 | import com.share.mvpsdk.base.adapter.BaseRecyclerViewHolder; |
25 | 20 | import com.share.mvpsdk.base.fragment.BaseMVPCompatFragment; |
26 | 21 | import com.share.mvpsdk.utils.DisplayUtils; |
27 | -import com.share.mvpsdk.utils.ToastUtils; | |
28 | -import com.shunzhi.parent.AppContext; | |
29 | 22 | import com.shunzhi.parent.R; |
30 | 23 | import com.shunzhi.parent.adapter.MyConsultAdapter; |
31 | 24 | import com.shunzhi.parent.bean.GrallyBean; |
32 | 25 | import com.shunzhi.parent.bean.MyConsultBean; |
33 | -import com.shunzhi.parent.contract.consult.ConsultContract; | |
34 | 26 | import com.shunzhi.parent.contract.consult.consultone.ConsultOneContract; |
35 | 27 | import com.shunzhi.parent.presenter.consult.consultone.ConsultOnePresenter; |
36 | -import com.shunzhi.parent.ui.activity.consult.ConsultTwoLevelActivity; | |
37 | -import com.shunzhi.parent.views.TextAndImgShowView; | |
38 | - | |
39 | -import java.io.ByteArrayOutputStream; | |
40 | -import java.io.IOException; | |
41 | -import java.io.InputStream; | |
42 | 28 | import java.util.ArrayList; |
43 | 29 | import java.util.List; |
44 | 30 | ... | ... |
app/src/main/res/layout/layout_textandimgshow.xml
... | ... | @@ -21,7 +21,7 @@ |
21 | 21 | android:orientation="horizontal" |
22 | 22 | android:padding="@dimen/size_dp_10"> |
23 | 23 | |
24 | - <LinearLayout | |
24 | + <!-- <LinearLayout | |
25 | 25 | android:visibility="gone" |
26 | 26 | android:layout_width="wrap_content" |
27 | 27 | android:layout_height="wrap_content" |
... | ... | @@ -62,7 +62,7 @@ |
62 | 62 | android:background="?android:selectableItemBackground"> |
63 | 63 | |
64 | 64 | </com.shunzhi.parent.views.TextAndImgShowView> |
65 | - </LinearLayout> | |
65 | + </LinearLayout>--> | |
66 | 66 | </LinearLayout> |
67 | 67 | </HorizontalScrollView> |
68 | 68 | </android.support.design.widget.CoordinatorLayout> |
69 | 69 | \ No newline at end of file | ... | ... |