Commit e18ab61af1e4508ac05f11603a5f944cf9a9fc67
1 parent
1dec60d7
Exists in
yxb_dev
and in
2 other branches
no message
Showing
14 changed files
with
268 additions
and
44 deletions
Show diff stats
app/build.gradle
app/src/main/AndroidManifest.xml
| @@ -67,9 +67,9 @@ | @@ -67,9 +67,9 @@ | ||
| 67 | 67 | ||
| 68 | 68 | ||
| 69 | <!-- 家长慧测试APPkey --> | 69 | <!-- 家长慧测试APPkey --> |
| 70 | - <!--<meta-data--> | ||
| 71 | - <!--android:name="com.netease.nim.appKey"--> | ||
| 72 | - <!--android:value="330158c080acdf4dc1092d6a74576c2c" />--> | 70 | + <!-- <meta-data --> |
| 71 | + <!-- android:name="com.netease.nim.appKey" --> | ||
| 72 | + <!-- android:value="330158c080acdf4dc1092d6a74576c2c" /> --> | ||
| 73 | <!-- 家长慧正式APPkey --> | 73 | <!-- 家长慧正式APPkey --> |
| 74 | 74 | ||
| 75 | <meta-data | 75 | <meta-data |
| @@ -127,10 +127,10 @@ | @@ -127,10 +127,10 @@ | ||
| 127 | <category android:name="android.intent.category.LAUNCHER" /> | 127 | <category android:name="android.intent.category.LAUNCHER" /> |
| 128 | </intent-filter> | 128 | </intent-filter> |
| 129 | </activity> | 129 | </activity> |
| 130 | - <!--<activity--> | ||
| 131 | - <!--android:name=".ui.MainActivity"--> | ||
| 132 | - <!--android:screenOrientation="portrait"--> | ||
| 133 | - <!--android:windowSoftInputMode="adjustPan|stateAlwaysHidden" />--> | 130 | + <!-- <activity --> |
| 131 | + <!-- android:name=".ui.MainActivity" --> | ||
| 132 | + <!-- android:screenOrientation="portrait" --> | ||
| 133 | + <!-- android:windowSoftInputMode="adjustPan|stateAlwaysHidden" /> --> | ||
| 134 | <!-- <activity --> | 134 | <!-- <activity --> |
| 135 | <!-- android:name=".ui.MainActivity" --> | 135 | <!-- android:name=".ui.MainActivity" --> |
| 136 | <!-- android:screenOrientation="portrait" --> | 136 | <!-- android:screenOrientation="portrait" --> |
| @@ -141,15 +141,13 @@ | @@ -141,15 +141,13 @@ | ||
| 141 | <activity | 141 | <activity |
| 142 | android:name=".ui.activity.consult.ConsultOneLevelActivity" | 142 | android:name=".ui.activity.consult.ConsultOneLevelActivity" |
| 143 | android:windowSoftInputMode="adjustPan|stateAlwaysHidden" /> | 143 | android:windowSoftInputMode="adjustPan|stateAlwaysHidden" /> |
| 144 | - | ||
| 145 | <activity | 144 | <activity |
| 146 | android:name=".ui.MainActivity" | 145 | android:name=".ui.MainActivity" |
| 147 | - android:screenOrientation="portrait"/> | ||
| 148 | - | 146 | + android:screenOrientation="portrait" /> |
| 149 | <activity | 147 | <activity |
| 150 | android:name=".ui.activity.ChildDetialActivity" | 148 | android:name=".ui.activity.ChildDetialActivity" |
| 151 | android:launchMode="singleInstance" | 149 | android:launchMode="singleInstance" |
| 152 | - android:screenOrientation="portrait"/> | 150 | + android:screenOrientation="portrait" /> |
| 153 | <activity | 151 | <activity |
| 154 | android:name=".ui.activity.binding.CreateChildInfoActivity" | 152 | android:name=".ui.activity.binding.CreateChildInfoActivity" |
| 155 | android:launchMode="singleInstance" | 153 | android:launchMode="singleInstance" |
| @@ -159,7 +157,6 @@ | @@ -159,7 +157,6 @@ | ||
| 159 | android:name=".ui.activity.binding.SelectSchoolActivity" | 157 | android:name=".ui.activity.binding.SelectSchoolActivity" |
| 160 | android:screenOrientation="portrait" | 158 | android:screenOrientation="portrait" |
| 161 | android:windowSoftInputMode="adjustPan|stateHidden" /> | 159 | android:windowSoftInputMode="adjustPan|stateHidden" /> |
| 162 | - | ||
| 163 | <activity | 160 | <activity |
| 164 | android:name=".ui.activity.LoginAndRegistActivity" | 161 | android:name=".ui.activity.LoginAndRegistActivity" |
| 165 | android:screenOrientation="portrait" | 162 | android:screenOrientation="portrait" |
| @@ -174,29 +171,27 @@ | @@ -174,29 +171,27 @@ | ||
| 174 | android:launchMode="singleInstance" | 171 | android:launchMode="singleInstance" |
| 175 | android:screenOrientation="portrait" | 172 | android:screenOrientation="portrait" |
| 176 | android:windowSoftInputMode="adjustPan|stateHidden" /> | 173 | android:windowSoftInputMode="adjustPan|stateHidden" /> |
| 177 | - | ||
| 178 | <activity | 174 | <activity |
| 179 | android:name=".ui.activity.binding.InviteCodeActivity" | 175 | android:name=".ui.activity.binding.InviteCodeActivity" |
| 180 | android:launchMode="singleInstance" | 176 | android:launchMode="singleInstance" |
| 181 | - android:screenOrientation="portrait"/> | 177 | + android:screenOrientation="portrait" /> |
| 182 | <activity | 178 | <activity |
| 183 | android:name=".ui.activity.mywebview.WebViewActivity" | 179 | android:name=".ui.activity.mywebview.WebViewActivity" |
| 184 | android:launchMode="singleInstance" | 180 | android:launchMode="singleInstance" |
| 185 | - android:screenOrientation="portrait"/> | ||
| 186 | - | 181 | + android:screenOrientation="portrait" /> |
| 187 | <activity | 182 | <activity |
| 188 | android:name=".ui.activity.consult.ConsultTwoLevelActivity" | 183 | android:name=".ui.activity.consult.ConsultTwoLevelActivity" |
| 189 | android:launchMode="singleInstance" | 184 | android:launchMode="singleInstance" |
| 190 | android:windowSoftInputMode="adjustPan|stateAlwaysHidden" /> | 185 | android:windowSoftInputMode="adjustPan|stateAlwaysHidden" /> |
| 191 | - | ||
| 192 | <activity | 186 | <activity |
| 193 | android:name=".ui.activity.orderdetail.OrderDetailActivity" | 187 | android:name=".ui.activity.orderdetail.OrderDetailActivity" |
| 194 | android:launchMode="singleInstance" /> | 188 | android:launchMode="singleInstance" /> |
| 195 | 189 | ||
| 196 | <service | 190 | <service |
| 197 | android:name=".ui.service.BadgeIntentService" | 191 | android:name=".ui.service.BadgeIntentService" |
| 198 | - android:exported="false"> | ||
| 199 | - </service> | 192 | + android:exported="false"></service> |
| 193 | + | ||
| 194 | + <activity android:name=".ui.activity.message.MesageActivity"></activity> | ||
| 200 | </application> | 195 | </application> |
| 201 | 196 | ||
| 202 | </manifest> | 197 | </manifest> |
| 203 | \ No newline at end of file | 198 | \ No newline at end of file |
app/src/main/java/com/shunzhi/parent/bean/message/MyMessage.java
0 → 100644
app/src/main/java/com/shunzhi/parent/bean/message/PHMessageSession.java
| @@ -2,12 +2,9 @@ package com.shunzhi.parent.bean.message; | @@ -2,12 +2,9 @@ package com.shunzhi.parent.bean.message; | ||
| 2 | 2 | ||
| 3 | import com.shunzhi.parent.AppConfig; | 3 | import com.shunzhi.parent.AppConfig; |
| 4 | import com.shunzhi.parent.AppContext; | 4 | import com.shunzhi.parent.AppContext; |
| 5 | - | ||
| 6 | import org.greenrobot.greendao.annotation.Entity; | 5 | import org.greenrobot.greendao.annotation.Entity; |
| 7 | import org.greenrobot.greendao.annotation.Id; | 6 | import org.greenrobot.greendao.annotation.Id; |
| 8 | - | ||
| 9 | import java.util.Date; | 7 | import java.util.Date; |
| 10 | - | ||
| 11 | import org.greenrobot.greendao.annotation.Generated; | 8 | import org.greenrobot.greendao.annotation.Generated; |
| 12 | import org.greenrobot.greendao.annotation.Keep; | 9 | import org.greenrobot.greendao.annotation.Keep; |
| 13 | 10 |
app/src/main/java/com/shunzhi/parent/manager/MessageManager.java
| @@ -101,12 +101,13 @@ public class MessageManager { | @@ -101,12 +101,13 @@ public class MessageManager { | ||
| 101 | JSONObject json = new JSONObject(customNotification.getContent()); | 101 | JSONObject json = new JSONObject(customNotification.getContent()); |
| 102 | String type = json.optString("type"); | 102 | String type = json.optString("type"); |
| 103 | String uuid = json.optString("msgId"); | 103 | String uuid = json.optString("msgId"); |
| 104 | + Timber.d("onCustomNotificationReceive%s","json="+json.toString()); | ||
| 104 | if ("homework".equals(type)) { | 105 | if ("homework".equals(type)) { |
| 105 | PHMessageSession session = PHMessageSession.findAndCreateSession(PHMessageSession.sessionType_homework, true); | 106 | PHMessageSession session = PHMessageSession.findAndCreateSession(PHMessageSession.sessionType_homework, true); |
| 106 | session.setSessionName("作业通知"); | 107 | session.setSessionName("作业通知"); |
| 107 | session.setDate(new Date(customNotification.getTime())); | 108 | session.setDate(new Date(customNotification.getTime())); |
| 108 | session.setSessionText(json.optString("title")); | 109 | session.setSessionText(json.optString("title")); |
| 109 | - ToastUtils.showToast(json.optString("title")+"uuid="+uuid); | 110 | +// ToastUtils.showToast(json.optString("title")+"uuid="+uuid); |
| 110 | 111 | ||
| 111 | PHMessage message = new PHMessage(); | 112 | PHMessage message = new PHMessage(); |
| 112 | PHMessageDao messageDao = AppContext.getInstance().getDaoSession().getPHMessageDao(); | 113 | PHMessageDao messageDao = AppContext.getInstance().getDaoSession().getPHMessageDao(); |
app/src/main/java/com/shunzhi/parent/ui/activity/message/MesageActivity.java
0 → 100644
| @@ -0,0 +1,121 @@ | @@ -0,0 +1,121 @@ | ||
| 1 | +package com.shunzhi.parent.ui.activity.message; | ||
| 2 | + | ||
| 3 | +import android.support.v7.app.AppCompatActivity; | ||
| 4 | +import android.os.Bundle; | ||
| 5 | +import android.support.v7.widget.LinearLayoutManager; | ||
| 6 | +import android.support.v7.widget.RecyclerView; | ||
| 7 | +import android.view.LayoutInflater; | ||
| 8 | +import android.view.View; | ||
| 9 | +import android.view.ViewGroup; | ||
| 10 | +import android.widget.ImageView; | ||
| 11 | +import android.widget.TextView; | ||
| 12 | + | ||
| 13 | +import com.share.mvpsdk.base.activity.BaseCompatActivity; | ||
| 14 | +import com.share.mvpsdk.base.adapter.BaseRecyclerViewAdapter; | ||
| 15 | +import com.share.mvpsdk.base.adapter.BaseRecyclerViewHolder; | ||
| 16 | +import com.share.mvpsdk.utils.DateUtils; | ||
| 17 | +import com.shunzhi.parent.R; | ||
| 18 | +import com.shunzhi.parent.bean.message.PHMessage; | ||
| 19 | +import com.shunzhi.parent.bean.message.PHMessageSession; | ||
| 20 | + | ||
| 21 | +import java.util.ArrayList; | ||
| 22 | +import java.util.List; | ||
| 23 | + | ||
| 24 | +public class MesageActivity extends BaseCompatActivity implements View.OnClickListener { | ||
| 25 | + | ||
| 26 | + RecyclerView recyclerView; | ||
| 27 | + | ||
| 28 | + ImageView iv_back; | ||
| 29 | + | ||
| 30 | + MEssageAdapter mEssageAdapter=null; | ||
| 31 | + | ||
| 32 | + List<PHMessage> phMessages=new ArrayList<>(); | ||
| 33 | + | ||
| 34 | + @Override | ||
| 35 | + protected void initView(Bundle savedInstanceState) { | ||
| 36 | + | ||
| 37 | + initViews(); | ||
| 38 | + | ||
| 39 | + } | ||
| 40 | + | ||
| 41 | + private void initViews() { | ||
| 42 | + | ||
| 43 | + recyclerView = findViewById(R.id.recyclerView); | ||
| 44 | + iv_back = findViewById(R.id.iv_back); | ||
| 45 | + | ||
| 46 | + iv_back.setOnClickListener(this); | ||
| 47 | + | ||
| 48 | + initAdapter(); | ||
| 49 | + } | ||
| 50 | + | ||
| 51 | + private void initAdapter() { | ||
| 52 | + | ||
| 53 | + if (null==mEssageAdapter)mEssageAdapter=new MEssageAdapter(); | ||
| 54 | + if (null==recyclerView.getAdapter())recyclerView.setAdapter(mEssageAdapter); | ||
| 55 | + mEssageAdapter.addAll(phMessages); | ||
| 56 | + recyclerView.setAdapter(mEssageAdapter); | ||
| 57 | + | ||
| 58 | + } | ||
| 59 | + | ||
| 60 | + @Override | ||
| 61 | + protected int getLayoutId() { | ||
| 62 | + return R.layout.activity_mesage; | ||
| 63 | + } | ||
| 64 | + | ||
| 65 | + @Override | ||
| 66 | + public void onClick(View view) { | ||
| 67 | + switch (view.getId()) { | ||
| 68 | + case R.id.iv_back: | ||
| 69 | + finish(); | ||
| 70 | + break; | ||
| 71 | + } | ||
| 72 | + } | ||
| 73 | + | ||
| 74 | + | ||
| 75 | + private class MEssageAdapter extends BaseRecyclerViewAdapter<PHMessage> { | ||
| 76 | + | ||
| 77 | + @Override | ||
| 78 | + public void onAttachedToRecyclerView(RecyclerView recyclerView) { | ||
| 79 | + super.onAttachedToRecyclerView(recyclerView); | ||
| 80 | + LinearLayoutManager layoutManager = new LinearLayoutManager(MesageActivity.this); | ||
| 81 | + layoutManager.setOrientation(LinearLayoutManager.VERTICAL); | ||
| 82 | + recyclerView.setLayoutManager(layoutManager); | ||
| 83 | + } | ||
| 84 | + | ||
| 85 | + @Override | ||
| 86 | + public BaseRecyclerViewHolder onCreateViewHolder(ViewGroup parent, int viewType) { | ||
| 87 | + | ||
| 88 | + View view = LayoutInflater.from(MesageActivity.this).inflate(R.layout.item_message, parent, false); | ||
| 89 | + MessageViewHolder messageViewHolder = new MessageViewHolder(view); | ||
| 90 | + | ||
| 91 | + return messageViewHolder; | ||
| 92 | + } | ||
| 93 | + | ||
| 94 | + private class MessageViewHolder extends BaseRecyclerViewHolder<PHMessage> { | ||
| 95 | + | ||
| 96 | + TextView tvMessageContent, tvDate; | ||
| 97 | + List<String> dateString = new ArrayList<>(); | ||
| 98 | + | ||
| 99 | + public MessageViewHolder(View itemView) { | ||
| 100 | + super(itemView); | ||
| 101 | + tvMessageContent = itemView.findViewById(R.id.tvMessageContent); | ||
| 102 | + tvDate = itemView.findViewById(R.id.tvDate); | ||
| 103 | + } | ||
| 104 | + | ||
| 105 | + @Override | ||
| 106 | + public void onBindViewHolder(PHMessage object, int position) { | ||
| 107 | + tvMessageContent.setText(object.getMessageText()); | ||
| 108 | + String date = DateUtils.date2str(object.getDate(), "yyyyMMDD"); | ||
| 109 | + if (!dateString.contains(date)) { | ||
| 110 | + dateString.add(date); | ||
| 111 | + tvDate.setText(date); | ||
| 112 | + tvDate.setVisibility(View.VISIBLE); | ||
| 113 | + }else { | ||
| 114 | + tvDate.setVisibility(View.GONE); | ||
| 115 | + } | ||
| 116 | + | ||
| 117 | + } | ||
| 118 | + } | ||
| 119 | + } | ||
| 120 | + | ||
| 121 | +} |
app/src/main/java/com/shunzhi/parent/ui/fragment/ConsultFragment.java
| @@ -15,6 +15,7 @@ import android.widget.ImageView; | @@ -15,6 +15,7 @@ import android.widget.ImageView; | ||
| 15 | import android.widget.LinearLayout; | 15 | import android.widget.LinearLayout; |
| 16 | import android.widget.TextView; | 16 | import android.widget.TextView; |
| 17 | 17 | ||
| 18 | +import com.bumptech.glide.Glide; | ||
| 18 | import com.jcodecraeer.xrecyclerview.XRecyclerView; | 19 | import com.jcodecraeer.xrecyclerview.XRecyclerView; |
| 19 | import com.share.mvpsdk.base.BasePresenter; | 20 | import com.share.mvpsdk.base.BasePresenter; |
| 20 | import com.share.mvpsdk.base.fragment.BaseMVPCompatFragment; | 21 | import com.share.mvpsdk.base.fragment.BaseMVPCompatFragment; |
| @@ -111,7 +112,6 @@ public class ConsultFragment extends BaseMVPCompatFragment<ConsultContract.Consu | @@ -111,7 +112,6 @@ public class ConsultFragment extends BaseMVPCompatFragment<ConsultContract.Consu | ||
| 111 | } | 112 | } |
| 112 | 113 | ||
| 113 | private void initRecycler() { | 114 | private void initRecycler() { |
| 114 | - | ||
| 115 | recycler_context.setPullRefreshEnabled(false); | 115 | recycler_context.setPullRefreshEnabled(false); |
| 116 | recycler_context.setLoadingListener(new XRecyclerView.LoadingListener() { | 116 | recycler_context.setLoadingListener(new XRecyclerView.LoadingListener() { |
| 117 | @Override | 117 | @Override |
| @@ -143,13 +143,7 @@ public class ConsultFragment extends BaseMVPCompatFragment<ConsultContract.Consu | @@ -143,13 +143,7 @@ public class ConsultFragment extends BaseMVPCompatFragment<ConsultContract.Consu | ||
| 143 | private void initBanners() { | 143 | private void initBanners() { |
| 144 | xBanner.setData(imgesUrl, describeList); | 144 | xBanner.setData(imgesUrl, describeList); |
| 145 | // xBanner.setPointsIsVisible(false); | 145 | // xBanner.setPointsIsVisible(false); |
| 146 | - xBanner.setmAdapter(new XBanner.XBannerAdapter() { | ||
| 147 | - @Override | ||
| 148 | - public void loadBanner(XBanner banner, Object model, View view, int position) { | ||
| 149 | - if(position<=imgesUrl.size()-1) | ||
| 150 | - GlideUtils.showImg(getActivity(),(ImageView) view,imgesUrl.get(position)); | ||
| 151 | - } | ||
| 152 | - }); | 146 | + xBanner.setmAdapter(xBannerAdapter); |
| 153 | 147 | ||
| 154 | xBanner.setOnItemClickListener(new XBanner.OnItemClickListener() { | 148 | xBanner.setOnItemClickListener(new XBanner.OnItemClickListener() { |
| 155 | @Override | 149 | @Override |
| @@ -159,6 +153,14 @@ public class ConsultFragment extends BaseMVPCompatFragment<ConsultContract.Consu | @@ -159,6 +153,14 @@ public class ConsultFragment extends BaseMVPCompatFragment<ConsultContract.Consu | ||
| 159 | }); | 153 | }); |
| 160 | } | 154 | } |
| 161 | 155 | ||
| 156 | + private XBanner.XBannerAdapter xBannerAdapter=new XBanner.XBannerAdapter() { | ||
| 157 | + @Override | ||
| 158 | + public void loadBanner(XBanner banner, Object model, View view, int position) { | ||
| 159 | + Glide.with(getContext()).load(imgesUrl.get(position)).into((ImageView) view); | ||
| 160 | +// GlideUtils.showImg(getActivity(),(ImageView) view,imgesUrl.get(position)); | ||
| 161 | + } | ||
| 162 | + }; | ||
| 163 | + | ||
| 162 | @NonNull | 164 | @NonNull |
| 163 | @Override | 165 | @Override |
| 164 | public BasePresenter initPresenter() { | 166 | public BasePresenter initPresenter() { |
app/src/main/java/com/shunzhi/parent/ui/fragment/MineFragment.java
| @@ -19,6 +19,8 @@ import com.share.mvpsdk.utils.CacheUtils; | @@ -19,6 +19,8 @@ import com.share.mvpsdk.utils.CacheUtils; | ||
| 19 | import com.shunzhi.parent.AppConfig; | 19 | import com.shunzhi.parent.AppConfig; |
| 20 | import com.shunzhi.parent.AppContext; | 20 | import com.shunzhi.parent.AppContext; |
| 21 | import com.shunzhi.parent.R; | 21 | import com.shunzhi.parent.R; |
| 22 | +import com.shunzhi.parent.bean.message.PHMessage; | ||
| 23 | +import com.shunzhi.parent.bean.message.PHMessageSession; | ||
| 22 | import com.shunzhi.parent.contract.loginandregister.LoginAndRegisterContract; | 24 | import com.shunzhi.parent.contract.loginandregister.LoginAndRegisterContract; |
| 23 | import com.shunzhi.parent.contract.mine.MineContract; | 25 | import com.shunzhi.parent.contract.mine.MineContract; |
| 24 | import com.shunzhi.parent.manager.MessageManager; | 26 | import com.shunzhi.parent.manager.MessageManager; |
| @@ -26,16 +28,19 @@ import com.shunzhi.parent.presenter.mine.MinePresenter; | @@ -26,16 +28,19 @@ import com.shunzhi.parent.presenter.mine.MinePresenter; | ||
| 26 | import com.shunzhi.parent.ui.activity.LoginAndRegistActivity; | 28 | import com.shunzhi.parent.ui.activity.LoginAndRegistActivity; |
| 27 | import com.shunzhi.parent.ui.activity.MyChildActivity; | 29 | import com.shunzhi.parent.ui.activity.MyChildActivity; |
| 28 | import com.shunzhi.parent.ui.activity.PersonInfoActivity; | 30 | import com.shunzhi.parent.ui.activity.PersonInfoActivity; |
| 31 | +import com.shunzhi.parent.ui.activity.message.MesageActivity; | ||
| 29 | import com.shunzhi.parent.ui.activity.mywebview.WebViewActivity; | 32 | import com.shunzhi.parent.ui.activity.mywebview.WebViewActivity; |
| 30 | import com.shunzhi.parent.ui.activity.orderdetail.OrderDetailActivity; | 33 | import com.shunzhi.parent.ui.activity.orderdetail.OrderDetailActivity; |
| 31 | 34 | ||
| 35 | + | ||
| 32 | public class MineFragment extends BaseMVPCompatFragment<LoginAndRegisterContract.LoginPresenter, LoginAndRegisterContract.ILoginModel> | 36 | public class MineFragment extends BaseMVPCompatFragment<LoginAndRegisterContract.LoginPresenter, LoginAndRegisterContract.ILoginModel> |
| 33 | implements MineContract.IMineView, View.OnClickListener { | 37 | implements MineContract.IMineView, View.OnClickListener { |
| 34 | 38 | ||
| 35 | - LinearLayout childlayout, personinfo, layout_orderDetail, layout_order, layout_cache, layout_about, layout_feedback, top_layout, layout_afterLogin; | 39 | + LinearLayout childlayout, personinfo, layout_orderDetail, layout_order, layout_cache, layout_about, layout_feedback, top_layout, layout_afterLogin |
| 40 | + ,layout_message; | ||
| 36 | 41 | ||
| 37 | RoundedImageView user_photo; | 42 | RoundedImageView user_photo; |
| 38 | - TextView user_name, user_mobile, tvExit, binding_state; | 43 | + TextView user_name, user_mobile, tvExit, binding_state,tvMessageCount; |
| 39 | 44 | ||
| 40 | @NonNull | 45 | @NonNull |
| 41 | @Override | 46 | @Override |
| @@ -59,6 +64,9 @@ public class MineFragment extends BaseMVPCompatFragment<LoginAndRegisterContract | @@ -59,6 +64,9 @@ public class MineFragment extends BaseMVPCompatFragment<LoginAndRegisterContract | ||
| 59 | layout_cache = view.findViewById(R.id.layout_cache); | 64 | layout_cache = view.findViewById(R.id.layout_cache); |
| 60 | layout_about = view.findViewById(R.id.layout_about); | 65 | layout_about = view.findViewById(R.id.layout_about); |
| 61 | layout_feedback = view.findViewById(R.id.layout_feedback); | 66 | layout_feedback = view.findViewById(R.id.layout_feedback); |
| 67 | + tvMessageCount=view.findViewById(R.id.tvMessageCount); | ||
| 68 | + layout_message=view.findViewById(R.id.layout_message); | ||
| 69 | + layout_message.setOnClickListener(this); | ||
| 62 | layout_about.setOnClickListener(this); | 70 | layout_about.setOnClickListener(this); |
| 63 | layout_feedback.setOnClickListener(this); | 71 | layout_feedback.setOnClickListener(this); |
| 64 | layout_cache.setOnClickListener(this); | 72 | layout_cache.setOnClickListener(this); |
| @@ -75,6 +83,7 @@ public class MineFragment extends BaseMVPCompatFragment<LoginAndRegisterContract | @@ -75,6 +83,7 @@ public class MineFragment extends BaseMVPCompatFragment<LoginAndRegisterContract | ||
| 75 | binding_state = view.findViewById(R.id.binding_state); | 83 | binding_state = view.findViewById(R.id.binding_state); |
| 76 | layout_afterLogin.setVisibility(View.GONE); | 84 | layout_afterLogin.setVisibility(View.GONE); |
| 77 | 85 | ||
| 86 | + tvMessageCount.setText(PHMessage.findUnreadNotificationCount()+""); | ||
| 78 | 87 | ||
| 79 | } | 88 | } |
| 80 | 89 | ||
| @@ -119,6 +128,9 @@ public class MineFragment extends BaseMVPCompatFragment<LoginAndRegisterContract | @@ -119,6 +128,9 @@ public class MineFragment extends BaseMVPCompatFragment<LoginAndRegisterContract | ||
| 119 | @Override | 128 | @Override |
| 120 | public void onClick(View v) { | 129 | public void onClick(View v) { |
| 121 | switch (v.getId()) { | 130 | switch (v.getId()) { |
| 131 | + case R.id.layout_message: | ||
| 132 | +startNewActivity(MesageActivity.class); | ||
| 133 | + break; | ||
| 122 | case R.id.childlayout: | 134 | case R.id.childlayout: |
| 123 | startActivity(new Intent().setClass(getActivity(), MyChildActivity.class)); | 135 | startActivity(new Intent().setClass(getActivity(), MyChildActivity.class)); |
| 124 | break; | 136 | break; |
app/src/main/java/com/shunzhi/parent/ui/fragment/StartFragment.java
| @@ -135,7 +135,6 @@ public class StartFragment extends BaseMVPCompatFragment<ConsultContract.Consult | @@ -135,7 +135,6 @@ public class StartFragment extends BaseMVPCompatFragment<ConsultContract.Consult | ||
| 135 | try { | 135 | try { |
| 136 | imgUrl = new ArrayList<>(); | 136 | imgUrl = new ArrayList<>(); |
| 137 | describeList = new ArrayList<>(); | 137 | describeList = new ArrayList<>(); |
| 138 | -// Log.d("66666","isQidong="+isQidong); | ||
| 139 | if (isQidong) { | 138 | if (isQidong) { |
| 140 | AppConfig.getAppConfig(getContext()).set(AppConfig.APP_IS_START, "1"); | 139 | AppConfig.getAppConfig(getContext()).set(AppConfig.APP_IS_START, "1"); |
| 141 | String fileUrl = "", describe = ""; | 140 | String fileUrl = "", describe = ""; |
| @@ -150,7 +149,6 @@ public class StartFragment extends BaseMVPCompatFragment<ConsultContract.Consult | @@ -150,7 +149,6 @@ public class StartFragment extends BaseMVPCompatFragment<ConsultContract.Consult | ||
| 150 | describeList.add(guangGaoBeanList.get(i).describe); | 149 | describeList.add(guangGaoBeanList.get(i).describe); |
| 151 | } | 150 | } |
| 152 | } | 151 | } |
| 153 | - Log.d("66666","fileUrl="+fileUrl); | ||
| 154 | if (!TextUtils.isEmpty(fileUrl)){ | 152 | if (!TextUtils.isEmpty(fileUrl)){ |
| 155 | jiecaoVideo.setUp(fileUrl, JZVideoPlayerStandard.SCREEN_WINDOW_NORMAL, describe); | 153 | jiecaoVideo.setUp(fileUrl, JZVideoPlayerStandard.SCREEN_WINDOW_NORMAL, describe); |
| 156 | jiecaoVideo.startVideo(); | 154 | jiecaoVideo.startVideo(); |
| @@ -0,0 +1,43 @@ | @@ -0,0 +1,43 @@ | ||
| 1 | +<?xml version="1.0" encoding="utf-8"?> | ||
| 2 | +<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" | ||
| 3 | + xmlns:app="http://schemas.android.com/apk/res-auto" | ||
| 4 | + xmlns:tools="http://schemas.android.com/tools" | ||
| 5 | + android:layout_width="match_parent" | ||
| 6 | + android:layout_height="match_parent" | ||
| 7 | + android:background="@color/bgColor" | ||
| 8 | + android:orientation="vertical" | ||
| 9 | + tools:context="com.shunzhi.parent.ui.activity.message.MesageActivity"> | ||
| 10 | + | ||
| 11 | + <FrameLayout | ||
| 12 | + android:layout_width="match_parent" | ||
| 13 | + android:layout_height="?android:actionBarSize" | ||
| 14 | + android:background="@color/titleColor"> | ||
| 15 | + | ||
| 16 | + <ImageView | ||
| 17 | + android:layout_width="wrap_content" | ||
| 18 | + android:layout_height="match_parent" | ||
| 19 | + android:src="@drawable/back" | ||
| 20 | + android:paddingLeft="@dimen/size_dp_15" | ||
| 21 | + android:paddingRight="@dimen/size_dp_15" | ||
| 22 | + android:id="@+id/iv_back" | ||
| 23 | + /> | ||
| 24 | + | ||
| 25 | + <TextView | ||
| 26 | + style="@style/TextView_Wrap_16" | ||
| 27 | + android:layout_gravity="center" | ||
| 28 | + android:gravity="center" | ||
| 29 | + android:text="消息" | ||
| 30 | + android:textSize="@dimen/textSize18" | ||
| 31 | + android:textColor="@color/white" /> | ||
| 32 | + | ||
| 33 | + </FrameLayout> | ||
| 34 | + | ||
| 35 | + <android.support.v7.widget.RecyclerView | ||
| 36 | + android:layout_width="match_parent" | ||
| 37 | + android:layout_height="match_parent" | ||
| 38 | + android:id="@+id/recyclerView" | ||
| 39 | + android:scrollbars="none" | ||
| 40 | + android:layout_margin="@dimen/size_dp_10" | ||
| 41 | + ></android.support.v7.widget.RecyclerView> | ||
| 42 | + | ||
| 43 | +</LinearLayout> |
app/src/main/res/layout/activity_personinfo.xml
| @@ -19,19 +19,20 @@ | @@ -19,19 +19,20 @@ | ||
| 19 | 19 | ||
| 20 | <RelativeLayout | 20 | <RelativeLayout |
| 21 | android:layout_width="match_parent" | 21 | android:layout_width="match_parent" |
| 22 | - android:layout_height="360dp"> | 22 | + android:layout_height="400dp"> |
| 23 | 23 | ||
| 24 | <LinearLayout | 24 | <LinearLayout |
| 25 | android:id="@+id/top_layout" | 25 | android:id="@+id/top_layout" |
| 26 | android:layout_width="match_parent" | 26 | android:layout_width="match_parent" |
| 27 | - android:layout_height="180dp" | 27 | + android:layout_height="200dp" |
| 28 | android:background="@drawable/backgroud_top" | 28 | android:background="@drawable/backgroud_top" |
| 29 | android:orientation="vertical" | 29 | android:orientation="vertical" |
| 30 | - android:paddingTop="20dp"> | 30 | + > |
| 31 | 31 | ||
| 32 | <TextView | 32 | <TextView |
| 33 | android:layout_width="match_parent" | 33 | android:layout_width="match_parent" |
| 34 | - android:layout_height="wrap_content" | 34 | + android:layout_height="?android:actionBarSize" |
| 35 | + android:background="@color/back_top" | ||
| 35 | android:layout_gravity="center" | 36 | android:layout_gravity="center" |
| 36 | android:gravity="center" | 37 | android:gravity="center" |
| 37 | android:text="个人资料" | 38 | android:text="个人资料" |
app/src/main/res/layout/fragment_mine.xml
| @@ -14,15 +14,15 @@ | @@ -14,15 +14,15 @@ | ||
| 14 | 14 | ||
| 15 | <LinearLayout | 15 | <LinearLayout |
| 16 | android:id="@+id/top_layout" | 16 | android:id="@+id/top_layout" |
| 17 | - android:paddingTop="20dp" | ||
| 18 | android:layout_width="match_parent" | 17 | android:layout_width="match_parent" |
| 19 | - android:layout_height="180dp" | 18 | + android:layout_height="200dp" |
| 20 | android:background="@color/back_top" | 19 | android:background="@color/back_top" |
| 21 | android:orientation="vertical"> | 20 | android:orientation="vertical"> |
| 22 | 21 | ||
| 23 | <TextView | 22 | <TextView |
| 24 | android:layout_width="match_parent" | 23 | android:layout_width="match_parent" |
| 25 | - android:layout_height="wrap_content" | 24 | + android:layout_height="?android:actionBarSize" |
| 25 | + android:background="@color/back_top" | ||
| 26 | android:layout_gravity="center" | 26 | android:layout_gravity="center" |
| 27 | android:gravity="center" | 27 | android:gravity="center" |
| 28 | android:text="个人中心" | 28 | android:text="个人中心" |
| @@ -98,6 +98,7 @@ | @@ -98,6 +98,7 @@ | ||
| 98 | android:orientation="vertical"> | 98 | android:orientation="vertical"> |
| 99 | 99 | ||
| 100 | <LinearLayout | 100 | <LinearLayout |
| 101 | + android:id="@+id/layout_message" | ||
| 101 | android:layout_width="match_parent" | 102 | android:layout_width="match_parent" |
| 102 | android:gravity="center_vertical" | 103 | android:gravity="center_vertical" |
| 103 | android:layout_height="?android:actionBarSize"> | 104 | android:layout_height="?android:actionBarSize"> |
| @@ -118,6 +119,7 @@ | @@ -118,6 +119,7 @@ | ||
| 118 | android:textSize="@dimen/txtsize_title" /> | 119 | android:textSize="@dimen/txtsize_title" /> |
| 119 | 120 | ||
| 120 | <TextView | 121 | <TextView |
| 122 | + android:id="@+id/tvMessageCount" | ||
| 121 | android:layout_width="40dp" | 123 | android:layout_width="40dp" |
| 122 | android:layout_height="wrap_content" | 124 | android:layout_height="wrap_content" |
| 123 | android:layout_gravity="center_vertical" | 125 | android:layout_gravity="center_vertical" |
| @@ -0,0 +1,34 @@ | @@ -0,0 +1,34 @@ | ||
| 1 | +<?xml version="1.0" encoding="utf-8"?> | ||
| 2 | +<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" | ||
| 3 | + android:layout_width="match_parent" | ||
| 4 | + android:background="@color/bgColor" | ||
| 5 | + android:orientation="vertical" | ||
| 6 | + android:layout_height="match_parent"> | ||
| 7 | + | ||
| 8 | + <TextView | ||
| 9 | + android:layout_width="wrap_content" | ||
| 10 | + android:layout_height="wrap_content" | ||
| 11 | + android:textColor="@color/textColor" | ||
| 12 | + android:textSize="@dimen/size_dp_16" | ||
| 13 | + android:text="" | ||
| 14 | + android:id="@+id/tvDate" | ||
| 15 | + android:layout_marginBottom="@dimen/size_dp_5" | ||
| 16 | + /> | ||
| 17 | + | ||
| 18 | + <TextView | ||
| 19 | + android:layout_width="match_parent" | ||
| 20 | + android:layout_height="wrap_content" | ||
| 21 | + android:maxLines="2" | ||
| 22 | + android:textSize="@dimen/textSize14" | ||
| 23 | + android:textColor="@color/textColor" | ||
| 24 | + android:background="@color/white" | ||
| 25 | + android:padding="@dimen/size_dp_5" | ||
| 26 | + android:ellipsize="end" | ||
| 27 | + android:id="@+id/tvMessageContent" | ||
| 28 | + /> | ||
| 29 | + <View | ||
| 30 | + android:layout_width="match_parent" | ||
| 31 | + android:layout_height="0.5dp" | ||
| 32 | + android:background="@color/gray" | ||
| 33 | + /> | ||
| 34 | +</LinearLayout> | ||
| 0 | \ No newline at end of file | 35 | \ No newline at end of file |
mvpsdk/src/main/java/com/share/mvpsdk/global/GlobalApplication.java
| @@ -6,7 +6,9 @@ import android.os.Handler; | @@ -6,7 +6,9 @@ import android.os.Handler; | ||
| 6 | 6 | ||
| 7 | import com.orhanobut.logger.LogLevel; | 7 | import com.orhanobut.logger.LogLevel; |
| 8 | import com.orhanobut.logger.Logger; | 8 | import com.orhanobut.logger.Logger; |
| 9 | +import com.share.mvpsdk.utils.ToastUtils; | ||
| 9 | 10 | ||
| 11 | +import timber.log.BuildConfig; | ||
| 10 | import timber.log.Timber; | 12 | import timber.log.Timber; |
| 11 | 13 | ||
| 12 | 14 | ||
| @@ -34,8 +36,11 @@ public class GlobalApplication extends Application { | @@ -34,8 +36,11 @@ public class GlobalApplication extends Application { | ||
| 34 | handler = new Handler(); | 36 | handler = new Handler(); |
| 35 | mainThreadId = android.os.Process.myTid(); | 37 | mainThreadId = android.os.Process.myTid(); |
| 36 | mApp=this; | 38 | mApp=this; |
| 39 | + if (!BuildConfig.DEBUG) { | ||
| 40 | + Timber.plant(new Timber.DebugTree()); | ||
| 41 | + } | ||
| 37 | //LogLevel.FULL : LogLevel.NONE | 42 | //LogLevel.FULL : LogLevel.NONE |
| 38 | - Logger.init(LOG_TAG).logLevel(LogLevel.FULL); | 43 | +// Logger.init(LOG_TAG).logLevel(LogLevel.FULL); |
| 39 | } | 44 | } |
| 40 | 45 | ||
| 41 | /** | 46 | /** |