Android Open Source - SmartEPW_Android_App Reside Menu Item






From Project

Back to project page SmartEPW_Android_App.

License

The source code is released under:

MIT License

If you think the Android project SmartEPW_Android_App 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.example.android.SmartEPW;
/* w  ww.  j  av a  2 s  .c  om*/
import android.content.Context;
import android.view.LayoutInflater;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView;

import com.example.android.SmartEPW.R;


/**
 * User: special
 * Date: 13-12-10
 * Time: ????11:05
 * Mail: specialcyci@gmail.com
 */
public class ResideMenuItem extends LinearLayout{

    /** menu item  icon  */
    private ImageView iv_icon;
    /** menu item  title */
    private TextView tv_title;

    public ResideMenuItem(Context context) {
        super(context);
        initViews(context);
    }

    public ResideMenuItem(Context context, int icon, int title) {
        super(context);
        initViews(context);
        iv_icon.setImageResource(icon);
        tv_title.setText(title);
    }

    public ResideMenuItem(Context context, int icon, String title) {
        super(context);
        initViews(context);
        iv_icon.setImageResource(icon);
        tv_title.setText(title);
    }

    private void initViews(Context context){
        LayoutInflater inflater=(LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
        inflater.inflate(R.layout.residemenu_item, this);
        iv_icon = (ImageView) findViewById(R.id.iv_icon);
        tv_title = (TextView) findViewById(R.id.tv_title);
    }

    /**
     * set the icon color;
     *
     * @param icon
     */
    public void setIcon(int icon){
        iv_icon.setImageResource(icon);
    }

    /**
     * set the title with resource
     * ;
     * @param title
     */
    public void setTitle(int title){
        tv_title.setText(title);
    }

    /**
     * set the title with string;
     *
     * @param title
     */
    public void setTitle(String title){
        tv_title.setText(title);
    }
}




Java Source Code List

com.example.android.SmartEPW.BluetoothChatService.java
com.example.android.SmartEPW.ControlEPW_Fragment.java
com.example.android.SmartEPW.Debug_Fragment.java
com.example.android.SmartEPW.DeviceListActivity.java
com.example.android.SmartEPW.Help_Fragment.java
com.example.android.SmartEPW.Home_Fragment.java
com.example.android.SmartEPW.MenuActivity.java
com.example.android.SmartEPW.ResideMenuItem.java
com.example.android.SmartEPW.ResideMenu.java
com.example.android.SmartEPW.util.ChartInitialization.java
com.example.android.SmartEPW.util.FormatConvert.java
com.example.android.SmartEPW.widget.VerticalSeekBar_Reverse.java
com.example.android.SmartEPW.widget.VerticalSeekBar.java