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
Jakarta EE meets AI
ivargrimstad
0
130
3 Effective Rules for Using Signals in Angular
manfredsteyer
PRO
1
100
アジャイルを支えるテストアーキテクチャ設計/Test Architecting for Agile
goyoki
9
3.3k
3rd party scriptでもReactを使いたい! Preact + Reactのハイブリッド開発
righttouch
PRO
1
600
弊社の「意識チョット低いアーキテクチャ」10選
texmeijin
5
24k
ActiveSupport::Notifications supporting instrumentation of Rails apps with OpenTelemetry
ymtdzzz
1
230
2024/11/8 関西Kaggler会 2024 #3 / Kaggle Kernel で Gemma 2 × vLLM を動かす。
kohecchi
5
910
シールドクラスをはじめよう / Getting Started with Sealed Classes
mackey0225
4
640
광고 소재 심사 과정에 AI를 도입하여 광고 서비스 생산성 향상시키기
kakao
PRO
0
170
Jakarta Concurrencyによる並行処理プログラミングの始め方 (JJUG CCC 2024 Fall)
tnagao7
1
290
Generative AI Use Cases JP (略称:GenU)奮闘記
hideg
1
290
LLM生成文章の精度評価自動化とプロンプトチューニングの効率化について
layerx
PRO
2
190
Featured
See All Featured
Statistics for Hackers
jakevdp
796
220k
YesSQL, Process and Tooling at Scale
rocio
169
14k
Into the Great Unknown - MozCon
thekraken
32
1.5k
Fashionably flexible responsive web design (full day workshop)
malarkey
405
65k
Put a Button on it: Removing Barriers to Going Fast.
kastner
59
3.5k
Rails Girls Zürich Keynote
gr2m
94
13k
Agile that works and the tools we love
rasmusluckow
327
21k
Adopting Sorbet at Scale
ufuk
73
9.1k
[RailsConf 2023] Rails as a piece of cake
palkan
52
4.9k
Raft: Consensus for Rubyists
vanstee
136
6.6k
Optimising Largest Contentful Paint
csswizardry
33
2.9k
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
͋Γ͕ͱ͏͍͟͝·ͨ͠ ٩ ๑❛ᴗ❛๑ ۶ גࣜձࣾحฌୂ ΤϯδχΞେืूதͰ͢