鸿蒙开源工具包——RxJava 包

jacksky
发布于 2021-12-20 18:17
浏览
0收藏

RxBinding

用于 OpenHarmonyOS  UI 小部件 的 RxJava 绑定 API 

Usage

方案1:

本地har包集成

1.将har包添加到lib文件夹。2.将以下代码添加到条目的Gradle:

implementation fileTree(dir: 'libs', include: ['.jar', '.har'])

方案2

allprojects{
    repositories{
        mavenCentral()
    }
}
implementation 'io.openharmony.tpc.thirdlib:RxBinding:1.0.2'

 

entry运行要求

通过DevEco studio,并下载OpenHarmonySDK 将项目中的build.gradle文件中dependencies→classpath版本改为对应的版本(即你的IDE新建项目中所用的版本)

 

用例

Component view = root.findComponentById(ResourceTable.Id_component);
        RxComponent.clicks(view).subscribe(new Consumer<Object>() {
            @Override
            public void accept(Object o) throws Throwable {
                System.out.println("the component is clicked");
            }
        });

 

License

Copyright (C) 2015 Jake Wharton

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.

RxBinding-master.zip 162.5K 4次下载
已于2021-12-20 18:17:28修改
收藏
回复
举报
回复
    相关推荐