Skip to content

Commit

Permalink
perf(内在实现改变): 删除了 withFragment 方法,统一改为 with 方法,不兼容改动
Browse files Browse the repository at this point in the history
删除了 withFragment 方法,统一改为 with 方法,不兼容改动

BREAKING CHANGE: 删除了 withFragment 方法,统一改为 with 方法,不兼容改动
  • Loading branch information
xiaojinzi123 committed Apr 3, 2019
1 parent 3448196 commit 5e9b265
Show file tree
Hide file tree
Showing 10 changed files with 12 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
*
* @return
*/
Class[] value() default {};
Class[] value();

/**
* 是否是单例,默认是单例模式的
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ public static Builder with(@NonNull Context context) {
* @param fragment
* @return
*/
public static Builder withFragment(@NonNull Fragment fragment) {
public static Builder with(@NonNull Fragment fragment) {
return new Builder(fragment);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@

import io.reactivex.Single;

@ServiceAnno(value = {Component1Service.class})
//@ServiceAnno(value = {Component1Service.class})
@ServiceAnno(Component1Service.class)
public class Component1ServiceImpl implements Component1Service {

private Random r = new Random();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public void onClick(View v) {
@Override
public void onClick(View v) {
RxRouter
.withFragment(Component1Fragment.this)
.with(Component1Fragment.this)
.host(ModuleConfig.Module1.NAME)
.path(ModuleConfig.Module1.TEST)
.query("data", "rxJumpGetData")
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:roundIcon="@mipmap/app_icon"
android:supportsRtl="true"
android:theme="@style/AppTheme">
<activity android:name="com.xiaojinzi.componentdemo.view.module1.TestInOtherModuleAct"></activity>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ private void addInfo(@Nullable RouterResult routerResult, @Nullable Throwable er

private void rxJumpGetData(){
RxRouter
.withFragment(this)
.with(this)
.host("component1")
.path("test")
.query("data", "rxJumpGetData")
Expand Down Expand Up @@ -123,7 +123,7 @@ public void onError(@NonNull RouterErrorResult errorResult) {

public void testCallbackAfterFinish() {
RxRouter
.withFragment(this)
.with(this)
.host(ModuleConfig.System.NAME)
.path(ModuleConfig.System.CALL_PHONE)
.putString("tel", "xxx")
Expand All @@ -145,7 +145,7 @@ public void onCancel(@NonNull RouterRequest request) {

public void testCallbackAfterFinishActivity() {
RxRouter
.withFragment(this)
.with(this)
.host(ModuleConfig.System.NAME)
.path(ModuleConfig.System.CALL_PHONE)
.putString("tel", "xxx")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -909,7 +909,7 @@ public void subscribe(CompletableEmitter emitter) throws Exception {
return;
}

RxRouter.withFragment(innerFragment)
RxRouter.with(innerFragment)
.host(ModuleConfig.Module1.NAME)
.path(ModuleConfig.Module1.TEST_AUTORETURN)
.requestCode(123)
Expand Down
Binary file added app/src/main/res/mipmap-xxxhdpi/app_icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
<resources>
<string name="app_name">ComponentDemo</string>
<string name="app_name">组件化</string>
</resources>
2 changes: 1 addition & 1 deletion dependencies.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ ext.versions = [
rxjava : "2.2.8",
rxandroid : "2.1.1",
rxbinding : "2.2.0",
component_version : "1.2.2"
component_version : "1.3"
]

ext.libs = [
Expand Down

0 comments on commit 5e9b265

Please sign in to comment.