Android Open Source - Android-ORM Abstract Base Adapter






From Project

Back to project page Android-ORM.

License

The source code is released under:

Apache License

If you think the Android project Android-ORM 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

/*
 * Copyright 2013 E6Home inc. All rights reserved. 
 * created date: 2013?9?12?/* ww w  .j  ava2  s  . c  om*/
 */
package cn.ieclipse.aorm.example;

import java.util.List;

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

/**
 * 
 * @author Jamling
 * 
 */
public abstract class AbstractBaseAdapter<T> extends BaseAdapter {
    protected Context mContext;
    protected List<T> dataList;
    
    public AbstractBaseAdapter(Context context, List<T> dataList) {
        this.mContext = context;
        this.dataList = dataList;
    }
    
    public List<T> getDataList() {
        return dataList;
    }
    
    public void setDataList(List<T> dataList) {
        this.dataList = dataList;
    }
    
    @Override
    public int getCount() {
        return dataList == null ? 0 : dataList.size();
    }
    
    @Override
    public T getItem(int position) {
        return dataList.get(position);
    }
    
    @Override
    public long getItemId(int position) {
        return 0;
    }
    
    @Override
    public View getView(int position, View convertView, ViewGroup root) {
        if (convertView == null) {
            convertView = View.inflate(mContext, getLayout(), null);
        }
        onUpdateView(convertView, position);
        return convertView;
    }
    
    protected abstract int getLayout();
    
    protected abstract void onUpdateView(View view, int position);
}




Java Source Code List

android.content.ContentResolver.java
android.content.ContentValues.java
android.database.ContentObserver.java
android.database.Cursor.java
android.database.sqlite.SQLiteDatabase.java
android.database.sqlite.SQLiteOpenHelper.java
android.net.Uri.java
android.os.Handler.java
android.util.FastPrintWriter.java
android.util.Log.java
android.util.Printer.java
cn.ieclipse.aorm.Aorm.java
cn.ieclipse.aorm.Criteria.java
cn.ieclipse.aorm.CursorUtils.java
cn.ieclipse.aorm.Mapping.java
cn.ieclipse.aorm.ORMException.java
cn.ieclipse.aorm.Order.java
cn.ieclipse.aorm.Restrictions.java
cn.ieclipse.aorm.SessionObserver.java
cn.ieclipse.aorm.Session.java
cn.ieclipse.aorm.annotation.ColumnWrap.java
cn.ieclipse.aorm.annotation.Column.java
cn.ieclipse.aorm.annotation.TableWrap.java
cn.ieclipse.aorm.annotation.Table.java
cn.ieclipse.aorm.example.AbstractBaseAdapter.java
cn.ieclipse.aorm.example.BaseActivity.java
cn.ieclipse.aorm.example.CourseDetailActivity.java
cn.ieclipse.aorm.example.CourseListActivity.java
cn.ieclipse.aorm.example.DetailActivity.java
cn.ieclipse.aorm.example.ExampleApplication.java
cn.ieclipse.aorm.example.ExampleContentProvider.java
cn.ieclipse.aorm.example.ListActivity.java
cn.ieclipse.aorm.example.MainActivity.java
cn.ieclipse.aorm.example.StudentDetailActivity.java
cn.ieclipse.aorm.example.StudentGradeActivity.java
cn.ieclipse.aorm.example.StudentGradeDetailActivity.java
cn.ieclipse.aorm.example.StudentListActivity.java
cn.ieclipse.aorm.example.bean.Course.java
cn.ieclipse.aorm.example.bean.Grade.java
cn.ieclipse.aorm.example.bean.Student.java