ü\Óü¿Æ¼¼Íø

 ÕÒ»ØÃÜÂë
 Á¢¼´×¢²á
mito
²é¿´: 1749|»Ø¸´: 9

¾«Í¨¸ß¼¶RxJava 2ÏìӦʽ±à³Ì˼ÏëÒÆ¶¯¶Ë¿ª·¢ÃëËÙ

[¸´ÖÆÁ´½Ó]

8Íò

Ö÷Ìâ

608

»ØÌû

27Íò

»ý·Ö

¹ÜÀíÔ±

Rank: 9Rank: 9Rank: 9

»ý·Ö
275170
QQ
·¢±íÓÚ 2018-6-4 10:19:55 | ÏÔʾȫ²¿Â¥²ã |ÔĶÁģʽ
¾«Í¨¸ß¼¶RxJava 2ÏìӦʽ±à³Ì˼ÏëÒÆ¶¯¶Ë¿ª·¢ÃëËÙ
RxJava´ÓÔ´Âëµ½Ó¦ÓÃ ÒÆ¶¯¶Ë¿ª·¢Ð§ÂÊÃëÌáËÙ
×÷ΪAndroid/Java¿ª·¢Õߣ¬»¹ÔÚûÈÕûҹµÄ¼Ó°à¼Óµãд´úÂ룿½²Õ棬ÄãÐèÒª´Ó˼ÏëÈëÊÖ£¡±¾¿Îͨ¹ýÍêÕû²ûÊÍÏìӦʽ±à³Ì˼Ïë¡¢¹Û²ìÕßģʽ£¬½áºÏRxJavaʵÏÖ£¬ÒÔÆÊÎöRxJavaÔ´Âë+°¸ÀýÕ¹ÏÖÏà½áºÏµÄ·½Ê½£¬½«Ë¼ÏëÓëʵ¼ÊÓ¦ÓÃÏà½áºÏ£¬ÖúÄã¿ìËÙÓÐЧµÄÌáÉý¹¤×÷ЧÂÊ¡£

µÚ1Õ ¿Î³Ì½éÉÜ¡ª¿Î³ÌÕûÌåÄÚÈݽéÉÜ
¼òµ¥½éÉܱ¾ÏµÁпγ̵ÄÄÚÈÝ£¬²¢Ìáǰ²¼ÖÃÔ¤ÏÈÐèÒª´¢±¸µÄ֪ʶ¡£

1-1 RxJava¿Î³Ì½éÉÜ-ÐÂ
µÚ2Õ ÏìӦʽ±à³Ì˼Ïë¸ÅÊö¡ª¸ÅÄîÓë°¸Àý½²½â
±¾Õ½ÚÖ÷Òª²ûÊÍÏìӦʽ±à³Ì˼Ï룬ÏÈ×öÒ»¸ö¸ÅÄîÐԵĽéÉÜ£¬Ö®ºó»áÒÔÉú»îÖеÄʵÀýºÍ´úÂëʵÀýÏà½áºÏµÄ·½Ê½À´½²½â¡£

2-1 ÏìӦʽ±à³Ì¸ÅÄî½éÉÜ
2-2 ÏìӦʽ±à³Ì¾ÙÀý½²½â
µÚ3Õ RxJava»ù±¾ÔªËØ¡ªÔ´Âë½âÎöÓë°¸Àýʵ¼ù
±¾Õ½ڿªÊ¼½øÈëÔ´Âë½²½â²¿·Ö£¬Ö÷Òª½²RxJavaµÄ»ù±¾ÔªËØ¡£Ïȼòµ¥½éÉܺͻعËRxJava£¬Ö®ºó½øÈëÔ´Âë·ÖÎö£¬ÔÙÒÔʵսÏîÄ¿À´¼ÓÉîÀí½â£¬×îºó»á¶Ô±¾Õ½ڽøÐлعˣ¬»áÒÔÕæÊµµÄ´úÂëÀ´ÔÙÒ»´Î²ûÊÍÏìӦʽ±à³ÌµÄ˼Ïë¡£

