Commit c8a5db9f1de6a8867fda108ab49957a06ef6b049
1 parent
dc60ceee
Exists in
yxb_dev
and in
2 other branches
no message
Showing
7 changed files
with
86 additions
and
56 deletions
Show diff stats
app/src/main/java/com/shunzhi/parent/ui/activity/consult/ConsultOneLevelActivity.java
| @@ -3,39 +3,37 @@ package com.shunzhi.parent.ui.activity.consult; | @@ -3,39 +3,37 @@ package com.shunzhi.parent.ui.activity.consult; | ||
| 3 | import android.content.Context; | 3 | import android.content.Context; |
| 4 | import android.content.Intent; | 4 | import android.content.Intent; |
| 5 | import android.support.v4.app.FragmentTransaction; | 5 | import android.support.v4.app.FragmentTransaction; |
| 6 | -import android.support.v7.app.AppCompatActivity; | ||
| 7 | import android.os.Bundle; | 6 | import android.os.Bundle; |
| 8 | import android.view.View; | 7 | import android.view.View; |
| 9 | import android.widget.EditText; | 8 | import android.widget.EditText; |
| 10 | import android.widget.FrameLayout; | 9 | import android.widget.FrameLayout; |
| 11 | import android.widget.ImageView; | 10 | import android.widget.ImageView; |
| 12 | -import android.widget.TextView; | ||
| 13 | 11 | ||
| 14 | import com.share.mvpsdk.base.activity.BaseCompatActivity; | 12 | import com.share.mvpsdk.base.activity.BaseCompatActivity; |
| 15 | import com.share.mvpsdk.utils.ToastUtils; | 13 | import com.share.mvpsdk.utils.ToastUtils; |
| 16 | import com.shunzhi.parent.R; | 14 | import com.shunzhi.parent.R; |
| 17 | import com.shunzhi.parent.ui.fragment.consult.ConsultOneLevelFragment; | 15 | import com.shunzhi.parent.ui.fragment.consult.ConsultOneLevelFragment; |
| 18 | 16 | ||
| 19 | -public class ConsultOneLevelActivity extends BaseCompatActivity implements View.OnClickListener{ | 17 | +public class ConsultOneLevelActivity extends BaseCompatActivity implements View.OnClickListener { |
| 20 | 18 | ||
| 21 | - | ||
| 22 | - public static void getInstance(Context context,String channel){ | ||
| 23 | - Intent intent=new Intent(context,ConsultOneLevelActivity.class); | ||
| 24 | - intent.putExtra("channel",channel); | 19 | + public static void getInstance(Context context, String channel) { |
| 20 | + Intent intent = new Intent(context, ConsultOneLevelActivity.class); | ||
| 21 | + intent.putExtra("channel", channel); | ||
| 25 | context.startActivity(intent); | 22 | context.startActivity(intent); |
| 26 | } | 23 | } |
| 27 | 24 | ||
| 28 | EditText et_search; | 25 | EditText et_search; |
| 29 | 26 | ||
| 30 | - ImageView ivSearch,ivBack; | 27 | + ImageView ivSearch, ivBack; |
| 31 | 28 | ||
| 32 | - String channel=""; | 29 | + String channel = ""; |
| 33 | 30 | ||
| 34 | FrameLayout frame_consult; | 31 | FrameLayout frame_consult; |
| 35 | 32 | ||
| 36 | - FragmentTransaction fragmentTransaction=null; | 33 | + FragmentTransaction fragmentTransaction = null; |
| 34 | + | ||
| 35 | + ConsultOneLevelFragment consultOneLevelFragment = null; | ||
| 37 | 36 | ||
| 38 | - ConsultOneLevelFragment consultOneLevelFragment=null; | ||
| 39 | @Override | 37 | @Override |
| 40 | protected void initView(Bundle savedInstanceState) { | 38 | protected void initView(Bundle savedInstanceState) { |
| 41 | 39 | ||
| @@ -45,22 +43,22 @@ public class ConsultOneLevelActivity extends BaseCompatActivity implements View. | @@ -45,22 +43,22 @@ public class ConsultOneLevelActivity extends BaseCompatActivity implements View. | ||
| 45 | 43 | ||
| 46 | private void initViews() { | 44 | private void initViews() { |
| 47 | 45 | ||
| 48 | - channel=getIntent().getStringExtra("channel"); | ||
| 49 | - consultOneLevelFragment=new ConsultOneLevelFragment(); | ||
| 50 | - et_search=findViewById(R.id.et_search); | ||
| 51 | - ivSearch=findViewById(R.id.ivSearch); | ||
| 52 | - ivBack=findViewById(R.id.ivBack); | ||
| 53 | - frame_consult=findViewById(R.id.frame_consult); | 46 | + channel = getIntent().getStringExtra("channel"); |
| 47 | + consultOneLevelFragment = new ConsultOneLevelFragment(); | ||
| 48 | + et_search = findViewById(R.id.et_search); | ||
| 49 | + ivSearch = findViewById(R.id.ivSearch); | ||
| 50 | + ivBack = findViewById(R.id.ivBack); | ||
| 51 | + frame_consult = findViewById(R.id.frame_consult); | ||
| 54 | 52 | ||
| 55 | ivSearch.setOnClickListener(this); | 53 | ivSearch.setOnClickListener(this); |
| 56 | ivBack.setOnClickListener(this); | 54 | ivBack.setOnClickListener(this); |
| 57 | 55 | ||
| 58 | - Bundle bundle=new Bundle(); | ||
| 59 | - bundle.putString("channel",channel); | 56 | + Bundle bundle = new Bundle(); |
| 57 | + bundle.putString("channel", channel); | ||
| 60 | consultOneLevelFragment.setArguments(bundle); | 58 | consultOneLevelFragment.setArguments(bundle); |
| 61 | - ToastUtils.showToast("channel="+channel); | ||
| 62 | - fragmentTransaction=getSupportFragmentManager().beginTransaction(); | ||
| 63 | - fragmentTransaction.add(R.id.frame_consult,consultOneLevelFragment) | 59 | +// ToastUtils.showToast("channel=" + channel); |
| 60 | + fragmentTransaction = getSupportFragmentManager().beginTransaction(); | ||
| 61 | + fragmentTransaction.add(R.id.frame_consult, consultOneLevelFragment) | ||
| 64 | .show(consultOneLevelFragment).commit(); | 62 | .show(consultOneLevelFragment).commit(); |
| 65 | } | 63 | } |
| 66 | 64 | ||
| @@ -71,9 +69,9 @@ public class ConsultOneLevelActivity extends BaseCompatActivity implements View. | @@ -71,9 +69,9 @@ public class ConsultOneLevelActivity extends BaseCompatActivity implements View. | ||
| 71 | 69 | ||
| 72 | @Override | 70 | @Override |
| 73 | public void onClick(View view) { | 71 | public void onClick(View view) { |
| 74 | - switch (view.getId()){ | 72 | + switch (view.getId()) { |
| 75 | case R.id.ivSearch: | 73 | case R.id.ivSearch: |
| 76 | - | 74 | + consultOneLevelFragment.showSearchContent(et_search.getText().toString()); |
| 77 | break; | 75 | break; |
| 78 | case R.id.ivBack: | 76 | case R.id.ivBack: |
| 79 | finish(); | 77 | finish(); |
app/src/main/java/com/shunzhi/parent/ui/fragment/CePingFragment.java
| @@ -70,7 +70,6 @@ public class CePingFragment extends BaseMVPCompatFragment<CepingContract.CePingP | @@ -70,7 +70,6 @@ public class CePingFragment extends BaseMVPCompatFragment<CepingContract.CePingP | ||
| 70 | 70 | ||
| 71 | addTools(); | 71 | addTools(); |
| 72 | 72 | ||
| 73 | - tvLocalAddress.setText(AppContext.getInstance().cityName); | ||
| 74 | textAndImg_xqjc.setTextColor(R.color.white); | 73 | textAndImg_xqjc.setTextColor(R.color.white); |
| 75 | textAndImg_xqjc.setText("学情检测"); | 74 | textAndImg_xqjc.setText("学情检测"); |
| 76 | textAndImg_xqjc.setImgs(R.drawable.xqjc, R.drawable.xqjc); | 75 | textAndImg_xqjc.setImgs(R.drawable.xqjc, R.drawable.xqjc); |
| @@ -99,6 +98,10 @@ public class CePingFragment extends BaseMVPCompatFragment<CepingContract.CePingP | @@ -99,6 +98,10 @@ public class CePingFragment extends BaseMVPCompatFragment<CepingContract.CePingP | ||
| 99 | @Override | 98 | @Override |
| 100 | public void onResume() { | 99 | public void onResume() { |
| 101 | super.onResume(); | 100 | super.onResume(); |
| 101 | + if (!tvLocalAddress.getText().toString().equals(AppContext.getInstance().cityName)){ | ||
| 102 | + tvLocalAddress.setText(AppContext.getInstance().cityName); | ||
| 103 | + addTools(); | ||
| 104 | + } | ||
| 102 | } | 105 | } |
| 103 | 106 | ||
| 104 | private void initListeners(View view) { | 107 | private void initListeners(View view) { |
| @@ -125,7 +128,6 @@ public class CePingFragment extends BaseMVPCompatFragment<CepingContract.CePingP | @@ -125,7 +128,6 @@ public class CePingFragment extends BaseMVPCompatFragment<CepingContract.CePingP | ||
| 125 | return new CePingPresenter(); | 128 | return new CePingPresenter(); |
| 126 | } | 129 | } |
| 127 | 130 | ||
| 128 | - | ||
| 129 | @Override | 131 | @Override |
| 130 | public void onClick(View view) { | 132 | public void onClick(View view) { |
| 131 | switch (view.getId()) { | 133 | switch (view.getId()) { |
| @@ -175,7 +177,6 @@ public class CePingFragment extends BaseMVPCompatFragment<CepingContract.CePingP | @@ -175,7 +177,6 @@ public class CePingFragment extends BaseMVPCompatFragment<CepingContract.CePingP | ||
| 175 | mPresenter.getTools(layout_control, name.split(" ")[2]); | 177 | mPresenter.getTools(layout_control, name.split(" ")[2]); |
| 176 | AppContext.getInstance().cityName=name.split(" ")[1]; | 178 | AppContext.getInstance().cityName=name.split(" ")[1]; |
| 177 | AppContext.getInstance().district=name.split(" ")[2]; | 179 | AppContext.getInstance().district=name.split(" ")[2]; |
| 178 | -// ToastUtils.showToast(name.split(" ")[2]); | ||
| 179 | } | 180 | } |
| 180 | 181 | ||
| 181 | @Override | 182 | @Override |
app/src/main/java/com/shunzhi/parent/ui/fragment/ConsultFragment.java
| @@ -133,6 +133,11 @@ public class ConsultFragment extends BaseMVPCompatFragment<ConsultContract.Consu | @@ -133,6 +133,11 @@ public class ConsultFragment extends BaseMVPCompatFragment<ConsultContract.Consu | ||
| 133 | public void onResume() { | 133 | public void onResume() { |
| 134 | super.onResume(); | 134 | super.onResume(); |
| 135 | xBanner.startAutoPlay(); | 135 | xBanner.startAutoPlay(); |
| 136 | + if (!tvLocalAddress.getText().toString().equals(AppContext.getInstance().cityName)){ | ||
| 137 | + tvLocalAddress.setText(AppContext.getInstance().cityName); | ||
| 138 | + mPresenter.getBanners("2", AppContext.getInstance().district); | ||
| 139 | + mPresenter.getContextChannel(AppContext.getInstance().district, 0, 1, 1); | ||
| 140 | + } | ||
| 136 | } | 141 | } |
| 137 | 142 | ||
| 138 | @Override | 143 | @Override |
app/src/main/java/com/shunzhi/parent/ui/fragment/MineFragment.java
| 1 | package com.shunzhi.parent.ui.fragment; | 1 | package com.shunzhi.parent.ui.fragment; |
| 2 | 2 | ||
| 3 | +import android.app.AlertDialog; | ||
| 4 | +import android.content.DialogInterface; | ||
| 3 | import android.content.Intent; | 5 | import android.content.Intent; |
| 4 | import android.os.Bundle; | 6 | import android.os.Bundle; |
| 5 | import android.support.annotation.NonNull; | 7 | import android.support.annotation.NonNull; |
| @@ -13,6 +15,7 @@ import com.bumptech.glide.Glide; | @@ -13,6 +15,7 @@ import com.bumptech.glide.Glide; | ||
| 13 | import com.makeramen.roundedimageview.RoundedImageView; | 15 | import com.makeramen.roundedimageview.RoundedImageView; |
| 14 | import com.share.mvpsdk.base.BasePresenter; | 16 | import com.share.mvpsdk.base.BasePresenter; |
| 15 | import com.share.mvpsdk.base.fragment.BaseMVPCompatFragment; | 17 | import com.share.mvpsdk.base.fragment.BaseMVPCompatFragment; |
| 18 | +import com.share.mvpsdk.utils.CacheUtils; | ||
| 16 | import com.share.mvpsdk.utils.ToastUtils; | 19 | import com.share.mvpsdk.utils.ToastUtils; |
| 17 | import com.shunzhi.parent.AppConfig; | 20 | import com.shunzhi.parent.AppConfig; |
| 18 | import com.shunzhi.parent.AppContext; | 21 | import com.shunzhi.parent.AppContext; |
| @@ -26,9 +29,11 @@ import com.shunzhi.parent.ui.activity.PersonInfoActivity; | @@ -26,9 +29,11 @@ import com.shunzhi.parent.ui.activity.PersonInfoActivity; | ||
| 26 | import com.shunzhi.parent.ui.activity.mywebview.WebViewActivity; | 29 | import com.shunzhi.parent.ui.activity.mywebview.WebViewActivity; |
| 27 | import com.shunzhi.parent.ui.activity.orderdetail.OrderDetailActivity; | 30 | import com.shunzhi.parent.ui.activity.orderdetail.OrderDetailActivity; |
| 28 | 31 | ||
| 32 | +import static java.util.ResourceBundle.clearCache; | ||
| 33 | + | ||
| 29 | public class MineFragment extends BaseMVPCompatFragment<LoginAndRegisterContract.LoginPresenter, LoginAndRegisterContract.ILoginModel> | 34 | public class MineFragment extends BaseMVPCompatFragment<LoginAndRegisterContract.LoginPresenter, LoginAndRegisterContract.ILoginModel> |
| 30 | implements MineContract.IMineView, View.OnClickListener { | 35 | implements MineContract.IMineView, View.OnClickListener { |
| 31 | - LinearLayout childlayout, personinfo, layout_orderDetail, layout_order; | 36 | + LinearLayout childlayout, personinfo, layout_orderDetail, layout_order,layout_cache; |
| 32 | RoundedImageView user_photo; | 37 | RoundedImageView user_photo; |
| 33 | TextView user_name, user_mobile, tvExit,binding_state; | 38 | TextView user_name, user_mobile, tvExit,binding_state; |
| 34 | 39 | ||
| @@ -49,6 +54,8 @@ public class MineFragment extends BaseMVPCompatFragment<LoginAndRegisterContract | @@ -49,6 +54,8 @@ public class MineFragment extends BaseMVPCompatFragment<LoginAndRegisterContract | ||
| 49 | personinfo = view.findViewById(R.id.personinfo); | 54 | personinfo = view.findViewById(R.id.personinfo); |
| 50 | layout_order = view.findViewById(R.id.layout_order); | 55 | layout_order = view.findViewById(R.id.layout_order); |
| 51 | layout_orderDetail = view.findViewById(R.id.layout_orderDetail); | 56 | layout_orderDetail = view.findViewById(R.id.layout_orderDetail); |
| 57 | + layout_cache=view.findViewById(R.id.layout_cache); | ||
| 58 | + layout_cache.setOnClickListener(this); | ||
| 52 | childlayout.setOnClickListener(this); | 59 | childlayout.setOnClickListener(this); |
| 53 | personinfo.setOnClickListener(this); | 60 | personinfo.setOnClickListener(this); |
| 54 | layout_order.setOnClickListener(this); | 61 | layout_order.setOnClickListener(this); |
| @@ -109,11 +116,42 @@ public class MineFragment extends BaseMVPCompatFragment<LoginAndRegisterContract | @@ -109,11 +116,42 @@ public class MineFragment extends BaseMVPCompatFragment<LoginAndRegisterContract | ||
| 109 | case R.id.tvExit: | 116 | case R.id.tvExit: |
| 110 | clearUerinfo(); | 117 | clearUerinfo(); |
| 111 | break; | 118 | break; |
| 119 | + case R.id.layout_cache: | ||
| 120 | + clearMyCache(); | ||
| 121 | + break; | ||
| 112 | default: | 122 | default: |
| 113 | break; | 123 | break; |
| 114 | } | 124 | } |
| 115 | } | 125 | } |
| 116 | 126 | ||
| 127 | + private void clearMyCache() { | ||
| 128 | + | ||
| 129 | + AlertDialog.Builder builder=new AlertDialog.Builder(getActivity()); | ||
| 130 | + try { | ||
| 131 | + builder.setMessage("清理缓存"+CacheUtils.getCacheSize(getActivity())+"") | ||
| 132 | + .setPositiveButton("取消", new DialogInterface.OnClickListener() { | ||
| 133 | + @Override | ||
| 134 | + public void onClick(DialogInterface dialogInterface, int i) { | ||
| 135 | + dialogInterface.dismiss(); | ||
| 136 | + } | ||
| 137 | + }) | ||
| 138 | + .setNegativeButton("确定", new DialogInterface.OnClickListener() { | ||
| 139 | + @Override | ||
| 140 | + public void onClick(DialogInterface dialogInterface, int i) { | ||
| 141 | + try { | ||
| 142 | + CacheUtils.clearCache(getActivity()); | ||
| 143 | + } catch (Exception e) { | ||
| 144 | + e.printStackTrace(); | ||
| 145 | + } | ||
| 146 | + dialogInterface.dismiss(); | ||
| 147 | + } | ||
| 148 | + }); | ||
| 149 | + } catch (Exception e) { | ||
| 150 | + e.printStackTrace(); | ||
| 151 | + } | ||
| 152 | + builder.create().show(); | ||
| 153 | + } | ||
| 154 | + | ||
| 117 | private void clearUerinfo() { | 155 | private void clearUerinfo() { |
| 118 | AppConfig.getAppConfig(AppContext.getInstance()).set(AppConfig.USER_IMAGE, ""); | 156 | AppConfig.getAppConfig(AppContext.getInstance()).set(AppConfig.USER_IMAGE, ""); |
| 119 | AppConfig.getAppConfig(AppContext.getInstance()).set(AppConfig.USER_NAME, ""); | 157 | AppConfig.getAppConfig(AppContext.getInstance()).set(AppConfig.USER_NAME, ""); |
app/src/main/java/com/shunzhi/parent/ui/fragment/consult/ConsultOneLevelFragment.java
| @@ -49,9 +49,7 @@ public class ConsultOneLevelFragment extends BaseMVPCompatFragment<ConsultOneCon | @@ -49,9 +49,7 @@ public class ConsultOneLevelFragment extends BaseMVPCompatFragment<ConsultOneCon | ||
| 49 | 49 | ||
| 50 | LinearLayout layout_control; | 50 | LinearLayout layout_control; |
| 51 | 51 | ||
| 52 | - List<MyConsultBean> myConsultBeanList = null; | ||
| 53 | - | ||
| 54 | - String channel=""; | 52 | + String channel = ""; |
| 55 | 53 | ||
| 56 | @Override | 54 | @Override |
| 57 | public int getLayoutId() { | 55 | public int getLayoutId() { |
| @@ -60,7 +58,7 @@ public class ConsultOneLevelFragment extends BaseMVPCompatFragment<ConsultOneCon | @@ -60,7 +58,7 @@ public class ConsultOneLevelFragment extends BaseMVPCompatFragment<ConsultOneCon | ||
| 60 | 58 | ||
| 61 | @Override | 59 | @Override |
| 62 | public void initUI(View view, @Nullable Bundle savedInstanceState) { | 60 | public void initUI(View view, @Nullable Bundle savedInstanceState) { |
| 63 | - initViews(view); | 61 | + initViews(view); |
| 64 | } | 62 | } |
| 65 | 63 | ||
| 66 | private void initRecyclerView(List<GuangGaoBean> guangGaoBeanList) { | 64 | private void initRecyclerView(List<GuangGaoBean> guangGaoBeanList) { |
| @@ -83,35 +81,20 @@ public class ConsultOneLevelFragment extends BaseMVPCompatFragment<ConsultOneCon | @@ -83,35 +81,20 @@ public class ConsultOneLevelFragment extends BaseMVPCompatFragment<ConsultOneCon | ||
| 83 | } | 81 | } |
| 84 | 82 | ||
| 85 | private void initViews(View view) { | 83 | private void initViews(View view) { |
| 86 | - channel=getArguments().getString("channel"); | 84 | + channel = getArguments().getString("channel"); |
| 87 | ToastUtils.showToast(channel); | 85 | ToastUtils.showToast(channel); |
| 88 | layout_control = view.findViewById(R.id.layout_control); | 86 | layout_control = view.findViewById(R.id.layout_control); |
| 89 | layout_control.measure(0, 0); | 87 | layout_control.measure(0, 0); |
| 90 | -// mPresenter.getTools(layout_control); | ||
| 91 | recyclerViewGrally = view.findViewById(R.id.recyclerViewGrally); | 88 | recyclerViewGrally = view.findViewById(R.id.recyclerViewGrally); |
| 92 | recyclerViewConsultOne = view.findViewById(R.id.recyclerViewConsultOne); | 89 | recyclerViewConsultOne = view.findViewById(R.id.recyclerViewConsultOne); |
| 93 | 90 | ||
| 94 | mPresenter.getBanners("3", AppContext.getInstance().district); | 91 | mPresenter.getBanners("3", AppContext.getInstance().district); |
| 95 | mPresenter.getConsultContent(AppContext.getInstance().district, Integer.parseInt(channel), 0, 1); | 92 | mPresenter.getConsultContent(AppContext.getInstance().district, Integer.parseInt(channel), 0, 1); |
| 96 | -// initRecyclerViewConsult(); | ||
| 97 | } | 93 | } |
| 98 | 94 | ||
| 99 | -// private void initRecyclerViewConsult() { | ||
| 100 | -// if (null == myConsultAdapter) myConsultAdapter = new MyConsultAdapter(getActivity()); | ||
| 101 | -// if (null == myConsultBeanList) myConsultBeanList = new ArrayList<>(); | ||
| 102 | -// else myConsultBeanList.clear(); | ||
| 103 | -// for (int i = 0; i < 12; i++) { | ||
| 104 | -// MyConsultBean myConsultBean = new MyConsultBean(); | ||
| 105 | -// myConsultBean.consultCounts = i + ""; | ||
| 106 | -// myConsultBean.consultContent = "咨询内容" + i; | ||
| 107 | -// myConsultBean.consultTitle = "咨询标题" + i; | ||
| 108 | -// myConsultBean.consultZhuanfaCounts = "转发:" + i; | ||
| 109 | -// myConsultBeanList.add(myConsultBean); | ||
| 110 | -// } | ||
| 111 | -// myConsultAdapter.addAll(myConsultBeanList); | ||
| 112 | -// recyclerViewConsultOne.setAdapter(myConsultAdapter); | ||
| 113 | -// | ||
| 114 | -// } | 95 | + public void showSearchContent(String keyword) { |
| 96 | + mPresenter.getInformationTopic(keyword, AppContext.getInstance().district, channel, "0", 1); | ||
| 97 | + } | ||
| 115 | 98 | ||
| 116 | @NonNull | 99 | @NonNull |
| 117 | @Override | 100 | @Override |
| @@ -148,7 +131,6 @@ public class ConsultOneLevelFragment extends BaseMVPCompatFragment<ConsultOneCon | @@ -148,7 +131,6 @@ public class ConsultOneLevelFragment extends BaseMVPCompatFragment<ConsultOneCon | ||
| 148 | TextAndImgShowView textAndImgShowView = new TextAndImgShowView(getActivity()); | 131 | TextAndImgShowView textAndImgShowView = new TextAndImgShowView(getActivity()); |
| 149 | textAndImgShowView.setTextColor(R.color.textColor); | 132 | textAndImgShowView.setTextColor(R.color.textColor); |
| 150 | textAndImgShowView.setText(list.get(i).getChannelName()); | 133 | textAndImgShowView.setText(list.get(i).getChannelName()); |
| 151 | -// textAndImgShowView.setImgs(R.drawable.play, Integer.parseInt(list.get(i).getChannelImage())); | ||
| 152 | textAndImgShowView.addImgs(list.get(i).getChannelImage()); | 134 | textAndImgShowView.addImgs(list.get(i).getChannelImage()); |
| 153 | textAndImgShowView.setSelect(true); | 135 | textAndImgShowView.setSelect(true); |
| 154 | textAndImgShowView.setWidth(getActivity(), layout_control); | 136 | textAndImgShowView.setWidth(getActivity(), layout_control); |
| @@ -157,8 +139,8 @@ public class ConsultOneLevelFragment extends BaseMVPCompatFragment<ConsultOneCon | @@ -157,8 +139,8 @@ public class ConsultOneLevelFragment extends BaseMVPCompatFragment<ConsultOneCon | ||
| 157 | textAndImgShowView.setOnClickListener(new View.OnClickListener() { | 139 | textAndImgShowView.setOnClickListener(new View.OnClickListener() { |
| 158 | @Override | 140 | @Override |
| 159 | public void onClick(View view) { | 141 | public void onClick(View view) { |
| 160 | - ChannelBean channelBean= (ChannelBean) view.getTag(); | ||
| 161 | - ConsultTwoLevelActivity.getInstance(getActivity(),channelBean.getId()+""); | 142 | + ChannelBean channelBean = (ChannelBean) view.getTag(); |
| 143 | + ConsultTwoLevelActivity.getInstance(getActivity(), channelBean.getId() + ""); | ||
| 162 | } | 144 | } |
| 163 | }); | 145 | }); |
| 164 | layout_control.addView(textAndImgShowView); | 146 | layout_control.addView(textAndImgShowView); |
| @@ -199,8 +181,8 @@ public class ConsultOneLevelFragment extends BaseMVPCompatFragment<ConsultOneCon | @@ -199,8 +181,8 @@ public class ConsultOneLevelFragment extends BaseMVPCompatFragment<ConsultOneCon | ||
| 199 | 181 | ||
| 200 | @Override | 182 | @Override |
| 201 | public void onBindViewHolder(GuangGaoBean object, int position) { | 183 | public void onBindViewHolder(GuangGaoBean object, int position) { |
| 202 | - Glide.with(getActivity()).load(AppConfig.BASE_URL_IMG+object.fileSrc).error(R.drawable.ic_launcher_foreground).into(iv_grally); | ||
| 203 | - tv_grally_title.setText(object.describe+""); | 184 | + Glide.with(getActivity()).load(AppConfig.BASE_URL_IMG + object.fileSrc).error(R.drawable.ic_launcher_foreground).into(iv_grally); |
| 185 | + tv_grally_title.setText(object.describe + ""); | ||
| 204 | } | 186 | } |
| 205 | } | 187 | } |
| 206 | } | 188 | } |
app/src/main/res/layout/fragment_mine.xml
| @@ -268,6 +268,7 @@ | @@ -268,6 +268,7 @@ | ||
| 268 | android:background="@color/bottomline" /> | 268 | android:background="@color/bottomline" /> |
| 269 | 269 | ||
| 270 | <LinearLayout | 270 | <LinearLayout |
| 271 | + android:id="@+id/layout_cache" | ||
| 271 | android:layout_width="match_parent" | 272 | android:layout_width="match_parent" |
| 272 | android:layout_height="?android:actionBarSize" | 273 | android:layout_height="?android:actionBarSize" |
| 273 | android:gravity="center_vertical" | 274 | android:gravity="center_vertical" |
mvpsdk/src/main/java/com/share/mvpsdk/utils/CacheUtils.java
| @@ -96,6 +96,11 @@ public class CacheUtils { | @@ -96,6 +96,11 @@ public class CacheUtils { | ||
| 96 | cleanCustomCache(filepath); | 96 | cleanCustomCache(filepath); |
| 97 | } | 97 | } |
| 98 | 98 | ||
| 99 | + public static void clearCache(Context context)throws Exception{ | ||
| 100 | + File file=new File("/data/data/"+ context.getPackageName()); | ||
| 101 | + cleanCustomCache(file.toString()); | ||
| 102 | + } | ||
| 103 | + | ||
| 99 | public static String getCacheSize(Context context) throws Exception { | 104 | public static String getCacheSize(Context context) throws Exception { |
| 100 | File file=new File("/data/data/"+ context.getPackageName()); | 105 | File file=new File("/data/data/"+ context.getPackageName()); |
| 101 | return getFormatSize(getFolderSize(file)); | 106 | return getFormatSize(getFolderSize(file)); |