Android Open Source - dNote Drawer Menu List






From Project

Back to project page dNote.

License

The source code is released under:

GNU General Public License

If you think the Android project dNote 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.digutsoft.note;
/*from  ww  w . j av a  2  s .  com*/
import android.content.Context;
import android.graphics.drawable.Drawable;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.ImageView;
import android.widget.TextView;

import java.util.ArrayList;

class DrawerMenuList {
    DrawerMenuList(String title, Drawable icon) {
        this.title = title;
        this.icon = icon;
    }

    String title;
    Drawable icon;
}

class DrawerMenuListAdapter extends BaseAdapter {

    Context mContext;
    ArrayList<DrawerMenuList> alDrawerList;

    public DrawerMenuListAdapter(Context mContext, ArrayList<DrawerMenuList> alDrawerList) {
        this.mContext = mContext;
        this.alDrawerList = alDrawerList;
    }

    public int getCount() {
        return alDrawerList.size();
    }

    public Object getItem(int position) {
        return alDrawerList.get(position);
    }

    public long getItemId(int position) {
        return position;
    }

    public View getView(final int position, View convertView, ViewGroup parent) {
        if (convertView == null) {
            LayoutInflater layoutInflater = LayoutInflater.from(mContext);
            convertView = layoutInflater.inflate(R.layout.drawer_menu, parent, false);

            TextView tvTitle = (TextView) convertView.findViewById(R.id.tvTitle);
            ImageView ivIcon = (ImageView) convertView.findViewById(R.id.ivIcon);

            tvTitle.setText(alDrawerList.get(position).title);
            ivIcon.setImageDrawable(alDrawerList.get(position).icon);
        }

        return convertView;
    }

    public boolean hasStableIds() {
        return true;
    }
}




Java Source Code List

android.support.v4.preference.PreferenceFragment.java
android.support.v4.preference.PreferenceManagerCompat.java
android.support.v4.preferencefragment.BuildConfig.java
android.support.v4.preferencefragment.BuildConfig.java
com.digutsoft.note.DMCategoryManager.java
com.digutsoft.note.DMMain.java
com.digutsoft.note.DMMemoView.java
com.digutsoft.note.DMNewNote.java
com.digutsoft.note.DMSaveFromWear.java
com.digutsoft.note.DMSaveFrom.java
com.digutsoft.note.DMSettingsFragment.java
com.digutsoft.note.DMSettings.java
com.digutsoft.note.DMSplash.java
com.digutsoft.note.DMWearVoiceAction.java
com.digutsoft.note.DrawerMenuList.java
com.digutsoft.note.NavigationDrawerFragment.java
com.digutsoft.note.classes.DMDatabaseHelper.java
com.digutsoft.note.classes.DMMemoList.java
com.digutsoft.note.classes.DMMemoTools.java