3-1 ¼òµ¥½éÉܼ°»Ø¹ËRxJava
3-2 RxJava1»ù±¾ÔªËØÔ´Âë·ÖÎö
3-3 ±³Ñ¹µÄ¸ÅÄî
3-4 RxJava2Ô´Âë·ÖÎö(ÎÞ±³Ñ¹)£¨ÉÏ£©
3-5 RxJava2Ô´Âë·ÖÎö(ÎÞ±³Ñ¹)£¨Ï£©
3-6 RxJava2»ù±¾ÔªËØÔ´Âë·ÖÎö(Óб³Ñ¹)
3-7 ʵս»ù±¾ÔªËØ(RxJava1)ÉÏ
3-8 ʵս»ù±¾ÔªËØ(RxJava1)ÏÂ
3-9 ʵս»ù±¾ÔªËØ(RxJava2ÎÞ±³Ñ¹)
3-10 ʵս»ù±¾ÔªËØ(RxJava2Óб³Ñ¹)
3-11 Õ½ڻعË
3-12 °¸ÀýÑÝÁ·
µÚ4Õ Operator²Ù×÷·û±ä»»¡ªÔ´Âë½âÎöÓë°¸Àýʵ¼ù
±¾Õ½ڽ²½âRxJava²Ù×÷·û£¬Ö÷ÒªÊÇÆÊÎöºËÐIJÙ×÷·ûlift£¬Ö®ºóÒÔʵսÏîÄ¿À´¼ÓÉîÀí½â£¬×îºó»á¶Ô±¾Õ½ڽøÐлعˣ¬»áÒÔÕæÊµµÄ´úÂëÀ´ÔÙÒ»´Î²ûÊÍÏìӦʽ±à³ÌµÄ˼Ïë¡£

4-1 ¾ßÌå²Ù×÷·û¼ò½é
4-2 RxJava1²Ù×÷·ûÔ´Âë·ÖÎö
4-3 Java2²Ù×÷·ûÔ´Âë·ÖÎö
4-4 ʵս²Ù×÷·ûRxJava1
4-5 ʵս²Ù×÷·û(RxJava2ÎÞ±³Ñ¹)
4-6 ʵս²Ù×÷·û(RxJava2Óб³Ñ¹)
4-7 Õ½ڻعË
4-8 °¸ÀýÑÝÁ·
µÚ5Õ SchedulerÏ̱߳任¡ªÔ´Âë½âÎöÓë°¸Àýʵ¼ù
±¾Õ½ÚÖ÷Òª½²½âRxJavaÏ̱߳任£¬Ö÷ÒªÊÇÆÊÎösubscribeOnºÍobserveOnÁ½¸öÓÃÓÚÏ̱߳任µÄ·½·¨£¬Ö®ºóÒÔʵսÏîÄ¿À´¼ÓÉîÀí½â£¬×îºó»á¶Ô±¾Õ½ڽøÐлعˣ¬»áÒÔÕæÊµµÄ´úÂëÀ´ÔÙÒ»´Î²ûÊÍÏìӦʽ±à³ÌµÄ˼Ïë¡£

