Android Open Source - led-notifier S M S App Adapter From Project Back to project page led-notifier .
License The source code is released under:
Apache License
If you think the Android project led-notifier 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.ciubotariu_levy.lednotifier;
/ * f r o m w w w . j a v a 2 s . c o m * /
import android.content.Context;
import android.graphics.drawable.Drawable;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ArrayAdapter;
import android.widget.ImageView;
import android.widget.ImageView.ScaleType;
import android.widget.TextView;
import com.ciubotariu_levy.lednotifier.SMSAppAdapter.IconPackagePair;
public class SMSAppAdapter extends ArrayAdapter<IconPackagePair> {
public static class IconPackagePair{
public Drawable icon;
public String appName;
}
private static final int LAYOUT_RESOURCE = R.layout.app_row;
private static final int TEXTVIEW_RESOURCE = R.id.app_name;
private static final int APP_ICON_RESOURCE = R.id.app_icon;
private LayoutInflater mInflater;
public SMSAppAdapter(Context context, IconPackagePair[] objects) {
super (context, LAYOUT_RESOURCE, TEXTVIEW_RESOURCE, objects);
mInflater = LayoutInflater.from(context);
}
@Override
public View getView (int position, View convertView, ViewGroup parent){
View view = convertView;
if (view == null){
view = mInflater.inflate(LAYOUT_RESOURCE, parent, false);
}
IconPackagePair pair = getItem(position);
ImageView appIcon = (ImageView) view.findViewById(APP_ICON_RESOURCE);
appIcon.setScaleType(ScaleType.FIT_CENTER);
appIcon.setImageDrawable(pair.icon);
TextView appName = (TextView) view.findViewById(TEXTVIEW_RESOURCE);
appName.setText (pair.appName);
return view;
}
}
Java Source Code List com.ciubotariu_levy.lednotifier.AboutActivity.java com.ciubotariu_levy.lednotifier.AlarmDismissReceiver.java com.ciubotariu_levy.lednotifier.BoldCheckedView.java com.ciubotariu_levy.lednotifier.BootBroadcastReceiver.java com.ciubotariu_levy.lednotifier.CircularColorView.java com.ciubotariu_levy.lednotifier.ColorDialog.java com.ciubotariu_levy.lednotifier.ColorVibrateDialog.java com.ciubotariu_levy.lednotifier.ContactsFragment.java com.ciubotariu_levy.lednotifier.CustomContactsFragment.java com.ciubotariu_levy.lednotifier.DataFetcher.java com.ciubotariu_levy.lednotifier.DefaultColorChooserContainer.java com.ciubotariu_levy.lednotifier.FastScrollThemedListView.java com.ciubotariu_levy.lednotifier.LEDCancelReceiver.java com.ciubotariu_levy.lednotifier.MainActivity.java com.ciubotariu_levy.lednotifier.NotificationService.java com.ciubotariu_levy.lednotifier.NotificationUtils.java com.ciubotariu_levy.lednotifier.ObserverService.java com.ciubotariu_levy.lednotifier.SMSAppAdapter.java com.ciubotariu_levy.lednotifier.SMSAppChooserContainer.java com.ciubotariu_levy.lednotifier.SMSReceiver.java com.ciubotariu_levy.lednotifier.SectionedCursorAdapter.java com.ciubotariu_levy.lednotifier.SettingsActivity.java com.ciubotariu_levy.lednotifier.SmsAppChooserDialog.java com.ciubotariu_levy.lednotifier.providers.LedContactInfo.java com.ciubotariu_levy.lednotifier.providers.LedContactProvider.java com.ciubotariu_levy.lednotifier.providers.LedContacts.java com.larswerkman.holocolorpicker.ColorPicker.java com.larswerkman.holocolorpicker.EndColorPicker.java com.larswerkman.holocolorpicker.LinearColorPicker.java com.larswerkman.holocolorpicker.OnColorChangedListener.java com.larswerkman.holocolorpicker.OpacityBar.java com.larswerkman.holocolorpicker.SVBar.java com.larswerkman.holocolorpicker.SaturationBar.java com.larswerkman.holocolorpicker.ValueBar.java com.makeramen.RoundedDrawable.java com.makeramen.RoundedTransformationBuilder.java