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.3k
初めてのiOS関連GitHub ActionsをMarketplaceに公開するまでの実録
konifar
3
300
オーナーシップを持つ領域を明確にする
konifar
15
5.1k
雑に思考を整理する技術と効能
konifar
76
40k
何のための個人目標設定?
konifar
28
14k
30点で打席に立つ
konifar
79
51k
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.7k
Other Decks in Programming
See All in Programming
ErdMap: Thinking about a map for Rails applications
makicamel
1
580
ATDDで素早く安定した デリバリを実現しよう!
tonnsama
1
1.8k
Lookerは可視化だけじゃない。UIコンポーネントもあるんだ!
ymd65536
1
130
CQRS+ES の力を使って効果を感じる / Feel the effects of using the power of CQRS+ES
seike460
PRO
0
240
責務を分離するための例外設計 - PHPカンファレンス 2024
kajitack
9
2.3k
Fibonacci Function Gallery - Part 2
philipschwarz
PRO
0
210
PicoRubyと暮らす、シェアハウスハック
ryosk7
0
200
rails newと同時に型を書く
aki19035vc
5
710
20年もののレガシープロダクトに 0からPHPStanを入れるまで / phpcon2024
hirobe1999
0
1k
Amazon Nova Reelの可能性
hideg
0
190
『改訂新版 良いコード/悪いコードで学ぶ設計入門』活用方法−爆速でスキルアップする!効果的な学習アプローチ / effective-learning-of-good-code
minodriven
28
4k
2025.01.17_Sansan × DMM.swift
riofujimon
2
540
Featured
See All Featured
The Psychology of Web Performance [Beyond Tellerrand 2023]
tammyeverts
45
2.3k
Speed Design
sergeychernyshev
25
730
[RailsConf 2023] Rails as a piece of cake
palkan
53
5.1k
No one is an island. Learnings from fostering a developers community.
thoeni
19
3.1k
Building Your Own Lightsaber
phodgson
104
6.2k
Making the Leap to Tech Lead
cromwellryan
133
9k
How GitHub (no longer) Works
holman
312
140k
Easily Structure & Communicate Ideas using Wireframe
afnizarnur
192
16k
4 Signs Your Business is Dying
shpigford
182
22k
How to Think Like a Performance Engineer
csswizardry
22
1.3k
Practical Tips for Bootstrapping Information Extraction Pipelines
honnibal
PRO
10
860
Embracing the Ebb and Flow
colly
84
4.5k
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
͋Γ͕ͱ͏͍͟͝·ͨ͠ ٩ ๑❛ᴗ❛๑ ۶ גࣜձࣾحฌୂ ΤϯδχΞେืूதͰ͢