-
Notifications
You must be signed in to change notification settings - Fork 58
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
Showing
22 changed files
with
98 additions
and
38 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
25 changes: 25 additions & 0 deletions
25
app/src/main/java/net/lishaoy/android_ctrip/service/MethodChannelServiceImp.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,25 @@ | ||
package net.lishaoy.android_ctrip.service; | ||
|
||
|
||
import android.content.Context; | ||
import android.util.Log; | ||
|
||
import com.alibaba.android.arouter.facade.annotation.Route; | ||
|
||
import net.lishaoy.android_ctrip.channel.MethodChannelPlugin; | ||
import net.lishaoy.lib_base.app.service.MethodChannelService; | ||
|
||
import io.flutter.view.FlutterView; | ||
|
||
@Route(path = "/app/MethodChannel") | ||
public class MethodChannelServiceImp implements MethodChannelService { | ||
@Override | ||
public void registerWith(FlutterView flutterView) { | ||
MethodChannelPlugin.registerWith(flutterView); | ||
} | ||
|
||
@Override | ||
public void init(Context context) { | ||
Log.i(MethodChannelServiceImp.class.getSimpleName(),"init"); | ||
} | ||
} |
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
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
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
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
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
9 changes: 9 additions & 0 deletions
9
lib_base/src/main/java/net/lishaoy/lib_base/app/service/MethodChannelService.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,9 @@ | ||
package net.lishaoy.lib_base.app.service; | ||
|
||
import com.alibaba.android.arouter.facade.template.IProvider; | ||
|
||
import io.flutter.view.FlutterView; | ||
|
||
public interface MethodChannelService extends IProvider { | ||
void registerWith(FlutterView flutterView); | ||
} |
35 changes: 35 additions & 0 deletions
35
lib_base/src/main/java/net/lishaoy/lib_base/app/service/wrapper/MethodChannelImpl.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,35 @@ | ||
package net.lishaoy.lib_base.app.service.wrapper; | ||
|
||
import com.alibaba.android.arouter.facade.annotation.Autowired; | ||
import com.alibaba.android.arouter.launcher.ARouter; | ||
|
||
import net.lishaoy.lib_base.app.service.MethodChannelService; | ||
|
||
import io.flutter.view.FlutterView; | ||
|
||
public class MethodChannelImpl { | ||
@Autowired(name = "/app/MethodChannel") | ||
protected MethodChannelService methodChannelService; | ||
|
||
private static MethodChannelImpl methodChannel = null; | ||
|
||
public static MethodChannelImpl getInstance() { | ||
if (methodChannel == null) { | ||
synchronized (MethodChannelImpl.class) { | ||
if (methodChannel == null) { | ||
methodChannel = new MethodChannelImpl(); | ||
} | ||
} | ||
} | ||
|
||
return methodChannel; | ||
} | ||
|
||
private MethodChannelImpl() { | ||
ARouter.getInstance().inject(this); | ||
} | ||
|
||
public void registerWith(FlutterView flutterView) { | ||
methodChannelService.registerWith(flutterView); | ||
} | ||
} |
2 changes: 1 addition & 1 deletion
2
...base/lib_home/service/WebViewService.java → ...e/lib_webview/service/WebViewService.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
4 changes: 2 additions & 2 deletions
4
...lib_home/service/wrapper/WebViewImpl.java → ..._webview/service/wrapper/WebViewImpl.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
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