Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
ripple-implement
Search
yiwaisako
August 23, 2018
Technology
2
480
ripple-implement
AndroidのRippleについてpotato tips#54で話しました。
yiwaisako
August 23, 2018
Tweet
Share
Other Decks in Technology
See All in Technology
AI時代を生き抜くエンジニアキャリアの築き方 (AI-Native 時代、エンジニアという道は 「最大の挑戦の場」となる) / Building an Engineering Career to Thrive in the Age of AI (In the AI-Native Era, the Path of Engineering Becomes the Ultimate Arena of Challenge)
jeongjaesoon
0
210
RSCの時代にReactとフレームワークの境界を探る
uhyo
10
3.5k
Evolución del razonamiento matemático de GPT-4.1 a GPT-5 - Data Aventura Summit 2025 & VSCode DevDays
lauchacarro
0
210
自作JSエンジンに推しプロポーザルを実装したい!
sajikix
1
190
Oracle Base Database Service 技術詳細
oracle4engineer
PRO
10
75k
下手な強制、ダメ!絶対! 「ガードレール」を「檻」にさせない"ガバナンス"の取り方とは?
tsukaman
2
450
まずはマネコンでちゃちゃっと作ってから、それをCDKにしてみよか。
yamada_r
2
120
Aurora DSQLはサーバーレスアーキテクチャの常識を変えるのか
iwatatomoya
1
1.1k
「全員プロダクトマネージャー」を実現する、Cursorによる仕様検討の自動運転
applism118
22
12k
共有と分離 - Compose Multiplatform "本番導入" の設計指針
error96num
2
1k
バイブスに「型」を!Kent Beckに学ぶ、AI時代のテスト駆動開発
amixedcolor
2
580
💡Ruby 川辺で灯すPicoRubyからの光
bash0c7
0
120
Featured
See All Featured
Become a Pro
speakerdeck
PRO
29
5.5k
GitHub's CSS Performance
jonrohan
1032
460k
Bootstrapping a Software Product
garrettdimon
PRO
307
110k
The Art of Delivering Value - GDevCon NA Keynote
reverentgeek
15
1.7k
Optimizing for Happiness
mojombo
379
70k
Statistics for Hackers
jakevdp
799
220k
How STYLIGHT went responsive
nonsquared
100
5.8k
Building Flexible Design Systems
yeseniaperezcruz
329
39k
Documentation Writing (for coders)
carmenintech
74
5k
Sharpening the Axe: The Primacy of Toolmaking
bcantrill
44
2.5k
4 Signs Your Business is Dying
shpigford
184
22k
ReactJS: Keep Simple. Everything can be a component!
pedronauck
667
120k
Transcript
3JQQMF࣮ʹ͍ͭͯ 1PUBUPUJQT BOEGBDUPSZגࣜձࣾॕഭળ
ࣗݾհ w ॕഭળʢ:PTIJUP*XBJTBLP !ZTU@J w "OESPJEΤϯδχΞ w BOEGBDUPSZגࣜձࣾ w ϚϯΨ1BSL
w "OESPJEΤϯδχΞืूதͰ͢ʂ w .BUFSJBM%FTJHO͖Ͱ͢ʂ
͍ͨ͜͠ͱ w 3JQQMFͷ࣮ w 3JQQMFΛίʔυͰ࣮͢Δ
ಈ࡞ڥ w DPNQJMF4EL7FSTJPO w NJO4EL7FSTJPO w UBSHFU4EL7FSTJPO w TVQQPSU-JCSBSZ7FSTJPO
3JQQMF
.BUFSJBM%FTJHOͷλον ϑΟʔυόοΫ
3JQQMFαϯϓϧ
*NQMFNFOU
Γ͍ͨ͜ͱ w -PMJQPQҎ্3JQQMFΛදࣔɺ,JULBUผͷλονϑΟʔ υόοΫΛදࣔɻ w 7JFX(SPVQͷ֊ΛͰ͖Δ͚ͩઙ͘͢Δ
αϯϓϧσβΠϯ wᶃɿը૾ɻશମʹ3JQQMFΛදࣔ͢Δ wᶄɿλΠτϧͱઆ໌จɻશମʹ3JQQMFΛදࣔ͢Δ wᶅɺᶆɿSFBEϘλϯɺUSJBMϘλϯɻϘλϯͷΈ 3JQQMFΛදࣔ͢Δ ᶃ ᶅ ᶄ ᶆ
ϨΠΞτ <android.support.v7.widget.CardView android:foreground="@drawable/foreground_ripple"> <RelativeLayout> <ImageView/> <RelativeLayout> <RelativeLayout> <TextView android:id="@+id/title"/> <TextView
android:id=“@+id/update_info"/> </RelativeLayout> <LinearLayout> <android.support.v7.widget.CardView android:id="@+id/read_button_wrapper" android:foreground="@drawable/foreground_ripple"> <TextView android:id="@+id/read_button_text"/> </android.support.v7.widget.CardView> <android.support.v7.widget.CardView android:id="@+id/trial_button_wrapper" android:foreground="@drawable/foreground_ripple"> <TextView android:id="@+id/trial_button_text"> </android.support.v7.widget.CardView> </LinearLayout> </RelativeLayout> </RelativeLayout> </android.support.v7.widget.CardView>
ϨΠΞτ 1. <android.support.v7.widget.CardView 2. android:foreground=“@drawable/foreground_ripple” 3. <!— android:foreground=“?android:attr/selectableItemBackground”> —> 4.
<RelativeLayout> 5. <ImageView/> 6. <RelativeLayout> 7. <RelativeLayout> 8. <TextView 9. android:id="@+id/title"/> 10. <TextView 11. android:id=“@+id/update_info"/> 12. </RelativeLayout> 13. <LinearLayout> 14. <android.support.v7.widget.CardView 15. android:id="@+id/read_button_wrapper" 16. android:foreground="@drawable/foreground_ripple"> 17. <TextView 18. android:id="@+id/read_button_text"/> 19. </android.support.v7.widget.CardView> 20. <android.support.v7.widget.CardView 21. android:id="@+id/trial_button_wrapper" 22. android:foreground="@drawable/foreground_ripple"> 23. <TextView 24. android:id="@+id/trial_button_text"> 25. </android.support.v7.widget.CardView> 26. </LinearLayout> 27. </RelativeLayout> 28. </RelativeLayout> 29.</android.support.v7.widget.CardView> ίʔυଆͰTFU0O$MJDL-JTUFOFS ඞཁ 3FMBUJWF-BZPVUͷGPSFHSPVOEʹ3JQQMFΛηοτͯ͠-PMJQPQ ͩͱಈ͔ͳ͍
3JQQMF9.- 1. <?xml version="1.0" encoding="utf-8"?> 2. <ripple xmlns:android="http://schemas.android.com/apk/res/android" 3. android:color="@color/red">
4. <item 5. android:id="@android:id/mask" 6. android:drawable="@android:color/white"/> 7. </ripple> ࢠཁૉͷJUNͷNBTLʹESBXBCMFΛࢦఆ͠ͳ͍ͱɺࢦΛ ͨ͠λΠϛϯάͰ3JQQMF͕දࣔ͞Ε·ͤΜͰͨ͠ɻ
None
3JQQMFΛίʔυͰ࣮͢Δ 1.holder.root.setOnClickListener { _ -> } 3. if (Build.VERSION.SDK_INT >=
Build.VERSION_CODES.LOLLIPOP) { 4. val rippleColors = intArrayOf(R.color.colorAccent, R.color.colorPrimary, R.color.colorPrimaryDark, 5. R.color.medium_turquoise_cc, R.color.eclipse, R.color.malibu 6. ) 8. val i = Random().nextInt(rippleColors.size) 9. val mask = ContextCompat.getDrawable(context, R.drawable.mask) 10. val color = ContextCompat.getColor(context, rippleColors[i]) 11. holder.root.foreground = RippleDrawable(ColorStateList.valueOf(color), null, mask).mutate() 12.} 14. $PMPSͱ%SBXBCMFΛ࡞ ̎NBTL༻ͷ%SBXBCMFΛ࡞ 3JQQMF%SBXBCMFΛ7JFXͷGPSFHSPVOEʹηοτ TFU0ODMJDL-JTUFOFS Λઃఆ ͢Δ͔ɺ9.-ʹzDMJDLBCMF USVFzͷઃఆ͕ඞཁͰ͢
None
·ͱΊ w ,JULBUΛಈ࡞ର֎ͱ͢ΔΞϓϦ͕૿͖͑ͯ·͕ͨ͠ɺ -PMJQPQ͠Β͘ରԠ͕ଓ͖ͦ͏Ͱ͢ɻ w -PMJQPQͰ3JQQMFΛදࣔ͢Δʹɺ$BSE7JFX 'SBNF-BZPVUΛར༻ͯ͠ϨΠΞτΛߟ͑Δඞཁ͕͋Γ ͦ͏Ͱ͢ɻ w 1MBJEͰ3FMBUJWF-BZPVUͷTFU'PSFHSPVOEΛόοΫϙʔ
τ͍ͯ͠ΔΑ͏Ͱ͢ɻ
͝੩ௌ͋Γ͕ͱ͏͍͟͝·͠ ͨʂ