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

Commit 043a608f authored by g git branch's avatar g git branch Committed by Josh Guilfoyle
Browse files

-- Adding three Files SectionHeaderimageButton - in code/java/com/tmobile/widget/

pluto_button_add_element_rest.xml in core/res/res/drawable/

 tmobile_section_header_image_button.xml core/res/res/layout/

 to create section header component.
parent a834ddd6
Loading
Loading
Loading
Loading
+60 −0
Original line number Diff line number Diff line
package com.tmobile.widget;

import com.android.internal.R;

import android.content.Context;
import android.content.res.TypedArray;
import android.graphics.drawable.Drawable;
import android.util.AttributeSet;
import android.view.LayoutInflater;
import android.widget.Button;
import android.widget.LinearLayout;
import android.widget.TextView;

public class SectionHeaderImageButton extends LinearLayout {

	private TextView mHeader;
    private Button mButton;
	
	public SectionHeaderImageButton(Context context) {
		this(context, null);
	}

	public SectionHeaderImageButton(Context context, AttributeSet attrs) {
		this(context, attrs, R.attr.sectionHeaderLayoutLabel);
	}
	
	public SectionHeaderImageButton(Context context, AttributeSet attrs, int defStyle) {
		super(context, attrs, defStyle);

		LayoutInflater.from(context).inflate(R.layout.tmobile_section_header_image_button, this, true);

		TypedArray a = 
            context.obtainStyledAttributes(attrs, R.styleable.HeaderLayout, defStyle, 0);

		mHeader = (TextView)findViewById(R.id.headerId);
		String headerText = a.getString(R.styleable.HeaderLayout_headerText);
        if (headerText != null) {
        	mHeader.setText(headerText);
        }
        
        mButton = (Button)findViewById(R.id.button1);
        a.recycle();
	}

	public CharSequence getHeaderText() {
		return mHeader.getText();
	}
	
	public void setHeaderText(CharSequence text) {
		mHeader.setText(text);
	}
	
	public Button getButton() {
		return mButton;
	}
	
	public void setButtonBackGround(int resource){
		mButton.setBackgroundResource(resource);
	}
}
+1.13 KiB
Loading image diff...
+18 −0
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<merge
	xmlns:android="http://schemas.android.com/apk/res/android">
	<TextView
		android:layout_width="wrap_content"
		android:layout_height="wrap_content"
		android:layout_weight="1.0"
		android:singleLine="true"
		android:textAppearance="?android:attr/textAppearanceLabelHeader"
		android:id="@+id/headerId" />

	<Button
		android:layout_width="wrap_content"
		android:layout_height="wrap_content"
		android:paddingLeft="8dp"
		android:id="@+id/button1"
		android:background="@drawable/pluto_button_add_element_rest"/>
</merge>
 No newline at end of file