当前位置: 首页>>代码示例>>Java>>正文


Java FocusFinder.getInstance方法代码示例

本文整理汇总了Java中android.view.FocusFinder.getInstance方法的典型用法代码示例。如果您正苦于以下问题:Java FocusFinder.getInstance方法的具体用法?Java FocusFinder.getInstance怎么用?Java FocusFinder.getInstance使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在android.view.FocusFinder的用法示例。


在下文中一共展示了FocusFinder.getInstance方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: focusSearch

import android.view.FocusFinder; //导入方法依赖的package包/类
@Override
public View focusSearch(View focused, int direction) {
    View result = mLayout.onInterceptFocusSearch(focused, direction);
    if (result != null) {
        return result;
    }
    final FocusFinder ff = FocusFinder.getInstance();
    result = ff.findNextFocus(this, focused, direction);
    if (result == null && mAdapter != null && mLayout != null && !isComputingLayout()
            && !mLayoutFrozen) {
        eatRequestLayout();
        result = mLayout.onFocusSearchFailed(focused, direction, mRecycler, mState);
        resumeRequestLayout(false);
    }
    return result != null ? result : super.focusSearch(focused, direction);
}
 
开发者ID:MLNO,项目名称:airgram,代码行数:17,代码来源:RecyclerView.java

示例2: setUp

import android.view.FocusFinder; //导入方法依赖的package包/类
@Override
protected void setUp() throws Exception {
    super.setUp();

    mFocusFinder = FocusFinder.getInstance();

    // inflate the layout
    final Context context = getContext();
    final LayoutInflater inflater = LayoutInflater.from(context);
    mRoot = (ViewGroup) inflater.inflate(R.layout.focus_2, null);

    // manually measure it, and lay it out
    mRoot.measure(500, 500);
    mRoot.layout(0, 0, 500, 500);

    mLeftButton = (Button) mRoot.findViewById(R.id.leftButton);
    mCenterButton = (Button) mRoot.findViewById(R.id.centerButton);
    mRightButton = (Button) mRoot.findViewById(R.id.rightButton);
}
 
开发者ID:luoqii,项目名称:ApkLauncher,代码行数:20,代码来源:Focus2AndroidTest.java

示例3: focusSearch

import android.view.FocusFinder; //导入方法依赖的package包/类
@Override
public View focusSearch(View focused, int direction) {
	View result = mLayout.onInterceptFocusSearch(focused, direction);
	if (result != null) {
		return result;
	}
	final FocusFinder ff = FocusFinder.getInstance();
	result = ff.findNextFocus(this, focused, direction);
	if (result == null && mAdapter != null) {
		eatRequestLayout();
		result = mLayout.onFocusSearchFailed(focused, direction, mRecycler, mState);
		resumeRequestLayout(false);
	}
	return result != null ? result : super.focusSearch(focused, direction);
}
 
开发者ID:fython-tools,项目名称:NyanpasuTile,代码行数:16,代码来源:RecyclerView.java

示例4: requestNaturalFocus

import android.view.FocusFinder; //导入方法依赖的package包/类
/**
 * Request natural focus.
 *
 * @param direction             direction in which focus is changing
 * @param previouslyFocusedRect previously focus rectangle
 */
private void requestNaturalFocus(int direction, Rect previouslyFocusedRect) {
    FocusFinder ff = FocusFinder.getInstance();
    previouslyFocusedRect = previouslyFocusedRect == null
            ? new Rect(0, 0, 0, 0) : previouslyFocusedRect;
    View toFocus = ff.findNextFocusFromRect(this, previouslyFocusedRect, direction);
    toFocus = toFocus == null ? getChildAt(0) : toFocus;
    if (toFocus != null) {
        toFocus.requestFocus();
    }
}
 
开发者ID:vganin,项目名称:dpad-aware-recycler-view,代码行数:17,代码来源:DpadAwareRecyclerView.java

示例5: focusSearch

import android.view.FocusFinder; //导入方法依赖的package包/类
@Override
public View focusSearch(View focused, int direction) {
    View result = mLayout.onInterceptFocusSearch(focused, direction);
    if (result != null) {
        return result;
    }
    final FocusFinder ff = FocusFinder.getInstance();
    result = ff.findNextFocus(this, focused, direction);
    if (result == null && mAdapter != null) {
        eatRequestLayout();
        result = mLayout.onFocusSearchFailed(focused, direction, mRecycler, mState);
        resumeRequestLayout(false);
    }
    return result != null ? result : super.focusSearch(focused, direction);
}
 
开发者ID:kingargyle,项目名称:adt-leanback-support,代码行数:16,代码来源:RecyclerView.java


注:本文中的android.view.FocusFinder.getInstance方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。