类 AbstractWheelTextAdapter

    • 字段详细资料

      • TEXT_VIEW_ITEM_RESOURCE

        public static final int TEXT_VIEW_ITEM_RESOURCE
        Text view resource. Used as a default view for adapter.
        另请参阅:
        常量字段值
      • LABEL_COLOR

        public static final int LABEL_COLOR
        Default text color
        另请参阅:
        常量字段值
      • DEFAULT_TEXT_SIZE

        public static final int DEFAULT_TEXT_SIZE
        Default text size
        另请参阅:
        常量字段值
      • NO_RESOURCE

        protected static final int NO_RESOURCE
        No resource constant.
        另请参阅:
        常量字段值
      • context

        protected Context context
      • itemResourceId

        protected int itemResourceId
      • itemTextResourceId

        protected int itemTextResourceId
      • emptyItemResourceId

        protected int emptyItemResourceId
    • 构造器详细资料

      • AbstractWheelTextAdapter

        protected AbstractWheelTextAdapter​(Context context)
        Constructor
        参数:
        context - the current context
      • AbstractWheelTextAdapter

        protected AbstractWheelTextAdapter​(Context context,
                                           int itemResource)
        Constructor
        参数:
        context - the current context
        itemResource - the resource ID for a layout file containing a TextView to use when instantiating items views
      • AbstractWheelTextAdapter

        protected AbstractWheelTextAdapter​(Context context,
                                           int itemResource,
                                           int itemTextResource)
        Constructor
        参数:
        context - the current context
        itemResource - the resource ID for a layout file containing a TextView to use when instantiating items views
        itemTextResource - the resource ID for a text view in the item layout
    • 方法详细资料

      • getItemResource

        public int getItemResource()
        Gets resource Id for items views
        返回:
        the item resource Id
      • setItemResource

        public void setItemResource​(int itemResourceId)
        Sets resource Id for items views
        参数:
        itemResourceId - the resource Id to set
      • getItemTextResource

        public int getItemTextResource()
        Gets resource Id for text view in item layout
        返回:
        the item text resource Id
      • setItemTextResource

        public void setItemTextResource​(int itemTextResourceId)
        Sets resource Id for text view in item layout
        参数:
        itemTextResourceId - the item text resource Id to set
      • getEmptyItemResource

        public int getEmptyItemResource()
        Gets resource Id for empty items views
        返回:
        the empty item resource Id
      • setEmptyItemResource

        public void setEmptyItemResource​(int emptyItemResourceId)
        Sets resource Id for empty items views
        参数:
        emptyItemResourceId - the empty item resource Id to set
      • getItemText

        protected abstract CharSequence getItemText​(int index)
        Returns text for specified item
        参数:
        index - the item index
        返回:
        the text of specified items
      • getItem

        public View getItem​(int index,
                            View convertView,
                            ViewGroup parent)
        从接口复制的说明: WheelViewAdapter
        Get a View that displays the data at the specified position in the data set
        参数:
        index - the item index
        convertView - the old view to reuse if possible
        parent - the parent that this view will eventually be attached to
        返回:
        the wheel item View
      • getEmptyItem

        public View getEmptyItem​(View convertView,
                                 ViewGroup parent)
        从接口复制的说明: WheelViewAdapter
        Get a View that displays an empty wheel item placed before the first or after the last wheel item.
        指定者:
        getEmptyItem 在接口中 WheelViewAdapter
        覆盖:
        getEmptyItem 在类中 AbstractWheelAdapter
        参数:
        convertView - the old view to reuse if possible
        parent - the parent that this view will eventually be attached to
        返回:
        the empty item View
      • configureTextView

        protected void configureTextView​(TextView view)
        Configures text view. Is called for the TEXT_VIEW_ITEM_RESOURCE views.
        参数:
        view - the text view to be configured
      • setConfig

        public void setConfig​(PickerConfig config)