Back to project page SmartEPW_Android_App.
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.
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); } }