Skip to content

Commit 8376f8c

Browse files
committedNov 20, 2018
Remove v4 Fragment compat logic
1 parent 41ab27d commit 8376f8c

File tree

6 files changed

+1
-47
lines changed

6 files changed

+1
-47
lines changed
 

‎router-api/build.gradle

-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@ android {
3535
dependencies {
3636
api fileTree(include: ['*.jar'], dir: 'libs')
3737
api project(':router-anno')
38-
compileOnly 'com.android.support:support-v4:28.0.0'
3938
}
4039

4140
apply from: '../javadoc.gradle'

‎router-api/src/main/java/com/lzh/nonview/router/launcher/ActivityLauncher.java

-7
Original file line numberDiff line numberDiff line change
@@ -43,11 +43,4 @@ public abstract class ActivityLauncher extends Launcher{
4343
* @throws Exception a error occurs
4444
*/
4545
public abstract void open(Fragment fragment) throws Exception;
46-
47-
/**
48-
* The launch method for Support-v4 Fragment: {@link android.support.v4.app.Fragment#startActivityForResult(Intent, int)}
49-
* @param fragment The fragment instance
50-
* @throws Exception a error occurs
51-
*/
52-
public void open(android.support.v4.app.Fragment fragment) throws Exception {}
5346
}

‎router-api/src/main/java/com/lzh/nonview/router/launcher/DefaultActivityLauncher.java

-13
Original file line numberDiff line numberDiff line change
@@ -53,19 +53,6 @@ public void open(Fragment fragment) {
5353
}
5454
}
5555

56-
@Override
57-
public void open(android.support.v4.app.Fragment fragment) {
58-
if (resumeContext != null) {
59-
open(resumeContext);
60-
} else if (resultCallback != null) {
61-
open(fragment.getActivity());
62-
} else {
63-
Intent intent = createIntent(fragment.getActivity());
64-
fragment.startActivityForResult(intent, extras.getRequestCode());
65-
overridePendingTransition(fragment.getActivity(), extras);
66-
}
67-
}
68-
6956
@Override
7057
public void open(Context context) {
7158
Activity resume = resumeContext;

‎router-api/src/main/java/com/lzh/nonview/router/route/ActivityRoute.java

-14
Original file line numberDiff line numberDiff line change
@@ -87,20 +87,6 @@ public void open(Fragment fragment) {
8787
callback.invoke(fragment.getActivity());
8888
}
8989

90-
@Override
91-
public void open(android.support.v4.app.Fragment fragment) {
92-
try {
93-
Utils.checkInterceptor(uri, callback.getExtras(), fragment.getActivity(), getInterceptors());
94-
ActivityLauncher activityLauncher = (ActivityLauncher) launcher;
95-
activityLauncher.set(uri, bundle, callback.getExtras(), routeRule, remote);
96-
activityLauncher.open(fragment);
97-
callback.onOpenSuccess(routeRule);
98-
} catch (Throwable e) {
99-
callback.onOpenFailed(e);
100-
}
101-
callback.invoke(fragment.getActivity());
102-
}
103-
10490
@Override
10591
protected Launcher obtainLauncher() throws Exception{
10692
ActivityRouteRule rule = (ActivityRouteRule) routeRule;

‎router-api/src/main/java/com/lzh/nonview/router/route/IActivityRoute.java

-11
Original file line numberDiff line numberDiff line change
@@ -71,12 +71,6 @@ public interface IActivityRoute extends IBaseRoute<IActivityRoute> {
7171
*/
7272
void open(Fragment fragment);
7373

74-
/**
75-
* Launch ronting by {@link android.support.v4.app.Fragment}
76-
* @param fragment the fragment to startActivity
77-
*/
78-
void open(android.support.v4.app.Fragment fragment);
79-
8074
class EmptyActivityRoute extends EmptyBaseRoute<IActivityRoute> implements IActivityRoute {
8175

8276
public EmptyActivityRoute(InternalCallback internal) {
@@ -124,10 +118,5 @@ public IActivityRoute addFlags(int flag) {
124118
public void open(Fragment fragment) {
125119
internal.invoke(fragment.getActivity());
126120
}
127-
128-
@Override
129-
public void open(android.support.v4.app.Fragment fragment) {
130-
internal.invoke(fragment.getActivity());
131-
}
132121
}
133122
}

‎sample/build.gradle

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ android {
2828
}
2929

3030
def parceler_version="1.4.0"
31-
def router_version="2.8.4"
31+
def router_version="41ab27dd4f"
3232
def butterknife_version='8.0.1'
3333
dependencies {
3434
api fileTree(include: ['*.jar'], dir: 'libs')

0 commit comments

Comments
 (0)
Failed to load comments.