使用一個(gè)已經(jīng)存在的類(lèi),如果它的方法跟我們的要求不相同時(shí),這時(shí)就應(yīng)該考慮使用適配器模式。
適配器可以讓客戶端統(tǒng)一調(diào)用同一接口,這樣可以更簡(jiǎn)單、更直接、更緊湊。(摘自《大話設(shè)計(jì)模式》)
適配器可以讓客戶端統(tǒng)一調(diào)用同一接口,這樣可以更簡(jiǎn)單、更直接、更緊湊。(摘自《大話設(shè)計(jì)模式》)
2015-01-30
zhuang zuo jian he zhuenbeijinwanlinihaoa haha!ni hao ma?ha ha ni hao a?
2015-01-29
private interface topbarVlicklistenerP
public void leftclick();
public void rightclick();
public void setOntopbarClickliteneer();
private void setOnTOPbATCLICKLISTENER();
TOPBA TIP=FINDvIEW
TOPT
TOPSEToNTOPBARcLIKX
NEW TOPSETonpto
public void leftclick();
public void rightclick();
public void setOntopbarClickliteneer();
private void setOnTOPbATCLICKLISTENER();
TOPBA TIP=FINDvIEW
TOPT
TOPSEToNTOPBARcLIKX
NEW TOPSETonpto
2015-01-29
public interfacepublic void setOnTopbarClickListener(topbarClickLiatener listener){
2015-01-29
<TextView>
<com.imooc.app.topbar
wid th
height;
leftButton.setOnClickListener(new OnClickListener(){
public void onClick(View v ){
<com.imooc.app.topbar
wid th
height;
leftButton.setOnClickListener(new OnClickListener(){
public void onClick(View v ){
2015-01-29
private LayoutParams leftParams,rightParams,titleParams;
leftParams=new LayourParams();
leftParams.addRule(RelativeLayout.al;ture;);
addView(leftButton,leftParams);
tvtitle,titleparams;
certerinmatchpar;
leftParams=new LayourParams();
leftParams.addRule(RelativeLayout.al;ture;);
addView(leftButton,leftParams);
tvtitle,titleparams;
certerinmatchpar;
2015-01-29
leftButton=new Button(context);
rightButton=new Button(context);
tvtitle=new TextView(context);
leftButton.setTextColor(leftBackground);
leftButton.setBackground(tightBackground);
ta.recycle();
tvtltle.setTEXTcolor();
tvtitle.setTextSize(titleTextSize);
tvtitle.setGravity(Gravity.center);
setB
rightButton=new Button(context);
tvtitle=new TextView(context);
leftButton.setTextColor(leftBackground);
leftButton.setBackground(tightBackground);
ta.recycle();
tvtltle.setTEXTcolor();
tvtitle.setTextSize(titleTextSize);
tvtitle.setGravity(Gravity.center);
setB
2015-01-29
private Button leftButtons Relativelayout{
private Button leftButton,rightButton;
private
private int titleTextColor;
private String title;
private Drawable rightBackground;
public Topbar(Context context,AttribuSET
private Button leftButton,rightButton;
private
private int titleTextColor;
private String title;
private Drawable rightBackground;
public Topbar(Context context,AttribuSET
2015-01-29
ID <declare-styleable name="Topbar">
<attr name="title" >
<attr name="titleTextSize" format="dimension"/>
<attr name="title" >
<attr name="titleTextSize" format="dimension"/>
2015-01-29