Commit 1ec4334b6e140dccadedababbbfd903243de4bda
Exists in
yxb_dev
and in
1 other branch
no message
Showing
19 changed files
with
124 additions
and
77 deletions
Show diff stats
app/src/main/AndroidManifest.xml
... | ... | @@ -154,6 +154,7 @@ |
154 | 154 | android:windowSoftInputMode="adjustPan|stateAlwaysHidden" /> |
155 | 155 | <activity |
156 | 156 | android:name=".ui.MainActivity" |
157 | + android:launchMode="singleTask" | |
157 | 158 | android:screenOrientation="portrait" /> |
158 | 159 | <activity |
159 | 160 | android:name=".ui.activity.ChildDetialActivity" | ... | ... |
app/src/main/java/com/shunzhi/parent/AppConfig.java
... | ... | @@ -24,8 +24,8 @@ public class AppConfig { |
24 | 24 | public static String PARENT_ID = "parent_id"; |
25 | 25 | public static String NIM_CONFIG_VIBRATE = "nim_config_vibrate";//收到通知震动 |
26 | 26 | public static String NIM_CONFIG_SOUND = "nim_config_sound";//收到通知响铃 |
27 | - public static String ISBINDING="isbinding"; | |
28 | - public static String CURRCHILDJSONSTR=""; | |
27 | + public static String ISBINDING = "isbinding"; | |
28 | + public static String CURRCHILDJSONSTR = ""; | |
29 | 29 | |
30 | 30 | |
31 | 31 | public static boolean ISLOGIN = false; |
... | ... | @@ -39,16 +39,18 @@ public class AppConfig { |
39 | 39 | public static String APP_IS_START = "app_is_start"; |
40 | 40 | |
41 | 41 | //测试 |
42 | -// public static String BASE_URL="http://60.190.202.57:1000/"; | |
43 | -// public static String BASE_URL_ORDER="http://60.190.202.57:8101/"; | |
44 | -// public static String BASE_URL_FILE="http://60.190.202.57:8196"; | |
42 | + public static String BASE_URL="http://60.190.202.57:1000/"; | |
43 | + public static String BASE_URL_ORDER="http://60.190.202.57:8101/"; | |
44 | + public static String BASE_URL_FILE="http://60.190.202.57:8196"; | |
45 | + public static String BASE_URL_VOTE = "http://60.190.202.57:8812/"; | |
45 | 46 | |
46 | 47 | |
47 | 48 | //正式 |
48 | - public static String BASE_URL="http://campus.myjxt.com/"; | |
49 | - public static String BASE_URL_ORDER="http://parent.myjxt.com/"; | |
50 | - public static String BASE_URL_FILE="http://manage.myjxt.com"; | |
51 | - public static final String url_version = BASE_URL + "api/Common/AppVersion?appType=3"; | |
49 | +// public static String BASE_URL = "http://campus.myjxt.com/"; | |
50 | +// public static String BASE_URL_ORDER = "http://parent.myjxt.com/"; | |
51 | +// public static String BASE_URL_FILE = "http://manage.myjxt.com"; | |
52 | +// public static String BASE_URL_VOTE = "www.sxspy.net/"; | |
53 | +// public static final String url_version = BASE_URL + "api/Common/AppVersion?appType=3"; | |
52 | 54 | |
53 | 55 | |
54 | 56 | //默认日志保存的路径 |
... | ... | @@ -63,7 +65,7 @@ public class AppConfig { |
63 | 65 | |
64 | 66 | private static AppConfig appConfig = null; |
65 | 67 | private static Context mContext = null; |
66 | - public static String url_apk="http://update.myjxt.com/zh_parent.apk"; | |
68 | + public static String url_apk = "http://update.myjxt.com/zh_parent.apk"; | |
67 | 69 | |
68 | 70 | public static AppConfig getAppConfig(Context context) { |
69 | 71 | if (appConfig == null) { | ... | ... |
app/src/main/java/com/shunzhi/parent/AppContext.java
app/src/main/java/com/shunzhi/parent/api/Consult.java
... | ... | @@ -32,4 +32,9 @@ public interface Consult { |
32 | 32 | Observable<JsonObject> getInformationTopic(@Field("keyword") String keyword,@Field("areaName") String areaName, @Field("channel") String channel |
33 | 33 | , @Field("toFirstPage") String toFirstPage, @Field("pageIndex") int pageIndex); |
34 | 34 | |
35 | + | |
36 | + @FormUrlEncoded | |
37 | + @POST("RoleLogin/GetToken") | |
38 | + Observable<JsonObject> loginVote(@Field("username") String username, @Field("password") String password); | |
39 | + | |
35 | 40 | } | ... | ... |
app/src/main/java/com/shunzhi/parent/bean/message/PHMessage.java
... | ... | @@ -65,6 +65,7 @@ public class PHMessage { |
65 | 65 | return dao.queryBuilder() |
66 | 66 | .where(PHMessageDao.Properties.SessionType.in( |
67 | 67 | PHMessageSession.sessionType_homework, |
68 | + PHMessageSession.sessionType_kaoqin, | |
68 | 69 | PHMessageSession.sessionType_notification//新加通知类型请在此处加上,否则会导致计数不准确 |
69 | 70 | )) |
70 | 71 | .count(); | ... | ... |
app/src/main/java/com/shunzhi/parent/bean/message/PHMessageSession.java
... | ... | @@ -2,12 +2,14 @@ package com.shunzhi.parent.bean.message; |
2 | 2 | |
3 | 3 | import com.shunzhi.parent.AppConfig; |
4 | 4 | import com.shunzhi.parent.AppContext; |
5 | + | |
5 | 6 | import org.greenrobot.greendao.annotation.Entity; |
6 | -import org.greenrobot.greendao.annotation.Id; | |
7 | -import java.util.Date; | |
8 | 7 | import org.greenrobot.greendao.annotation.Generated; |
8 | +import org.greenrobot.greendao.annotation.Id; | |
9 | 9 | import org.greenrobot.greendao.annotation.Keep; |
10 | 10 | |
11 | +import java.util.Date; | |
12 | + | |
11 | 13 | /** |
12 | 14 | * Created by 10501 on 2018/3/20. |
13 | 15 | */ |
... | ... | @@ -29,6 +31,8 @@ public class PHMessageSession { |
29 | 31 | public static final int sessionType_notification = 101; |
30 | 32 | @Keep |
31 | 33 | public static final int sessionType_homework = 102; |
34 | + @Keep | |
35 | + public static final int sessionType_kaoqin = 103; | |
32 | 36 | |
33 | 37 | @Generated(hash = 1156938953) |
34 | 38 | public PHMessageSession(Long id, String sessionId, String sessionText, String sessionName, |
... | ... | @@ -60,6 +64,10 @@ public class PHMessageSession { |
60 | 64 | session.setSessionId(AppConfig.getAppConfig(AppContext.getInstance()).get(AppConfig.USER_ID) + "_homework_" + System.currentTimeMillis()); |
61 | 65 | session.setSessionName("作业通知"); |
62 | 66 | break; |
67 | + case sessionType_kaoqin: | |
68 | + session.setSessionId(AppConfig.getAppConfig(AppContext.getInstance()).get(AppConfig.USER_ID) + "_kaoqin_" + System.currentTimeMillis()); | |
69 | + session.setSessionName("考勤通知"); | |
70 | + break; | |
63 | 71 | } |
64 | 72 | AppContext.getInstance().getDaoSession().getPHMessageSessionDao().insert(session); |
65 | 73 | } | ... | ... |
app/src/main/java/com/shunzhi/parent/contract/consult/ConsultContract.java
... | ... | @@ -28,6 +28,8 @@ public interface ConsultContract { |
28 | 28 | public abstract void getContextChannel(String areaName, int channel, int toFirstPage, int pageIndex); |
29 | 29 | |
30 | 30 | public abstract void getInformationTopic(String keyword,String areaName,String channel,String toFirstPage,int pageIndex); |
31 | + | |
32 | + public abstract void loginVote(String phoneNum,String password,int position); | |
31 | 33 | } |
32 | 34 | |
33 | 35 | |
... | ... | @@ -39,10 +41,12 @@ public interface ConsultContract { |
39 | 41 | Observable<JsonObject> getContextChannel(String areaName, int channel, int toFirstPage, int pageIndex); |
40 | 42 | |
41 | 43 | Observable<JsonObject> getInformationTopic(String keyword,String areaName,String channel,String toFirstPage,int pageIndex); |
44 | + | |
45 | + Observable<JsonObject> loginVote(String phoneNum,String password); | |
42 | 46 | } |
43 | 47 | |
44 | 48 | interface IConsultView extends IBaseFragment { |
45 | - void showTools(); | |
49 | + void showVote(int position); | |
46 | 50 | |
47 | 51 | void showBanners(List<GuangGaoBean> guangGaoBeanList); |
48 | 52 | ... | ... |
app/src/main/java/com/shunzhi/parent/manager/MessageManager.java
... | ... | @@ -75,7 +75,6 @@ public class MessageManager { |
75 | 75 | |
76 | 76 | |
77 | 77 | private MessageManager() { |
78 | - Log.d("77777","messageObserver="+messageObserver); | |
79 | 78 | NIMClient.getService(MsgServiceObserve.class).observeReceiveMessage(messageObserver, true); |
80 | 79 | NIMClient.getService(MsgServiceObserve.class).observeCustomNotification(customNotificationObserver, true); |
81 | 80 | NIMClient.getService(AuthServiceObserver.class).observeOnlineStatus(new Observer<StatusCode>() { |
... | ... | @@ -100,11 +99,13 @@ public class MessageManager { |
100 | 99 | } |
101 | 100 | |
102 | 101 | private void onCustomNotificationReceive(CustomNotification customNotification) { |
102 | + Timber.d("sss-==" + customNotification.getContent()); | |
103 | 103 | try { |
104 | 104 | JSONObject json = new JSONObject(customNotification.getContent()); |
105 | + Timber.d("sss-==" + json.toString()); | |
105 | 106 | String type = json.optString("type"); |
106 | 107 | String uuid = json.optString("msgId"); |
107 | - Timber.d("onCustomNotificationReceive%s","json="+json.toString()); | |
108 | + Timber.d("onCustomNotificationReceive%s", "json=" + json.toString()); | |
108 | 109 | if ("homework".equals(type)) { |
109 | 110 | PHMessageSession session = PHMessageSession.findAndCreateSession(PHMessageSession.sessionType_homework, true); |
110 | 111 | session.setSessionName("作业通知"); |
... | ... | @@ -121,6 +122,24 @@ public class MessageManager { |
121 | 122 | message.setSessionType(session.getSessionType()); |
122 | 123 | Long id = messageDao.insert(message); |
123 | 124 | notifyNotification(uuid, id, "收到一条作业通知"); |
125 | + } else if ("attend".equals(type)) { | |
126 | + //考勤 | |
127 | + PHMessageSession session = PHMessageSession.findAndCreateSession(PHMessageSession.sessionType_kaoqin, true); | |
128 | + session.setSessionName("考勤通知"); | |
129 | + session.setDate(new Date(customNotification.getTime())); | |
130 | + session.setSessionText(json.optString("title")); | |
131 | + | |
132 | + PHMessage message = new PHMessage(); | |
133 | + PHMessageDao messageDao = AppContext.getInstance().getDaoSession().getPHMessageDao(); | |
134 | + message.setDate(new Date(customNotification.getTime())); | |
135 | + message.setMessageId(uuid); | |
136 | + message.setSessionId(session.getSessionId()); | |
137 | + message.setMessageText("不能为空的字段。。。"); | |
138 | + message.setExValue(customNotification.getContent()); | |
139 | + message.setSessionType(session.getSessionType()); | |
140 | + Long id = messageDao.insert(message); | |
141 | + Log.e("aaaaa","------"+id); | |
142 | + notifyNotification(uuid, id, "收到一条考勤通知"); | |
124 | 143 | } |
125 | 144 | } catch (JSONException e) { |
126 | 145 | e.printStackTrace(); |
... | ... | @@ -128,8 +147,9 @@ public class MessageManager { |
128 | 147 | } |
129 | 148 | |
130 | 149 | public void notifyNotification(String uuid, long msgLongId, String text) { |
131 | - if (!isNotiNotification) | |
150 | + if (!isNotiNotification) { | |
132 | 151 | return; |
152 | + } | |
133 | 153 | int notificationCount = (int) PHMessage.findUnreadNotificationCount();//XSTMessage.findUnreadNotificationCount(); |
134 | 154 | boolean setBadgerSuccessful = ShortcutBadger.applyCount(AppContext.getInstance(), notificationCount); |
135 | 155 | Timber.i("----== notificationCount : %s ,setBadgerSuccessful : %s", notificationCount, setBadgerSuccessful); |
... | ... | @@ -170,10 +190,8 @@ public class MessageManager { |
170 | 190 | (NotificationManager) AppContext.getInstance().getSystemService(Context.NOTIFICATION_SERVICE); |
171 | 191 | notifyMgr.notify((int) msgLongId, mBuilder.build()); |
172 | 192 | |
173 | - | |
174 | 193 | } |
175 | 194 | |
176 | - | |
177 | 195 | public Observable<NIMLoginResultBean> login(String account, String password) { |
178 | 196 | final PublishSubject<NIMLoginResultBean> subject = PublishSubject.create(); |
179 | 197 | SharedPreferences sp = AppContext.getInstance().getApplicationContext().getSharedPreferences("info", Context.MODE_PRIVATE); |
... | ... | @@ -207,7 +225,6 @@ public class MessageManager { |
207 | 225 | return subject; |
208 | 226 | } |
209 | 227 | |
210 | - | |
211 | 228 | public void logout() { |
212 | 229 | SharedPreferences sp = AppContext.getInstance().getApplicationContext().getSharedPreferences("info", Context.MODE_PRIVATE); |
213 | 230 | sp.edit().putString("account", "").apply(); | ... | ... |
app/src/main/java/com/shunzhi/parent/model/consult/ConsultModel.java
... | ... | @@ -47,6 +47,13 @@ public class ConsultModel extends BaseModel implements ConsultContract.IConsultM |
47 | 47 | .getInformationTopic(keyword,areaName,channel,toFirstPage,pageIndex).compose(RxHelper.<JsonObject>rxSchedulerHelper()); |
48 | 48 | } |
49 | 49 | |
50 | + @Override | |
51 | + public Observable<JsonObject> loginVote(String phoneNum, String password) { | |
52 | + return RetrofitCreateHelper.getInstance().createApi(Consult.class, AppConfig.BASE_URL_VOTE) | |
53 | + .loginVote(phoneNum,password).compose(RxHelper.<JsonObject>rxSchedulerHelper()); | |
54 | +// return null; | |
55 | + } | |
56 | + | |
50 | 57 | public static ConsultContract.IConsultModel newInstance() { |
51 | 58 | return new ConsultModel(); |
52 | 59 | } | ... | ... |
app/src/main/java/com/shunzhi/parent/presenter/consult/ConsultPresenter.java
1 | 1 | package com.shunzhi.parent.presenter.consult; |
2 | 2 | |
3 | -import android.util.Log; | |
4 | 3 | import android.view.View; |
5 | 4 | import android.widget.LinearLayout; |
6 | 5 | |
... | ... | @@ -8,6 +7,7 @@ import com.google.gson.Gson; |
8 | 7 | import com.google.gson.JsonArray; |
9 | 8 | import com.google.gson.JsonObject; |
10 | 9 | import com.share.mvpsdk.utils.OkHttpExceptionUtil; |
10 | +import com.share.mvpsdk.utils.ToastUtils; | |
11 | 11 | import com.shunzhi.parent.R; |
12 | 12 | import com.shunzhi.parent.bean.GuangGaoBean; |
13 | 13 | import com.shunzhi.parent.bean.ToolBean; |
... | ... | @@ -53,7 +53,7 @@ public class ConsultPresenter extends ConsultContract.ConsultPresenter { |
53 | 53 | }); |
54 | 54 | layout_control.addView(textAndImgShowView); |
55 | 55 | } |
56 | - mIView.showTools(); | |
56 | +// mIView.showVote(); | |
57 | 57 | } |
58 | 58 | |
59 | 59 | @Override |
... | ... | @@ -71,7 +71,7 @@ public class ConsultPresenter extends ConsultContract.ConsultPresenter { |
71 | 71 | } |
72 | 72 | mIView.showBanners(guangGaoBeanList); |
73 | 73 | } else { |
74 | -// ToastUtils.showToast(jsonObject.get("message").getAsString()); | |
74 | + ToastUtils.showToast(jsonObject.get("message").getAsString()); | |
75 | 75 | } |
76 | 76 | } |
77 | 77 | }, new Consumer<Throwable>() { |
... | ... | @@ -88,9 +88,9 @@ public class ConsultPresenter extends ConsultContract.ConsultPresenter { |
88 | 88 | @Override |
89 | 89 | public void accept(JsonObject jsonObject) throws Exception { |
90 | 90 | // ToastUtils.showToast(jsonObject.toString()); |
91 | - JsonObject json=jsonObject.getAsJsonObject("data"); | |
92 | - Gson g=new Gson(); | |
93 | - ChannelInfo channelInfo = g.fromJson(json.toString(),ChannelInfo.class); | |
91 | + JsonObject json = jsonObject.getAsJsonObject("data"); | |
92 | + Gson g = new Gson(); | |
93 | + ChannelInfo channelInfo = g.fromJson(json.toString(), ChannelInfo.class); | |
94 | 94 | List<ChannelContextBean> contextList = channelInfo.getChannelContent(); |
95 | 95 | List<ChannelBean> channelList = channelInfo.getSubchannel(); |
96 | 96 | mIView.showChannel(channelList); |
... | ... | @@ -105,20 +105,19 @@ public class ConsultPresenter extends ConsultContract.ConsultPresenter { |
105 | 105 | })); |
106 | 106 | |
107 | 107 | |
108 | - | |
109 | 108 | } |
110 | 109 | |
111 | 110 | @Override |
112 | 111 | public void getInformationTopic(String keyword, String areaName, String channel, String toFirstPage, int pageIndex) { |
113 | - mRxManager.register(mIModel.getInformationTopic(keyword,areaName,channel,toFirstPage,pageIndex).subscribe(new Consumer<JsonObject>() { | |
112 | + mRxManager.register(mIModel.getInformationTopic(keyword, areaName, channel, toFirstPage, pageIndex).subscribe(new Consumer<JsonObject>() { | |
114 | 113 | @Override |
115 | 114 | public void accept(JsonObject jsonObject) throws Exception { |
116 | - JsonObject json=jsonObject.getAsJsonObject("data"); | |
117 | - Gson g=new Gson(); | |
115 | + JsonObject json = jsonObject.getAsJsonObject("data"); | |
116 | + Gson g = new Gson(); | |
118 | 117 | List<ChannelContextBean> channelList = new ArrayList<>(); |
119 | - JsonArray jsonArray=json.getAsJsonArray("channelList"); | |
118 | + JsonArray jsonArray = json.getAsJsonArray("channelList"); | |
120 | 119 | for (int i = 0; i < jsonArray.size(); i++) { |
121 | - ChannelContextBean channelBean=g.fromJson(jsonArray.get(i),ChannelContextBean.class); | |
120 | + ChannelContextBean channelBean = g.fromJson(jsonArray.get(i), ChannelContextBean.class); | |
122 | 121 | channelList.add(channelBean); |
123 | 122 | } |
124 | 123 | mIView.showContext(channelList); |
... | ... | @@ -133,6 +132,22 @@ public class ConsultPresenter extends ConsultContract.ConsultPresenter { |
133 | 132 | } |
134 | 133 | |
135 | 134 | @Override |
135 | + public void loginVote(String phoneNum, String password, final int position) { | |
136 | + mRxManager.register(mIModel.loginVote(phoneNum, password).subscribe(new Consumer<JsonObject>() { | |
137 | + @Override | |
138 | + public void accept(JsonObject jsonObject) throws Exception { | |
139 | + ToastUtils.showToast(jsonObject.toString()); | |
140 | + mIView.showVote(position); | |
141 | + } | |
142 | + }, new Consumer<Throwable>() { | |
143 | + @Override | |
144 | + public void accept(Throwable throwable) throws Exception { | |
145 | + mIView.showVote(position); | |
146 | + } | |
147 | + })); | |
148 | + } | |
149 | + | |
150 | + @Override | |
136 | 151 | public ConsultContract.IConsultModel getModel() { |
137 | 152 | return ConsultModel.newInstance(); |
138 | 153 | } | ... | ... |
app/src/main/java/com/shunzhi/parent/ui/MainActivity.java
... | ... | @@ -15,9 +15,7 @@ import com.shunzhi.parent.AppContext; |
15 | 15 | import com.shunzhi.parent.R; |
16 | 16 | import com.shunzhi.parent.bean.message.PHMessage; |
17 | 17 | import com.shunzhi.parent.bean.message.PHMessageDao; |
18 | -import com.shunzhi.parent.bean.message.PHMessageSession; | |
19 | 18 | import com.shunzhi.parent.manager.MessageManager; |
20 | -import com.shunzhi.parent.ui.fragment.CePingFragment; | |
21 | 19 | import com.shunzhi.parent.ui.fragment.ConsultFragment; |
22 | 20 | import com.shunzhi.parent.ui.fragment.MineFragment; |
23 | 21 | import com.shunzhi.parent.ui.fragment.ReportFragment; |
... | ... | @@ -36,6 +34,7 @@ public class MainActivity extends BaseCompatActivity implements PermissionUtils. |
36 | 34 | |
37 | 35 | Fragment[] fragments = null; |
38 | 36 | |
37 | + | |
39 | 38 | private int CEPING_INDEX = 0, CONSULT_INDEX = 0, REPORT_INDEX = 1, MINE_INDEX = 2; |
40 | 39 | |
41 | 40 | FragmentTransaction fragmentTransaction = null; |
... | ... | @@ -43,10 +42,8 @@ public class MainActivity extends BaseCompatActivity implements PermissionUtils. |
43 | 42 | @Override |
44 | 43 | protected void initView(Bundle savedInstanceState) { |
45 | 44 | |
46 | - | |
47 | 45 | PermissionUtils.requestMultiPermissions(this, this); |
48 | 46 | bottom_navigationView = findViewById(R.id.bottom_navigationView); |
49 | - | |
50 | 47 | BottomNavigationViewHelper.disableShiftMode(bottom_navigationView); |
51 | 48 | |
52 | 49 | bottom_navigationView.setSelectedItemId(R.id.bottom_navigationView); |
... | ... | @@ -73,6 +70,8 @@ public class MainActivity extends BaseCompatActivity implements PermissionUtils. |
73 | 70 | }); |
74 | 71 | |
75 | 72 | initFragments(); |
73 | + handIntent(getIntent()); | |
74 | + | |
76 | 75 | } |
77 | 76 | |
78 | 77 | private void initFragments() { |
... | ... | @@ -113,7 +112,7 @@ public class MainActivity extends BaseCompatActivity implements PermissionUtils. |
113 | 112 | @Override |
114 | 113 | protected void onNewIntent(Intent intent) { |
115 | 114 | super.onNewIntent(intent); |
116 | -// handIntent(intent); | |
115 | + handIntent(intent); | |
117 | 116 | } |
118 | 117 | |
119 | 118 | private void handIntent(Intent intent) { |
... | ... | @@ -121,8 +120,8 @@ public class MainActivity extends BaseCompatActivity implements PermissionUtils. |
121 | 120 | PHMessageDao dao = AppContext.getInstance().getDaoSession().getPHMessageDao(); |
122 | 121 | PHMessage message = dao.queryBuilder().where(PHMessageDao.Properties.Id.eq(msgLongId)).unique(); |
123 | 122 | if (message == null) return; |
124 | - if (message.getSessionType() == PHMessageSession.sessionType_homework) { | |
125 | - //TODO 跳转 | |
123 | + if(msgLongId!=-1){ | |
124 | + showFragment(2); | |
126 | 125 | } |
127 | 126 | } |
128 | 127 | ... | ... |
app/src/main/java/com/shunzhi/parent/ui/activity/message/MesageActivity.java
1 | 1 | package com.shunzhi.parent.ui.activity.message; |
2 | 2 | |
3 | -import android.support.v7.app.AppCompatActivity; | |
4 | 3 | import android.os.Bundle; |
5 | 4 | import android.support.v7.widget.LinearLayoutManager; |
6 | 5 | import android.support.v7.widget.RecyclerView; |
... | ... | @@ -14,9 +13,9 @@ import com.share.mvpsdk.base.activity.BaseCompatActivity; |
14 | 13 | import com.share.mvpsdk.base.adapter.BaseRecyclerViewAdapter; |
15 | 14 | import com.share.mvpsdk.base.adapter.BaseRecyclerViewHolder; |
16 | 15 | import com.share.mvpsdk.utils.DateUtils; |
16 | +import com.shunzhi.parent.AppContext; | |
17 | 17 | import com.shunzhi.parent.R; |
18 | 18 | import com.shunzhi.parent.bean.message.PHMessage; |
19 | -import com.shunzhi.parent.bean.message.PHMessageSession; | |
20 | 19 | |
21 | 20 | import java.util.ArrayList; |
22 | 21 | import java.util.List; |
... | ... | @@ -52,6 +51,9 @@ public class MesageActivity extends BaseCompatActivity implements View.OnClickLi |
52 | 51 | |
53 | 52 | if (null==mEssageAdapter)mEssageAdapter=new MEssageAdapter(); |
54 | 53 | if (null==recyclerView.getAdapter())recyclerView.setAdapter(mEssageAdapter); |
54 | + | |
55 | + | |
56 | + phMessages= AppContext.getInstance().getDaoSession().getPHMessageDao().loadAll(); | |
55 | 57 | mEssageAdapter.addAll(phMessages); |
56 | 58 | recyclerView.setAdapter(mEssageAdapter); |
57 | 59 | ... | ... |
app/src/main/java/com/shunzhi/parent/ui/fragment/ConsultFragment.java
1 | 1 | package com.shunzhi.parent.ui.fragment; |
2 | 2 | |
3 | -import android.annotation.TargetApi; | |
4 | -import android.app.DatePickerDialog; | |
5 | 3 | import android.content.BroadcastReceiver; |
6 | 4 | import android.content.Context; |
7 | 5 | import android.content.Intent; |
... | ... | @@ -13,18 +11,12 @@ import android.support.annotation.Nullable; |
13 | 11 | import android.support.annotation.RequiresApi; |
14 | 12 | import android.support.v4.widget.NestedScrollView; |
15 | 13 | import android.text.TextUtils; |
16 | -import android.util.Log; | |
17 | 14 | import android.view.View; |
18 | 15 | import android.widget.EditText; |
19 | 16 | import android.widget.ImageView; |
20 | 17 | import android.widget.LinearLayout; |
21 | 18 | import android.widget.TextView; |
22 | -import android.widget.Toast; | |
23 | 19 | |
24 | -import com.bigkoo.pickerview.builder.TimePickerBuilder; | |
25 | -import com.bigkoo.pickerview.listener.CustomListener; | |
26 | -import com.bigkoo.pickerview.listener.OnTimeSelectListener; | |
27 | -import com.bigkoo.pickerview.view.TimePickerView; | |
28 | 20 | import com.bumptech.glide.Glide; |
29 | 21 | import com.jcodecraeer.xrecyclerview.XRecyclerView; |
30 | 22 | import com.share.mvpsdk.base.BasePresenter; |
... | ... | @@ -41,20 +33,15 @@ import com.shunzhi.parent.presenter.consult.ConsultPresenter; |
41 | 33 | import com.shunzhi.parent.ui.activity.consult.ConsultOneLevelActivity; |
42 | 34 | import com.shunzhi.parent.ui.activity.mywebview.WebViewActivity; |
43 | 35 | import com.shunzhi.parent.util.AttrsUtils; |
44 | -import com.shunzhi.parent.util.GlideUtils; | |
45 | 36 | import com.shunzhi.parent.views.TextAndImgShowView; |
46 | 37 | import com.stx.xhb.xbanner.XBanner; |
47 | 38 | |
48 | -import java.text.SimpleDateFormat; | |
49 | 39 | import java.util.ArrayList; |
50 | -import java.util.Calendar; | |
51 | -import java.util.Date; | |
52 | 40 | import java.util.List; |
53 | 41 | |
54 | 42 | import cn.jzvd.JZVideoPlayerStandard; |
55 | 43 | import me.leefeng.citypicker.CityPicker; |
56 | 44 | import me.leefeng.citypicker.CityPickerListener; |
57 | -import timber.log.Timber; | |
58 | 45 | |
59 | 46 | public class ConsultFragment extends BaseMVPCompatFragment<ConsultContract.ConsultPresenter, ConsultContract.IConsultModel> implements View.OnClickListener |
60 | 47 | , ConsultContract.IConsultView, CityPickerListener { |
... | ... | @@ -164,7 +151,9 @@ public class ConsultFragment extends BaseMVPCompatFragment<ConsultContract.Consu |
164 | 151 | xBanner.setOnItemClickListener(new XBanner.OnItemClickListener() { |
165 | 152 | @Override |
166 | 153 | public void onItemClick(XBanner banner, int position) { |
167 | - WebViewActivity.getInstance(getContext(), imgWebUrl.get(position), -1); | |
154 | + mPresenter.loginVote(AppConfig.getAppConfig(AppContext.getInstance()).get(AppConfig.LOGIN_NAME) | |
155 | + , AppConfig.getAppConfig(AppContext.getInstance()).get(AppConfig.LOGIN_PWD),position); | |
156 | +// WebViewActivity.getInstance(getContext(), imgWebUrl.get(position), -1); | |
168 | 157 | } |
169 | 158 | }); |
170 | 159 | } |
... | ... | @@ -240,8 +229,8 @@ public class ConsultFragment extends BaseMVPCompatFragment<ConsultContract.Consu |
240 | 229 | } |
241 | 230 | |
242 | 231 | @Override |
243 | - public void showTools() { | |
244 | - | |
232 | + public void showVote(int position) { | |
233 | + WebViewActivity.getInstance(getContext(), imgWebUrl.get(position), -1); | |
245 | 234 | } |
246 | 235 | |
247 | 236 | @Override | ... | ... |
app/src/main/java/com/shunzhi/parent/ui/fragment/MineFragment.java
... | ... | @@ -21,7 +21,6 @@ import com.shunzhi.parent.AppContext; |
21 | 21 | import com.shunzhi.parent.BuildConfig; |
22 | 22 | import com.shunzhi.parent.R; |
23 | 23 | import com.shunzhi.parent.bean.message.PHMessage; |
24 | -import com.shunzhi.parent.bean.message.PHMessageSession; | |
25 | 24 | import com.shunzhi.parent.contract.loginandregister.LoginAndRegisterContract; |
26 | 25 | import com.shunzhi.parent.contract.mine.MineContract; |
27 | 26 | import com.shunzhi.parent.manager.MessageManager; | ... | ... |
app/src/main/java/com/shunzhi/parent/ui/fragment/StartFragment.java
1 | 1 | package com.shunzhi.parent.ui.fragment; |
2 | 2 | |
3 | -import android.media.MediaMetadataRetriever; | |
4 | 3 | import android.os.Bundle; |
5 | 4 | import android.os.CountDownTimer; |
6 | 5 | import android.support.annotation.NonNull; |
7 | 6 | import android.support.annotation.Nullable; |
8 | 7 | import android.text.TextUtils; |
9 | -import android.util.Log; | |
10 | 8 | import android.view.View; |
11 | 9 | import android.widget.ImageView; |
12 | 10 | import android.widget.TextView; |
... | ... | @@ -29,9 +27,6 @@ import com.stx.xhb.xbanner.XBanner; |
29 | 27 | import java.util.ArrayList; |
30 | 28 | import java.util.List; |
31 | 29 | |
32 | -import cn.jzvd.JZVideoPlayerStandard; | |
33 | -import timber.log.Timber; | |
34 | - | |
35 | 30 | public class StartFragment extends BaseMVPCompatFragment<ConsultContract.ConsultPresenter, ConsultContract.IConsultModel> |
36 | 31 | implements ConsultContract.IConsultView { |
37 | 32 | |
... | ... | @@ -102,8 +97,9 @@ public class StartFragment extends BaseMVPCompatFragment<ConsultContract.Consult |
102 | 97 | return new ConsultPresenter(); |
103 | 98 | } |
104 | 99 | |
100 | + | |
105 | 101 | @Override |
106 | - public void showTools() { | |
102 | + public void showVote(int position) { | |
107 | 103 | |
108 | 104 | } |
109 | 105 | ... | ... |
app/src/main/java/com/shunzhi/parent/ui/fragment/apply/ApplyReplaceCardFragment.java
... | ... | @@ -72,7 +72,7 @@ public class ApplyReplaceCardFragment extends BaseMVPCompatFragment<ApplyReplace |
72 | 72 | switch (view.getId()) { |
73 | 73 | case R.id.bt_sure: |
74 | 74 | cardnum = et_cardnum.getText().toString().trim(); |
75 | - ToastUtils.showToast("cardnum:" + cardnum); | |
75 | +// ToastUtils.showToast("cardnum:" + cardnum); | |
76 | 76 | Log.i("ApplyReplaceCardFragment:data", cardnum); |
77 | 77 | if (TextUtils.isEmpty(cardnum)) { |
78 | 78 | ToastUtils.showToast("卡号不能为空,请重新输入!"); | ... | ... |
app/src/main/java/com/shunzhi/parent/ui/fragment/apply/ApplySigninFragment.java
... | ... | @@ -89,8 +89,8 @@ public class ApplySigninFragment extends BaseMVPCompatFragment<ApplySigninContra |
89 | 89 | } |
90 | 90 | |
91 | 91 | private void getData() { |
92 | - mPresenter.SigninDetail(currChildBean.getStudentId(), currChildBean.getSchoolId(), currdate); | |
93 | -// mPresenter.SigninDetail(185, 1, currdate);//测试接口 | |
92 | +// mPresenter.SigninDetail(currChildBean.getStudentId(), currChildBean.getSchoolId(), currdate); | |
93 | + mPresenter.SigninDetail(185, 1, currdate);//测试接口 | |
94 | 94 | } |
95 | 95 | |
96 | 96 | /** |
... | ... | @@ -121,7 +121,7 @@ public class ApplySigninFragment extends BaseMVPCompatFragment<ApplySigninContra |
121 | 121 | Calendar startDate = Calendar.getInstance(); |
122 | 122 | startDate.set(1900, 0, 1); |
123 | 123 | Calendar endDate = Calendar.getInstance(); |
124 | - endDate.set(2099, 11, 31); | |
124 | + endDate.set(2099, 11, 31);//注意:mouth是从0开始计算的,下面宕机的原因可能是之前这边设置的问题 | |
125 | 125 | //AppContext.getInstance().startLocation(); |
126 | 126 | //时间选择器 |
127 | 127 | pvCustomLunar = new TimePickerBuilder(getActivity(), new OnTimeSelectListener() { | ... | ... |
app/src/main/java/com/shunzhi/parent/ui/service/BadgeIntentService.java
... | ... | @@ -7,9 +7,8 @@ import android.app.PendingIntent; |
7 | 7 | import android.content.Context; |
8 | 8 | import android.content.Intent; |
9 | 9 | import android.os.Build; |
10 | -import android.support.annotation.Nullable; | |
11 | 10 | import android.support.v4.app.NotificationCompat; |
12 | -import android.text.TextUtils; | |
11 | +import android.util.Log; | |
13 | 12 | |
14 | 13 | import com.shunzhi.parent.AppConfig; |
15 | 14 | import com.shunzhi.parent.AppContext; |
... | ... | @@ -71,9 +70,10 @@ public class BadgeIntentService extends IntentService { |
71 | 70 | //String uuid, long xstsid |
72 | 71 | String uuid = intent.getStringExtra("uuid"); |
73 | 72 | long xstsid = intent.getLongExtra("xstsid", -1); |
74 | - if (xstsid == -1 || TextUtils.isEmpty(uuid)) | |
75 | - createIntentNotification(badgeCount, title, message); | |
76 | - if (xstsid != -1 && !TextUtils.isEmpty(uuid)) | |
73 | + Log.e("1234-===","uuid=="+uuid+"xstsid=="+xstsid); | |
74 | +// if (xstsid == -1 || TextUtils.isEmpty(uuid)) | |
75 | +// createIntentNotification(badgeCount, title, message); | |
76 | +// if (xstsid != -1 && !TextUtils.isEmpty(uuid)) | |
77 | 77 | createPendingIntentNotification(badgeCount, title, message, uuid, xstsid); |
78 | 78 | |
79 | 79 | } |
... | ... | @@ -89,13 +89,12 @@ public class BadgeIntentService extends IntentService { |
89 | 89 | mNotificationManager.cancel(notificationId); |
90 | 90 | |
91 | 91 | notificationId++; |
92 | - | |
93 | 92 | Notification.Builder builder = new Notification.Builder(getApplicationContext()) |
94 | 93 | .setContentTitle(title) |
95 | 94 | .setContentText(message) |
96 | 95 | .setSmallIcon(R.mipmap.ic_launcher); |
97 | 96 | Notification notification = Build.VERSION.SDK_INT > 15 ? builder.build() : builder.getNotification(); |
98 | - ShortcutBadger.applyNotification(getApplicationContext(), notification, badgeCount); | |
97 | + ShortcutBadger.applyNotification(getApplicationContext(), notification, badgeCount); | |
99 | 98 | if (mNotificationManager != null) |
100 | 99 | mNotificationManager.notify(notificationId, notification); |
101 | 100 | } |
... | ... | @@ -104,7 +103,7 @@ public class BadgeIntentService extends IntentService { |
104 | 103 | if (mNotificationManager == null) { |
105 | 104 | mNotificationManager = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE); |
106 | 105 | } |
107 | - Intent resultIntent = new Intent(AppContext.getInstance(), MainActivity.class); | |
106 | + Intent resultIntent = new Intent(AppContext.getInstance(),MainActivity.class); | |
108 | 107 | resultIntent.putExtra("sid", xstsid); |
109 | 108 | resultIntent.putExtra("uuid", uuid); |
110 | 109 | mNotificationManager.cancel(notificationId); | ... | ... |
app/src/main/res/layout/fragment_apply_replacecard.xml
... | ... | @@ -37,15 +37,16 @@ |
37 | 37 | android:layout_width="match_parent" |
38 | 38 | android:layout_height="0dp" |
39 | 39 | android:layout_weight="2" |
40 | + android:gravity="center" | |
40 | 41 | android:background="@drawable/report_white" |
41 | 42 | android:orientation="horizontal"> |
42 | 43 | |
43 | 44 | <TextView |
44 | 45 | android:layout_weight="1.2" |
45 | 46 | android:id="@+id/tv_carduser" |
46 | - android:layout_margin="@dimen/dp_8" | |
47 | 47 | android:layout_width="0dp" |
48 | 48 | android:layout_height="wrap_content" |
49 | + android:paddingLeft="@dimen/margin_small" | |
49 | 50 | android:text="补卡人:" |
50 | 51 | android:textColor="@color/hintTextColor" |
51 | 52 | android:textSize="@dimen/textSize16" /> |
... | ... | @@ -66,6 +67,7 @@ |
66 | 67 | android:layout_width="match_parent" |
67 | 68 | android:layout_height="0dp" |
68 | 69 | android:layout_weight="2" |
70 | + android:gravity="center" | |
69 | 71 | android:orientation="horizontal"> |
70 | 72 | |
71 | 73 | <TextView |
... | ... | @@ -73,7 +75,7 @@ |
73 | 75 | android:layout_weight="1.2" |
74 | 76 | android:layout_width="0dp" |
75 | 77 | android:layout_height="wrap_content" |
76 | - android:layout_margin="@dimen/dp_8" | |
78 | + android:paddingLeft="@dimen/margin_small" | |
77 | 79 | android:text="卡号:" |
78 | 80 | android:textColor="@color/hintTextColor" |
79 | 81 | android:textSize="@dimen/textSize16" /> | ... | ... |