• Stars
    star
    135
  • Rank 269,297 (Top 6 %)
  • Language
    Java
  • License
    Apache License 2.0
  • Created over 8 years ago
  • Updated over 8 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

更好的管理线程间跳转的库

ObservableScheduler

Download

你的app是不是经常做一些很耗费是工作,但这些工作都是在主线程完成的,因为开线程然后回调主线程很麻烦的说。当然,我们可以用RxJava轻松实现, 但是如果你的项目没有集成RxJava怎么办,集成进去? 如果集成RxJava只为做这些事岂不是太浪费了。你最好集成RxAndroid,RxBus,RxLifecycle,RxBinding 是不是感觉要改架构了😂

ObservableScheduler 最主要的目的就是轻松的帮你在子线程和主线程之间做转换, 项目的思想来自RxJava,代码很有可能也是模仿RxJava,没关系,人家牛我们就得模仿。

##Demo:

##示例代码:

JObservable.create(new JObservable.OnSubscribe<List<Bitmap>>() {
            @Override
            public void call(SubscribeManager<List<Bitmap>> mSubscriber) {
                try {
                    //TODO... 
                    mSubscriber.notifyData(bitmaps);
                } catch (Exception e) {
                    mSubscriber.error(e);
                }
            }
        }).workedOn(Schedules.background())
                .subscribeOn(Schedules.mainThread())
                .subscribe(new Subscriber<List<Bitmap>>() {
                    @Override
                    public void notifyData(List<Bitmap> strings) {
                      //TODO... 
                    }
                    @Override
                    public void error(Throwable t) {
                      //TODO... 
                    }
                });

##用法: ###第一步: gradle:

compile 'com.jiang.android.observablescheduler:schedule:1.0.1'

Maven:

<dependency>
  <groupId>com.jiang.android.observablescheduler</groupId>
  <artifactId>schedule</artifactId>
  <version>1.0.1</version>
  <type>pom</type>
</dependency>

###第二步:

阅读Wiki

License

Copyright 2016 NewTab

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.

More Repositories

1

awesome-android-tips

some code tips for android 💯
2,541
star
2

IndexRecyclerView

[DEPRECATED] a Contact list implements by RecyclerView
Java
1,157
star
3

Awesome-RecyclerView-LayoutManager

RecyclerView-LayoutManager Resources
1,085
star
4

RxJavaApp

学习RxJava操作符的APP,新增RxJava2.x介绍
Java
1,045
star
5

awesome-androidstudio-plugins

收集Android studio 常用的插件
657
star
6

IndicatorDialog

a dialog with arrow indicator in the location where you want
Java
485
star
7

CProgressButton

a circle progress button like iOS
Java
385
star
8

chrome-plugin-recommand

chrome-plugin-recommand 程序员必备的那些Chrome插件
JavaScript
296
star
9

flutter_code

b站视频教程: https://space.bilibili.com/480410119/
Dart
288
star
10

AndroidPush

[DEPRECATED] 更方便的将各个rom厂商自己的推送服务进行集成,并统一管理
Java
231
star
11

ProgressView

用于展示注册进度的view
Java
175
star
12

ZhiHu-TopAnswer

DEPRECATED 解析已经失效,不再维护
Java
140
star
13

DragView2Fill

ViewDragHelper结合RecyclerView的使用示例
Java
104
star
14

ReSend-SMS

将手机接收到的短信以邮件的形式发送至指定邮箱
Java
97
star
15

SortList

Android通讯录实现排序以及顶部悬浮窗
Java
88
star
16

TranslateToast

翻译助手 一步步提升英语能力
Java
87
star
17

ScalingIndicator

可对文字进行放大缩小和展示未读提示的PageIndicator
Java
85
star
18

ScalableTabIndicator

可定制的ViewPagerIndicator,当然不通过ViewPager也可以用
Java
58
star
19

ViewPagerTransformer

ViewPagerTransformer
Java
39
star
20

flutter_bloc_architecture_demo

flutter使用BLoC模式,配合rxdart和dio来进行网络请求
Dart
32
star
21

flutter_hotpatch

Android端flutter资源和代码的热更新,实验性项目,勿用于生产环境
Java
20
star
22

Kotlin-Extract

Kotlin-Extract
Kotlin
16
star
23

FloatActionView

Android悬浮操作按钮
Java
11
star
24

notify_inapp

show custom in-app notification with any Widgets in flutter
C++
5
star
25

pub_server

Self-hosted private Dart Pub server for Enterprise
Dart
5
star
26

flutter_advanced_seekbar

flutter_advanced_seekbar
Dart
4
star
27

route_lifecycle

a new way to manage routes lifecycle.
Dart
4
star
28

jiang111.github.io

JavaScript
2
star
29

json_conversion

dart中Json序列化全局统一解析
Dart
2
star
30

flutter_starter

a flutter template base on myself project
Dart
1
star
31

flutter_pub_web

Dart
1
star
32

jiang111

Shell
1
star