Showing
10 changed files
with
198 additions
and
34 deletions
| ... | ... | @@ -123,7 +123,7 @@ android { |
| 123 | 123 | |
| 124 | 124 | dependencies { |
| 125 | 125 | compile files('libs/decoder.jar') |
| 126 | - compile files('libs/cinemaLib-1220.jar') | |
| 126 | + compile files('libs/CinemaLibs-170426.jar') | |
| 127 | 127 | compile files('libs/glide-3.7.0.jar') |
| 128 | 128 | compile files('libs/greenbluetoothlelib.jar') |
| 129 | 129 | ... | ... |
gimiCinema/libs/CinemaLibs-170426.jar
0 → 100644
No preview for this file type
| ... | ... | @@ -22,6 +22,7 @@ public class RoomStatusInfo extends BaseModel { |
| 22 | 22 | private int end_time; |
| 23 | 23 | private int status; |
| 24 | 24 | private String film_hash; |
| 25 | + private int now_time; | |
| 25 | 26 | |
| 26 | 27 | public String getOrder_sn() { |
| 27 | 28 | return order_sn; |
| ... | ... | @@ -63,6 +64,14 @@ public class RoomStatusInfo extends BaseModel { |
| 63 | 64 | this.film_hash = film_hash; |
| 64 | 65 | } |
| 65 | 66 | |
| 67 | + public int getNow_time() { | |
| 68 | + return now_time; | |
| 69 | + } | |
| 70 | + | |
| 71 | + public void setNow_time(int now_time) { | |
| 72 | + this.now_time = now_time; | |
| 73 | + } | |
| 74 | + | |
| 66 | 75 | @Override |
| 67 | 76 | public String toString() { |
| 68 | 77 | return "DataEntity{" + |
| ... | ... | @@ -71,6 +80,7 @@ public class RoomStatusInfo extends BaseModel { |
| 71 | 80 | ", end_time=" + end_time + |
| 72 | 81 | ", status=" + status + |
| 73 | 82 | ", film_hash='" + film_hash + '\'' + |
| 83 | + ", now_time=" + now_time + | |
| 74 | 84 | '}'; |
| 75 | 85 | } |
| 76 | 86 | } | ... | ... |
| ... | ... | @@ -64,6 +64,7 @@ import com.gimi.common.cinema.model.RoomInfo; |
| 64 | 64 | import com.gimi.common.cinema.model.RoomQrCodeInfo; |
| 65 | 65 | import com.gimi.common.cinema.model.RoomStatusInfo; |
| 66 | 66 | import com.gimi.common.cinema.utils.AuthUtils; |
| 67 | +import com.gimi.common.cinema.utils.CToast; | |
| 67 | 68 | import com.gimi.common.cinema.utils.LeeImageLoader; |
| 68 | 69 | import com.gimi.common.cinema.utils.M1905Utils; |
| 69 | 70 | import com.gimi.common.cinema.utils.NetStatusUtils; |
| ... | ... | @@ -120,6 +121,7 @@ import java.net.Socket; |
| 120 | 121 | import java.net.SocketTimeoutException; |
| 121 | 122 | import java.text.SimpleDateFormat; |
| 122 | 123 | import java.util.ArrayList; |
| 124 | +import java.util.Calendar; | |
| 123 | 125 | import java.util.Date; |
| 124 | 126 | import java.util.List; |
| 125 | 127 | import java.util.Locale; |
| ... | ... | @@ -181,7 +183,6 @@ public class MainActivity extends BaseActivity implements IMainView, EventListen |
| 181 | 183 | setContentView(R.layout.a_main); |
| 182 | 184 | EventBus.getDefault().register(this); |
| 183 | 185 | context = this; |
| 184 | - | |
| 185 | 186 | initLight(); |
| 186 | 187 | initLock(); |
| 187 | 188 | initScreen(); |
| ... | ... | @@ -237,13 +238,31 @@ public class MainActivity extends BaseActivity implements IMainView, EventListen |
| 237 | 238 | presenter.load(this); |
| 238 | 239 | Intent intent = new Intent(this, SocketService.class); |
| 239 | 240 | startService(intent); |
| 240 | - new Handler().postDelayed(new Runnable() { | |
| 241 | - @Override | |
| 242 | - public void run() { | |
| 243 | - Log.d("room-info", "test open door report"); | |
| 244 | - openDoor(); | |
| 245 | - } | |
| 246 | - }, 5 * 1000); | |
| 241 | + final long l = (System.currentTimeMillis() / 60000) % (24 * 60) + 480; | |
| 242 | + SimpleDateFormat sdf = new SimpleDateFormat(" yyyy-MM-dd ", Locale.SIMPLIFIED_CHINESE); | |
| 243 | + getTimeByCalendar(); | |
| 244 | + presenter.getOrderInfo(); | |
| 245 | +// new Handler().postDelayed(new Runnable() { | |
| 246 | +// @Override | |
| 247 | +// public void run() { | |
| 248 | +// Log.d("room-info", "test open door report"); | |
| 249 | +// openDoor(); | |
| 250 | +// } | |
| 251 | +// }, 5 * 1000); | |
| 252 | + } | |
| 253 | + | |
| 254 | + public void getTimeByCalendar() { | |
| 255 | + Calendar cal = Calendar.getInstance(); | |
| 256 | + int year = cal.get(Calendar.YEAR);//获取年份 | |
| 257 | + int month = cal.get(Calendar.MONTH);//获取月份 | |
| 258 | + int day = cal.get(Calendar.DATE);//获取日 | |
| 259 | + int hour = cal.get(Calendar.HOUR_OF_DAY);//小时 | |
| 260 | + int minute = cal.get(Calendar.MINUTE);//分 | |
| 261 | + int second = cal.get(Calendar.SECOND);//秒 | |
| 262 | + int WeekOfYear = cal.get(Calendar.DAY_OF_WEEK);//一周的第几天 | |
| 263 | + Log.d("room-info", "现在的时间是:公元" + year + "年" + month + "月" + day + "日 " + hour + "时" + minute + "分" + second + "秒 星期" + WeekOfYear); | |
| 264 | + Log.d("room-info", "current minute:" + (hour * 60 + minute) + ""); | |
| 265 | + | |
| 247 | 266 | } |
| 248 | 267 | |
| 249 | 268 | @Override |
| ... | ... | @@ -284,7 +303,7 @@ public class MainActivity extends BaseActivity implements IMainView, EventListen |
| 284 | 303 | registerReceiver(bleBroadcastReceiver, intentFilter); |
| 285 | 304 | } |
| 286 | 305 | if (!LeBluetooth.getInstance().isSupport(getApplicationContext())) { |
| 287 | - Toast.makeText(this, "ble not support", Toast.LENGTH_SHORT).show(); | |
| 306 | + Toast.makeText(this, "蓝牙不支持", Toast.LENGTH_SHORT).show(); | |
| 288 | 307 | // finish(); |
| 289 | 308 | // return; |
| 290 | 309 | } |
| ... | ... | @@ -316,15 +335,15 @@ public class MainActivity extends BaseActivity implements IMainView, EventListen |
| 316 | 335 | protected void onPause() { |
| 317 | 336 | super.onPause(); |
| 318 | 337 | isSearching = false; |
| 319 | - if (HAS_SYSTEM_FEATURE_BLUETOOTH_LE) { | |
| 320 | - unregisterReceiver(bleBroadcastReceiver); | |
| 321 | - } | |
| 322 | 338 | } |
| 323 | 339 | |
| 324 | 340 | @Override |
| 325 | 341 | protected void onDestroy() { |
| 326 | 342 | super.onDestroy(); |
| 327 | 343 | presenter.umountSamba(); |
| 344 | + if (HAS_SYSTEM_FEATURE_BLUETOOTH_LE) { | |
| 345 | + unregisterReceiver(bleBroadcastReceiver); | |
| 346 | + } | |
| 328 | 347 | unregisterReceiver(mReceiver); |
| 329 | 348 | EventBus.getDefault().unregister(this); |
| 330 | 349 | } |
| ... | ... | @@ -466,7 +485,12 @@ public class MainActivity extends BaseActivity implements IMainView, EventListen |
| 466 | 485 | public void updateOrderInfo(RoomStatusInfo info) { |
| 467 | 486 | roomStatusInfo = info; |
| 468 | 487 | RoomStatusInfo.DataEntity data = info.getData(); |
| 469 | - int durationMinutes = data.getEnd_time() - data.getBegin_time(); | |
| 488 | + int offset = data.getNow_time() - data.getBegin_time(); | |
| 489 | + if (offset > 3) { | |
| 490 | + CToast.makeText(context, "您已迟到" + offset + "分钟,请注意把握时间", 100 * 1000).show(); | |
| 491 | + } | |
| 492 | +// int durationMinutes = data.getEnd_time() - data.getBegin_time() - offset; | |
| 493 | + int durationMinutes = data.getEnd_time() - data.getNow_time(); | |
| 470 | 494 | Log.d("CountService", "durationMinutes:" + durationMinutes); |
| 471 | 495 | if (durationMinutes <= 1) { |
| 472 | 496 | return; |
| ... | ... | @@ -477,6 +501,9 @@ public class MainActivity extends BaseActivity implements IMainView, EventListen |
| 477 | 501 | LocalMovieMessage localMovieMessages = null; |
| 478 | 502 | if (!TextUtils.isEmpty(data.getFilm_hash())) { |
| 479 | 503 | localMovieMessages = new NewDBManager(this).queryPlayMovie(data.getFilm_hash()); |
| 504 | + if (localMovieMessages == null) { | |
| 505 | + show("电影信息出错,找不到相关电影"); | |
| 506 | + } | |
| 480 | 507 | } |
| 481 | 508 | if (localMovieMessages == null) { |
| 482 | 509 | show("没有获取到相应订单信息,即将为您播放银河护卫队"); |
| ... | ... | @@ -753,6 +780,8 @@ public class MainActivity extends BaseActivity implements IMainView, EventListen |
| 753 | 780 | |
| 754 | 781 | public void openSearch(View view) { |
| 755 | 782 | presenter.jumpToSearch(); |
| 783 | +// openDoor(); | |
| 784 | +// PollingUtils.startPollingService(this.getApplicationContext(), 60, PollingServiceDemo.class, PollingServiceDemo.ACTION); | |
| 756 | 785 | } |
| 757 | 786 | |
| 758 | 787 | |
| ... | ... | @@ -953,10 +982,13 @@ public class MainActivity extends BaseActivity implements IMainView, EventListen |
| 953 | 982 | registerReceiver(mReceiver, filter); |
| 954 | 983 | } |
| 955 | 984 | |
| 985 | + boolean needReport = false; | |
| 986 | + | |
| 956 | 987 | @Subscribe(threadMode = ThreadMode.MAIN) |
| 957 | 988 | public void onMoonEvent(MessageEvent messageEvent) { |
| 958 | 989 | switch (messageEvent.getEventId()) { |
| 959 | 990 | case SocketService.JUST_OPEN_DOOR: |
| 991 | + needReport = false; | |
| 960 | 992 | openDoor(); |
| 961 | 993 | if (rightSn) { |
| 962 | 994 | down(); |
| ... | ... | @@ -964,6 +996,7 @@ public class MainActivity extends BaseActivity implements IMainView, EventListen |
| 964 | 996 | Log.d("event bus", "open door" + messageEvent.getMessage()); |
| 965 | 997 | break; |
| 966 | 998 | case SocketService.USER_OPEN_DOOR_AND_GET_MOVIE: |
| 999 | + needReport = true; | |
| 967 | 1000 | openDoor(); |
| 968 | 1001 | if (rightSn) { |
| 969 | 1002 | down(); |
| ... | ... | @@ -972,6 +1005,7 @@ public class MainActivity extends BaseActivity implements IMainView, EventListen |
| 972 | 1005 | Log.d("event bus", "open door" + messageEvent.getMessage()); |
| 973 | 1006 | break; |
| 974 | 1007 | case SocketService.USER_OPEN_DOOR: |
| 1008 | + needReport = true; | |
| 975 | 1009 | openDoor(); |
| 976 | 1010 | if (rightSn) { |
| 977 | 1011 | down(); |
| ... | ... | @@ -1030,9 +1064,9 @@ public class MainActivity extends BaseActivity implements IMainView, EventListen |
| 1030 | 1064 | } |
| 1031 | 1065 | break; |
| 1032 | 1066 | case CountService.COUNT_DOWN_ZERO: |
| 1033 | - if (info == null || info.getData() == null) { | |
| 1034 | - break; | |
| 1035 | - } | |
| 1067 | +// if (info == null || info.getData() == null) { | |
| 1068 | +// break; | |
| 1069 | +// } | |
| 1036 | 1070 | presenter.getCleanQrCode(roomStatusInfo.getData().getOrder_sn()); |
| 1037 | 1071 | // startActivity(new Intent(this, QrCodeShowActivity.class).putExtra("qr", "updateOrderInfo")); |
| 1038 | 1072 | break; |
| ... | ... | @@ -1040,6 +1074,8 @@ public class MainActivity extends BaseActivity implements IMainView, EventListen |
| 1040 | 1074 | } |
| 1041 | 1075 | |
| 1042 | 1076 | private void openDoor() { |
| 1077 | + //open LED | |
| 1078 | + new SystemUtils().openFtLed(context); | |
| 1043 | 1079 | Log.d("room-info", "openDoor called"); |
| 1044 | 1080 | bleBroadcastReceiver.setResponseObj(new GREENCITYBLEProtocolFactory.GREENCITYBleDataWritten() { |
| 1045 | 1081 | |
| ... | ... | @@ -1054,8 +1090,11 @@ public class MainActivity extends BaseActivity implements IMainView, EventListen |
| 1054 | 1090 | intent.setAction(GREENBluetoothLeService.ACTION_OPEN_SUCCESS); |
| 1055 | 1091 | intent.putExtra("openrecord", bleOpenRecord); |
| 1056 | 1092 | sendBroadcast(intent); |
| 1093 | + if (needReport) { | |
| 1094 | + handler.postDelayed(reportRunnable, 10 * 1000); | |
| 1095 | + Log.d("room-info", "user open door ,report the open success status"); | |
| 1096 | + } | |
| 1057 | 1097 | Log.d("room-info", "open success"); |
| 1058 | - handler.postDelayed(reportRunnable, 30 * 1000); | |
| 1059 | 1098 | } |
| 1060 | 1099 | |
| 1061 | 1100 | @Override | ... | ... |
| ... | ... | @@ -24,6 +24,7 @@ import com.gimi.common.cinema.model.MessageEvent; |
| 24 | 24 | import com.gimi.common.cinema.model.SambaMsg; |
| 25 | 25 | import com.gimi.common.cinema.utils.T; |
| 26 | 26 | import com.gimi.common.cinema.utils.WifiApManger; |
| 27 | +import com.qnbar.smc.service.SocketService; | |
| 27 | 28 | import com.xgimi.gimicinema.BuildConfig; |
| 28 | 29 | import com.xgimi.gimicinema.R; |
| 29 | 30 | import com.xgimi.gimicinema.mview.ISettingView; |
| ... | ... | @@ -34,8 +35,6 @@ import org.greenrobot.eventbus.EventBus; |
| 34 | 35 | import java.util.ArrayList; |
| 35 | 36 | import java.util.HashMap; |
| 36 | 37 | |
| 37 | -import static com.qnbar.smc.service.SocketService.JUST_OPEN_DOOR; | |
| 38 | - | |
| 39 | 38 | /** |
| 40 | 39 | * 设置类 |
| 41 | 40 | * Created by pc on 2014/12/16. |
| ... | ... | @@ -337,7 +336,9 @@ public class SettingActivity extends BaseActivity implements ISettingView { |
| 337 | 336 | } |
| 338 | 337 | |
| 339 | 338 | public void testOpenDoor(View view) { |
| 340 | - openDoor(JUST_OPEN_DOOR, "setting test open door"); | |
| 339 | + openDoor(SocketService.JUST_OPEN_DOOR, "setting test open door"); | |
| 340 | +// PollingUtils.stopPollingService(this.getApplicationContext(), PollingServiceDemo.class, PollingService.ACTION); | |
| 341 | +// new SystemUtils().closeFtLed(this);;//test close led,could open by power | |
| 341 | 342 | } |
| 342 | 343 | |
| 343 | 344 | private void openDoor(int type, String msg) { | ... | ... |
| ... | ... | @@ -52,6 +52,7 @@ public class RoomInfoModelImpl implements IRoomInfoModel { |
| 52 | 52 | @Override |
| 53 | 53 | public void onResponse(String response) { |
| 54 | 54 | RoomInfo roomInfo1 = null; |
| 55 | + Log.d("room-info", "getRoomInfo" +response); | |
| 55 | 56 | try { |
| 56 | 57 | roomInfo1 = new Gson().fromJson(response, RoomInfo.class); |
| 57 | 58 | } catch (JsonSyntaxException e) { |
| ... | ... | @@ -85,6 +86,8 @@ public class RoomInfoModelImpl implements IRoomInfoModel { |
| 85 | 86 | @Override |
| 86 | 87 | public void onResponse(String response) { |
| 87 | 88 | RoomStatusInfo roomInfo1 = null; |
| 89 | + Log.d("room-info", "getRoomStatus" +response); | |
| 90 | + | |
| 88 | 91 | try { |
| 89 | 92 | roomInfo1 = new Gson().fromJson(response, RoomStatusInfo.class); |
| 90 | 93 | } catch (JsonSyntaxException e) { |
| ... | ... | @@ -115,6 +118,8 @@ public class RoomInfoModelImpl implements IRoomInfoModel { |
| 115 | 118 | |
| 116 | 119 | @Override |
| 117 | 120 | public void onResponse(String response) { |
| 121 | + Log.d("room-info", "getRoomQrCode:" + response); | |
| 122 | + | |
| 118 | 123 | RoomQrCodeInfo roomInfo1 = null; |
| 119 | 124 | try { |
| 120 | 125 | roomInfo1 = new Gson().fromJson(response, RoomQrCodeInfo.class); |
| ... | ... | @@ -146,7 +151,7 @@ public class RoomInfoModelImpl implements IRoomInfoModel { |
| 146 | 151 | |
| 147 | 152 | @Override |
| 148 | 153 | public void onResponse(String response) { |
| 149 | - Log.d("room-info", response); | |
| 154 | + Log.d("room-info", "reportOpenDoorStatus:" + response); | |
| 150 | 155 | listener.onOpenDoorSuccess(); |
| 151 | 156 | } |
| 152 | 157 | }); | ... | ... |
| 1 | +/* | |
| 2 | + * Copyright (c) 2017. wugian | |
| 3 | + * Licensed under the Apache License, Version 2.0 (the "License"); | |
| 4 | + * you may not use this file except in compliance with the License. | |
| 5 | + * You may obtain a copy of the License at | |
| 6 | + * | |
| 7 | + * http://www.apache.org/licenses/LICENSE-2.0 | |
| 8 | + * | |
| 9 | + * Unless required by applicable law or agreed to in writing, software | |
| 10 | + * distributed under the License is distributed on an "AS IS" BASIS, | |
| 11 | + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |
| 12 | + * See the License for the specific language governing permissions and | |
| 13 | + * limitations under the License. | |
| 14 | + * | |
| 15 | + */ | |
| 16 | + | |
| 17 | +package com.xgimi.gimicinema.poll; | |
| 18 | + | |
| 19 | +import android.app.Service; | |
| 20 | +import android.content.Intent; | |
| 21 | +import android.os.IBinder; | |
| 22 | +import android.util.Log; | |
| 23 | + | |
| 24 | +/** | |
| 25 | + * PollingService Demo do something in PollingThread | |
| 26 | + */ | |
| 27 | +public class PollingServiceDemo extends Service { | |
| 28 | + //name of this service action | |
| 29 | + public static final String ACTION = "com.qnbar.service.PollingServiceDemo"; | |
| 30 | + | |
| 31 | + @Override | |
| 32 | + public IBinder onBind(Intent intent) { | |
| 33 | + return null; | |
| 34 | + } | |
| 35 | + | |
| 36 | + @Override | |
| 37 | + public void onCreate() { | |
| 38 | + Log.d("polling-demo", "onCreate"); | |
| 39 | +// initNotifiManager(); | |
| 40 | + } | |
| 41 | + | |
| 42 | + @Override | |
| 43 | + public int onStartCommand(Intent intent, int flags, int startId) { | |
| 44 | + Log.d("polling-demo", "onStartCommand"); | |
| 45 | + new PollingThread().start(); | |
| 46 | + return super.onStartCommand(intent, flags, startId); | |
| 47 | + } | |
| 48 | + | |
| 49 | + // @Override | |
| 50 | +// public void onStart(Intent intent, int startId) { | |
| 51 | +// new PollingThread().start(); | |
| 52 | +// } | |
| 53 | +// //初始化通知栏配置 | |
| 54 | +// private void initNotifiManager() { | |
| 55 | +// mManager = (NotificationManager) getSystemService(NOTIFICATION_SERVICE); | |
| 56 | +// int icon = R.drawable.ic_launcher; | |
| 57 | +// mNotification = new Notification(); | |
| 58 | +// mNotification.icon = icon; | |
| 59 | +// mNotification.tickerText = "New Message"; | |
| 60 | +// mNotification.defaults |= Notification.DEFAULT_SOUND; | |
| 61 | +// mNotification.flags = Notification.FLAG_AUTO_CANCEL; | |
| 62 | +// } | |
| 63 | +// //弹出Notification | |
| 64 | +// private void showNotification() { | |
| 65 | +// mNotification.when = System.currentTimeMillis(); | |
| 66 | +// //Navigator to the new activity when click the notification title | |
| 67 | +// Intent i = new Intent(this, MessageActivity.class); | |
| 68 | +// PendingIntent pendingIntent = PendingIntent.getActivity(this, 0, i, | |
| 69 | +// Intent.FLAG_ACTIVITY_NEW_TASK); | |
| 70 | +// mNotification.setLatestEventInfo(this, | |
| 71 | +// getResources().getString(R.string.app_name), "You have new message!", pendingIntent); | |
| 72 | +// mManager.notify(0, mNotification); | |
| 73 | +// } | |
| 74 | + /** | |
| 75 | + * Polling thread | |
| 76 | + * 模拟向Server轮询的异步线程 | |
| 77 | + * | |
| 78 | + * @Author Ryan | |
| 79 | + * @Create 2013-7-13 上午10:18:34 | |
| 80 | + */ | |
| 81 | + int count = 0; | |
| 82 | + | |
| 83 | + class PollingThread extends Thread { | |
| 84 | + @Override | |
| 85 | + public void run() { | |
| 86 | + Log.d("polling-demo", "polling run"); | |
| 87 | +// System.out.println("Polling..."); | |
| 88 | + count++; | |
| 89 | + //当计数能被5整除时弹出通知 | |
| 90 | +// if (count % 5 == 0) { | |
| 91 | +//// showNotification(); | |
| 92 | +// System.out.println("New message!"); | |
| 93 | +// } | |
| 94 | + } | |
| 95 | + } | |
| 96 | + | |
| 97 | + @Override | |
| 98 | + public void onDestroy() { | |
| 99 | + super.onDestroy(); | |
| 100 | + Log.d("polling-demo", "onDestroy"); | |
| 101 | + | |
| 102 | + System.out.println("Service:onDestroy"); | |
| 103 | + } | |
| 104 | +} | |
| \ No newline at end of file | ... | ... |
| ... | ... | @@ -256,21 +256,10 @@ public class MainPresenter extends BasePresenter |
| 256 | 256 | public void onGetRoomStatusSuccess(RoomStatusInfo info) { |
| 257 | 257 | Log.d("room-info", "getOrderInfo#onGetRoomStatusSuccess:" + info.toString()); |
| 258 | 258 | RoomStatusInfo.DataEntity data = info.getData(); |
| 259 | + int offset = data.getNow_time() - data.getBegin_time(); | |
| 259 | 260 | int durationMinutes = data.getEnd_time() - data.getBegin_time(); |
| 260 | 261 | Log.d("CountService", "durationMinutes:" + durationMinutes); |
| 261 | 262 | mainView.updateOrderInfo(info); |
| 262 | -// roomInfoModel.getRoomQrCode(data.getOrder_sn(), new RoomInfoModelImpl.GetRoomQrCodeListener() { | |
| 263 | -// @Override | |
| 264 | -// public void onGetRoomQrCodeSuccess(RoomQrCodeInfo info) { | |
| 265 | -// Log.d("room-info", "getOrderInfo#onGetRoomStatusSuccess#onGetRoomQrCodeSuccess:" + info.toString()); | |
| 266 | -// mainView.prepareRoomQrCodeInfo(info); | |
| 267 | -// } | |
| 268 | -// | |
| 269 | -// @Override | |
| 270 | -// public void onGetRoomQrCodeFailure(WrongMsg wrongMsg) { | |
| 271 | -// Log.d("room-info", "onGetRoomQrCodeFailure:" + wrongMsg.toString()); | |
| 272 | -// } | |
| 273 | -// }); | |
| 274 | 263 | } |
| 275 | 264 | |
| 276 | 265 | @Override | ... | ... |
| ... | ... | @@ -24,6 +24,8 @@ import android.os.IBinder; |
| 24 | 24 | import android.os.RemoteException; |
| 25 | 25 | import android.util.Log; |
| 26 | 26 | import android.widget.Toast; |
| 27 | +import com.gimi.common.cinema.model.Constant; | |
| 28 | +import com.gimi.common.cinema.model.MessageEvent; | |
| 27 | 29 | import com.gimi.common.cinema.utils.Utils; |
| 28 | 30 | import com.qnbar.smc.model.Light; |
| 29 | 31 | import com.qnbar.smc.model.Lights; |
| ... | ... | @@ -32,10 +34,13 @@ import com.telink.bluetooth.light.ConnectionStatus; |
| 32 | 34 | import com.telink.bluetooth.light.DeviceInfo; |
| 33 | 35 | import com.xgimi.gimicinema.ICinemaControl; |
| 34 | 36 | import com.xgimi.gimicinema.application.FangTangApplication; |
| 37 | +import org.greenrobot.eventbus.EventBus; | |
| 35 | 38 | |
| 36 | 39 | import java.util.ArrayList; |
| 37 | 40 | import java.util.List; |
| 38 | 41 | |
| 42 | +import static com.xgimi.gimicinema.service.CountService.COUNT_DOWN_ZERO; | |
| 43 | + | |
| 39 | 44 | public class CinemaControlService extends Service { |
| 40 | 45 | private static final int LIGHT_MIN_VALUE = 5; |
| 41 | 46 | private ArrayList<String> movies = new ArrayList<>(); |
| ... | ... | @@ -95,6 +100,7 @@ public class CinemaControlService extends Service { |
| 95 | 100 | switch (state) { |
| 96 | 101 | case 0://空闲 |
| 97 | 102 | fadeIn(); |
| 103 | + showQrCodeRightNow(); | |
| 98 | 104 | // msgEvent.setEventId(0x19910); |
| 99 | 105 | // msgEvent.setMessage("open_switch"); |
| 100 | 106 | // EventBus.getDefault().post(msgEvent); |
| ... | ... | @@ -313,4 +319,13 @@ public class CinemaControlService extends Service { |
| 313 | 319 | // params = new byte[]{0x05, (byte) value}; |
| 314 | 320 | // TelinkLightService.Instance().sendCommandNoResponse(opcode, addr, params, true); |
| 315 | 321 | } |
| 322 | + | |
| 323 | + private void showQrCodeRightNow() { | |
| 324 | + Constant.count = -1; | |
| 325 | +// PollingUtils.stopPollingService(); | |
| 326 | + MessageEvent messageEvent = new MessageEvent(); | |
| 327 | + messageEvent.setEventId(COUNT_DOWN_ZERO); | |
| 328 | + messageEvent.setMessage("记数为0"); | |
| 329 | + EventBus.getDefault().post(messageEvent); | |
| 330 | + } | |
| 316 | 331 | } | ... | ... |
Please
register
or
login
to post a comment