{"id":30063,"date":"2019-11-15T02:16:00","date_gmt":"2019-11-14T17:16:00","guid":{"rendered":"https:\/\/www.charlezz.com\/?p=30063"},"modified":"2019-12-21T16:40:55","modified_gmt":"2019-12-21T07:40:55","slug":"rxjava%ec%99%80-%eb%8d%b0%ec%9d%b4%ed%84%b0-%eb%b0%94%ec%9d%b8%eb%94%a9%ec%9c%bc%eb%a1%9c-%ec%9c%a0%ed%9a%a8%ec%84%b1-%ea%b2%80%ec%82%ac%ed%95%98%ea%b8%b0","status":"publish","type":"post","link":"https:\/\/charlezz.com\/?p=30063","title":{"rendered":"RxJava\uc640 \ub370\uc774\ud130 \ubc14\uc778\ub529\uc73c\ub85c \uc720\ud6a8\uc131 \uac80\uc0ac\ud558\uae30"},"content":{"rendered":"<h1>RxJava\uc640 \ub370\uc774\ud130 \ubc14\uc778\ub529\uc73c\ub85c \uc720\ud6a8\uc131 \uac80\uc0ac\ud558\uae30<\/h1>\n<p>\ub9ce\uc740 \uc548\ub4dc\ub85c\uc774\ub4dc \uc560\ud50c\ub9ac\ucf00\uc774\uc158\uc774 \ud68c\uc6d0\uac00\uc785, \uc740\ud589, \uc1fc\ud551\ubab0 \uc8fc\ubb38 \ub4f1\uacfc \uac19\uc740 \uacf3\uc5d0\uc11c Email, \uc804\ud654\ubc88\ud638, \uc774\ub984, \ube44\ubc00\ubc88\ud638 \ub4f1\uc744 \uc0ac\uc6a9\uc790\ub85c \ubd80\ud130 \uc785\ub825 \ubc1b\ub294\ub2e4.<\/p>\n<p><a href=\"https:\/\/www.charlezz.com\/?attachment_id=30065\" rel=\"attachment wp-att-30065\"><img decoding=\"async\" loading=\"lazy\" src=\"https:\/\/www.charlezz.com\/wordpress\/wp-content\/uploads\/2019\/11\/Screenshot_20191114-233535_BAND-stage-498x1024.jpg\" alt=\"\" width=\"498\" height=\"1024\" class=\"aligncenter size-large wp-image-30065\" srcset=\"https:\/\/charlezz.com\/wordpress\/wp-content\/uploads\/2019\/11\/Screenshot_20191114-233535_BAND-stage-498x1024.jpg 498w, https:\/\/charlezz.com\/wordpress\/wp-content\/uploads\/2019\/11\/Screenshot_20191114-233535_BAND-stage-146x300.jpg 146w, https:\/\/charlezz.com\/wordpress\/wp-content\/uploads\/2019\/11\/Screenshot_20191114-233535_BAND-stage.jpg 720w\" sizes=\"(max-width: 498px) 100vw, 498px\" \/><\/a><\/p>\n<p>\uc0ac\uc6a9\uc790\uc758 \ub2e8\uc21c\ud55c \uc2e4\uc218 \ub610\ub294 \uc5b4\ubdf0\uc9d5\uc744 \ub9c9\uae30 \uc704\ud574 \uac01 \ud3fc\uc758 \uc720\ud6a8\uc131 \uac80\uc0ac\ub97c \ud574\uc57c\ud55c\ub2e4.<\/p>\n<p>\ud68c\uc6d0\uac00\uc785\uc744 \uc608\ub85c\ub4e4\uc5c8\uc744 \ub54c \uc720\ud6a8\uc131 \uac80\uc0ac\ub97c \ud558\ub294 \uc2dc\uc810\uc744 \ub2e4\uc74c\uc911 \ud558\ub098\ub97c \ud0dd\ud560 \uc218 \uc788\ub2e4.<\/p>\n<ul>\n<li>\ud68c\uc6d0 \uac00\uc785 \ubc84\ud2bc\uc744 \ub20c\ub800\uc744 \ub54c \ubaa8\ub4e0 \ud544\ub4dc\uc5d0 \ub300\ud55c \uc720\ud6a8\uc131\uc744 \uccb4\ud06c\ud55c\ub2e4.\u00a0<\/li>\n<li>\ud558\ub098\uc758 \ud544\ub4dc\uc5d0 \ub300\ud574 \ub3c5\ub9bd\uc801\uc73c\ub85c \uc720\ud6a8\uc131\uc744 \uac80\uc0ac\ud558\ub294 \ubc84\ud2bc\uc744 \ucd94\uac00\ud55c\ub2e4. \uc608) \uc911\ubcf5 \uc544\uc774\ub514 \uccb4\ud06c<\/li>\n<li>\ubaa8\ub4e0 \ud544\ub4dc\uc5d0 \ub300\ud574 \uc2e4\uc2dc\uac04\uc73c\ub85c \uc720\ud6a8\uc131 \uac80\uc0ac\ub97c \ud55c\ub2e4.<\/li>\n<\/ul>\n<p>\uc774 \uae00\uc5d0\uc11c\ub294 3\ubc88\uc9f8 \ubc29\ubc95\uc744 \uc0ac\uc6a9\ud55c \uc608\uc81c\ub97c \ub2e4\ub8f0 \uac83\uc774\ub2e4.<\/p>\n<p>\uc0ac\uc6a9\uc790 \uc774\ub984\uc744 \uc785\ub825\ubc1b\uace0 \uc774\ub984\uc774 \uc785\ub825\ub41c \uacbd\uc6b0 \uccb4\ud06c\ubaa8\uc591\uc758 \uc774\ubbf8\uc9c0\ub97c \ub098\ud0c0\ub0b4\ub294 \uc560\ud50c\ub9ac\ucf00\uc774\uc158\uc788\ub2e4\uace0 \uc0c1\uc0c1\ud574\ubcf4\uc790. \uc0ac\uc6a9\uc790\uc5d0\uac8c \uc785\ub825\ubc1b\uc740 \uc774\ub984\uc744 \uc2e4\uc2dc\uac04\uc73c\ub85c \ucc98\ub9ac\ud558\uae30 \uc704\ud574\uc11c \uc591\ubc29\ud5a5 \ubc14\uc778\ub529\uc744 \uad6c\ud604\ud558\uace0 \uc774\ub97c BehaviorSubject\ub85c \ubc1c\ud589\ud558\uc5ec \uc720\ud6a8\uc131\uac80\uc0ac\ub97c \ud55c \ub4a4 \uacb0\uacfc\uac12\uc744 \uad6c\ub3c5\ud558\uc5ec UI \ub97c \uac31\uc2e0\ud55c\ub2e4.\u00a0<\/p>\n<p><a href=\"https:\/\/www.charlezz.com\/?attachment_id=30187\" rel=\"attachment wp-att-30187\"><img decoding=\"async\" loading=\"lazy\" src=\"https:\/\/www.charlezz.com\/wordpress\/wp-content\/uploads\/2019\/11\/Untitled-Diagram-1.png\" alt=\"\" width=\"631\" height=\"387\" class=\"aligncenter size-full wp-image-30187\" srcset=\"https:\/\/charlezz.com\/wordpress\/wp-content\/uploads\/2019\/11\/Untitled-Diagram-1.png 631w, https:\/\/charlezz.com\/wordpress\/wp-content\/uploads\/2019\/11\/Untitled-Diagram-1-300x184.png 300w\" sizes=\"(max-width: 631px) 100vw, 631px\" \/><\/a><\/p>\n<p>&nbsp;<\/p>\n<p>\uc704\uc758 \ud50c\ub85c\uc6b0 \ucc28\ud2b8\ub97c \uad6c\ud604\ud55c \ucf54\ub4dc\ub294 \ub2e4\uc74c\uacfc \uac19\ub2e4.<\/p>\n<pre class=\"lang:xhtml decode:true\">&lt;?xml version=\"1.0\" encoding=\"utf-8\"?&gt;\r\n&lt;layout&gt;\r\n    &lt;data&gt;\r\n        &lt;import type=\"android.view.View\"\/&gt;\r\n        &lt;variable\r\n            name=\"viewModel\"\r\n            type=\"com.charlezz.rxvalidation.MainViewModel\" \/&gt;\r\n    &lt;\/data&gt;\r\n        ...\r\n        &lt;EditText\r\n            android:layout_width=\"0dp\"\r\n            android:layout_height=\"wrap_content\"\r\n            android:layout_weight=\"1\"\r\n            android:hint=\"Your name\"\r\n            android:text=\"@={viewModel.name}\" \/&gt;\r\n\r\n        &lt;ImageView\r\n            android:layout_width=\"wrap_content\"\r\n            android:layout_height=\"wrap_content\"\r\n            android:src=\"@drawable\/baseline_done_black_18dp\"\r\n            android:visibility=\"@{viewModel.nameValid? View.VISIBLE: View.GONE}\"\r\n            \/&gt;\r\n        ...\r\n&lt;\/layout&gt;<\/pre>\n<pre class=\"lang:java decode:true\">public class MainViewModel extends AndroidViewModel {\r\n    public static final String TAG = MainViewModel.class.getSimpleName();\r\n\r\n    private final BehaviorSubject&lt;String&gt; name = BehaviorSubject.createDefault(\"Charles\");\r\n\r\n    private final MutableLiveData&lt;Boolean&gt; nameValid = new InitMutableLiveData&lt;&gt;(false);\r\n    \r\n    private final CompositeDisposable disposables = new CompositeDisposable();\r\n\r\n    public MainViewModel(Application application) {\r\n        super(application);\r\n        disposables.add(getNameValidator().subscribe(nameValid::postValue));\r\n    }\r\n\r\n    public String getName() {\r\n        return name.getValue();\r\n    }\r\n\r\n    public void setName(String name) {\r\n        this.name.onNext(name);\r\n    }\r\n\r\n    private Observable&lt;Boolean&gt; getNameValidator() {\r\n        return name.map(str-&gt;{\r\n            return !TextUtils.isEmpty(str);\r\n        });\r\n    }\r\n\r\n    public MutableLiveData&lt;Boolean&gt; getNameValid() {\r\n        return nameValid;\r\n    }\r\n\r\n    public MutableLiveData&lt;Boolean&gt; getEmailValid() {\r\n        return emailValid;\r\n    }\r\n\r\n}\r\n<\/pre>\n<pre class=\"lang:java decode:true \">public class MainActivity extends AppCompatActivity {\r\n\r\n    private MainViewModel viewModel;\r\n    private ActivityMainBinding binding;\r\n    @Override\r\n    protected void onCreate(Bundle savedInstanceState) {\r\n        super.onCreate(savedInstanceState);\r\n        viewModel = ViewModelProviders.of(this).get(MainViewModel.class);\r\n        binding = DataBindingUtil.setContentView(this, R.layout.activity_main);\r\n        binding.setLifecycleOwner(this);\r\n        binding.setViewModel(viewModel);\r\n\r\n    }\r\n}\r\n<\/pre>\n<p>\ud544\ub4dc\uac00 \uc5ec\ub7ec\uac1c\uc778 \uacbd\uc6b0 \ubaa8\ub4e0 \ud544\ub4dc\ub97c \uc720\ud6a8\uc131 \uac80\uc0ac\ub97c \ud1b5\ud569\uc801\uc73c\ub85c \ud558\uae30 \uc704\ud574 combineLatest \uc5f0\uc0b0\uc790\ub97c \uc774\uc6a9\ud560 \uc218 \uc788\ub2e4. \uc544\ub798\uc758 \ube44\ub514\uc624\ub97c \ud655\uc778\ud558\uba74 \ubaa8\ub4e0 \ud544\ub4dc\uac00 \uc720\ud6a8\ud560 \ub54c SIGN UP \ubc84\ud2bc\uc774 \ud65c\uc131\ud654 \ub418\ub294\uac83\uc744 \ud655\uc778\ud560 \uc218 \uc788\ub2e4.<\/p>\n<p><iframe loading=\"lazy\" width=\"560\" height=\"315\" src=\"https:\/\/www.youtube.com\/embed\/Jj7x3txbMBc\" frameborder=\"0\" allow=\"accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture\" allowfullscreen=\"allowfullscreen\"><\/iframe><\/p>\n<p>\uc704 \uc608\uc81c\uc758 \uc804\uccb4\ucf54\ub4dc\ub294 <a href=\"https:\/\/github.com\/Charlezz\/RxValidation\">github<\/a>\uc5d0\uc11c \ud655\uc778\ud560 \uc218 \uc788\ub2e4.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>RxJava\uc640 \ub370\uc774\ud130 \ubc14\uc778\ub529\uc73c\ub85c \uc720\ud6a8\uc131 \uac80\uc0ac\ud558\uae30 \ub9ce\uc740 \uc548\ub4dc\ub85c\uc774\ub4dc \uc560\ud50c\ub9ac\ucf00\uc774\uc158\uc774 \ud68c\uc6d0\uac00\uc785, \uc740\ud589, \uc1fc\ud551\ubab0 \uc8fc\ubb38 \ub4f1\uacfc \uac19\uc740 \uacf3\uc5d0\uc11c Email, \uc804\ud654\ubc88\ud638, \uc774\ub984, \ube44\ubc00\ubc88\ud638 \ub4f1\uc744 \uc0ac\uc6a9\uc790\ub85c \ubd80\ud130 \uc785\ub825 \ubc1b\ub294\ub2e4. \uc0ac\uc6a9\uc790\uc758 \ub2e8\uc21c\ud55c \uc2e4\uc218 \ub610\ub294 \uc5b4\ubdf0\uc9d5\uc744 \ub9c9\uae30 \uc704\ud574 \uac01 \ud3fc\uc758 \uc720\ud6a8\uc131 \uac80\uc0ac\ub97c \ud574\uc57c\ud55c\ub2e4. \ud68c\uc6d0\uac00\uc785\uc744 \uc608\ub85c\ub4e4\uc5c8\uc744 \ub54c \uc720\ud6a8\uc131 \uac80\uc0ac\ub97c \ud558\ub294 \uc2dc\uc810\uc744 \ub2e4\uc74c\uc911 \ud558\ub098\ub97c \ud0dd\ud560 \uc218 \uc788\ub2e4. \ud68c\uc6d0 \uac00\uc785 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"om_disable_all_campaigns":false,"inline_featured_image":false,"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0},"categories":[7],"tags":[],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/charlezz.com\/index.php?rest_route=\/wp\/v2\/posts\/30063"}],"collection":[{"href":"https:\/\/charlezz.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/charlezz.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/charlezz.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/charlezz.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=30063"}],"version-history":[{"count":6,"href":"https:\/\/charlezz.com\/index.php?rest_route=\/wp\/v2\/posts\/30063\/revisions"}],"predecessor-version":[{"id":43756,"href":"https:\/\/charlezz.com\/index.php?rest_route=\/wp\/v2\/posts\/30063\/revisions\/43756"}],"wp:attachment":[{"href":"https:\/\/charlezz.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=30063"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/charlezz.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=30063"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/charlezz.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=30063"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}