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
Viewの再利用方法まとめ
Search
konifar
March 12, 2015
Programming
0
120
Viewの再利用方法まとめ
potatotips#15でのLTです。
http://connpass.com/event/12140/
konifar
March 12, 2015
Tweet
Share
More Decks by konifar
See All by konifar
Android開発以外のAndroid開発経験の活かしどころ
konifar
3
2.4k
初めてのiOS関連GitHub ActionsをMarketplaceに公開するまでの実録
konifar
3
320
オーナーシップを持つ領域を明確にする
konifar
15
5.3k
雑に思考を整理する技術と効能
konifar
76
41k
何のための個人目標設定?
konifar
28
14k
30点で打席に立つ
konifar
85
55k
Linterでチョット安心 iOS多言語化対応 / ios-i18n-linter
konifar
2
1.3k
VPoEとして1年 もっとこうすればよかった3選 / VPoE Retrospective
konifar
13
6.3k
Introduction to API Testing Automation by Postman
konifar
1
3.8k
Other Decks in Programming
See All in Programming
第3回関東Kaggler会_AtCoderはKaggleの役に立つ
chettub
3
1.1k
Domain-Driven Transformation
hschwentner
2
1.9k
Writing documentation can be fun with plugin system
okuramasafumi
0
130
クリーンアーキテクチャから見る依存の向きの大切さ
shimabox
4
890
.NET Frameworkでも汎用ホストが使いたい!
tomokusaba
0
180
pylint custom ruleで始めるレビュー自動化
shogoujiie
0
140
ソフトウェアエンジニアの成長
masuda220
PRO
12
2k
バッチを作らなきゃとなったときに考えること
irof
2
470
How mixi2 Uses TiDB for SNS Scalability and Performance
kanmo
40
16k
法律の脱レガシーに学ぶフロントエンド刷新
oguemon
5
740
Honoとフロントエンドの 型安全性について
yodaka
7
1.4k
Ruby on cygwin 2025-02
fd0
0
160
Featured
See All Featured
Code Reviewing Like a Champion
maltzj
521
39k
Distributed Sagas: A Protocol for Coordinating Microservices
caitiem20
330
21k
Designing on Purpose - Digital PM Summit 2013
jponch
117
7.1k
Testing 201, or: Great Expectations
jmmastey
42
7.2k
Java REST API Framework Comparison - PWX 2021
mraible
28
8.4k
The Psychology of Web Performance [Beyond Tellerrand 2023]
tammyeverts
46
2.3k
JavaScript: Past, Present, and Future - NDC Porto 2020
reverentgeek
47
5.2k
The Web Performance Landscape in 2024 [PerfNow 2024]
tammyeverts
4
420
Site-Speed That Sticks
csswizardry
4
390
How To Stay Up To Date on Web Technology
chriscoyier
790
250k
Optimising Largest Contentful Paint
csswizardry
34
3.1k
For a Future-Friendly Web
brad_frost
176
9.6k
Transcript
7JFXͷ࠶ར༻ํ๏·ͱΊ ʢʣ খ༟հ
!LPOJGBS w "OESPJE࡞ͬͯ·͢ɻ w ࠷ۙ8FCɻ w ಙౡݝࠤಹՏଜग़ɻ 4BOTBOਆࢁΦϑΟεͷྡͷଜ
7JFXͷ࠶ར༻ํ๏ EJNFOTYNMɺDPMPSTYNM ESBXBCMFYNM TUZMFTYNM JODMVEF
$VTUPN7JFX
EJNFOTYNMɺDPMPSTYNM <TextView android:textColor="#757575" android:gravity="center_vertical" android:layout_width="match_parent" android:layout_height="wrap_content" android:maxLines="2" android:textSize="12dp" />
EJNFOTYNMɺDPMPSTYNM <TextView android:textColor="#757575" android:gravity="center_vertical" android:layout_width="match_parent" android:layout_height="wrap_content" android:maxLines="2" android:textSize="12dp" />
EJNFOTYNMɺDPMPSTYNM <TextView android:textColor="@color/grey600" android:gravity="center_vertical" android:layout_width="match_parent" android:layout_height="wrap_content" android:maxLines="2" android:textSize="@dimen/text_small" /> <color
name=“grey600">#757575</color> <dimen name="text_small">12sp</dimen>
ESBXBCMF <RelativeLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:background="@color/white"> … </RelativeLayout>
ESBXBCMF <RelativeLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:background="@color/white"> … </RelativeLayout>
ESBXBCMF <RelativeLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:background="@drawable_bg_feedback"> … </RelativeLayout>
ESBXBCMF <?xml version="1.0" encoding="utf-8"?> <selector xmlns:android="http://schemas.~~android"> ! <item android:state_pressed="true"> <shape
android:shape="rectangle"> <solid android:color="#0a000000" /> </shape> </item> ! </selector>
ESBXBCMF <?xml version="1.0" encoding="utf-8"?> <selector xmlns:android="http://schemas.~~android"> ! <item android:state_pressed="true"> <shape
android:shape="rectangle"> <solid android:color="#0a000000" /> </shape> </item> ! </selector> ͑ΔTUBUFɺ4UBUF-JTU%SBXBCMFͷϖʔδࢀরɻ
TUZMFTYNM <TextView android:textColor="@color/grey600" android:gravity="center_vertical" android:layout_width="match_parent" android:layout_height="wrap_content" android:maxLines="2" android:textSize="@dimen/text_small" />
TUZMFTYNM <TextView android:textColor="@color/grey600" android:gravity="center_vertical" android:layout_width="match_parent" android:layout_height="wrap_content" android:maxLines="2" android:textSize="@dimen/text_small" />
TUZMFTYNM <TextView style="@style/TextSub" android:layout_width="match_parent" android:layout_height="wrap_content" /> <style name="TextSub"> <item name="android:textSize">@dimen/text_small</item>
<item name="android:textColor">@color/grey600</item> <item name=“android:gravity">center_vertical</item> <item name="android:maxLines">2</item> </style>
TUZMFTYNM TUZMFTෳͷYNMʹ͚ͯཧͨ͠ํ͕͍͍͔ ͠Ε·ͤΜɻ ྫ TUZMFT@IPNFYNMɺTUZMFT@EFUBJMTYNM ! ৄ͘͠<༁>BOESPJECFTUQSBDUJDFΛࢀরɻ
JODMVEF <RelativeLayout android:layout_width="match_parent" android:layout_height=“wrap_content”> ! <ImageView … /> ! <RelativeLayout
android:layout_width="match_parent" android:layout_height="wrap_content"> <TextView … /> <TextView … /> <TextView … /> </RelativeLayout> ! </RelativeLayout>
JODMVEF <RelativeLayout android:layout_width="match_parent" android:layout_height=“wrap_content”> ! <ImageView … /> ! <RelativeLayout
android:layout_width="match_parent" android:layout_height="wrap_content"> <TextView … /> <TextView … /> <TextView … /> </RelativeLayout> ! </RelativeLayout>
JODMVEF <RelativeLayout android:layout_width="match_parent" android:layout_height=“wrap_content”> ! <ImageView … /> ! <include
layout=“@layout/part_character_info" /> ! </RelativeLayout> 7JFXͷωετ͕ଟ͘ͳΓ͕ͪͳͷͰɺNFSHFͷ͍ํΛ֮͑ͯ ͓͘ͱΑ͍ɻ 㱺8IBUJTUIFQVSQPTFPG"OESPJETUBHJO9.-MBZPVUT
$VTUPN7JFX <RelativeLayout android:layout_width="match_parent" android:layout_height="wrap_content"> ! <FrameLayout android:id="@+id/triangle" android:background=“@drawable/left_triangle" … />
! <TextView android:id=“@+id/txt_balloon" android:background="@drawable/bg_word_balloon" … /> ! </RelativeLayout>
$VTUPN7JFX <com.konifar.whovoice.views.WordBalloonView android:id="@+id/balloon_word" android:layout_width="match_parent" android:layout_height=“wrap_content" />
$VTUPN7JFX public class WordBalloonView extends RelativeLayout { ... public WordBalloonView(Context
context, AttributeSet attrs) { super(context, attrs); inflate(context, R.layout.ui_word_balloon, this); ButterKnife.inject(this); ! TypedArray a = context.obtainStyledAttributes( attrs, R.styleable.WordBalloonView); try { balloonText = a.getString( R.styleable.WordBalloonView_balloonText); } finally { a.recycle(); } ! mTxtBalloon.setText(balloonText); } ! public void setBalloonText(String balloonText) { mTxtBalloon.setText(balloonText); } }
$VTUPN7JFX public class WordBalloonView extends RelativeLayout { ... public WordBalloonView(Context
context, AttributeSet attrs) { super(context, attrs); inflate(context, R.layout.ui_word_balloon, this); ButterKnife.inject(this); ! TypedArray a = context.obtainStyledAttributes( attrs, R.styleable.WordBalloonView); try { balloonText = a.getString( R.styleable.WordBalloonView_balloonText); } finally { a.recycle(); } ! mTxtBalloon.setText(balloonText); } ! public void setBalloonText(String balloonText) { mTxtBalloon.setText(balloonText); } }
$VTUPN7JFX public class WordBalloonView extends RelativeLayout { ... public WordBalloonView(Context
context, AttributeSet attrs) { super(context, attrs); inflate(context, R.layout.ui_word_balloon, this); ButterKnife.inject(this); ! TypedArray a = context.obtainStyledAttributes( attrs, R.styleable.WordBalloonView); try { balloonText = a.getString( R.styleable.WordBalloonView_balloonText); } finally { a.recycle(); } ! mTxtBalloon.setText(balloonText); } ! public void setBalloonText(String balloonText) { mTxtBalloon.setText(balloonText); } }
$VTUPN7JFX public class WordBalloonView extends RelativeLayout { ... public WordBalloonView(Context
context, AttributeSet attrs) { super(context, attrs); inflate(context, R.layout.ui_word_balloon, this); ButterKnife.inject(this); ! TypedArray a = context.obtainStyledAttributes( attrs, R.styleable.WordBalloonView); try { balloonText = a.getString( R.styleable.WordBalloonView_balloonText); } finally { a.recycle(); } ! mTxtBalloon.setText(balloonText); } ! public void setBalloonText(String balloonText) { mTxtBalloon.setText(balloonText); } }
$VTUPN7JFX public class WordBalloonView extends RelativeLayout { ... public WordBalloonView(Context
context, AttributeSet attrs) { super(context, attrs); inflate(context, R.layout.ui_word_balloon, this); ButterKnife.inject(this); ! TypedArray a = context.obtainStyledAttributes( attrs, R.styleable.WordBalloonView); try { balloonText = a.getString( R.styleable.WordBalloonView_balloonText); } finally { a.recycle(); } ! mTxtBalloon.setText(balloonText); } ! public void setBalloonText(String balloonText) { mTxtBalloon.setText(balloonText); } }
·ͱΊ EJNFOTYNM DPMPSTYNM ESBXBCMFYNM Կग़ͯ͘Δ ϨΠΞτ͔ TUZMFTYNM JODMVEF $VTUPN7JFX ෳͷ7JFXͰ
ߏ͞Ε͍ͯΔ͔ ϩδοΫؚ͕· ΕΔ͔ ϨΠΞτYNMʹهड़ /P :FT /P :FT /P :FT σβΠϯʹ߹Θͤͯ༻
͋Γ͕ͱ͏͍͟͝·ͨ͠ ٩ ๑❛ᴗ❛๑ ۶ גࣜձࣾحฌୂ ΤϯδχΞେืूதͰ͢