类android.view.View.OnFocusChangeListener源码实例Demo

下面列出了怎么用android.view.View.OnFocusChangeListener的API类实例代码及写法,或者点击链接到github查看源代码。

源代码1 项目: LaunchEnr   文件: ViewGroupFocusHelper.java
/**
 * Sets the alpha of this FocusIndicatorHelper to 0 when a view with this listener
 * receives focus.
 */
public View.OnFocusChangeListener getHideIndicatorOnFocusListener() {
    return new OnFocusChangeListener() {
        @Override
        public void onFocusChange(View v, boolean hasFocus) {
            if (hasFocus) {
                endCurrentAnimation();
                setCurrentView(null);
                setAlpha(0);
                invalidateDirty();
            }
        }
    };
}
 
源代码2 项目: VSigner   文件: BaseDialog.java
/**
 * 获取焦点改变事件监听,设置EditText文本默认全选
 * @return 焦点改变事件监听
 */
protected OnFocusChangeListener GetOnFocusChangeListener() {
	return new OnFocusChangeListener() {
		public void onFocusChange(View v, boolean hasFocus) {
			if (hasFocus && v instanceof EditText) {
				((EditText) v).setSelection(0, ((EditText) v).getText().length());
			}
		}
	};
}
 
源代码3 项目: coursera-android   文件: DialtactsActivity.java
private void prepareSearchView() {
    final View searchViewLayout =
            getLayoutInflater().inflate(R.layout.dialtacts_custom_action_bar, null);
    mSearchView = (SearchView) searchViewLayout.findViewById(R.id.search_view);
    mSearchView.setOnQueryTextListener(mPhoneSearchQueryTextListener);
    mSearchView.setOnCloseListener(mPhoneSearchCloseListener);
    // Since we're using a custom layout for showing SearchView instead of letting the
    // search menu icon do that job, we need to manually configure the View so it looks
    // "shown via search menu".
    // - it should be iconified by default
    // - it should not be iconified at this time
    // See also comments for onActionViewExpanded()/onActionViewCollapsed()
    mSearchView.setIconifiedByDefault(true);
    mSearchView.setQueryHint(getString(R.string.hint_findContacts));
    mSearchView.setIconified(false);
    mSearchView.setOnQueryTextFocusChangeListener(new OnFocusChangeListener() {
        @Override
        public void onFocusChange(View view, boolean hasFocus) {
            if (hasFocus) {
                showInputMethod(view.findFocus());
            }
        }
    });

    if (!ViewConfiguration.get(this).hasPermanentMenuKey()) {
        // Filter option menu should be shown on the right side of SearchView.
        final View filterOptionView = searchViewLayout.findViewById(R.id.search_option);
        filterOptionView.setVisibility(View.VISIBLE);
        filterOptionView.setOnClickListener(mFilterOptionClickListener);
    }

    getActionBar().setCustomView(searchViewLayout,
            new LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.WRAP_CONTENT));
}
 
源代码4 项目: air-ane-fullscreen   文件: FullScreenContext.java
public View.OnFocusChangeListener getOnFocusChangeListener()
{
	if (_onFocusChangeListener == null)
	{
		_onFocusChangeListener = getDecorView().getOnFocusChangeListener();
	}
	
	return _onFocusChangeListener; 
}
 
源代码5 项目: LaunchEnr   文件: AllAppsGridAdapter.java
void setIconFocusListener(OnFocusChangeListener focusListener) {
    mIconFocusListener = focusListener;
}
 
源代码6 项目: LaunchEnr   文件: FocusedItemDecorator.java
public OnFocusChangeListener getFocusListener() {
    return mHelper;
}
 
源代码7 项目: SimpleDialogFragments   文件: ClearableEditText.java
@Override
public void setOnFocusChangeListener(OnFocusChangeListener f) {
    this.f = f;
}
 
源代码8 项目: SimpleDialogFragments   文件: ClearableEditText.java
@Override
public void setOnFocusChangeListener(OnFocusChangeListener f) {
    this.f = f;
}
 
 类所在包
 类方法
 同包方法