예배 규칙서 찾다
android Manifest Manifest.permission Manifest.permission_group android.accessibilityservice AccessibilityService android.accounts Account android.app NotificationManager android.bluetooth BluetoothAdapter BluetoothClass BluetoothClass.Device BluetoothClass.Device.Major BluetoothClass.Service BluetoothDevice BluetoothServerSocket BluetoothSocket android.content SharedPreferences android.database.sqlite SQLiteCursorDriver SQLiteOpenHelper android.graphics Bitmap android.location LocationListener Geocoder GpsStatus GpsStatus.Listener GpsStatus.NmeaListener GpsSatellite android.media AudioFormat AsyncPlayer AudioRecord AudioRecord.OnRecordPositionUpdateListener ThumbnailUtils AudioManager android.net TrafficStats MailTo LocalSocket android.os AsyncTask AsyncTask.Status CountDownTimer Message MessageQueue HandlerThread android.text Html android.util JsonWriter android.view ContextMenu ContextMenu.ContextMenuInfo Display ViewManager View ViewStub ViewTreeObserver ViewParent WindowManager GestureDetector Gravity MenuInflater ScaleGestureDetector SoundEffectConstants android.view.inputmethod InputConnection InputMethod InputMethodSession BaseInputConnection InputMethodManager android.widget AbsListView AbsListView.LayoutParams AbsListView.OnScrollListener AbsListView.RecyclerListener AbsoluteLayout AbsoluteLayout.LayoutParams AbsSeekBar AbsSpinner AdapterView AdapterView.AdapterContextMenuInfo AdapterView.OnItemLongClickListener AdapterView.OnItemSelectedListener AdapterView.OnItemClickListener AnalogClock BaseAdapter BaseExpandableListAdapter Button CheckBox CheckedTextView Checkable Chronometer Chronometer.OnChronometerTickListener CompoundButton CompoundButton.OnCheckedChangeListener CursorAdapter CursorTreeAdapter DatePicker DatePicker.OnDateChangedListener DialerFilter DigitalClock EditText Filter Filter.FilterListener Filter.FilterResults ExpandableListAdapter ExpandableListView.OnChildClickListener ExpandableListView.OnGroupClickListener ExpandableListView.OnGroupCollapseListener ExpandableListView.OnGroupExpandListener Filterable Gallery Gallery.LayoutParams GridView GridLayout GridLayout.Alignment RadioGroup ImageView ImageView.ScaleType HorizontalScrollView ImageButton ImageSwitcher FilterQueryProvider ListAdapter ListView MediaController MultiAutoCompleteTextView MultiAutoCompleteTextView.CommaTokenizer MultiAutoCompleteTextView.Tokenizer QuickContactBadge RadioButton RatingBar RatingBar.OnRatingBarChangeListener RelativeLayout RemoteViews ResourceCursorAdapter ResourceCursorTreeAdapter Scroller ScrollView SearchView SearchView.OnCloseListener SearchView.OnQueryTextListener SearchView.OnSuggestionListener SeekBar SeekBar.OnSeekBarChangeListener SimpleAdapter SimpleAdapter.ViewBinder SimpleCursorAdapter SimpleCursorAdapter.CursorToStringConverter SimpleCursorAdapter.ViewBinder SimpleCursorTreeAdapter SimpleCursorTreeAdapter.ViewBinder SimpleExpandableListAdapter SlidingDrawer SlidingDrawer.OnDrawerCloseListener SlidingDrawer.OnDrawerOpenListener SlidingDrawer.OnDrawerScrollListener Spinner SpinnerAdapter WrapperListAdapter TabHost TabHost.TabSpec TextView TimePicker TimePicker.OnTimeChangedListener Toast TableLayout TableLayout.LayoutParams TableRow TableRow.LayoutParams TabWidget TextSwitcher ToggleButton TwoLineListItem VideoView ViewAnimator ViewFlipper ViewSwitcher ViewSwitcher.ViewFactory ZoomButtonsController ZoomButtonsController.OnZoomListener ZoomButton ZoomControls dalvik.system DexFile
문자


DialerFilter

版本:Android 3.1 r1

结构

继承关系

public classDialerFilterextendsRelativeLayout

java.lang.Object

android.view.View

android.view.ViewGroup

