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