Created
June 13, 2015 02:25
-
-
Save ar-android/f628346fe82a367531ec to your computer and use it in GitHub Desktop.
AdapterActionBar
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import android.annotation.SuppressLint; | |
import android.content.Context; | |
import android.util.AttributeSet; | |
import android.view.LayoutInflater; | |
import android.widget.ImageView; | |
import android.widget.RelativeLayout; | |
import android.widget.TextView; | |
@SuppressLint("NewApi") | |
public class AdapterActionBar extends RelativeLayout { | |
TextView title, subtitle; | |
ImageView imgLogo; | |
public void setTitle(String title) { | |
this.title.setText(title); | |
} | |
public void setSubtitle(String subtitle) { | |
this.subtitle.setText(subtitle); | |
} | |
public AdapterActionBar(Context context) { | |
super(context); | |
init(context); | |
} | |
public AdapterActionBar(Context context, AttributeSet attrs) { | |
super(context, attrs); | |
init(context); | |
} | |
public AdapterActionBar(Context context, AttributeSet attrs, | |
int defStyleAttr, int defStyleRes) { | |
super(context, attrs, defStyleAttr, defStyleRes); | |
init(context); | |
} | |
private void init(Context context) { | |
LayoutInflater laybar = LayoutInflater.from(context); | |
laybar.inflate(R.layout.inflanter_actionbar, this); | |
imgLogo = (ImageView) findViewById(R.id.imgUser); | |
title = (TextView) findViewById(R.id.txTitle); | |
subtitle = (TextView) findViewById(R.id.txSubtitle); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment