Commit e099c4c1efc71e92d83484784a2f38dc078060cc

Authored by Penley
1 parent 901f3d9c

online envroment,toast

... ... @@ -147,7 +147,7 @@
147 147 <service android:name="com.xgimi.smartscreen.service.ConfigService"/>
148 148 <service android:name=".poll.PollingServiceDemo"/>
149 149
150   - <activity android:name=".activity.QrCodeShowActivity" android:launchMode="singleTop">
  150 + <activity android:name=".activity.QrCodeShowActivity"><!-- android:launchMode="singleTop"-->
151 151 </activity>
152 152 <activity android:name=".activity.ConfigWifiActivity">
153 153 </activity>
... ...
... ... @@ -61,6 +61,10 @@ public class SocketService extends Service {
61 61 private static final int ROOM_NOT_EXIST_M = 1002;
62 62 private static final int HEAT_BEAT_RTN = 1003;
63 63
  64 + // online
  65 + public static final String SERVER_HOST_ONLINE = "conn.ft.qnbar.com";// "192.168.1.21";//
  66 + public static final int SERVER_PORT_ONLINE= 8899;
  67 +
64 68 // develop
65 69 public static final String SERVER_HOST_DEVELOP = "10.10.4.6";// "192.168.1.21";//
66 70 public static final int SERVER_PORT_DEVELOP = 9501;
... ... @@ -128,8 +132,8 @@ public class SocketService extends Service {
128 132 int ftTest = Utils.getInt(this, "ft-test", 0);
129 133 switch (ftTest) {
130 134 case 0:
131   - serverHost = SERVER_HOST;
132   - serverPort = SERVER_PORT;
  135 + serverHost = SERVER_HOST_ONLINE;
  136 + serverPort = SERVER_PORT_ONLINE;
133 137 break;
134 138 case 1:
135 139 serverHost = SERVER_HOST_DEVELOP;
... ...
... ... @@ -535,10 +535,21 @@ public class MainActivity extends BaseActivity implements IMainView, EventListen
535 535 @Override
536 536 public void prepareRoomQrCodeInfo(RoomQrCodeInfo info) {
537 537 this.info = info;
538   - startActivity(new Intent(this, QrCodeShowActivity.class)
  538 + try {
  539 + new SystemUtils().stopMediaPlayer(context.getApplicationContext());
  540 + } catch (Exception e) {
  541 + e.printStackTrace();
  542 + }
  543 + Intent intent = new Intent(this, QrCodeShowActivity.class)
539 544 .putExtra("qr", info.getData().getCode())
540 545 .putExtra("room_sn", roomInfo.getData().getRoom_sn())
541   - .putExtra("order_sn", roomStatusInfo.getData().getOrder_sn()));
  546 + .putExtra("order_sn", roomStatusInfo.getData().getOrder_sn());
  547 + if ("count_service".equals(countMsg)) {
  548 + intent.putExtra("count_call", true);
  549 + }
  550 + intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
  551 + intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
  552 + startActivity(intent);
542 553 }
543 554
544 555 private RoomInfo roomInfo;
... ... @@ -1014,6 +1025,10 @@ public class MainActivity extends BaseActivity implements IMainView, EventListen
1014 1025 }
1015 1026 if (!TextUtils.isEmpty(roomStatusInfo.getData().getFilm_hash())) {
1016 1027 LocalMovieMessage lmm = new NewDBManager(this).queryPlayMovie(roomStatusInfo.getData().getFilm_hash());
  1028 + if (lmm == null) {
  1029 + Log.d("room-info", "movie not exits");
  1030 + break;
  1031 + }
1017 1032 if (!roomStatusInfo.getData().getFilm_hash().equals(lmm.getMd5())) {
1018 1033 //当前播放电影信息不正确正在重新拉取
1019 1034 show("当前播放电影信息不正确正在重新拉取");
... ... @@ -1064,6 +1079,7 @@ public class MainActivity extends BaseActivity implements IMainView, EventListen
1064 1079 if (roomStatusInfo != null && roomStatusInfo.getData() != null & roomInfo != null && roomInfo.getData() != null) {
1065 1080 if (System.currentTimeMillis() - lastRequest > 3000) {
1066 1081 lastRequest = System.currentTimeMillis();
  1082 + countMsg = messageEvent.getMessage();
1067 1083 presenter.getCleanQrCode(roomStatusInfo.getData().getOrder_sn(), roomInfo.getData().getRoom_sn());
1068 1084 }
1069 1085 } else {
... ... @@ -1076,6 +1092,7 @@ public class MainActivity extends BaseActivity implements IMainView, EventListen
1076 1092 }
1077 1093
1078 1094 private long lastRequest = 0;
  1095 + private String countMsg = "";
1079 1096
1080 1097 private void openDoor() {
1081 1098 Log.d("room-info", "openDoor called");
... ...
... ... @@ -30,6 +30,7 @@ import android.widget.RatingBar;
30 30 import android.widget.RelativeLayout;
31 31 import android.widget.TextView;
32 32 import android.widget.Toast;
  33 +
33 34 import com.gimi.common.cinema.model.LocalMovieMessage;
34 35 import com.gimi.common.cinema.model.MovieCast;
35 36 import com.gimi.common.cinema.model.MovieMessage;
... ...
... ... @@ -5,6 +5,7 @@ import android.os.Bundle;
5 5 import android.os.Handler;
6 6 import android.util.Log;
7 7 import android.widget.ImageView;
  8 +import android.widget.Toast;
8 9
9 10 import com.gimi.common.cinema.model.MessageEvent;
10 11 import com.gimi.common.cinema.utils.QRCodeUtils;
... ... @@ -45,6 +46,12 @@ public class QrCodeShowActivity extends Activity {
45 46 final String qr = getIntent().getStringExtra("qr");
46 47 oderSn = getIntent().getStringExtra("order_sn");
47 48 roomSn = getIntent().getStringExtra("room_sn");
  49 + boolean countCall = getIntent().getBooleanExtra("count_call", false);
  50 + if (countCall) {
  51 + Toast.makeText(this,"你预定的时段已结束,请携带好随身物品,欢迎下次光临",Toast.LENGTH_LONG).show();
  52 + }else{
  53 + Toast.makeText(this,"电影观看完成,请携带好随身物品,欢迎下次光临",Toast.LENGTH_LONG).show();
  54 + }
48 55 ImageView iv = (ImageView) findViewById(R.id.qrCodeIv);
49 56 try {
50 57 iv.setImageBitmap(QRCodeUtils.createQRCode(qr, 400));
... ...
... ... @@ -22,6 +22,7 @@ public class RoomInfoModelImpl implements IRoomInfoModel {
22 22 // private static final String roomUrl = "https://ft.qnbar.cn/develop/api/";
23 23 private static String roomUrl = "https://ft.qnbar.cn/test/api/";
24 24 private static final String FT_ROOT_TEST_URL = "https://ft.qnbar.cn/test/api/";
  25 + private static final String FT_ROOT_URL = "https://ft.qnbar.com/api/";
25 26 private static final String FT_ROOT_DEVELOP_URL = "https://ft.qnbar.cn/develop/api/";
26 27 private static String ROOM_INFO_BY_IMEI_URL = roomUrl + "tcp/getRoomInfoByimei?imei=";
27 28 private static String ROOM_STATUS_BY_ROOM_SN_URL = roomUrl + "tcp/getRoomStatus?room_sn=";
... ... @@ -34,7 +35,7 @@ public class RoomInfoModelImpl implements IRoomInfoModel {
34 35 int ftTest = Utils.getInt(applicationContext, "ft-test", 0);
35 36 switch (ftTest) {
36 37 case 0:
37   - roomUrl = FT_ROOT_TEST_URL;
  38 + roomUrl = FT_ROOT_URL;
38 39 break;
39 40 case 1:
40 41 roomUrl = FT_ROOT_DEVELOP_URL;
... ...
... ... @@ -23,9 +23,8 @@ import android.content.IntentFilter;
23 23 import android.content.SharedPreferences;
24 24 import android.net.ConnectivityManager;
25 25 import android.net.NetworkInfo;
  26 +
26 27 import com.gimi.common.cinema.model.Constant;
27   -import com.gimi.common.cinema.utils.SystemUtils;
28   -import com.gimi.common.cinema.utils.WifiApManger;
29 28 import com.xgimi.gimicinema.activity.StartActivity;
30 29 import com.xgimi.gimicinema.service.AskService;
31 30
... ... @@ -34,9 +33,6 @@ import com.xgimi.gimicinema.service.AskService;
34 33 */
35 34 public class BootReceiver extends BroadcastReceiver {
36 35 static final String ACTION = "android.intent.action.BOOT_COMPLETED";
37   - private int workMode;
38   - private boolean startOpen;
39   - private boolean openAp;
40 36
41 37 public void onReceiveIntent(Context context, Intent intent) {
42 38 if (intent.getAction().equals(ACTION)) {
... ... @@ -45,9 +41,6 @@ public class BootReceiver extends BroadcastReceiver {
45 41 SharedPreferences.Editor editor = sharedPreferences.edit();
46 42 editor.putBoolean("has_enter_pwd", false);
47 43 editor.apply();
48   - startOpen = sharedPreferences.getBoolean("start_open", false);
49   - openAp = sharedPreferences.getBoolean("open_ap", false);
50   - workMode = new SystemUtils().getYbProp();
51 44 mConnectivityManager = (ConnectivityManager)
52 45 context.getSystemService(Context.CONNECTIVITY_SERVICE);
53 46 netInfo = mConnectivityManager.getActiveNetworkInfo();
... ... @@ -93,17 +86,10 @@ public class BootReceiver extends BroadcastReceiver {
93 86 };
94 87
95 88 private void bootInit(Context context) {
96   - if (workMode != 3) {
97   - Intent intents = new Intent(context, AskService.class);
98   - context.startService(intents);
99   - }
100   -// if (startOpen && !Constant.userOpen) {
  89 + Intent intents = new Intent(context, AskService.class);
  90 + context.startService(intents);
101 91 Intent openIntent = new Intent(context, StartActivity.class);
102 92 openIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
103 93 context.startActivity(openIntent);
104   -// }
105   - if (openAp) {
106   - WifiApManger.openWifiAp(context);
107   - }
108 94 }
109 95 }
... ...
... ... @@ -78,7 +78,7 @@ public class CinemaControlService extends Service {
78 78 currentPosition = duration;
79 79 if (saveBeat-- <= 0) {
80 80 //TODO 保存当前进度,需要时从保存位置开始播放,取消播放器播放记录功能
81   - //TODO 播放一段时间确保状态为关闭
  81 + // 播放一段时间确保状态为关闭
82 82 saveBeat = SAVE_BEAT;
83 83 try {
84 84 if (!fadeOuting && Lights.getInstance().getByMeshAddress(
... ...
... ... @@ -61,6 +61,7 @@ public class CountService extends Service {
61 61 MessageEvent messageEvent = new MessageEvent();
62 62 messageEvent.setEventId(COUNT_DOWN_ZERO);
63 63 messageEvent.setMessage("记数为0");
  64 + messageEvent.setMessage("count_service");
64 65 EventBus.getDefault().post(messageEvent);
65 66 CountService.this.onDestroy();
66 67 }
... ...
Please register or login to post a comment