Android Open Source - dialogplus Basic Holder






From Project

Back to project page dialogplus.

License

The source code is released under:

Apache License

If you think the Android project dialogplus 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.orhanobut.dialogplus;
//www . ja va  2  s  .  c  o m
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;

/**
 * @author Orhan Obut
 */
public class BasicHolder implements Holder, SimpleListView.OnItemClickListener {

    private static final String TAG = BasicHolder.class.getSimpleName();
    private SimpleListView simpleListView;
    private OnItemClickListener listener;

    @Override
    public void addHeader(View view) {
        Log.d(TAG, "addHeader called");
        simpleListView.setHeaderView(view);
    }

    @Override
    public void addFooter(View view) {
        Log.d(TAG, "addFooter called");
        simpleListView.setFooterView(view);
    }

    @Override
    public void setAdapter(BaseAdapter adapter) {
        simpleListView.setAdapter(adapter);
    }

    @Override
    public View getView(LayoutInflater inflater, ViewGroup parent) {
        View view = inflater.inflate(R.layout.dialog_basic, parent, false);
        simpleListView = (SimpleListView) view.findViewById(R.id.list);
        simpleListView.setOnItemClickListener(this);
        return view;
    }

    @Override
    public void setOnItemClickListener(OnItemClickListener listener) {
        this.listener = listener;
    }

    @Override
    public void onItemClick(Object item, View view, int position) {
        listener.onItemClick(item, view, position);
    }
}




Java Source Code List

com.orhanobut.android.dialogplus.ApplicationTest.java
com.orhanobut.android.dialogplussample.ApplicationTest.java
com.orhanobut.android.dialogplussample.MainActivity.java
com.orhanobut.dialogplus.BasicHolder.java
com.orhanobut.dialogplus.DialogPlus.java
com.orhanobut.dialogplus.GridHolder.java
com.orhanobut.dialogplus.Holder.java
com.orhanobut.dialogplus.ListHolder.java
com.orhanobut.dialogplus.OnItemClickListener.java
com.orhanobut.dialogplus.SimpleListView.java