Back to project page treedo.
The source code is released under:
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE Version 2, December 2004 Everyone is permitted to copy and distribute verbatim or modified copies of this license document, ...
If you think the Android project treedo listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package com.mbonnin.treedo; /*from w ww . j ava2 s. co m*/ import android.content.Context; import android.database.DataSetObserver; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.ListAdapter; import android.widget.TextView; import java.util.ArrayList; /** * Created by martin on 17/11/14. */ public class BackupAdapter implements ListAdapter { ArrayList<BackupManager.Drive> mDrives; Context mContext; public BackupAdapter(Context context, ArrayList<BackupManager.Drive> drives) { mDrives = drives; mContext = context; } @Override public void registerDataSetObserver(DataSetObserver observer) { } @Override public void unregisterDataSetObserver(DataSetObserver observer) { } @Override public int getCount() { return mDrives.size(); } @Override public Object getItem(int position) { return mDrives.get(position); } @Override public long getItemId(int position) { return 0; } @Override public boolean hasStableIds() { return false; } @Override public View getView(int position, View convertView, ViewGroup parent) { View view = LayoutInflater.from(mContext).inflate(R.layout.backup_item, null); TextView textView = (TextView)view.findViewById(R.id.label); textView.setText(mDrives.get(position).title); return view; } @Override public int getItemViewType(int position) { return 0; } @Override public int getViewTypeCount() { return 1; } @Override public boolean isEmpty() { return false; } @Override public boolean areAllItemsEnabled() { return true; } @Override public boolean isEnabled(int position) { return true; } }