-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
yizeliang
committed
Dec 23, 2022
1 parent
0139eb2
commit 4505da4
Showing
51 changed files
with
995 additions
and
635 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,37 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<manifest xmlns:android="http://schemas.android.com/apk/res/android" | ||
package="cn.yizems.saved.delegate.simple"> | ||
package="cn.yzl.auto.save.simple"> | ||
|
||
<application | ||
android:name="cn.yzl.auto.save.simple.MyApplication" | ||
android:allowBackup="true" | ||
android:icon="@mipmap/ic_launcher" | ||
android:label="@string/app_name" | ||
android:roundIcon="@mipmap/ic_launcher_round" | ||
android:supportsRtl="true" | ||
android:theme="@style/AppTheme"> | ||
<activity android:name="cn.yizems.saved.delegate.simple.Main2Activity"></activity> | ||
<activity android:name="cn.yizems.saved.delegate.simple.MainActivity"> | ||
<activity | ||
android:name="cn.yzl.auto.save.simple.LastPageActivity" | ||
android:label="最后一个页面" | ||
android:exported="false"></activity> | ||
<activity | ||
android:name="cn.yzl.auto.save.simple.TestKotinActivity" | ||
android:label="测试Kotlin" | ||
android:exported="true"> | ||
<intent-filter> | ||
<action android:name="android.intent.action.MAIN" /> | ||
|
||
<category android:name="android.intent.category.LAUNCHER" /> | ||
</intent-filter> | ||
</activity> | ||
<activity android:name="cn.yizems.saved.delegate.simple.MainActivity3" /> | ||
<activity | ||
android:name="cn.yzl.auto.save.simple.TestJava" | ||
android:label="测试Java" | ||
android:exported="false" /> | ||
<activity | ||
android:name="cn.yzl.auto.save.simple.TestJavaExtendLibrary" | ||
android:label="测试Java继承自lib" | ||
android:exported="false" /> | ||
</application> | ||
|
||
</manifest> |
16 changes: 0 additions & 16 deletions
16
app/src/main/java/cn/yizems/saved/delegate/simple/MainActivity3ASR.kt
This file was deleted.
Oops, something went wrong.
7 changes: 5 additions & 2 deletions
7
...ms/saved/delegate/simple/Main2Activity.kt → .../yzl/auto/save/simple/LastPageActivity.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 13 additions & 0 deletions
13
app/src/main/java/cn/yzl/auto/save/simple/MyApplication.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
package cn.yzl.auto.save.simple | ||
|
||
import android.app.Application | ||
|
||
class MyApplication : Application() { | ||
|
||
override fun onCreate() { | ||
super.onCreate() | ||
Thread.setDefaultUncaughtExceptionHandler { t, e -> | ||
e.printStackTrace() | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
53 changes: 53 additions & 0 deletions
53
app/src/main/java/cn/yzl/auto/save/simple/TestJavaExtendLibrary.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
package cn.yzl.auto.save.simple; | ||
|
||
import android.content.Intent; | ||
import android.os.Bundle; | ||
import android.util.Log; | ||
import android.view.View; | ||
|
||
import cn.yzl.auto.save.AutoSaveHelper; | ||
import cn.yzl.auto.save.base.AutoSaveRestore; | ||
import cn.yzl.auto.save.testlib.TestActivity; | ||
|
||
/** | ||
* 测试java类的自动保存,该类继承自一个library中的类 | ||
*/ | ||
public class TestJavaExtendLibrary extends TestActivity { | ||
|
||
@AutoSaveRestore | ||
private int b = 10; | ||
|
||
@Override | ||
protected void onCreate(Bundle savedInstanceState) { | ||
log("onCreate:" + this.hashCode()); | ||
super.onCreate(savedInstanceState); | ||
setContentView(R.layout.activity_main2); | ||
final long startTime = System.currentTimeMillis(); | ||
AutoSaveHelper.registerForJava(this); | ||
a++; | ||
b++; | ||
log("--registerForJava--" + (System.currentTimeMillis() - startTime)); | ||
|
||
log("----"); | ||
log(String.valueOf(a)); | ||
log(String.valueOf(b)); | ||
|
||
findViewById(R.id.cl_content).setOnClickListener(new View.OnClickListener() { | ||
@Override | ||
public void onClick(View v) { | ||
startActivity(new Intent(TestJavaExtendLibrary.this, LastPageActivity.class)); | ||
} | ||
}); | ||
|
||
} | ||
|
||
private void log(String msg) { | ||
Log.e("TestJavaExtendLibrary", msg); | ||
} | ||
|
||
@Override | ||
protected void onDestroy() { | ||
log("onDestroy:" + this.hashCode()); | ||
super.onDestroy(); | ||
} | ||
} |
Oops, something went wrong.