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の共通化方法まとめ short ver
Search
konifar
March 12, 2015
Programming
4
3.9k
Viewの共通化方法まとめ short ver
【第15回】potatotips(iOS/Android開発Tips共有会)
http://connpass.com/event/12140/
でLTした内容です。
konifar
March 12, 2015
Tweet
Share
More Decks by konifar
See All by konifar
Android開発以外のAndroid開発経験の活かしどころ
konifar
3
2.2k
初めてのiOS関連GitHub ActionsをMarketplaceに公開するまでの実録
konifar
3
290
オーナーシップを持つ領域を明確にする
konifar
15
4.1k
雑に思考を整理する技術と効能
konifar
74
36k
何のための個人目標設定?
konifar
28
14k
30点で打席に立つ
konifar
79
51k
Linterでチョット安心 iOS多言語化対応 / ios-i18n-linter
konifar
2
1.2k
VPoEとして1年 もっとこうすればよかった3選 / VPoE Retrospective
konifar
13
6.3k
Introduction to API Testing Automation by Postman
konifar
1
3.7k
Other Decks in Programming
See All in Programming
rails stats で紐解く ANDPAD のイマを支える技術たち
andpad
1
290
暇に任せてProxmoxコンソール 作ってみました
karugamo
2
720
HTTP compression in PHP and Symfony apps
dunglas
2
1.7k
採用事例の少ないSvelteを選んだ理由と それを正解にするためにやっていること
oekazuma
2
1k
SymfonyCon Vienna 2025: Twig, still relevant in 2025?
fabpot
3
1.2k
これでLambdaが不要に?!Step FunctionsのJSONata対応について
iwatatomoya
2
3.7k
Security_for_introducing_eBPF
kentatada
0
110
Cloudflare MCP ServerでClaude Desktop からWeb APIを構築
kutakutat
1
550
複雑な仕様に立ち向かうアーキテクチャ
myohei
0
170
Semantic Kernelのネイティブプラグインで知識拡張をしてみる
tomokusaba
0
180
17年周年のWebアプリケーションにTanStack Queryを導入する / Implementing TanStack Query in a 17th Anniversary Web Application
saitolume
0
250
テストケースの名前はどうつけるべきか?
orgachem
PRO
0
130
Featured
See All Featured
YesSQL, Process and Tooling at Scale
rocio
169
14k
Building Better People: How to give real-time feedback that sticks.
wjessup
365
19k
Art, The Web, and Tiny UX
lynnandtonic
298
20k
Typedesign – Prime Four
hannesfritz
40
2.4k
Faster Mobile Websites
deanohume
305
30k
Why You Should Never Use an ORM
jnunemaker
PRO
54
9.1k
Mobile First: as difficult as doing things right
swwweet
222
9k
I Don’t Have Time: Getting Over the Fear to Launch Your Podcast
jcasabona
29
2k
The Art of Delivering Value - GDevCon NA Keynote
reverentgeek
8
1.2k
Producing Creativity
orderedlist
PRO
341
39k
Fight the Zombie Pattern Library - RWD Summit 2016
marcelosomers
232
17k
Making the Leap to Tech Lead
cromwellryan
133
9k
Transcript
7JFXͷڞ௨Խํ๏·ͱΊ ʢʣ QPUBUPUJQT খ༟հ
!LPOJGBS w "OESPJE࡞ͬͯ·͢ɻ w ಙౡݝࠤಹՏଜग़ɻ 4BOTBOਆࢁΦϑΟεͷྡͷଜ
5BQUSJQ w IUUQBQQNBSLFUJOHMBCPOFUUBQUSJQ
7JFXͷڞ௨Խํ๏ EJNFOTYNMɺDPMPSTYNM ESBXBCMFYNM TUZMFTYNM JODMVEF
$VTUPN7JFX
7JFXͷڞ௨Խํ๏ EJNFOTYNMɺDPMPSTYNM ESBXBCMFYNM TUZMFTYNM JODMVEF
$VTUPN7JFX ˡࠓ͜͜ͷ
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 <!-- Extends --> <style name="TextSub.Big"> <item name="android:textSize">@dimen/text_medium</item> </style> <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Λࢀরɻ IUUQRJJUBDPNLHNZTIJOJUFNTBE⒎CDE
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); } }
$VTUPN7JFX $VTUPN7JFXᇪༀɻ աͳڞ௨ԽʹΑΔ$VTUPN7JFXཚཱʹҙ
·ͱΊ EJNFOTYNM DPMPSTYNM ESBXBCMFYNM Կग़ͯ͘Δ ϨΠΞτ͔ JODMVEF $VTUPN7JFX ෳͷ7JFXͰ ߏ͞Ε͍ͯΔ͔
ϩδοΫؚ͕· ΕΔ͔ ϨΠΞτYNMʹهड़ /P :FT /P :FT /P :FT σβΠϯʹ߹Θͤͯ༻ TUZMFTYNM $VTUPN7JFX
͋Γ͕ͱ͏͍͟͝·ͨ͠ ٩ ๑❛ᴗ❛๑ ۶ גࣜձࣾحฌୂ ΤϯδχΞେืूதͰ͢