Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 17e5caff authored by Amit Kohli's avatar Amit Kohli Committed by Josh Guilfoyle
Browse files

added accessor methods to headerSubHeaderIcon widget

parent d052f64d
Loading
Loading
Loading
Loading
+10 −2
Original line number Diff line number Diff line
@@ -15,6 +15,7 @@ public class HeaderSubHeaderIcon extends LinearLayout {
	
	private TextView mHeader;
	private TextView mSubHeader;
	private ImageView mImageView;
		
	public HeaderSubHeaderIcon(Context context) {
		this(context, null);
@@ -32,10 +33,10 @@ public class HeaderSubHeaderIcon extends LinearLayout {
		TypedArray a = 
            context.obtainStyledAttributes(attrs, R.styleable.HeaderLayout, defStyle, 0);

		mImageView = (ImageView)findViewById(R.id.headerIcon);
        Drawable mIcon = a.getDrawable(R.styleable.HeaderLayout_iconSrc);
        if (mIcon != null) {
        	ImageView imageView = (ImageView)findViewById(R.id.headerIcon);
        	imageView.setImageDrawable(mIcon);
        	mImageView.setImageDrawable(mIcon);
        }

        mHeader = (TextView)findViewById(R.id.headerId);
@@ -69,4 +70,11 @@ public class HeaderSubHeaderIcon extends LinearLayout {
		mSubHeader.setText(text);
	}
	
	public Drawable getIconSrc() {
		return mImageView.getDrawable();
	}
	
	public void setIconSrc(Drawable drawable) {
		mImageView.setImageDrawable(drawable);
	}
}