5-1 Ï̱߳任¼ò½é
5-2 SchedulerÔ´Âë·ÖÎö(RxJava1)
5-3 Schedulerµ÷¶ÈÕßÔ´Âë·ÖÎö(RxJava2)
5-4 ʵսSchedulerµ÷¶ÈÕß(RxJava1)
5-5 ʵսScheduler(RxJava2)
5-6 subscribeOnÔ­Àí·ÖÎö(RxJava1)
5-7 subscribeOnÔ­Àí·ÖÎö(RxJava2ÎÞ±³Ñ¹)
5-8 subscribeOnÔ­Àí·ÖÎö(RxJava2Óб³Ñ¹)
5-9 ʵսsubscribeOn(RxJava1)
5-10 ʵսsubscribeOn(RxJava2ÎÞ±³Ñ¹)
5-11 ʵսsubscribeOn(RxJava2Óб³Ñ¹)
5-12 observeOnÔ­Àí·ÖÎö(RxJava1)
5-13 observeOnÔ­Àí·ÖÎö(RxJava2ÎÞ±³Ñ¹)
5-14 observeOnÔ­Àí·ÖÎö(RxJava2Óб³Ñ¹)
5-15 ʵսobserveOn(RxJava1)
5-16 ʵսobserveOn(RxJava2ÎÞ±³Ñ¹)
5-17 ʵսobserveOn(RxJava2Óб³Ñ¹)
5-18 Õ½ڻعË
µÚ6Õ ÕûÌå±ä»»composeºÍTransformerÔ­Àí
±¾Õ½ÚÖ÷Òª½²½âRxJavaÕûÌå±ä»»£¬Ö÷ÒªÊÇÆÊÎöcompose·½·¨ºÍTransformer½Ó¿Ú£¬Ö®ºóÒÔʵսÏîÄ¿À´¼ÓÉîÀí½â£¬×îºó»á¶Ô±¾Õ½ڽøÐлعˣ¬»áÒÔÕæÊµµÄ´úÂëÀ´ÔÙÒ»´Î²ûÊÍÏìӦʽ±à³ÌµÄ˼Ïë¡£

6-1 ÕûÌå±ä»»¼ò½é
6-2 ÕûÌå±ä»»Ô­Àí(RxJava1)
6-3 ÕûÌå±ä»»Ô­Àí(RxJava2)
6-4 ʵսÕûÌå±ä»»(RxJava1)
6-5 ʵսÕûÌå±ä»»(RxJava2)
6-6 Õ½ڻعË
µÚ7Õ RxJava+Retrofit+MVP×ۺϰ¸Àý
×îºóʵ¼ù£ºRxJava+Retrofit+MVP°¸Àýʵ¼ÊÏîĿӦÓÃ

7-1 RxJava½áºÏRetrofit
7-2 ½áºÏMVPģʽ
7-3 RxJava½áºÏRetrofit½áºÏMVP-1
7-4 RxJava½áºÏRetrofit½áºÏMVP-2

Óοͣ¬Èç¹ûÄúÒª²é¿´±¾ÌûÒþ²ØÄÚÈÝÇë»Ø¸´



¸ü¶àÌû×ÓÍÆ¼ö

»Ø¸´

ʹÓõÀ¾ß ¾Ù±¨

0

Ö÷Ìâ

1438

»ØÌû

3410

»ý·Ö

ÂÛ̳ԪÀÏ

Rank: 6Rank: 6

»ý·Ö
3410
QQ
·¢±íÓÚ 2018-6-5 10:23:44 | ÏÔʾȫ²¿Â¥²ã
0000000000123
»Ø¸´

ʹÓõÀ¾ß ¾Ù±¨

0

Ö÷Ìâ

2Íò

»ØÌû

4Íò

»ý·Ö

½ûÖ¹·ÃÎÊ

»ý·Ö
41607
·¢±íÓÚ 2021-10-21 17:27:23 | ÏÔʾȫ²¿Â¥²ã
Ìáʾ: ×÷Õß±»½ûÖ¹»òɾ³ý ÄÚÈÝ×Ô¶¯ÆÁ±Î
»Ø¸´

ʹÓõÀ¾ß ¾Ù±¨

QQ|Archiver|ÊÖ»ú°æ|ü\Óü¿Æ¼¼Íø

GMT+8, 2025-11-30 12:09 , Processed in 0.229112 second(s), 26 queries .

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

¿ìËٻظ´ ·µ»Ø¶¥²¿ ·µ»ØÁбí