<commit_before>package teamawesome.cs180frontend.Adapters;

import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;

import teamawesome.cs180frontend.Misc.Utils;
import teamawesome.cs180frontend.Misc.ViewHolders.NavDrawerViewHolder;
import teamawesome.cs180frontend.R;

/**
 * Created by KongK on 10/14/2016.
 */

public class NavDrawerAdapter extends BaseAdapter {
    private String[] mIcons;
    private String[] mText;
    private Context mContext;

    public NavDrawerAdapter(String[] icons, String[] text, Context context) {
        this.mIcons = icons;
        this.mText = text;
        this.mContext = context;
    }

    @Override
    public int getCount() {
        return mIcons.length;
    }

    @Override
    public Object getItem(int position) {
        return mText[position];
    }

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

    public void changeLoginElem() {

        if (mText[4].equals(mContext.getString(R.string.login))) {
            mText[4] = mContext.getString(R.string.logout);
        } else {
            mText[4] = mContext.getString(R.string.login);
        }
        notifyDataSetChanged();
    }

    @Override
    public View getView(int position, View convertView, ViewGroup parent) {
        NavDrawerViewHolder holder;

        if(convertView == null) {
            LayoutInflater vi = (LayoutInflater) mContext.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
            convertView = vi.inflate(R.layout.list_item_nav_drawer, parent, false);
            holder = new NavDrawerViewHolder(convertView);<commit_msg>Fix login school autocomplete<commit_after>package teamawesome.cs180frontend.Adapters;

import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;

import teamawesome.cs180frontend.Misc.Utils;
import teamawesome.cs180frontend.Misc.ViewHolders.NavDrawerViewHolder;
import teamawesome.cs180frontend.R;

/**
 * Created by KongK on 10/14/2016.
 */

public class NavDrawerAdapter extends BaseAdapter {
    private String[] mIcons;
    private String[] mText;
    private Context mContext;

    public NavDrawerAdapter(String[] icons, String[] text, Context context) {
        this.mIcons = icons;
        this.mText = text;
        this.mContext = context;
    }

    @Override
    public int getCount() {
        return mIcons.length;
    }

    @Override
    public Object getItem(int position) {
        return mText[position];
    }

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

    public void changeLoginElem() {

        if (mText[3].equals(mContext.getString(R.string.login))) {
            mText[3] = mContext.getString(R.string.logout);
        } else {
            mText[3] = mContext.getString(R.string.login);
        }
        notifyDataSetChanged();
    }

    @Override
    public View getView(int position, View convertView, ViewGroup parent) {
        NavDrawerViewHolder holder;

        if(convertView == null) {
            LayoutInflater vi = (LayoutInflater) mContext.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
            convertView = vi.inflate(R.layout.list_item_nav_drawer, parent, false);
            holder = new NavDrawerViewHolder(convertView);
{'fraction_non_alphanumeric': 0.0956268221574344, 'fraction_numerical': 0.013411078717201166, 'mean_word_length': 3.065165876777251, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2278834', 'n_tokens_mistral': 1066, 'n_tokens_neox': 1002, 'n_words': 212}