android.widget.RelativeLayout

android.widget.DialerFilter

类概述

(译者注:拨号器过滤,暂时不清楚使用方法和场景。)

常量

public static final int DIGITS_AND_LETTERS

该模式包含两行。

常量值:1 (0x00000001)

public static final int DIGITS_AND_LETTERS_NO_DIGITS

DIGITS_AND_LETTERS模式开始后,过滤器移除了所有匹配的数字,只剩字母行时的模式。

常量值:2 (0x00000002)

public static final int DIGITS_AND_LETTERS_NO_LETTERS

DIGITS_AND_LETTERS模式开始后,过滤器移除了所有匹配的字母,只剩数字行时的模式。

常量值:3 (0x00000003)

public static final int DIGITS_ONLY

该模式只有数字行。

常量值:4 (0x00000004)

public static final int LETTERS_ONLY

该模式只有字母行。

常量值:5 (0x00000005)

公共方法

public voidappend(String text)

public voidclearText()

清除数值和过滤器文本。

public CharSequencegetDigits()

public CharSequencegetFilterText()

public CharSequencegetLetters()

public intgetMode()

public booleanisQwertyKeyboard()

public booleanonKeyDown(int keyCode, KeyEvent event)

KeyEvent.Callback.onKeyMultiple()的默认实现.如果视图可用并可按,当按下KEYCODE_DPAD_CENTERKEYCODE_ENTER时执行视图的按下事件.

参数

keyCode表示按下的键的、在KEYCODE_ENTER中定义的键盘代码.

event KeyEvent对象,定义了按钮动作.

返回值

如果处理了事件,返回真.如果允许下一个事件接受器处理该事件,可以返回假.

public booleanonKeyUp(int keyCode, KeyEvent event)

KeyEvent.Callback.onKeyMultiple()的默认实现.当释放KEYCODE_DPAD_CENTERKEYCODE_ENTER时执行视图的单击事件.

参数

keyCode表示按下的键的、在KEYCODE_ENTER中定义的键盘代码.

event KeyEvent对象,定义了按钮动作.

返回值

如果处理了事件,返回真.如果允许下一个事件接受器处理该事件,可以返回假.

public voidremoveFilterWatcher(TextWatcher watcher)

public voidsetDigitsWatcher(TextWatcher watcher)

public voidsetFilterWatcher(TextWatcher watcher)

public voidsetLettersWatcher(TextWatcher watcher)

public voidsetMode(int newMode)

改变小部件的模式。

参数

newMode变更的目标模式。

受保护方法

protected voidonFinishInflate()

根据XML生成视图工作完成.该函数在生成视图的最后调用,在所有子视图添加完之后。

即使子类覆盖了onFinishInflate方法,也应该调用父类的方法,使该方法得以执行。

protected voidonFocusChanged(boolean focused, int direction, Rect previouslyFocusedRect)

如果有图标,只是在得到焦点时显示图标视图。

参数

focused如果视图具有焦点,值为真;否则为假.

direction当调用requestFocus()为该视图设置焦点时,该值为焦点移动的方向.其值为FOCUS_UPFOCUS_DOWNFOCUS_LEFT或者FOCUS_RIGHT.当使用无参数的requestFocus()时,可能无值.

previouslyFocusedRect失去焦点的视图的矩形坐标,使用该视图的坐标系统.如果指定了,它将传入可以知道焦点来自哪里的详细信息(作为对direction的补充).否则,其值为null

protected voidonModeChange(int oldMode, int newMode)

在模式变更后调用,为子类提供可以用于重新更改风格的等附加操作的机会。

补充

示例代码

xmlversion="1.0"encoding="utf-8"?>

<DialerFilterandroid:id="@+id/dialer_filter"

xmlns:android="http://schemas.android.com/apk/res/android"

android:layout_width="match_parent"

android:layout_height="match_parent">

<EditTextandroid:id="@android:id/hint"

android:layout_width="match_parent"

android:layout_height="wrap_content"

android:background="@android:drawable/editbox_background"/>

<EditTextandroid:id="@android:id/primary"

android:layout_width="match_parent"

android:layout_height="wrap_content"

android:layout_below="@android:id/hint"/>

DialerFilter>

测试代码

DialerFilterTest.java


이전 기사: 다음 기사: