File tree Expand file tree Collapse file tree 8 files changed +64
-2
lines changed
kotlin/com/ztc1997/fingerprint2sleep Expand file tree Collapse file tree 8 files changed +64
-2
lines changed Original file line number Diff line number Diff line change @@ -43,6 +43,8 @@ dependencies {
4343 compile " com.google.firebase:firebase-core:$firebaseVersion "
4444 compile " com.google.firebase:firebase-crash:$firebaseVersion "
4545 compile " com.google.firebase:firebase-ads:$firebaseVersion "
46+
47+ compile ' com.hwangjr.rxbus:rxbus:1.0.5'
4648}
4749
4850buildscript {
Original file line number Diff line number Diff line change 2727}
2828
2929-dontwarn org.jetbrains.anko.**
30- -keep class org.jetbrains.anko.** { *;}
30+ -keep class org.jetbrains.anko.** { *;}
31+
32+ -dontwarn rx.**
33+ -keep class rx.** { *;}
34+
35+ -keepattributes *Annotation*
36+ -keepclassmembers class ** {
37+ @com.hwangjr.rxbus.annotation.Subscribe public *;
38+ @com.hwangjr.rxbus.annotation.Produce public *;
39+ }
40+ -keepclassmembers class * implements java.io.Serializable {
41+ static final long serialVersionUID;
42+ private static final java.io.ObjectStreamField[] serialPersistentFields;
43+ !static !transient <fields>;
44+ !private <fields>;
45+ !private <methods>;
46+ private void writeObject(java.io.ObjectOutputStream);
47+ private void readObject(java.io.ObjectInputStream);
48+ java.lang.Object writeReplace();
49+ java.lang.Object readResolve();
50+ }
Original file line number Diff line number Diff line change 2424
2525 <activity
2626 android : name =" .StartFPQAActivity"
27+ android : excludeFromRecents =" true"
2728 android : process =" :bg"
2829 android : theme =" @android:style/Theme.Translucent.NoTitleBar" />
2930
Original file line number Diff line number Diff line change 1+ /*
2+ * Copyright 2016. Alex Zhang aka. ztc1997
3+ *
4+ * Licensed under the Apache License, Version 2.0 (the "License");
5+ * you may not use this file except in compliance with the License.
6+ * You may obtain a copy of the License at
7+ *
8+ * http://www.apache.org/licenses/LICENSE-2.0
9+ *
10+ * Unless required by applicable law or agreed to in writing, software
11+ * distributed under the License is distributed on an "AS IS" BASIS,
12+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+ * See the License for the specific language governing permissions and
14+ * limitations under the License.
15+ */
16+
17+ package com.ztc1997.fingerprint2sleep
18+
19+ object FinishStartFPQAActivityEvent
Original file line number Diff line number Diff line change 1+ package com.ztc1997.fingerprint2sleep
2+
3+ import com.hwangjr.rxbus.Bus
4+ import com.hwangjr.rxbus.RxBus
5+
6+ val rxBus: Bus get() = RxBus .get()
Original file line number Diff line number Diff line change @@ -90,6 +90,8 @@ class FPQAService : Service() {
9090 isScanning = true
9191 }
9292
93+ rxBus.post(FinishStartFPQAActivityEvent )
94+
9395 isError = false
9496
9597 lastIntent?.let {
Original file line number Diff line number Diff line change @@ -45,5 +45,6 @@ class RequireAdminActivity : Activity() {
4545 }
4646
4747 finish()
48+ overridePendingTransition(0 , 0 )
4849 }
4950}
Original file line number Diff line number Diff line change @@ -4,6 +4,7 @@ import android.app.Activity
44import android.content.Context
55import android.content.Intent
66import android.os.Bundle
7+ import com.hwangjr.rxbus.annotation.Subscribe
78import org.jetbrains.anko.startService
89
910class StartFPQAActivity : Activity () {
@@ -12,15 +13,25 @@ class StartFPQAActivity : Activity() {
1213 val startIntent = Intent (context, StartFPQAActivity ::class .java)
1314 startIntent.addFlags(Intent .FLAG_ACTIVITY_NEW_TASK )
1415 startIntent.addFlags(Intent .FLAG_ACTIVITY_MULTIPLE_TASK )
15- startIntent.addFlags(Intent .FLAG_ACTIVITY_NO_HISTORY )
1616 startIntent.addFlags(Intent .FLAG_ACTIVITY_NO_ANIMATION )
1717 context.startActivity(startIntent)
1818 }
1919 }
2020
2121 override fun onCreate (savedInstanceState : Bundle ? ) {
2222 super .onCreate(savedInstanceState)
23+ rxBus.register(this )
2324 startService<FPQAService >()
25+ }
26+
27+ override fun onDestroy () {
28+ super .onDestroy()
29+ rxBus.unregister(this )
30+ }
31+
32+ @Subscribe
33+ fun finishSelf (event : FinishStartFPQAActivityEvent ) {
2434 finish()
35+ overridePendingTransition(0 , 0 )
2536 }
2637}
You can’t perform that action at this time.
0 commit comments