Android Open Source - inbox-android Sample Array Adapter






From Project

Back to project page inbox-android.

License

The source code is released under:

MIT License

If you think the Android project inbox-android 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.inboxapp.androidsdk.sample_application;
//www  .ja  v a 2  s  . c  o m
import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ArrayAdapter;
import android.widget.TextView;

import com.inboxapp.androidsdk.R;

/**
 * Created by sylvianguessan on 8/7/14.
 */
public class SampleArrayAdapter extends ArrayAdapter<String> {
    private final Context context;
    private final String[] values;
    private boolean isMenuItem;
    private String detailCategoryTitle;

    public SampleArrayAdapter(Context context, String[] values, boolean isMenu, String detailCategoryTitleStr) {
        super(context, R.layout.row_sample_menu, values);
        this.context = context;
        this.values = values;
        this.isMenuItem = isMenu;
        this.detailCategoryTitle = detailCategoryTitleStr;
    }

    @Override
    public View getView(int position, View convertView, ViewGroup parent) {
        LayoutInflater inflater = (LayoutInflater) context
                .getSystemService(Context.LAYOUT_INFLATER_SERVICE);
        if (isMenuItem) {
            View rowView = inflater.inflate(R.layout.row_sample_menu, parent, false);
            TextView textView = (TextView) rowView.findViewById(R.id.categoryTitle);
            textView.setText(values[position]);
            return rowView;
        }
        else
        {
            View rowView = inflater.inflate(R.layout.row_sample_detail, parent, false);
            TextView textView = (TextView) rowView.findViewById(R.id.categoryTitle);
            textView.setText(String.format("%s%s%d%s", detailCategoryTitle, "[", position,"]"));
            TextView textViewDetails = (TextView) rowView.findViewById(R.id.categoryDetails);
            textViewDetails.setText(values[position]);
            return rowView;
        }
    }
}




Java Source Code List

com.inboxapp.androidapplication.MainActivity.java
com.inboxapp.androidsdk.apis.InboxAppClient.java
com.inboxapp.androidsdk.apis.taskmanagement.InboxAppTaskCallback.java
com.inboxapp.androidsdk.apis.taskmanagement.InboxAppTaskQueue.java
com.inboxapp.androidsdk.apis.taskmanagement.InboxTaskID.java
com.inboxapp.androidsdk.apis.taskmanagement.InboxAppTasks.CreateCustomTagTask.java
com.inboxapp.androidsdk.apis.taskmanagement.InboxAppTasks.CreateDraftWithBodyTask.java
com.inboxapp.androidsdk.apis.taskmanagement.InboxAppTasks.SendDraftWithBodyTask.java
com.inboxapp.androidsdk.apis.taskmanagement.InboxAppTasks.SendDraftWithIDTask.java
com.inboxapp.androidsdk.apis.taskmanagement.InboxAppTasks.UpdateThreadTagsTask.java
com.inboxapp.androidsdk.apis.taskmanagement.InboxAppTasks.base.InboxAppTask.java
com.inboxapp.androidsdk.json_objects.collection_objects.ContactList.java
com.inboxapp.androidsdk.json_objects.collection_objects.DraftList.java
com.inboxapp.androidsdk.json_objects.collection_objects.FileList.java
com.inboxapp.androidsdk.json_objects.collection_objects.MessageList.java
com.inboxapp.androidsdk.json_objects.collection_objects.NameSpaceList.java
com.inboxapp.androidsdk.json_objects.collection_objects.ParticipantList.java
com.inboxapp.androidsdk.json_objects.collection_objects.TagList.java
com.inboxapp.androidsdk.json_objects.collection_objects.ThreadList.java
com.inboxapp.androidsdk.json_objects.single_objects.Contact.java
com.inboxapp.androidsdk.json_objects.single_objects.Draft.java
com.inboxapp.androidsdk.json_objects.single_objects.File.java
com.inboxapp.androidsdk.json_objects.single_objects.Message.java
com.inboxapp.androidsdk.json_objects.single_objects.Namespace.java
com.inboxapp.androidsdk.json_objects.single_objects.Participant.java
com.inboxapp.androidsdk.json_objects.single_objects.Tag.java
com.inboxapp.androidsdk.json_objects.single_objects.Thread.java
com.inboxapp.androidsdk.json_objects.single_objects.base.InboxAppSingleObject.java
com.inboxapp.androidsdk.json_objects.single_objects.body_objects.DraftID.java
com.inboxapp.androidsdk.json_objects.single_objects.body_objects.TagEdit.java
com.inboxapp.androidsdk.json_objects.single_objects.body_objects.TagName.java
com.inboxapp.androidsdk.sample_application.SampleArrayAdapter.java
com.inboxapp.androidsdk.sample_application.SampleDetailsActivity.java
com.inboxapp.androidsdk.sample_application.SampleMenuActivity.java
com.inboxapp.androidsdk.scratchpad.Scratchpad_MainActivity.java
com.inboxapp.androidsdk.scratchpad.scratchpad_apis.JacksonContributor.java
com.inboxapp.androidsdk.scratchpad.scratchpad_apis.TestApi.java
com.inboxapp.androidsdk.utils.InboxAppStringUtils.java