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
470
ripple-implement
AndroidのRippleについてpotato tips#54で話しました。
yiwaisako
August 23, 2018
Tweet
Share
Other Decks in Technology
See All in Technology
ドメインの本質を掴む / Get the essence of the domain
sinsoku
2
160
Terraform Stacks入門 #HashiTalks
msato
0
360
強いチームと開発生産性
onk
PRO
36
12k
アジャイルでの品質の進化 Agile in Motion vol.1/20241118 Hiroyuki Sato
shift_evolve
0
190
B2B SaaSから見た最近のC#/.NETの進化
sansantech
PRO
0
960
CysharpのOSS群から見るModern C#の現在地
neuecc
2
3.6k
AGIについてChatGPTに聞いてみた
blueb
0
130
Amplify Gen2 Deep Dive / バックエンドの型をいかにしてフロントエンドへ伝えるか #TSKaigi #TSKaigiKansai #AWSAmplifyJP
tacck
PRO
0
400
100 名超が参加した日経グループ横断の競技型 AWS 学習イベント「Nikkei Group AWS GameDay」の紹介/mediajaws202411
nikkei_engineer_recruiting
1
170
New Relicを活用したSREの最初のステップ / NRUG OKINAWA VOL.3
isaoshimizu
3
660
電話を切らさない技術 電話自動応答サービスを支える フロントエンド
barometrica
1
130
【LT】ソフトウェア産業は進化しているのか? #Agilejapan
takabow
0
110
Featured
See All Featured
The Myth of the Modular Monolith - Day 2 Keynote - Rails World 2024
eileencodes
16
2.1k
Optimizing for Happiness
mojombo
376
70k
GraphQLの誤解/rethinking-graphql
sonatard
67
10k
Build your cross-platform service in a week with App Engine
jlugia
229
18k
Music & Morning Musume
bryan
46
6.2k
Intergalactic Javascript Robots from Outer Space
tanoku
269
27k
The Art of Programming - Codeland 2020
erikaheidi
52
13k
Distributed Sagas: A Protocol for Coordinating Microservices
caitiem20
329
21k
Exploring the Power of Turbo Streams & Action Cable | RailsConf2023
kevinliebholz
27
4.3k
How To Stay Up To Date on Web Technology
chriscoyier
788
250k
The Straight Up "How To Draw Better" Workshop
denniskardys
232
140k
What’s in a name? Adding method to the madness
productmarketing
PRO
22
3.1k
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ΛόοΫϙʔ
τ͍ͯ͠ΔΑ͏Ͱ͢ɻ
͝੩ௌ͋Γ͕ͱ͏͍͟͝·͠ ͨʂ