diff --git a/.gitignore b/.gitignore index 895aa13..930f450 100644 --- a/.gitignore +++ b/.gitignore @@ -3,6 +3,9 @@ bin/ gen/ *.DS_Store +app/build/ +library/build/ + */bin/ */gen/ .settings/ diff --git a/.idea/.gitignore b/.idea/.gitignore new file mode 100644 index 0000000..26d3352 --- /dev/null +++ b/.idea/.gitignore @@ -0,0 +1,3 @@ +# Default ignored files +/shelf/ +/workspace.xml diff --git a/.idea/compiler.xml b/.idea/compiler.xml new file mode 100644 index 0000000..fb7f4a8 --- /dev/null +++ b/.idea/compiler.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/.idea/gradle.xml b/.idea/gradle.xml new file mode 100644 index 0000000..0081406 --- /dev/null +++ b/.idea/gradle.xml @@ -0,0 +1,20 @@ + + + + + + \ No newline at end of file diff --git a/.idea/libraries/android_support_v4.xml b/.idea/libraries/android_support_v4.xml new file mode 100644 index 0000000..00acd90 --- /dev/null +++ b/.idea/libraries/android_support_v4.xml @@ -0,0 +1,9 @@ + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/lib.xml b/.idea/libraries/lib.xml new file mode 100644 index 0000000..69f6a36 --- /dev/null +++ b/.idea/libraries/lib.xml @@ -0,0 +1,12 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml new file mode 100644 index 0000000..2483849 --- /dev/null +++ b/.idea/misc.xml @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml new file mode 100644 index 0000000..94a25f7 --- /dev/null +++ b/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/AndroidManifest.xml b/AndroidManifest.xml deleted file mode 100644 index 7775d66..0000000 --- a/AndroidManifest.xml +++ /dev/null @@ -1,10 +0,0 @@ - - - - - diff --git a/README-ch.md b/README-ch.md index 414d64f..4ea344f 100644 --- a/README-ch.md +++ b/README-ch.md @@ -18,6 +18,8 @@ * [大题小作](http://www.pkdati.com/) * [易泊商户](http://www.myebox.cn/) * [易方达移动OA](http://www.wandoujia.com/apps/com.efunds.trade) +* [功夫泡](http://gongfupao.com) +* * [魅族手机中的日历应用]() `欢迎大家给我反馈使用情况` @@ -117,7 +119,7 @@ public class YourActivity extends Activity { ## 集成 ### jar文件集成 -将jar文件添加到工程中的引用中即可,[AndroidEventBus.jar下载](lib/androideventbus-1.0.4.jar?raw=true "点击下载到本地") +将jar文件添加到工程中的引用中即可,[AndroidEventBus.jar下载](lib/androideventbus-1.0.5.1.jar?raw=true "点击下载到本地") ### Android Studio集成 @@ -128,7 +130,7 @@ dependencies { compile fileTree(dir: 'libs', include: ['*.jar']) // 添加依赖 - compile 'org.simple:androideventbus:latest' + compile 'org.simple:androideventbus:1.0.5.1' } ``` @@ -165,6 +167,7 @@ private void onEventMainThread(User aUser) { -keepclassmembers class * { @org.simple.eventbus.Subscriber ; } +-keepattributes *Annotation* ``` ## 感谢 diff --git a/README.md b/README.md index a3e4d1d..f6ffb07 100644 --- a/README.md +++ b/README.md @@ -1,10 +1,8 @@ -# ![AndroidEventBus Logo](http://img.blog.csdn.net/20150203120217873) AndroidEventBus +# AndroidEventBus This is an EventBus library for Android. It simplifies the communication between Activities, Fragments, Threads, Services, etc. and lowers the coupling among them to a great extent, thus making simplifier codes, lower coupling possible and improving code quality. - ****中文版 [README.md](README-ch.md).**** - - **AndroidEventBus技术交流群群 号:312090070。有问题或者有建议可以到该群中咨询,谢谢。** +[//]: # (   ****中文版 [README.md](README-ch.md).【该项目不再维护】****    ) ## new feature @@ -17,6 +15,7 @@ This is an EventBus library for Android. It simplifies the communication between * [大题小作](http://www.pkdati.com/) * [易方达移动OA](http://www.wandoujia.com/apps/com.efunds.trade) * [Novu - Your Health Rewarded](https://play.google.com/store/apps/details?id=com.novu.novu) +* [魅族手机中的日历应用]() ## Basic Architecture ![arch](http://img.blog.csdn.net/20150426223040789) @@ -121,7 +120,7 @@ The receiving function will use “tag” to mark receivable types of events, ju ## Usage ### integrate with jar -It will be enough to add the jar file into the “quote” part of the Project, AndroidEventBus.[AndroidEventBus.jar](lib/androideventbus-1.0.4.jar?raw=true "download") +It will be enough to add the jar file into the “quote” part of the Project, AndroidEventBus.[AndroidEventBus.jar](lib/androideventbus-1.0.5.1.jar?raw=true "download") ### Gradle @@ -132,7 +131,7 @@ It will be enough to add the jar file into the “quote” part of the Project, dependencies { // add AndroidEventBus dependency - compile 'org.simple:androideventbus:1.0.5' + compile 'org.simple:androideventbus:1.0.5.1' } ``` @@ -168,6 +167,7 @@ These are the differences between AndroidEventBus and EventBus of greenrobot. Bu -keepclassmembers class * { @org.simple.eventbus.Subscriber ; } +-keepattributes *Annotation* ``` ## Thanks Note diff --git a/Simple_Event_Test/AndroidManifest.xml b/Simple_Event_Test/AndroidManifest.xml deleted file mode 100644 index 0108195..0000000 --- a/Simple_Event_Test/AndroidManifest.xml +++ /dev/null @@ -1,19 +0,0 @@ - - - - - - - - - - - - \ No newline at end of file diff --git a/Simple_Event_Test/proguard-project.txt b/Simple_Event_Test/proguard-project.txt deleted file mode 100644 index f2fe155..0000000 --- a/Simple_Event_Test/proguard-project.txt +++ /dev/null @@ -1,20 +0,0 @@ -# To enable ProGuard in your project, edit project.properties -# to define the proguard.config property as described in that file. -# -# Add project specific ProGuard rules here. -# By default, the flags in this file are appended to flags specified -# in ${sdk.dir}/tools/proguard/proguard-android.txt -# You can edit the include path and order by changing the ProGuard -# include property in project.properties. -# -# For more details, see -# http://developer.android.com/guide/developing/tools/proguard.html - -# Add any project specific keep options here: - -# If your project uses WebView with JS, uncomment the following -# and specify the fully qualified class name to the JavaScript interface -# class: -#-keepclassmembers class fqcn.of.javascript.interface.for.webview { -# public *; -#} diff --git a/Simple_Event_Test/project.properties b/Simple_Event_Test/project.properties deleted file mode 100644 index 3aedb2f..0000000 --- a/Simple_Event_Test/project.properties +++ /dev/null @@ -1,15 +0,0 @@ -# This file is automatically generated by Android Tools. -# Do not modify this file -- YOUR CHANGES WILL BE ERASED! -# -# This file must be checked in Version Control Systems. -# -# To customize properties used by the Ant build system edit -# "ant.properties", and override values to adapt the script to your -# project structure. -# -# To enable ProGuard to shrink and obfuscate your code, uncomment this (available properties: sdk.dir, user.home): -#proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard-project.txt - -# Project target. -target=android-10 -android.library.reference.1=.. diff --git a/Simple_Event_Test/res/drawable-hdpi/ic_launcher.png b/Simple_Event_Test/res/drawable-hdpi/ic_launcher.png deleted file mode 100644 index 96a442e..0000000 Binary files a/Simple_Event_Test/res/drawable-hdpi/ic_launcher.png and /dev/null differ diff --git a/Simple_Event_Test/res/drawable-ldpi/ic_launcher.png b/Simple_Event_Test/res/drawable-ldpi/ic_launcher.png deleted file mode 100644 index 9923872..0000000 Binary files a/Simple_Event_Test/res/drawable-ldpi/ic_launcher.png and /dev/null differ diff --git a/Simple_Event_Test/res/drawable-mdpi/ic_launcher.png b/Simple_Event_Test/res/drawable-mdpi/ic_launcher.png deleted file mode 100644 index 359047d..0000000 Binary files a/Simple_Event_Test/res/drawable-mdpi/ic_launcher.png and /dev/null differ diff --git a/Simple_Event_Test/res/drawable-xhdpi/ic_launcher.png b/Simple_Event_Test/res/drawable-xhdpi/ic_launcher.png deleted file mode 100644 index 71c6d76..0000000 Binary files a/Simple_Event_Test/res/drawable-xhdpi/ic_launcher.png and /dev/null differ diff --git a/Simple_Event_Test/res/values/strings.xml b/Simple_Event_Test/res/values/strings.xml deleted file mode 100644 index 7bbdda0..0000000 --- a/Simple_Event_Test/res/values/strings.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - Simple_Event_TestTest - - diff --git a/Simple_Event_Test/src/org/simple/eventbus/test/BusTestSuite.java b/Simple_Event_Test/src/org/simple/eventbus/test/BusTestSuite.java deleted file mode 100644 index 7b5bd73..0000000 --- a/Simple_Event_Test/src/org/simple/eventbus/test/BusTestSuite.java +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright (C) 2015 Mr.Simple - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.simple.eventbus.test; - -import android.test.suitebuilder.TestSuiteBuilder; - -import junit.framework.Test; -import junit.framework.TestSuite; - -/** - * @author mrsimple - */ -public class BusTestSuite extends TestSuite { - public static Test suite() { - return new TestSuiteBuilder(BusTestSuite.class) - .includePackages( - "org.simple.eventbus.test.EventBusTest", - "org.simple.eventbus.test.EventTypeTest", - "org.simple.eventbus.test.ThreadModeTest", - "org.simple.eventbus.testDefaultMatchPolicyTest") - .build(); - } -} diff --git a/Simple_eventbus_demo/ic_launcher-web.png b/Simple_eventbus_demo/ic_launcher-web.png deleted file mode 100644 index a18cbb4..0000000 Binary files a/Simple_eventbus_demo/ic_launcher-web.png and /dev/null differ diff --git a/Simple_eventbus_demo/libs/android-support-v4.jar b/Simple_eventbus_demo/libs/android-support-v4.jar deleted file mode 100644 index 4ebdaa9..0000000 Binary files a/Simple_eventbus_demo/libs/android-support-v4.jar and /dev/null differ diff --git a/Simple_eventbus_demo/proguard-project.txt b/Simple_eventbus_demo/proguard-project.txt deleted file mode 100644 index f2fe155..0000000 --- a/Simple_eventbus_demo/proguard-project.txt +++ /dev/null @@ -1,20 +0,0 @@ -# To enable ProGuard in your project, edit project.properties -# to define the proguard.config property as described in that file. -# -# Add project specific ProGuard rules here. -# By default, the flags in this file are appended to flags specified -# in ${sdk.dir}/tools/proguard/proguard-android.txt -# You can edit the include path and order by changing the ProGuard -# include property in project.properties. -# -# For more details, see -# http://developer.android.com/guide/developing/tools/proguard.html - -# Add any project specific keep options here: - -# If your project uses WebView with JS, uncomment the following -# and specify the fully qualified class name to the JavaScript interface -# class: -#-keepclassmembers class fqcn.of.javascript.interface.for.webview { -# public *; -#} diff --git a/Simple_eventbus_demo/project.properties b/Simple_eventbus_demo/project.properties deleted file mode 100644 index 3aedb2f..0000000 --- a/Simple_eventbus_demo/project.properties +++ /dev/null @@ -1,15 +0,0 @@ -# This file is automatically generated by Android Tools. -# Do not modify this file -- YOUR CHANGES WILL BE ERASED! -# -# This file must be checked in Version Control Systems. -# -# To customize properties used by the Ant build system edit -# "ant.properties", and override values to adapt the script to your -# project structure. -# -# To enable ProGuard to shrink and obfuscate your code, uncomment this (available properties: sdk.dir, user.home): -#proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard-project.txt - -# Project target. -target=android-10 -android.library.reference.1=.. diff --git a/Simple_eventbus_demo/res/drawable-xhdpi/event_bus.png b/Simple_eventbus_demo/res/drawable-xhdpi/event_bus.png deleted file mode 100644 index 0c6e5a2..0000000 Binary files a/Simple_eventbus_demo/res/drawable-xhdpi/event_bus.png and /dev/null differ diff --git a/Simple_eventbus_demo/res/drawable-xhdpi/ic_launcher.png b/Simple_eventbus_demo/res/drawable-xhdpi/ic_launcher.png deleted file mode 100644 index d4fb7cd..0000000 Binary files a/Simple_eventbus_demo/res/drawable-xhdpi/ic_launcher.png and /dev/null differ diff --git a/Simple_eventbus_demo/res/drawable-xxhdpi/ic_launcher.png b/Simple_eventbus_demo/res/drawable-xxhdpi/ic_launcher.png deleted file mode 100644 index 85a6081..0000000 Binary files a/Simple_eventbus_demo/res/drawable-xxhdpi/ic_launcher.png and /dev/null differ diff --git a/Simple_eventbus_demo/res/values/styles.xml b/Simple_eventbus_demo/res/values/styles.xml deleted file mode 100644 index 6ce89c7..0000000 --- a/Simple_eventbus_demo/res/values/styles.xml +++ /dev/null @@ -1,20 +0,0 @@ - - - - - - - - - diff --git a/app/.gitignore b/app/.gitignore new file mode 100644 index 0000000..42afabf --- /dev/null +++ b/app/.gitignore @@ -0,0 +1 @@ +/build \ No newline at end of file diff --git a/app/build.gradle b/app/build.gradle new file mode 100644 index 0000000..aeef32d --- /dev/null +++ b/app/build.gradle @@ -0,0 +1,45 @@ +plugins { + id 'com.android.application' + id 'org.jetbrains.kotlin.android' +} + +android { + namespace 'com.android.eventbus.demo' + compileSdk 33 + + defaultConfig { + applicationId "com.android.eventbus.demo" + minSdk 21 + targetSdk 33 + versionCode 1 + versionName "1.0" + + testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" + } + + buildTypes { + release { + minifyEnabled false + proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' + } + } + kotlinOptions { + jvmTarget = '1.8' + } + buildFeatures { + viewBinding true + } +} + +dependencies { + + implementation 'androidx.appcompat:appcompat:1.6.1' + implementation 'com.google.android.material:material:1.5.0' + implementation 'androidx.constraintlayout:constraintlayout:2.1.4' + implementation project(":library") + + + testImplementation 'junit:junit:4.13.2' + androidTestImplementation 'androidx.test.ext:junit:1.1.5' + androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.1' +} \ No newline at end of file diff --git a/app/proguard-rules.pro b/app/proguard-rules.pro new file mode 100644 index 0000000..481bb43 --- /dev/null +++ b/app/proguard-rules.pro @@ -0,0 +1,21 @@ +# Add project specific ProGuard rules here. +# You can control the set of applied configuration files using the +# proguardFiles setting in build.gradle. +# +# For more details, see +# http://developer.android.com/guide/developing/tools/proguard.html + +# If your project uses WebView with JS, uncomment the following +# and specify the fully qualified class name to the JavaScript interface +# class: +#-keepclassmembers class fqcn.of.javascript.interface.for.webview { +# public *; +#} + +# Uncomment this to preserve the line number information for +# debugging stack traces. +#-keepattributes SourceFile,LineNumberTable + +# If you keep the line number information, uncomment this to +# hide the original source file name. +#-renamesourcefileattribute SourceFile \ No newline at end of file diff --git a/app/src/androidTest/java/com/android/eventbus/demo/ExampleInstrumentedTest.kt b/app/src/androidTest/java/com/android/eventbus/demo/ExampleInstrumentedTest.kt new file mode 100644 index 0000000..476e9ba --- /dev/null +++ b/app/src/androidTest/java/com/android/eventbus/demo/ExampleInstrumentedTest.kt @@ -0,0 +1,24 @@ +package com.android.eventbus.demo + +import androidx.test.platform.app.InstrumentationRegistry +import androidx.test.ext.junit.runners.AndroidJUnit4 + +import org.junit.Test +import org.junit.runner.RunWith + +import org.junit.Assert.* + +/** + * Instrumented test, which will execute on an Android device. + * + * See [testing documentation](http://d.android.com/tools/testing). + */ +@RunWith(AndroidJUnit4::class) +class ExampleInstrumentedTest { + @Test + fun useAppContext() { + // Context of the app under test. + val appContext = InstrumentationRegistry.getInstrumentation().targetContext + assertEquals("com.android.eventbus.demo", appContext.packageName) + } +} \ No newline at end of file diff --git a/Simple_eventbus_demo/AndroidManifest.xml b/app/src/main/AndroidManifest.xml similarity index 50% rename from Simple_eventbus_demo/AndroidManifest.xml rename to app/src/main/AndroidManifest.xml index 8163d61..4c55b9c 100644 --- a/Simple_eventbus_demo/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -1,26 +1,28 @@ + - - + xmlns:tools="http://schemas.android.com/tools"> + android:supportsRtl="true" + android:theme="@style/Theme.AndroidEventBusV2" + tools:targetApi="31"> + android:exported="true" + android:label="@string/app_name" + android:theme="@style/Theme.AndroidEventBusV2"> + diff --git a/Simple_eventbus_demo/src/org/simple/eventbus/demo/MainActivity.java b/app/src/main/java/com/android/eventbus/demo/MainActivity.java similarity index 85% rename from Simple_eventbus_demo/src/org/simple/eventbus/demo/MainActivity.java rename to app/src/main/java/com/android/eventbus/demo/MainActivity.java index f4fe3a8..8e9bb65 100644 --- a/Simple_eventbus_demo/src/org/simple/eventbus/demo/MainActivity.java +++ b/app/src/main/java/com/android/eventbus/demo/MainActivity.java @@ -14,12 +14,13 @@ * limitations under the License. */ -package org.simple.eventbus.demo; +package com.android.eventbus.demo; import android.os.Bundle; -import android.support.v4.app.FragmentActivity; -public class MainActivity extends FragmentActivity { +import androidx.appcompat.app.AppCompatActivity; + +public class MainActivity extends AppCompatActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); diff --git a/Simple_eventbus_demo/src/org/simple/eventbus/demo/StickyActivity.java b/app/src/main/java/com/android/eventbus/demo/StickyActivity.java similarity index 96% rename from Simple_eventbus_demo/src/org/simple/eventbus/demo/StickyActivity.java rename to app/src/main/java/com/android/eventbus/demo/StickyActivity.java index 90208a7..e1e4f86 100644 --- a/Simple_eventbus_demo/src/org/simple/eventbus/demo/StickyActivity.java +++ b/app/src/main/java/com/android/eventbus/demo/StickyActivity.java @@ -22,16 +22,17 @@ * THE SOFTWARE. */ -package org.simple.eventbus.demo; +package com.android.eventbus.demo; import android.app.Activity; import android.os.Bundle; import android.util.Log; import android.widget.TextView; +import com.android.eventbus.demo.bean.User; + import org.simple.eventbus.EventBus; import org.simple.eventbus.Subscriber; -import org.simple.eventbus.demo.bean.User; public class StickyActivity extends Activity { diff --git a/Simple_eventbus_demo/src/org/simple/eventbus/demo/bean/StickyUser.java b/app/src/main/java/com/android/eventbus/demo/bean/StickyUser.java similarity index 96% rename from Simple_eventbus_demo/src/org/simple/eventbus/demo/bean/StickyUser.java rename to app/src/main/java/com/android/eventbus/demo/bean/StickyUser.java index b4d01ae..bc05ee6 100644 --- a/Simple_eventbus_demo/src/org/simple/eventbus/demo/bean/StickyUser.java +++ b/app/src/main/java/com/android/eventbus/demo/bean/StickyUser.java @@ -22,7 +22,7 @@ * THE SOFTWARE. */ -package org.simple.eventbus.demo.bean; +package com.android.eventbus.demo.bean; public class StickyUser extends User { diff --git a/Simple_eventbus_demo/src/org/simple/eventbus/demo/bean/User.java b/app/src/main/java/com/android/eventbus/demo/bean/User.java similarity index 97% rename from Simple_eventbus_demo/src/org/simple/eventbus/demo/bean/User.java rename to app/src/main/java/com/android/eventbus/demo/bean/User.java index 7443f7a..15c7c02 100644 --- a/Simple_eventbus_demo/src/org/simple/eventbus/demo/bean/User.java +++ b/app/src/main/java/com/android/eventbus/demo/bean/User.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.simple.eventbus.demo.bean; +package com.android.eventbus.demo.bean; public class User { public String name; diff --git a/Simple_eventbus_demo/src/org/simple/eventbus/demo/fragment/BaseFragment.java b/app/src/main/java/com/android/eventbus/demo/fragment/BaseFragment.java similarity index 92% rename from Simple_eventbus_demo/src/org/simple/eventbus/demo/fragment/BaseFragment.java rename to app/src/main/java/com/android/eventbus/demo/fragment/BaseFragment.java index c99a7fe..c5eb255 100644 --- a/Simple_eventbus_demo/src/org/simple/eventbus/demo/fragment/BaseFragment.java +++ b/app/src/main/java/com/android/eventbus/demo/fragment/BaseFragment.java @@ -22,13 +22,15 @@ * THE SOFTWARE. */ -package org.simple.eventbus.demo.fragment; +package com.android.eventbus.demo.fragment; -import android.support.v4.app.Fragment; import android.util.Log; +import androidx.fragment.app.Fragment; + +import com.android.eventbus.demo.bean.User; + import org.simple.eventbus.Subscriber; -import org.simple.eventbus.demo.bean.User; /** * @author mrsimple diff --git a/Simple_eventbus_demo/src/org/simple/eventbus/demo/fragment/ConstactFragment.java b/app/src/main/java/com/android/eventbus/demo/fragment/ConstactFragment.java similarity index 95% rename from Simple_eventbus_demo/src/org/simple/eventbus/demo/fragment/ConstactFragment.java rename to app/src/main/java/com/android/eventbus/demo/fragment/ConstactFragment.java index 3d50ab6..cd01c27 100644 --- a/Simple_eventbus_demo/src/org/simple/eventbus/demo/fragment/ConstactFragment.java +++ b/app/src/main/java/com/android/eventbus/demo/fragment/ConstactFragment.java @@ -14,10 +14,9 @@ * limitations under the License. */ -package org.simple.eventbus.demo.fragment; +package com.android.eventbus.demo.fragment; import android.os.Bundle; -import android.support.v4.app.Fragment; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; @@ -28,11 +27,14 @@ import android.widget.ListView; import android.widget.Toast; +import androidx.fragment.app.Fragment; + +import com.android.eventbus.demo.R; +import com.android.eventbus.demo.bean.User; + import org.simple.eventbus.EventBus; import org.simple.eventbus.Subscriber; import org.simple.eventbus.ThreadMode; -import org.simple.eventbus.demo.R; -import org.simple.eventbus.demo.bean.User; import java.util.LinkedList; import java.util.List; @@ -122,8 +124,7 @@ private void removePersonPrivate(User person) { /** * 执行在异步线程的函数 - * - * @param event + * @param person */ @Subscriber(tag = MenuFragment.ASYNC_TAG, mode = ThreadMode.ASYNC) private void asyncMethod(final User person) { diff --git a/Simple_eventbus_demo/src/org/simple/eventbus/demo/fragment/MenuFragment.java b/app/src/main/java/com/android/eventbus/demo/fragment/MenuFragment.java similarity index 97% rename from Simple_eventbus_demo/src/org/simple/eventbus/demo/fragment/MenuFragment.java rename to app/src/main/java/com/android/eventbus/demo/fragment/MenuFragment.java index 5fe207f..ba31e97 100644 --- a/Simple_eventbus_demo/src/org/simple/eventbus/demo/fragment/MenuFragment.java +++ b/app/src/main/java/com/android/eventbus/demo/fragment/MenuFragment.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.simple.eventbus.demo.fragment; +package com.android.eventbus.demo.fragment; import android.content.Intent; import android.os.Bundle; @@ -25,13 +25,14 @@ import android.view.ViewGroup; import android.widget.TextView; +import com.android.eventbus.demo.R; +import com.android.eventbus.demo.StickyActivity; +import com.android.eventbus.demo.bean.StickyUser; +import com.android.eventbus.demo.bean.User; + import org.simple.eventbus.EventBus; import org.simple.eventbus.Subscriber; import org.simple.eventbus.ThreadMode; -import org.simple.eventbus.demo.R; -import org.simple.eventbus.demo.StickyActivity; -import org.simple.eventbus.demo.bean.StickyUser; -import org.simple.eventbus.demo.bean.User; import java.util.ArrayList; import java.util.List; diff --git a/app/src/main/res/drawable-v24/ic_launcher_foreground.xml b/app/src/main/res/drawable-v24/ic_launcher_foreground.xml new file mode 100644 index 0000000..2b068d1 --- /dev/null +++ b/app/src/main/res/drawable-v24/ic_launcher_foreground.xml @@ -0,0 +1,30 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/drawable/ic_launcher_background.xml b/app/src/main/res/drawable/ic_launcher_background.xml new file mode 100644 index 0000000..07d5da9 --- /dev/null +++ b/app/src/main/res/drawable/ic_launcher_background.xml @@ -0,0 +1,170 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Simple_eventbus_demo/res/layout/include_sticky_activity.xml b/app/src/main/res/layout/include_sticky_activity.xml similarity index 90% rename from Simple_eventbus_demo/res/layout/include_sticky_activity.xml rename to app/src/main/res/layout/include_sticky_activity.xml index e166ce5..19a8b04 100755 --- a/Simple_eventbus_demo/res/layout/include_sticky_activity.xml +++ b/app/src/main/res/layout/include_sticky_activity.xml @@ -8,7 +8,7 @@ android:id="@+id/back_btn" android:layout_width="wrap_content" android:layout_height="wrap_content" - android:src="@drawable/ic_launcher" /> + android:src="@drawable/ic_launcher_background" /> diff --git a/Simple_eventbus_demo/res/layout/menu_fragment.xml b/app/src/main/res/layout/menu_fragment.xml similarity index 100% rename from Simple_eventbus_demo/res/layout/menu_fragment.xml rename to app/src/main/res/layout/menu_fragment.xml diff --git a/Simple_eventbus_demo/res/layout/sticky_activity.xml b/app/src/main/res/layout/sticky_activity.xml similarity index 83% rename from Simple_eventbus_demo/res/layout/sticky_activity.xml rename to app/src/main/res/layout/sticky_activity.xml index 300f0e8..dd407ee 100755 --- a/Simple_eventbus_demo/res/layout/sticky_activity.xml +++ b/app/src/main/res/layout/sticky_activity.xml @@ -10,12 +10,15 @@ android:id="@+id/name_tv" android:layout_width="match_parent" android:layout_height="wrap_content" + android:layout_marginTop="120dp" + android:textSize="15pt" android:text="name" /> \ No newline at end of file diff --git a/Simple_eventbus_demo/res/layout/test_sticky_activity.xml b/app/src/main/res/layout/test_sticky_activity.xml similarity index 100% rename from Simple_eventbus_demo/res/layout/test_sticky_activity.xml rename to app/src/main/res/layout/test_sticky_activity.xml diff --git a/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml b/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml new file mode 100644 index 0000000..eca70cf --- /dev/null +++ b/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml b/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml new file mode 100644 index 0000000..eca70cf --- /dev/null +++ b/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/app/src/main/res/mipmap-anydpi-v33/ic_launcher.xml b/app/src/main/res/mipmap-anydpi-v33/ic_launcher.xml new file mode 100644 index 0000000..6f3b755 --- /dev/null +++ b/app/src/main/res/mipmap-anydpi-v33/ic_launcher.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/app/src/main/res/mipmap-hdpi/ic_launcher.webp b/app/src/main/res/mipmap-hdpi/ic_launcher.webp new file mode 100644 index 0000000..c209e78 Binary files /dev/null and b/app/src/main/res/mipmap-hdpi/ic_launcher.webp differ diff --git a/app/src/main/res/mipmap-hdpi/ic_launcher_round.webp b/app/src/main/res/mipmap-hdpi/ic_launcher_round.webp new file mode 100644 index 0000000..b2dfe3d Binary files /dev/null and b/app/src/main/res/mipmap-hdpi/ic_launcher_round.webp differ diff --git a/app/src/main/res/mipmap-mdpi/ic_launcher.webp b/app/src/main/res/mipmap-mdpi/ic_launcher.webp new file mode 100644 index 0000000..4f0f1d6 Binary files /dev/null and b/app/src/main/res/mipmap-mdpi/ic_launcher.webp differ diff --git a/app/src/main/res/mipmap-mdpi/ic_launcher_round.webp b/app/src/main/res/mipmap-mdpi/ic_launcher_round.webp new file mode 100644 index 0000000..62b611d Binary files /dev/null and b/app/src/main/res/mipmap-mdpi/ic_launcher_round.webp differ diff --git a/app/src/main/res/mipmap-xhdpi/ic_launcher.webp b/app/src/main/res/mipmap-xhdpi/ic_launcher.webp new file mode 100644 index 0000000..948a307 Binary files /dev/null and b/app/src/main/res/mipmap-xhdpi/ic_launcher.webp differ diff --git a/app/src/main/res/mipmap-xhdpi/ic_launcher_round.webp b/app/src/main/res/mipmap-xhdpi/ic_launcher_round.webp new file mode 100644 index 0000000..1b9a695 Binary files /dev/null and b/app/src/main/res/mipmap-xhdpi/ic_launcher_round.webp differ diff --git a/app/src/main/res/mipmap-xxhdpi/ic_launcher.webp b/app/src/main/res/mipmap-xxhdpi/ic_launcher.webp new file mode 100644 index 0000000..28d4b77 Binary files /dev/null and b/app/src/main/res/mipmap-xxhdpi/ic_launcher.webp differ diff --git a/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.webp b/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.webp new file mode 100644 index 0000000..9287f50 Binary files /dev/null and b/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.webp differ diff --git a/app/src/main/res/mipmap-xxxhdpi/ic_launcher.webp b/app/src/main/res/mipmap-xxxhdpi/ic_launcher.webp new file mode 100644 index 0000000..aa7d642 Binary files /dev/null and b/app/src/main/res/mipmap-xxxhdpi/ic_launcher.webp differ diff --git a/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.webp b/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.webp new file mode 100644 index 0000000..9126ae3 Binary files /dev/null and b/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.webp differ diff --git a/app/src/main/res/values-land/dimens.xml b/app/src/main/res/values-land/dimens.xml new file mode 100644 index 0000000..22d7f00 --- /dev/null +++ b/app/src/main/res/values-land/dimens.xml @@ -0,0 +1,3 @@ + + 48dp + \ No newline at end of file diff --git a/app/src/main/res/values-night/themes.xml b/app/src/main/res/values-night/themes.xml new file mode 100644 index 0000000..15e703e --- /dev/null +++ b/app/src/main/res/values-night/themes.xml @@ -0,0 +1,7 @@ + + + + \ No newline at end of file diff --git a/app/src/main/res/values-v29/themes.xml b/app/src/main/res/values-v29/themes.xml new file mode 100644 index 0000000..3981268 --- /dev/null +++ b/app/src/main/res/values-v29/themes.xml @@ -0,0 +1,9 @@ + + + + \ No newline at end of file diff --git a/app/src/main/res/values-w1240dp/dimens.xml b/app/src/main/res/values-w1240dp/dimens.xml new file mode 100644 index 0000000..d73f4a3 --- /dev/null +++ b/app/src/main/res/values-w1240dp/dimens.xml @@ -0,0 +1,3 @@ + + 200dp + \ No newline at end of file diff --git a/app/src/main/res/values-w600dp/dimens.xml b/app/src/main/res/values-w600dp/dimens.xml new file mode 100644 index 0000000..22d7f00 --- /dev/null +++ b/app/src/main/res/values-w600dp/dimens.xml @@ -0,0 +1,3 @@ + + 48dp + \ No newline at end of file diff --git a/app/src/main/res/values/colors.xml b/app/src/main/res/values/colors.xml new file mode 100644 index 0000000..c8524cd --- /dev/null +++ b/app/src/main/res/values/colors.xml @@ -0,0 +1,5 @@ + + + #FF000000 + #FFFFFFFF + \ No newline at end of file diff --git a/app/src/main/res/values/dimens.xml b/app/src/main/res/values/dimens.xml new file mode 100644 index 0000000..125df87 --- /dev/null +++ b/app/src/main/res/values/dimens.xml @@ -0,0 +1,3 @@ + + 16dp + \ No newline at end of file diff --git a/Simple_eventbus_demo/res/values/strings.xml b/app/src/main/res/values/strings.xml similarity index 100% rename from Simple_eventbus_demo/res/values/strings.xml rename to app/src/main/res/values/strings.xml diff --git a/app/src/main/res/values/themes.xml b/app/src/main/res/values/themes.xml new file mode 100644 index 0000000..36170a4 --- /dev/null +++ b/app/src/main/res/values/themes.xml @@ -0,0 +1,9 @@ + + + + +