Commit 2359ee89c09a34f5f1c26379d1aba05407cd2d63
Merge branch 'master' of gitlab.qnbar.com:pan.li/fangTang
Showing
10 changed files
with
52 additions
and
90 deletions
| @@ -148,7 +148,7 @@ dependencies { | @@ -148,7 +148,7 @@ dependencies { | ||
| 148 | // compile 'com.android.support:support-v4:25.2.0' | 148 | // compile 'com.android.support:support-v4:25.2.0' |
| 149 | compile 'com.umeng.analytics:analytics:latest.integration' | 149 | compile 'com.umeng.analytics:analytics:latest.integration' |
| 150 | compile 'org.greenrobot:eventbus:3.0.0' | 150 | compile 'org.greenrobot:eventbus:3.0.0' |
| 151 | - compile 'com.android.support.constraint:constraint-layout:1.0.0-alpha4' | 151 | +// compile 'com.android.support.constraint:constraint-layout:1.0.0-alpha4' |
| 152 | } | 152 | } |
| 153 | 153 | ||
| 154 | def getPwd(modifyPwd) { | 154 | def getPwd(modifyPwd) { |
| @@ -6,6 +6,7 @@ import android.database.Cursor; | @@ -6,6 +6,7 @@ import android.database.Cursor; | ||
| 6 | import android.database.sqlite.SQLiteDatabase; | 6 | import android.database.sqlite.SQLiteDatabase; |
| 7 | import android.text.TextUtils; | 7 | import android.text.TextUtils; |
| 8 | import android.util.Log; | 8 | import android.util.Log; |
| 9 | + | ||
| 9 | import com.gimi.common.cinema.model.LocalMovieMessage; | 10 | import com.gimi.common.cinema.model.LocalMovieMessage; |
| 10 | import com.gimi.common.cinema.model.QueryType; | 11 | import com.gimi.common.cinema.model.QueryType; |
| 11 | import com.gimi.common.cinema.model.SourceType; | 12 | import com.gimi.common.cinema.model.SourceType; |
| @@ -457,6 +458,23 @@ public class NewDBManager { | @@ -457,6 +458,23 @@ public class NewDBManager { | ||
| 457 | * | 458 | * |
| 458 | * @return persons | 459 | * @return persons |
| 459 | */ | 460 | */ |
| 461 | + public List<LocalMovieMessage> queryPlayMovie(String md5) { | ||
| 462 | + String sql = "SELECT * FROM movie_message where md5 = '" + md5 + "'"; | ||
| 463 | + | ||
| 464 | + ArrayList<LocalMovieMessage> persons = new ArrayList<LocalMovieMessage>(); | ||
| 465 | + StringBuffer sb = new StringBuffer(sql); | ||
| 466 | + | ||
| 467 | + Cursor c = db.rawQuery(sb.toString(), null); | ||
| 468 | + readCursor2List(persons, c); | ||
| 469 | + c.close(); | ||
| 470 | + return persons; | ||
| 471 | + } | ||
| 472 | + | ||
| 473 | + /** | ||
| 474 | + * query all recommend qn | ||
| 475 | + * | ||
| 476 | + * @return persons | ||
| 477 | + */ | ||
| 460 | public List<LocalMovieMessage> queryAllDemandMovies() { | 478 | public List<LocalMovieMessage> queryAllDemandMovies() { |
| 461 | String sql = "SELECT * FROM movie_message order by cast(" + NewDBHelper.MOVIE_COUNT + " as int) desc, cast(movie_dl_time as int) desc limit " + PXB_MOVIE_COUNT;/* + " path like '%" + key + "%'";*/ | 479 | String sql = "SELECT * FROM movie_message order by cast(" + NewDBHelper.MOVIE_COUNT + " as int) desc, cast(movie_dl_time as int) desc limit " + PXB_MOVIE_COUNT;/* + " path like '%" + key + "%'";*/ |
| 462 | ArrayList<LocalMovieMessage> persons = new ArrayList<LocalMovieMessage>(); | 480 | ArrayList<LocalMovieMessage> persons = new ArrayList<LocalMovieMessage>(); |
| @@ -44,6 +44,7 @@ import android.widget.ImageView; | @@ -44,6 +44,7 @@ import android.widget.ImageView; | ||
| 44 | import android.widget.RelativeLayout; | 44 | import android.widget.RelativeLayout; |
| 45 | import android.widget.ScrollView; | 45 | import android.widget.ScrollView; |
| 46 | import android.widget.Toast; | 46 | import android.widget.Toast; |
| 47 | + | ||
| 47 | import com.adroplat.fist_switch.jni.Device; | 48 | import com.adroplat.fist_switch.jni.Device; |
| 48 | import com.adroplat.fist_switch.jni.FistJni; | 49 | import com.adroplat.fist_switch.jni.FistJni; |
| 49 | import com.adroplat.fist_switch.jni.SubDevice; | 50 | import com.adroplat.fist_switch.jni.SubDevice; |
| @@ -51,7 +52,6 @@ import com.adroplat.fist_switch.utils.protocol.one.FistProtocol; | @@ -51,7 +52,6 @@ import com.adroplat.fist_switch.utils.protocol.one.FistProtocol; | ||
| 51 | import com.bluetoothle.BLEBroadcastReceiver; | 52 | import com.bluetoothle.BLEBroadcastReceiver; |
| 52 | import com.bluetoothle.BLEOpenRecord; | 53 | import com.bluetoothle.BLEOpenRecord; |
| 53 | import com.bluetoothle.GREENBluetoothLeService; | 54 | import com.bluetoothle.GREENBluetoothLeService; |
| 54 | -import com.bluetoothle.greencity.GREENBLE; | ||
| 55 | import com.bluetoothle.greencity.GREENCITYBLEProtocolFactory; | 55 | import com.bluetoothle.greencity.GREENCITYBLEProtocolFactory; |
| 56 | import com.gimi.common.cinema.db.NewDBManager; | 56 | import com.gimi.common.cinema.db.NewDBManager; |
| 57 | import com.gimi.common.cinema.model.ClassificationItem; | 57 | import com.gimi.common.cinema.model.ClassificationItem; |
| @@ -61,6 +61,7 @@ import com.gimi.common.cinema.model.LocalMovieMessage; | @@ -61,6 +61,7 @@ import com.gimi.common.cinema.model.LocalMovieMessage; | ||
| 61 | import com.gimi.common.cinema.model.MessageEvent; | 61 | import com.gimi.common.cinema.model.MessageEvent; |
| 62 | import com.gimi.common.cinema.model.RoomInfo; | 62 | import com.gimi.common.cinema.model.RoomInfo; |
| 63 | import com.gimi.common.cinema.model.RoomQrCodeInfo; | 63 | import com.gimi.common.cinema.model.RoomQrCodeInfo; |
| 64 | +import com.gimi.common.cinema.model.RoomStatusInfo; | ||
| 64 | import com.gimi.common.cinema.utils.AuthUtils; | 65 | import com.gimi.common.cinema.utils.AuthUtils; |
| 65 | import com.gimi.common.cinema.utils.LeeImageLoader; | 66 | import com.gimi.common.cinema.utils.LeeImageLoader; |
| 66 | import com.gimi.common.cinema.utils.M1905Utils; | 67 | import com.gimi.common.cinema.utils.M1905Utils; |
| @@ -104,6 +105,7 @@ import com.xgimi.gimicinema.view.MovieItem; | @@ -104,6 +105,7 @@ import com.xgimi.gimicinema.view.MovieItem; | ||
| 104 | import com.xgimi.gimicinema.view.OrderRecyclerView; | 105 | import com.xgimi.gimicinema.view.OrderRecyclerView; |
| 105 | import com.xgimi.smartscreen.SmartScreenBean; | 106 | import com.xgimi.smartscreen.SmartScreenBean; |
| 106 | import com.xgimi.smartscreen.service.ConfigService; | 107 | import com.xgimi.smartscreen.service.ConfigService; |
| 108 | + | ||
| 107 | import org.greenrobot.eventbus.EventBus; | 109 | import org.greenrobot.eventbus.EventBus; |
| 108 | import org.greenrobot.eventbus.Subscribe; | 110 | import org.greenrobot.eventbus.Subscribe; |
| 109 | import org.greenrobot.eventbus.ThreadMode; | 111 | import org.greenrobot.eventbus.ThreadMode; |
| @@ -451,12 +453,28 @@ public class MainActivity extends BaseActivity implements IMainView, EventListen | @@ -451,12 +453,28 @@ public class MainActivity extends BaseActivity implements IMainView, EventListen | ||
| 451 | } | 453 | } |
| 452 | 454 | ||
| 453 | @Override | 455 | @Override |
| 454 | - public void countDownOrderTime(int durationMinutes) { | 456 | + public void updateOrderInfo(RoomStatusInfo info) { |
| 457 | + RoomStatusInfo.DataEntity data = info.getData(); | ||
| 458 | + int durationMinutes = data.getEnd_time() - data.getBegin_time(); | ||
| 459 | + Log.d("CountService", "durationMinutes:" + durationMinutes); | ||
| 455 | if (durationMinutes <= 1) { | 460 | if (durationMinutes <= 1) { |
| 456 | return; | 461 | return; |
| 457 | } | 462 | } |
| 458 | Constant.count = durationMinutes + 1; | 463 | Constant.count = durationMinutes + 1; |
| 459 | PollingUtils.startPollingService(context, 60, CountService.class, CountService.STATUS_ACTION); | 464 | PollingUtils.startPollingService(context, 60, CountService.class, CountService.STATUS_ACTION); |
| 465 | + | ||
| 466 | + List<LocalMovieMessage> localMovieMessages = null; | ||
| 467 | + if (!TextUtils.isEmpty(data.getFilm_hash())) { | ||
| 468 | + localMovieMessages = new NewDBManager(this).queryPlayMovie(data.getFilm_hash()); | ||
| 469 | + } | ||
| 470 | + if (localMovieMessages == null || localMovieMessages.size() == 0) { | ||
| 471 | + show("没有获取到相应订单信息,即将为您播放银河护卫队"); | ||
| 472 | + localMovieMessages = new NewDBManager(this).queryPlayMovie("C1584FFF17811A7FAE58BC564AE79488"); | ||
| 473 | + } | ||
| 474 | + if (localMovieMessages != null && localMovieMessages.size() > 0) { | ||
| 475 | + OpenMMUtils.openMMWithAds(this, localMovieMessages.get(0).getPlayPath(), null); | ||
| 476 | + } | ||
| 477 | + | ||
| 460 | } | 478 | } |
| 461 | 479 | ||
| 462 | private RoomQrCodeInfo info; | 480 | private RoomQrCodeInfo info; |
| @@ -464,6 +482,7 @@ public class MainActivity extends BaseActivity implements IMainView, EventListen | @@ -464,6 +482,7 @@ public class MainActivity extends BaseActivity implements IMainView, EventListen | ||
| 464 | @Override | 482 | @Override |
| 465 | public void prepareRoomQrCodeInfo(RoomQrCodeInfo info) { | 483 | public void prepareRoomQrCodeInfo(RoomQrCodeInfo info) { |
| 466 | this.info = info; | 484 | this.info = info; |
| 485 | + | ||
| 467 | } | 486 | } |
| 468 | 487 | ||
| 469 | @Override | 488 | @Override |
| @@ -922,7 +941,7 @@ public class MainActivity extends BaseActivity implements IMainView, EventListen | @@ -922,7 +941,7 @@ public class MainActivity extends BaseActivity implements IMainView, EventListen | ||
| 922 | break; | 941 | break; |
| 923 | } | 942 | } |
| 924 | startActivity(new Intent(this, QrCodeShowActivity.class).putExtra("qr", info.getData().getCode())); | 943 | startActivity(new Intent(this, QrCodeShowActivity.class).putExtra("qr", info.getData().getCode())); |
| 925 | -// startActivity(new Intent(this, QrCodeShowActivity.class).putExtra("qr", "countDownOrderTime")); | 944 | +// startActivity(new Intent(this, QrCodeShowActivity.class).putExtra("qr", "updateOrderInfo")); |
| 926 | break; | 945 | break; |
| 927 | } | 946 | } |
| 928 | } | 947 | } |
| @@ -951,12 +970,12 @@ public class MainActivity extends BaseActivity implements IMainView, EventListen | @@ -951,12 +970,12 @@ public class MainActivity extends BaseActivity implements IMainView, EventListen | ||
| 951 | } | 970 | } |
| 952 | 971 | ||
| 953 | }); | 972 | }); |
| 954 | - String openCMD = "Open the door"; | ||
| 955 | - GREENBLE.send(this, lockMac, openCMD.getBytes()); | ||
| 956 | - List<LocalMovieMessage> localMovieMessages = new NewDBManager(this).queryRandomMovies(); | ||
| 957 | - if (localMovieMessages != null && localMovieMessages.size() > 0) { | ||
| 958 | - OpenMMUtils.openMMWithAds(this, localMovieMessages.get(0).getPlayPath(), null); | ||
| 959 | - } | 973 | +// String openCMD = "Open the door"; |
| 974 | +// GREENBLE.send(this, lockMac, openCMD.getBytes()); | ||
| 975 | +// List<LocalMovieMessage> localMovieMessages = new NewDBManager(this).queryRandomMovies(); | ||
| 976 | +// if (localMovieMessages != null && localMovieMessages.size() > 0) { | ||
| 977 | +// OpenMMUtils.openMMWithAds(this, localMovieMessages.get(0).getPlayPath(), null); | ||
| 978 | +// } | ||
| 960 | } | 979 | } |
| 961 | 980 | ||
| 962 | //---------------------------about switch----------------------------------- | 981 | //---------------------------about switch----------------------------------- |
| @@ -21,6 +21,7 @@ import com.gimi.common.cinema.model.ClassificationItem; | @@ -21,6 +21,7 @@ import com.gimi.common.cinema.model.ClassificationItem; | ||
| 21 | import com.gimi.common.cinema.model.LocalMovieMessage; | 21 | import com.gimi.common.cinema.model.LocalMovieMessage; |
| 22 | import com.gimi.common.cinema.model.RoomInfo; | 22 | import com.gimi.common.cinema.model.RoomInfo; |
| 23 | import com.gimi.common.cinema.model.RoomQrCodeInfo; | 23 | import com.gimi.common.cinema.model.RoomQrCodeInfo; |
| 24 | +import com.gimi.common.cinema.model.RoomStatusInfo; | ||
| 24 | 25 | ||
| 25 | import java.util.List; | 26 | import java.util.List; |
| 26 | 27 | ||
| @@ -56,7 +57,7 @@ public interface IMainView { | @@ -56,7 +57,7 @@ public interface IMainView { | ||
| 56 | 57 | ||
| 57 | void openClazz(ClassificationItem classificationItem); | 58 | void openClazz(ClassificationItem classificationItem); |
| 58 | 59 | ||
| 59 | - void countDownOrderTime(int durationMinutes); | 60 | + void updateOrderInfo(RoomStatusInfo info); |
| 60 | 61 | ||
| 61 | void prepareRoomQrCodeInfo(RoomQrCodeInfo info); | 62 | void prepareRoomQrCodeInfo(RoomQrCodeInfo info); |
| 62 | 63 |
| @@ -242,7 +242,7 @@ public class MainPresenter extends BasePresenter | @@ -242,7 +242,7 @@ public class MainPresenter extends BasePresenter | ||
| 242 | RoomStatusInfo.DataEntity data = info.getData(); | 242 | RoomStatusInfo.DataEntity data = info.getData(); |
| 243 | int durationMinutes = data.getEnd_time() - data.getBegin_time(); | 243 | int durationMinutes = data.getEnd_time() - data.getBegin_time(); |
| 244 | Log.d("CountService", "durationMinutes:" + durationMinutes); | 244 | Log.d("CountService", "durationMinutes:" + durationMinutes); |
| 245 | - mainView.countDownOrderTime(durationMinutes); | 245 | + mainView.updateOrderInfo(info); |
| 246 | roomInfoModel.getRoomQrCode(data.getOrder_sn(), new RoomInfoModelImpl.GetRoomQrCodeListener() { | 246 | roomInfoModel.getRoomQrCode(data.getOrder_sn(), new RoomInfoModelImpl.GetRoomQrCodeListener() { |
| 247 | @Override | 247 | @Override |
| 248 | public void onGetRoomQrCodeSuccess(RoomQrCodeInfo info) { | 248 | public void onGetRoomQrCodeSuccess(RoomQrCodeInfo info) { |
| @@ -37,7 +37,7 @@ dependencies { | @@ -37,7 +37,7 @@ dependencies { | ||
| 37 | }) | 37 | }) |
| 38 | compile group: 'com.google.code.gson', name: 'gson', version: '2.7' | 38 | compile group: 'com.google.code.gson', name: 'gson', version: '2.7' |
| 39 | compile 'com.android.support:appcompat-v7:25.2.0' | 39 | compile 'com.android.support:appcompat-v7:25.2.0' |
| 40 | - compile 'com.android.support.constraint:constraint-layout:1.0.0-alpha4' | 40 | +// compile 'com.android.support.constraint:constraint-layout:1.0.0-alpha4' |
| 41 | compile 'com.android.support:design:25.2.0' | 41 | compile 'com.android.support:design:25.2.0' |
| 42 | compile 'org.greenrobot:eventbus:3.0.0' | 42 | compile 'org.greenrobot:eventbus:3.0.0' |
| 43 | testCompile 'junit:junit:4.12' | 43 | testCompile 'junit:junit:4.12' |
| @@ -11,19 +11,6 @@ | @@ -11,19 +11,6 @@ | ||
| 11 | android:supportsRtl="true" | 11 | android:supportsRtl="true" |
| 12 | android:theme="@style/AppTheme"> | 12 | android:theme="@style/AppTheme"> |
| 13 | <activity | 13 | <activity |
| 14 | - android:name=".MainActivity" | ||
| 15 | - android:label="@string/title_activity_main" | ||
| 16 | - android:theme="@style/AppTheme.NoActionBar"> | ||
| 17 | - | ||
| 18 | - <!-- | ||
| 19 | - <intent-filter> | ||
| 20 | - <action android:name="android.intent.action.MAIN"/> | ||
| 21 | - | ||
| 22 | - <category android:name="android.intent.category.LAUNCHER"/> | ||
| 23 | - </intent-filter> | ||
| 24 | - --> | ||
| 25 | - </activity> | ||
| 26 | - <activity | ||
| 27 | android:name=".SwitchControlActivity" | 14 | android:name=".SwitchControlActivity" |
| 28 | android:theme="@style/AppTheme.NoActionBar"> | 15 | android:theme="@style/AppTheme.NoActionBar"> |
| 29 | <intent-filter> | 16 | <intent-filter> |
| 1 | -package com.qnbar.switchcontrol; | ||
| 2 | - | ||
| 3 | -import android.os.Bundle; | ||
| 4 | -import android.support.design.widget.FloatingActionButton; | ||
| 5 | -import android.support.design.widget.Snackbar; | ||
| 6 | -import android.support.v7.app.AppCompatActivity; | ||
| 7 | -import android.support.v7.widget.Toolbar; | ||
| 8 | -import android.view.View; | ||
| 9 | - | ||
| 10 | -public class MainActivity extends AppCompatActivity { | ||
| 11 | - | ||
| 12 | - @Override | ||
| 13 | - protected void onCreate(Bundle savedInstanceState) { | ||
| 14 | - super.onCreate(savedInstanceState); | ||
| 15 | - setContentView(R.layout.activity_main); | ||
| 16 | - Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar); | ||
| 17 | - setSupportActionBar(toolbar); | ||
| 18 | - | ||
| 19 | - FloatingActionButton fab = (FloatingActionButton) findViewById(R.id.fab); | ||
| 20 | - fab.setOnClickListener(new View.OnClickListener() { | ||
| 21 | - @Override | ||
| 22 | - public void onClick(View view) { | ||
| 23 | - Snackbar.make(view, "Replace with your own action", Snackbar.LENGTH_LONG) | ||
| 24 | - .setAction("Action", null).show(); | ||
| 25 | - } | ||
| 26 | - }); | ||
| 27 | - } | ||
| 28 | - | ||
| 29 | -} |
| 1 | -<?xml version="1.0" encoding="utf-8"?> | ||
| 2 | -<android.support.design.widget.CoordinatorLayout | ||
| 3 | - xmlns:android="http://schemas.android.com/apk/res/android" | ||
| 4 | - xmlns:app="http://schemas.android.com/apk/res-auto" | ||
| 5 | - xmlns:tools="http://schemas.android.com/tools" | ||
| 6 | - android:layout_width="match_parent" | ||
| 7 | - android:layout_height="match_parent" | ||
| 8 | - tools:context="com.qnbar.switchcontrol.MainActivity"> | ||
| 9 | - | ||
| 10 | - <android.support.design.widget.AppBarLayout | ||
| 11 | - android:layout_height="wrap_content" | ||
| 12 | - android:layout_width="match_parent" | ||
| 13 | - android:theme="@style/AppTheme.AppBarOverlay"> | ||
| 14 | - | ||
| 15 | - <android.support.v7.widget.Toolbar | ||
| 16 | - android:id="@+id/toolbar" | ||
| 17 | - android:layout_width="match_parent" | ||
| 18 | - android:layout_height="?attr/actionBarSize" | ||
| 19 | - android:background="?attr/colorPrimary" | ||
| 20 | - app:popupTheme="@style/AppTheme.PopupOverlay"/> | ||
| 21 | - | ||
| 22 | - </android.support.design.widget.AppBarLayout> | ||
| 23 | - | ||
| 24 | - <include layout="@layout/content_main"/> | ||
| 25 | - | ||
| 26 | - <android.support.design.widget.FloatingActionButton | ||
| 27 | - android:id="@+id/fab" | ||
| 28 | - android:layout_width="wrap_content" | ||
| 29 | - android:layout_height="wrap_content" | ||
| 30 | - android:layout_gravity="bottom|end" | ||
| 31 | - android:layout_margin="@dimen/fab_margin" | ||
| 32 | - app:srcCompat="@android:drawable/ic_dialog_email"/> | ||
| 33 | - | ||
| 34 | -</android.support.design.widget.CoordinatorLayout> |
| @@ -36,7 +36,7 @@ dependencies { | @@ -36,7 +36,7 @@ dependencies { | ||
| 36 | }) | 36 | }) |
| 37 | compile group: 'com.google.code.gson', name: 'gson', version: '2.7' | 37 | compile group: 'com.google.code.gson', name: 'gson', version: '2.7' |
| 38 | compile 'com.android.support:appcompat-v7:25.2.0' | 38 | compile 'com.android.support:appcompat-v7:25.2.0' |
| 39 | - compile 'com.android.support.constraint:constraint-layout:1.0.0-alpha4' | 39 | +// compile 'com.android.support.constraint:constraint-layout:1.0.0-alpha4' |
| 40 | compile 'com.android.support:design:25.2.0' | 40 | compile 'com.android.support:design:25.2.0' |
| 41 | compile 'org.greenrobot:eventbus:3.0.0' | 41 | compile 'org.greenrobot:eventbus:3.0.0' |
| 42 | testCompile 'junit:junit:4.12' | 42 | testCompile 'junit:junit:4.12' |
Please
register
or
login
to post a comment