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.8k
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
2k
初めてのiOS関連GitHub ActionsをMarketplaceに公開するまでの実録
konifar
3
270
オーナーシップを持つ領域を明確にする
konifar
14
3.9k
雑に思考を整理する技術と効能
konifar
73
36k
何のための個人目標設定?
konifar
28
14k
30点で打席に立つ
konifar
79
50k
Linterでチョット安心 iOS多言語化対応 / ios-i18n-linter
konifar
2
1.2k
VPoEとして1年 もっとこうすればよかった3選 / VPoE Retrospective
konifar
13
6.2k
Introduction to API Testing Automation by Postman
konifar
1
3.7k
Other Decks in Programming
See All in Programming
macOS でできる リアルタイム動画像処理
biacco42
9
2.4k
どうして僕の作ったクラスが手続き型と言われなきゃいけないんですか
akikogoto
1
120
Ethereum_.pdf
nekomatu
0
460
TypeScript Graph でコードレビューの心理的障壁を乗り越える
ysk8hori
2
1.1k
Flutterを言い訳にしない!アプリの使い心地改善テクニック5選🔥
kno3a87
1
190
とにかくAWS GameDay!AWSは世界の共通言語! / Anyway, AWS GameDay! AWS is the world's lingua franca!
seike460
PRO
1
890
色々なIaCツールを実際に触って比較してみる
iriikeita
0
330
Contemporary Test Cases
maaretp
0
140
Amazon Bedrock Agentsを用いてアプリ開発してみた!
har1101
0
340
シェーダーで魅せるMapLibreの動的ラスタータイル
satoshi7190
1
480
[Do iOS '24] Ship your app on a Friday...and enjoy your weekend!
polpielladev
0
110
最新TCAキャッチアップ
0si43
0
190
Featured
See All Featured
Intergalactic Javascript Robots from Outer Space
tanoku
269
27k
Music & Morning Musume
bryan
46
6.2k
Producing Creativity
orderedlist
PRO
341
39k
Side Projects
sachag
452
42k
Optimizing for Happiness
mojombo
376
70k
Keith and Marios Guide to Fast Websites
keithpitt
409
22k
Typedesign – Prime Four
hannesfritz
40
2.4k
We Have a Design System, Now What?
morganepeng
50
7.2k
Navigating Team Friction
lara
183
14k
The Myth of the Modular Monolith - Day 2 Keynote - Rails World 2024
eileencodes
16
2.1k
BBQ
matthewcrist
85
9.3k
Fireside Chat
paigeccino
34
3k
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
͋Γ͕ͱ͏͍͟͝·ͨ͠ ٩ ๑❛ᴗ❛๑ ۶ גࣜձࣾحฌୂ ΤϯδχΞେืूதͰ͢