Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
C
clx-fluwx
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
openSourceLibrary
clx-fluwx
Commits
1f64e8f4
提交
1f64e8f4
authored
10月 19, 2018
作者:
JarvanMo
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
some handlers no longer singleton
上级
862043a1
显示空白字符变更
内嵌
并排
正在显示
5 个修改的文件
包含
19 行增加
和
13 行删除
+19
-13
FluwxPlugin.kt
android/src/main/kotlin/com/jarvan/fluwx/FluwxPlugin.kt
+14
-7
FluwxAuthHandler.kt
.../main/kotlin/com/jarvan/fluwx/handler/FluwxAuthHandler.kt
+1
-1
FluwxPayHandler.kt
...c/main/kotlin/com/jarvan/fluwx/handler/FluwxPayHandler.kt
+1
-1
FluwxResponseHandler.kt
...n/kotlin/com/jarvan/fluwx/handler/FluwxResponseHandler.kt
+0
-1
FluwxShareHandler.kt
...main/kotlin/com/jarvan/fluwx/handler/FluwxShareHandler.kt
+3
-3
没有找到文件。
android/src/main/kotlin/com/jarvan/fluwx/FluwxPlugin.kt
浏览文件 @
1f64e8f4
...
@@ -24,19 +24,26 @@ import io.flutter.plugin.common.MethodChannel.MethodCallHandler
...
@@ -24,19 +24,26 @@ import io.flutter.plugin.common.MethodChannel.MethodCallHandler
import
io.flutter.plugin.common.MethodChannel.Result
import
io.flutter.plugin.common.MethodChannel.Result
import
io.flutter.plugin.common.PluginRegistry.Registrar
import
io.flutter.plugin.common.PluginRegistry.Registrar
class
FluwxPlugin
(
private
va
r
registrar
:
Registrar
)
:
MethodCallHandler
{
class
FluwxPlugin
(
private
va
l
registrar
:
Registrar
,
private
val
channel
:
MethodChannel
)
:
MethodCallHandler
{
companion
object
{
companion
object
{
@JvmStatic
@JvmStatic
fun
registerWith
(
registrar
:
Registrar
):
Unit
{
fun
registerWith
(
registrar
:
Registrar
):
Unit
{
val
channel
=
MethodChannel
(
registrar
.
messenger
(),
"com.jarvanmo/fluwx"
)
val
channel
=
MethodChannel
(
registrar
.
messenger
(),
"com.jarvanmo/fluwx"
)
WXAPiHandler
.
setRegistrar
(
registrar
)
WXAPiHandler
.
setRegistrar
(
registrar
)
FluwxShareHandler
.
setRegistrar
(
registrar
)
FluwxShareHandler
.
setMethodChannel
(
channel
)
FluwxResponseHandler
.
setMethodChannel
(
channel
)
FluwxResponseHandler
.
setMethodChannel
(
channel
)
channel
.
setMethodCallHandler
(
FluwxPlugin
(
registrar
))
channel
.
setMethodCallHandler
(
FluwxPlugin
(
registrar
,
channel
))
}
}
}
}
private
val
fluwxShareHandler
=
FluwxShareHandler
()
private
val
fluwxAuthHandler
=
FluwxAuthHandler
()
private
val
fluwxPayHandler
=
FluwxPayHandler
()
init
{
fluwxShareHandler
.
setRegistrar
(
registrar
)
fluwxShareHandler
.
setMethodChannel
(
channel
)
}
override
fun
onMethodCall
(
call
:
MethodCall
,
result
:
Result
):
Unit
{
override
fun
onMethodCall
(
call
:
MethodCall
,
result
:
Result
):
Unit
{
if
(
call
.
method
==
WeChatPluginMethods
.
REGISTER_APP
)
{
if
(
call
.
method
==
WeChatPluginMethods
.
REGISTER_APP
)
{
WXAPiHandler
.
registerApp
(
call
,
result
)
WXAPiHandler
.
registerApp
(
call
,
result
)
...
@@ -56,17 +63,17 @@ class FluwxPlugin(private var registrar: Registrar) : MethodCallHandler {
...
@@ -56,17 +63,17 @@ class FluwxPlugin(private var registrar: Registrar) : MethodCallHandler {
}
}
if
(
"sendAuth"
==
call
.
method
)
{
if
(
"sendAuth"
==
call
.
method
)
{
F
luwxAuthHandler
.
sendAuth
(
call
,
result
)
f
luwxAuthHandler
.
sendAuth
(
call
,
result
)
return
return
}
}
if
(
call
.
method
==
WeChatPluginMethods
.
PAY
)
{
if
(
call
.
method
==
WeChatPluginMethods
.
PAY
)
{
F
luwxPayHandler
.
pay
(
call
,
result
)
f
luwxPayHandler
.
pay
(
call
,
result
)
return
return
}
}
if
(
call
.
method
.
startsWith
(
"share"
))
{
if
(
call
.
method
.
startsWith
(
"share"
))
{
F
luwxShareHandler
.
handle
(
call
,
result
)
f
luwxShareHandler
.
handle
(
call
,
result
)
}
else
{
}
else
{
result
.
notImplemented
()
result
.
notImplemented
()
}
}
...
...
android/src/main/kotlin/com/jarvan/fluwx/handler/FluwxAuthHandler.kt
浏览文件 @
1f64e8f4
...
@@ -20,7 +20,7 @@ import com.tencent.mm.opensdk.modelmsg.SendAuth
...
@@ -20,7 +20,7 @@ import com.tencent.mm.opensdk.modelmsg.SendAuth
import
io.flutter.plugin.common.MethodCall
import
io.flutter.plugin.common.MethodCall
import
io.flutter.plugin.common.MethodChannel
import
io.flutter.plugin.common.MethodChannel
internal
object
FluwxAuthHandler
{
internal
class
FluwxAuthHandler
{
fun
sendAuth
(
call
:
MethodCall
,
result
:
MethodChannel
.
Result
)
{
fun
sendAuth
(
call
:
MethodCall
,
result
:
MethodChannel
.
Result
)
{
val
req
=
SendAuth
.
Req
()
val
req
=
SendAuth
.
Req
()
...
...
android/src/main/kotlin/com/jarvan/fluwx/handler/FluwxPayHandler.kt
浏览文件 @
1f64e8f4
...
@@ -22,7 +22,7 @@ import com.tencent.mm.opensdk.openapi.WXAPIFactory
...
@@ -22,7 +22,7 @@ import com.tencent.mm.opensdk.openapi.WXAPIFactory
import
io.flutter.plugin.common.MethodCall
import
io.flutter.plugin.common.MethodCall
import
io.flutter.plugin.common.MethodChannel
import
io.flutter.plugin.common.MethodChannel
object
FluwxPayHandler
{
class
FluwxPayHandler
{
fun
pay
(
call
:
MethodCall
,
result
:
MethodChannel
.
Result
)
{
fun
pay
(
call
:
MethodCall
,
result
:
MethodChannel
.
Result
)
{
...
...
android/src/main/kotlin/com/jarvan/fluwx/handler/FluwxResponseHandler.kt
浏览文件 @
1f64e8f4
...
@@ -15,7 +15,6 @@
...
@@ -15,7 +15,6 @@
*/
*/
package
com.jarvan.fluwx.handler
package
com.jarvan.fluwx.handler
import
android.util.Log
import
com.jarvan.fluwx.constant.WeChatPluginMethods
import
com.jarvan.fluwx.constant.WeChatPluginMethods
import
com.jarvan.fluwx.constant.WechatPluginKeys
import
com.jarvan.fluwx.constant.WechatPluginKeys
import
com.tencent.mm.opensdk.modelbase.BaseResp
import
com.tencent.mm.opensdk.modelbase.BaseResp
...
...
android/src/main/kotlin/com/jarvan/fluwx/handler/FluwxShareHandler.kt
浏览文件 @
1f64e8f4
...
@@ -33,7 +33,7 @@ import kotlinx.coroutines.experimental.android.UI
...
@@ -33,7 +33,7 @@ import kotlinx.coroutines.experimental.android.UI
* 冷风如刀,以大地为砧板,视众生为鱼肉。
* 冷风如刀,以大地为砧板,视众生为鱼肉。
* 万里飞雪,将穹苍作烘炉,熔万物为白银。
* 万里飞雪,将穹苍作烘炉,熔万物为白银。
**/
**/
internal
object
FluwxShareHandler
{
internal
class
FluwxShareHandler
{
private
var
channel
:
MethodChannel
?
=
null
private
var
channel
:
MethodChannel
?
=
null
...
@@ -42,12 +42,12 @@ internal object FluwxShareHandler {
...
@@ -42,12 +42,12 @@ internal object FluwxShareHandler {
fun
setMethodChannel
(
channel
:
MethodChannel
)
{
fun
setMethodChannel
(
channel
:
MethodChannel
)
{
FluwxShareHandler
.
channel
=
channel
this
.
channel
=
channel
}
}
fun
setRegistrar
(
registrar
:
PluginRegistry
.
Registrar
)
{
fun
setRegistrar
(
registrar
:
PluginRegistry
.
Registrar
)
{
FluwxShareHandler
.
registrar
=
registrar
this
.
registrar
=
registrar
}
}
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论