Android Open Source - psiandroid Header Text View






From Project

Back to project page psiandroid.

License

The source code is released under:

GNU General Public License

If you think the Android project psiandroid listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

package com.phpsysinfo.ui;
//from   ww w  .  j  a  va 2s.  c  om
import android.content.Context;
import android.content.res.Resources;
import android.graphics.Canvas;
import android.graphics.Typeface;
import android.graphics.drawable.Drawable;
import android.util.AttributeSet;
import android.widget.LinearLayout;
import android.widget.TableRow.LayoutParams;
import android.widget.TextView;

import com.phpsysinfo.R;

public class HeaderTextView extends TextView {

  public HeaderTextView(Context context) {
    super(context);
    custom();
  }

  public HeaderTextView(Context context, AttributeSet attrs) {
    super(context, attrs);
    custom();
  }

  public HeaderTextView(Context context, AttributeSet attrs, int defStyle) {
    super(context, attrs, defStyle);
    custom();
  }

  protected void onDraw (Canvas canvas) {
    super.onDraw(canvas);
  }
  
  public void custom() {
    this.setBackgroundColor(getResources().getColor(R.color.header));
    this.setTypeface(null,Typeface.BOLD);
    this.setPadding(5, 5, 5, 5);
    LinearLayout.LayoutParams llp = new LinearLayout.LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT);
    llp.setMargins(0, 5, 0, 5);
    this.setLayoutParams(llp);
    
    Resources res = getResources();
    int resourceId = res.getIdentifier("up", "drawable", getContext().getPackageName());
    Drawable img = res.getDrawable(resourceId);
    this.setCompoundDrawablesWithIntrinsicBounds(img, null , null, null);
  }
}




Java Source Code List

com.phpsysinfo.activity.HostListActivity.java
com.phpsysinfo.activity.PSIActivity.java
com.phpsysinfo.activity.PSIConfig.java
com.phpsysinfo.activity.PSIPreferencesActivity.java
com.phpsysinfo.ui.HeaderTextView.java
com.phpsysinfo.utils.FormatUtils.java
com.phpsysinfo.xml.MySSLSocketFactory.java
com.phpsysinfo.xml.PSIBat.java
com.phpsysinfo.xml.PSIDownloadData.java
com.phpsysinfo.xml.PSIErrorCode.java
com.phpsysinfo.xml.PSIHostData.java
com.phpsysinfo.xml.PSIMountPoint.java
com.phpsysinfo.xml.PSINetworkInterface.java
com.phpsysinfo.xml.PSIPrinterItem.java
com.phpsysinfo.xml.PSIPrinter.java
com.phpsysinfo.xml.PSIRaidDevice.java
com.phpsysinfo.xml.PSIRaid.java
com.phpsysinfo.xml.PSISmart.java
com.phpsysinfo.xml.PSITemperature.java
com.phpsysinfo.xml.PSIUps.java
com.phpsysinfo.xml.PSIXmlParse.java