public class

IconPickerGridViewAdapter

extends ArrayAdapter<T>
java.lang.Object
   ↳ android.widget.BaseAdapter
     ↳ android.widget.ArrayAdapter<T>
       ↳ com.pdftron.pdf.utils.IconPickerGridViewAdapter

Class Overview

An array adapter for showing icons

Summary

[Expand]
Inherited Constants
From interface android.widget.Adapter
Public Constructors
IconPickerGridViewAdapter(Context context, List<String> list)
Class constructor
Public Methods
int getCount()
Gets icons count
String getItem(int position)
Gets icon at specified position
int getItemIndex(String icon)
Gets icon index
String getSelected()
Gets selected icon
View getView(int position, View convertView, ViewGroup parent)
Create a new ImageView for each item referenced by the Adapter
void setSelected(int position)
Selects icon at specified position
void unregisterDataSetObserver(DataSetObserver observer)
Overriding unregisterDataSetObserver resolves a bug on ICS where this function is called twice the number of times it should be.
void updateIconColor(int color)
Updates icon color
void updateIconOpacity(float opacity)
Updates icon opacity
[Expand]
Inherited Methods
From class android.widget.ArrayAdapter
From class android.widget.BaseAdapter
From class java.lang.Object
From interface android.widget.Adapter
From interface android.widget.Filterable
From interface android.widget.ListAdapter
From interface android.widget.SpinnerAdapter
From interface android.widget.ThemedSpinnerAdapter

Public Constructors

public IconPickerGridViewAdapter (Context context, List<String> list)

Class constructor

Parameters
context The context
list The list of icons

Public Methods

public int getCount ()

Gets icons count

Returns
  • icons count

public String getItem (int position)

Gets icon at specified position

Parameters
position The specified position
Returns
  • icon

public int getItemIndex (String icon)

Gets icon index

Parameters
icon The icon
Returns
  • The index

public String getSelected ()

Gets selected icon

Returns
  • The selected icon

public View getView (int position, View convertView, ViewGroup parent)

Create a new ImageView for each item referenced by the Adapter

public void setSelected (int position)

Selects icon at specified position

Parameters
position The specified position

public void unregisterDataSetObserver (DataSetObserver observer)

Overriding unregisterDataSetObserver resolves a bug on ICS where this function is called twice the number of times it should be. This causes the observer to be unregistered twice and throws a "Observer is null" exception when unregistered the second time.

Parameters
observer data set observer

public void updateIconColor (int color)

Updates icon color

Parameters
color The icon color

public void updateIconOpacity (float opacity)

Updates icon opacity

Parameters
opacity The icon opacity