Android Open Source - Yeah-MaterialLove Drawer List Adapter

From Project

Back to project page Yeah-MaterialLove.


The source code is released under:

Apache License

If you think the Android project Yeah-MaterialLove 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.yeahdev.materiallovetesting.adapter;
// ww  w .ja  v a  2s .  co  m
import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ArrayAdapter;
import android.widget.ImageView;

import com.devspark.robototextview.widget.RobotoTextView;
import com.yeahdev.materiallovetesting.R;

public class DrawerListAdapter extends ArrayAdapter {

    private Context context;
    private int[] iconList;
    private String[] itemList;

    public DrawerListAdapter(Context context, int[] iconList, String[] itemList) {
        super(context, R.layout.drawer_menu_item);
        this.context = context;
        this.iconList = iconList;
        this.itemList = itemList;

    public int getCount() {
        return this.iconList.length;

    public View getView(int position, View convertView, ViewGroup parent) {
        if (convertView == null) {
            convertView = LayoutInflater.from(getContext()).inflate(R.layout.drawer_menu_item, parent, false);

        ((ImageView) convertView.findViewById([position]));
        ((RobotoTextView) convertView.findViewById([position]);

        return convertView;

Java Source Code List