Back to project page android-gskbyte-utils.
The source code is released under:
GNU Lesser General Public License
If you think the Android project android-gskbyte-utils listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
/******************************************************************************* * Copyright (c) 2013 Jose Alcal Correa. * All rights reserved. This program and the accompanying materials * are made available under the terms of the GNU Lesser Public License v3.0 * which accompanies this distribution, and is available at * http://www.gnu.org/licenses/lgpl-3.0.txt * //ww w. j a v a 2s .c o m * Contributors: * Jose Alcal Correa - initial API and implementation ******************************************************************************/ package org.gskbyte.ui.iconifiedMainMenuList; import org.gskbyte.R; import android.content.Context; import android.util.AttributeSet; import android.view.LayoutInflater; import android.view.View; import android.widget.ImageView; import android.widget.RelativeLayout; import android.widget.TextView; public class EntryView extends RelativeLayout { protected ImageView icon; protected TextView title, subtitle; public EntryView(Context context, AttributeSet attrs) { super(context, attrs); LayoutInflater.from(context).inflate(R.layout.icon_menu_item, this); initViews(); } protected void initViews() { icon = (ImageView) findViewById(R.id.icon); title = (TextView) findViewById(R.id.title); subtitle = (TextView) findViewById(R.id.subtitle); } public void set(MenuEntry entry) { icon.setImageResource(entry.iconRes); title.setText(entry.title); subtitle.setVisibility( (entry.subtitle.length() == 0) ? View.GONE : View.VISIBLE); subtitle.setText(entry.subtitle); setTag(entry); } }