|
@@ -119,11 +119,6 @@ public class MainActivity extends BaseActivity implements IMainView, EventListen |
|
@@ -119,11 +119,6 @@ public class MainActivity extends BaseActivity implements IMainView, EventListen |
|
119
|
int itemHeight = 420;
|
119
|
int itemHeight = 420;
|
|
120
|
int itemSpace = 30;
|
120
|
int itemSpace = 30;
|
|
121
|
|
121
|
|
|
122
|
- private Handler handler = new Handler();
|
|
|
|
123
|
- private long lastKeyDownTime;
|
|
|
|
124
|
- private String videoAds;
|
|
|
|
125
|
- private boolean needStartScreenSaver = true;
|
|
|
|
126
|
-
|
|
|
|
127
|
public interface OnItemClickListener {
|
122
|
public interface OnItemClickListener {
|
|
128
|
void onItemClick(View view, int data);
|
123
|
void onItemClick(View view, int data);
|
|
129
|
}
|
124
|
}
|
|
@@ -202,9 +197,6 @@ public class MainActivity extends BaseActivity implements IMainView, EventListen |
|
@@ -202,9 +197,6 @@ public class MainActivity extends BaseActivity implements IMainView, EventListen |
|
202
|
clazzRv.setAdapter(adapterClazz);
|
197
|
clazzRv.setAdapter(adapterClazz);
|
|
203
|
|
198
|
|
|
204
|
presenter.load(this);
|
199
|
presenter.load(this);
|
|
205
|
-// Intent intent = new Intent();
|
|
|
|
206
|
-// intent.setAction(AskService.ASK_SERVICE_ACTION);
|
|
|
|
207
|
-// this.getBaseContext().startService(intent);
|
|
|
|
208
|
}
|
200
|
}
|
|
209
|
|
201
|
|
|
210
|
|
202
|
|
|
@@ -294,7 +286,6 @@ public class MainActivity extends BaseActivity implements IMainView, EventListen |
|
@@ -294,7 +286,6 @@ public class MainActivity extends BaseActivity implements IMainView, EventListen |
|
294
|
}
|
286
|
}
|
|
295
|
|
287
|
|
|
296
|
public void setVideoAds(String path) {
|
288
|
public void setVideoAds(String path) {
|
|
297
|
- videoAds = path;
|
|
|
|
298
|
}
|
289
|
}
|
|
299
|
|
290
|
|
|
300
|
@Override
|
291
|
@Override
|
|
@@ -319,8 +310,8 @@ public class MainActivity extends BaseActivity implements IMainView, EventListen |
|
@@ -319,8 +310,8 @@ public class MainActivity extends BaseActivity implements IMainView, EventListen |
|
319
|
|
310
|
|
|
320
|
@Override
|
311
|
@Override
|
|
321
|
public void jumpToSearch() {
|
312
|
public void jumpToSearch() {
|
|
322
|
- Intent intentSearch = new Intent(context, com.qnbar.smc.MainActivity.class);
|
|
|
|
323
|
-// Intent intentSearch = new Intent(context, SearchNewActivity.class);
|
313
|
+// Intent intentSearch = new Intent(context, com.qnbar.smc.MainActivity.class);
|
|
|
|
314
|
+ Intent intentSearch = new Intent(context, SearchNewActivity.class);
|
|
324
|
context.startActivity(intentSearch);
|
315
|
context.startActivity(intentSearch);
|
|
325
|
}
|
316
|
}
|
|
326
|
|
317
|
|
|
@@ -350,7 +341,6 @@ public class MainActivity extends BaseActivity implements IMainView, EventListen |
|
@@ -350,7 +341,6 @@ public class MainActivity extends BaseActivity implements IMainView, EventListen |
|
350
|
presenter.loadRecommend(context);
|
341
|
presenter.loadRecommend(context);
|
|
351
|
}
|
342
|
}
|
|
352
|
}
|
343
|
}
|
|
353
|
- needStartScreenSaver = true;
|
|
|
|
354
|
if (HAS_SYSTEM_FEATURE_BLUETOOTH_LE) {
|
344
|
if (HAS_SYSTEM_FEATURE_BLUETOOTH_LE) {
|
|
355
|
IntentFilter intentFilter = new IntentFilter();
|
345
|
IntentFilter intentFilter = new IntentFilter();
|
|
356
|
intentFilter.addAction(BLEBroadcastReceiver.ACTION_BLE_ERROR);
|
346
|
intentFilter.addAction(BLEBroadcastReceiver.ACTION_BLE_ERROR);
|
|
@@ -407,13 +397,11 @@ public class MainActivity extends BaseActivity implements IMainView, EventListen |
|
@@ -407,13 +397,11 @@ public class MainActivity extends BaseActivity implements IMainView, EventListen |
|
407
|
startActivity(i);
|
397
|
startActivity(i);
|
|
408
|
return true;
|
398
|
return true;
|
|
409
|
}
|
399
|
}
|
|
410
|
- lastKeyDownTime = System.currentTimeMillis();
|
|
|
|
411
|
return super.onKeyDown(keyCode, event);
|
400
|
return super.onKeyDown(keyCode, event);
|
|
412
|
}
|
401
|
}
|
|
413
|
|
402
|
|
|
414
|
@Override
|
403
|
@Override
|
|
415
|
protected void onPause() {
|
404
|
protected void onPause() {
|
|
416
|
- needStartScreenSaver = false;
|
|
|
|
417
|
super.onPause();
|
405
|
super.onPause();
|
|
418
|
if (HAS_SYSTEM_FEATURE_BLUETOOTH_LE) {
|
406
|
if (HAS_SYSTEM_FEATURE_BLUETOOTH_LE) {
|
|
419
|
unregisterReceiver(bleBroadcastReceiver);
|
407
|
unregisterReceiver(bleBroadcastReceiver);
|
|
@@ -635,13 +623,11 @@ public class MainActivity extends BaseActivity implements IMainView, EventListen |
|
@@ -635,13 +623,11 @@ public class MainActivity extends BaseActivity implements IMainView, EventListen |
|
635
|
|
623
|
|
|
636
|
BLEOpenRecord bleOpenRecord = new BLEOpenRecord();
|
624
|
BLEOpenRecord bleOpenRecord = new BLEOpenRecord();
|
|
637
|
bleOpenRecord.setLockmac(onClickDeviceMac);
|
625
|
bleOpenRecord.setLockmac(onClickDeviceMac);
|
|
638
|
-// bleOpenRecord.setUserid(MainActivity.account);
|
|
|
|
639
|
bleOpenRecord.setTime(new SimpleDateFormat("yyyy-MM-dd HH:mm:ss", Locale.US).format(new Date()));
|
626
|
bleOpenRecord.setTime(new SimpleDateFormat("yyyy-MM-dd HH:mm:ss", Locale.US).format(new Date()));
|
|
640
|
Intent intent = new Intent();
|
627
|
Intent intent = new Intent();
|
|
641
|
intent.setAction(GREENBluetoothLeService.ACTION_OPEN_SUCCESS);
|
628
|
intent.setAction(GREENBluetoothLeService.ACTION_OPEN_SUCCESS);
|
|
642
|
intent.putExtra("openrecord", bleOpenRecord);
|
629
|
intent.putExtra("openrecord", bleOpenRecord);
|
|
643
|
sendBroadcast(intent);
|
630
|
sendBroadcast(intent);
|
|
644
|
-// IS_OPENNING_DOOR = false;
|
|
|
|
645
|
}
|
631
|
}
|
|
646
|
|
632
|
|
|
647
|
@Override
|
633
|
@Override
|
|
@@ -680,8 +666,6 @@ public class MainActivity extends BaseActivity implements IMainView, EventListen |
|
@@ -680,8 +666,6 @@ public class MainActivity extends BaseActivity implements IMainView, EventListen |
|
680
|
private int connectMeshAddress;
|
666
|
private int connectMeshAddress;
|
|
681
|
private Handler mHandler = new Handler();
|
667
|
private Handler mHandler = new Handler();
|
|
682
|
|
668
|
|
|
683
|
- private Handler mDelayHandler = new Handler();
|
|
|
|
684
|
-
|
|
|
|
685
|
private BroadcastReceiver mReceiver = new BroadcastReceiver() {
|
669
|
private BroadcastReceiver mReceiver = new BroadcastReceiver() {
|
|
686
|
@Override
|
670
|
@Override
|
|
687
|
public void onReceive(Context context, Intent intent) {
|
671
|
public void onReceive(Context context, Intent intent) {
|
|
@@ -753,13 +737,6 @@ public class MainActivity extends BaseActivity implements IMainView, EventListen |
|
@@ -753,13 +737,6 @@ public class MainActivity extends BaseActivity implements IMainView, EventListen |
|
753
|
case LightAdapter.STATUS_LOGIN:
|
737
|
case LightAdapter.STATUS_LOGIN:
|
|
754
|
connectMeshAddress = mApplication.getConnectDevice().meshAddress;
|
738
|
connectMeshAddress = mApplication.getConnectDevice().meshAddress;
|
|
755
|
show("main login success");
|
739
|
show("main login success");
|
|
756
|
- mHandler.postDelayed(new Runnable() {
|
|
|
|
757
|
- @Override
|
|
|
|
758
|
- public void run() {
|
|
|
|
759
|
- TelinkLightService.Instance().sendCommandNoResponse((byte) 0xE4, 0xFFFF, new byte[]{});
|
|
|
|
760
|
-// getDeviceGroup();
|
|
|
|
761
|
- }
|
|
|
|
762
|
- }, 3 * 1000);
|
|
|
|
763
|
break;
|
740
|
break;
|
|
764
|
case LightAdapter.STATUS_CONNECTING:
|
741
|
case LightAdapter.STATUS_CONNECTING:
|
|
765
|
show("login");
|
742
|
show("login");
|
|
@@ -822,12 +799,6 @@ public class MainActivity extends BaseActivity implements IMainView, EventListen |
|
@@ -822,12 +799,6 @@ public class MainActivity extends BaseActivity implements IMainView, EventListen |
|
822
|
light.status = notificationInfo.connectStatus;
|
799
|
light.status = notificationInfo.connectStatus;
|
|
823
|
light.updateIcon();
|
800
|
light.updateIcon();
|
|
824
|
}
|
801
|
}
|
|
825
|
- mHandler.post(new Runnable() {
|
|
|
|
826
|
- @Override
|
|
|
|
827
|
- public void run() {
|
|
|
|
828
|
- adapter.notifyDataSetChanged();
|
|
|
|
829
|
- }
|
|
|
|
830
|
- });
|
|
|
|
831
|
}
|
802
|
}
|
|
832
|
|
803
|
|
|
833
|
/**
|
804
|
/**
|