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


Java View.addFocusables方法代码示例

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


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

示例1: addFocusables

import android.view.View; //导入方法依赖的package包/类
public void addFocusables(ArrayList<View> views, int direction, int focusableMode) {
    int focusableCount = views.size();
    int descendantFocusability = getDescendantFocusability();
    if (descendantFocusability != 393216) {
        for (int i = 0; i < getChildCount(); i++) {
            View child = getChildAt(i);
            if (child.getVisibility() == 0) {
                ItemInfo ii = infoForChild(child);
                if (ii != null && ii.position == this.mCurItem) {
                    child.addFocusables(views, direction, focusableMode);
                }
            }
        }
    }
    if ((descendantFocusability == 262144 && focusableCount != views.size()) || !isFocusable()) {
        return;
    }
    if (((focusableMode & 1) != 1 || !isInTouchMode() || isFocusableInTouchMode()) && views != null) {
        views.add(this);
    }
}
 
开发者ID:JackChan1999,项目名称:letv,代码行数:22,代码来源:ViewPager.java

示例2: addFocusables

import android.view.View; //导入方法依赖的package包/类
/**
 * We only want the current page that is being shown to be focusable.
 */
@Override
public void addFocusables(ArrayList<View> views, int direction, int focusableMode) {
    final int focusableCount = views.size();

    final int descendantFocusability = getDescendantFocusability();

    if (descendantFocusability != FOCUS_BLOCK_DESCENDANTS) {
        for (int i = 0; i < getChildCount(); i++) {
            final View child = getChildAt(i);
            if (child.getVisibility() == VISIBLE) {
                ItemInfo ii = infoForChild(child);
                if (ii != null && ii.position == mCurItem) {
                    child.addFocusables(views, direction, focusableMode);
                }
            }
        }
    }

    // we add ourselves (if focusable) in all cases except for when we are
    // FOCUS_AFTER_DESCENDANTS and there are some descendants focusable.  this is
    // to avoid the focus search finding layouts when a more precise search
    // among the focusable children would be more interesting.
    if (descendantFocusability != FOCUS_AFTER_DESCENDANTS
            || (focusableCount == views.size())) { // No focusable descendants
        // Note that we can't call the superclass here, because it will
        // add all views in.  So we need to do the same thing View does.
        if (!isFocusable()) {
            return;
        }
        if ((focusableMode & FOCUSABLES_TOUCH_MODE) == FOCUSABLES_TOUCH_MODE
                && isInTouchMode() && !isFocusableInTouchMode()) {
            return;
        }
        //noinspection ConstantConditions
        if (views != null) {
            views.add(this);
        }
    }
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:43,代码来源:BaseViewPager.java

示例3: addFocusables

import android.view.View; //导入方法依赖的package包/类
@Override
public void addFocusables(ArrayList<View> views, int direction, int focusableMode) {
    View topView = AbstractFloatingView.getTopOpenView(mLauncher);
    if (topView != null) {
        topView.addFocusables(views, direction);
    } else {
        super.addFocusables(views, direction, focusableMode);
    }
}
 
开发者ID:enricocid,项目名称:LaunchEnr,代码行数:10,代码来源:DragLayer.java

示例4: addFocusables

import android.view.View; //导入方法依赖的package包/类
/**
 * We only want the current page that is being shown to be focusable.
 */
@Override
public void addFocusables(ArrayList<View> views, int direction, int focusableMode) {
    final int focusableCount = views.size();

    final int descendantFocusability = getDescendantFocusability();

    if (descendantFocusability != FOCUS_BLOCK_DESCENDANTS) {
        for (int i = 0; i < getChildCount(); i++) {
            final View child = getChildAt(i);
            if (child.getVisibility() == VISIBLE) {
                YViewPager.ItemInfo ii = infoForChild(child);
                if (ii != null && ii.position == mCurItem) {
                    child.addFocusables(views, direction, focusableMode);
                }
            }
        }
    }

    // we add ourselves (if focusable) in all cases except for when we are
    // FOCUS_AFTER_DESCENDANTS and there are some descendants focusable.  this is
    // to avoid the focus search finding layouts when a more precise search
    // among the focusable children would be more interesting.
    if (descendantFocusability != FOCUS_AFTER_DESCENDANTS
            || (focusableCount == views.size())) { // No focusable descendants
        // Note that we can't call the superclass here, because it will
        // add all views in.  So we need to do the same thing View does.
        if (!isFocusable()) {
            return;
        }
        if ((focusableMode & FOCUSABLES_TOUCH_MODE) == FOCUSABLES_TOUCH_MODE
                && isInTouchMode() && !isFocusableInTouchMode()) {
            return;
        }
        if (views != null) {
            views.add(this);
        }
    }
}
 
开发者ID:youngkaaa,项目名称:YViewPagerDemo,代码行数:42,代码来源:YViewPager.java

示例5: addFocusables

import android.view.View; //导入方法依赖的package包/类
/**
 * We only want the current page that is being shown to be focusable.
 */
@Override
public void addFocusables(ArrayList<View> views, int direction, int focusableMode) {
    final int focusableCount = views.size();

    final int descendantFocusability = getDescendantFocusability();

    if (descendantFocusability != FOCUS_BLOCK_DESCENDANTS) {
        for (int i = 0; i < getChildCount(); i++) {
            final View child = getChildAt(i);
            if (child.getVisibility() == VISIBLE) {
                YViewPagerNew.ItemInfo ii = infoForChild(child);
                if (ii != null && ii.position == mCurItem) {
                    child.addFocusables(views, direction, focusableMode);
                }
            }
        }
    }

    // we add ourselves (if focusable) in all cases except for when we are
    // FOCUS_AFTER_DESCENDANTS and there are some descendants focusable.  this is
    // to avoid the focus search finding layouts when a more precise search
    // among the focusable children would be more interesting.
    if (descendantFocusability != FOCUS_AFTER_DESCENDANTS
            || (focusableCount == views.size())) { // No focusable descendants
        // Note that we can't call the superclass here, because it will
        // add all views in.  So we need to do the same thing View does.
        if (!isFocusable()) {
            return;
        }
        if ((focusableMode & FOCUSABLES_TOUCH_MODE) == FOCUSABLES_TOUCH_MODE
                && isInTouchMode() && !isFocusableInTouchMode()) {
            return;
        }
        if (views != null) {
            views.add(this);
        }
    }
}
 
开发者ID:youngkaaa,项目名称:YViewPagerDemo,代码行数:42,代码来源:YViewPagerNew.java

示例6: addFocusables

import android.view.View; //导入方法依赖的package包/类
@Override
public void addFocusables(ArrayList<View> views, int direction, int focusableMode) {
    View topView = mLauncher.getTopFloatingView();
    if (topView != null) {
        topView.addFocusables(views, direction);
    } else {
        super.addFocusables(views, direction, focusableMode);
    }
}
 
开发者ID:TeamBrainStorm,项目名称:SimpleUILauncher,代码行数:10,代码来源:DragLayer.java

示例7: addFocusables

import android.view.View; //导入方法依赖的package包/类
/**
 * We only want the current page that is being shown to be focusable.
 */
@Override
public void addFocusables(ArrayList<View> views, int direction, int focusableMode) {
    final int focusableCount = views.size();

    final int descendantFocusability = getDescendantFocusability();

    if (descendantFocusability != FOCUS_BLOCK_DESCENDANTS) {
        for (int i = 0; i < getChildCount(); i++) {
            final View child = getChildAt(i);
            if (child.getVisibility() == VISIBLE) {
                ViewPager.ItemInfo ii = infoForChild(child);
                if (ii != null && ii.position == mCurItem) {
                    child.addFocusables(views, direction, focusableMode);
                }
            }
        }
    }

    // we add ourselves (if focusable) in all cases except for when we are
    // FOCUS_AFTER_DESCENDANTS and there are some descendants focusable.  this is
    // to avoid the focus search finding layouts when a more precise search
    // among the focusable children would be more interesting.
    if (descendantFocusability != FOCUS_AFTER_DESCENDANTS
            || (focusableCount == views.size())) { // No focusable descendants
        // Note that we can't call the superclass here, because it will
        // add all views in.  So we need to do the same thing View does.
        if (!isFocusable()) {
            return;
        }
        if ((focusableMode & FOCUSABLES_TOUCH_MODE) == FOCUSABLES_TOUCH_MODE
                && isInTouchMode() && !isFocusableInTouchMode()) {
            return;
        }
        if (views != null) {
            views.add(this);
        }
    }
}
 
开发者ID:SimonCherryGZ,项目名称:JewelryUI,代码行数:42,代码来源:ViewPager.java

示例8: addFocusables

import android.view.View; //导入方法依赖的package包/类
/**
 * We only want the current page that is being shown to be focusable.
 */
@Override
public void addFocusables(ArrayList<View> views, int direction, int focusableMode) {
    final int focusableCount = views.size();

    final int descendantFocusability = getDescendantFocusability();

    if (descendantFocusability != FOCUS_BLOCK_DESCENDANTS) {
        for (int i = 0; i < getChildCount(); i++) {
            final View child = getChildAt(i);
            if (child.getVisibility() == VISIBLE) {
                ItemInfo ii = infoForChild(child);
                if (ii != null && ii.position == mCurItem) {
                    child.addFocusables(views, direction, focusableMode);
                }
            }
        }
    }

    // we add ourselves (if focusable) in all cases except for when we are
    // FOCUS_AFTER_DESCENDANTS and there are some descendants focusable.  this is
    // to avoid the focus search finding layouts when a more precise search
    // among the focusable children would be more interesting.
    if (descendantFocusability != FOCUS_AFTER_DESCENDANTS
            || (focusableCount == views.size())) { // No focusable descendants
        // Note that we can't call the superclass here, because it will
        // add all views in.  So we need to do the same thing View does.
        if (!isFocusable()) {
            return;
        }
        if ((focusableMode & FOCUSABLES_TOUCH_MODE) == FOCUSABLES_TOUCH_MODE
                && isInTouchMode() && !isFocusableInTouchMode()) {
            return;
        }
        if (views != null) {
            views.add(this);
        }
    }
}
 
开发者ID:simplezhli,项目名称:ChangeTabLayout,代码行数:42,代码来源:VerticalViewPager.java

示例9: addFocusables

import android.view.View; //导入方法依赖的package包/类
/**
 * We only want the current page that is being shown to be focusable.
 */
@Override
public void addFocusables(ArrayList<View> views, int direction, int focusableMode) {
    final int focusableCount = views.size();

    final int descendantFocusability = getDescendantFocusability();

    if (descendantFocusability != FOCUS_BLOCK_DESCENDANTS) {
        for (int i = 0; i < getChildCount(); i++) {
            final View child = getChildAt(i);
            if (child.getVisibility() == VISIBLE) {
                ItemInfo ii = infoForChild(child);
                if (ii != null && ii.position == mCurItem) {
                    child.addFocusables(views, direction, focusableMode);
                }
            }
        }
    }

    // we add ourselves (if focusable) in all cases except for when we are
    // FOCUS_AFTER_DESCENDANTS and there are some descendants focusable.  this is
    // to avoid the focus search finding layouts when a more precise search
    // among the focusable children would be more interesting.
    if (
            descendantFocusability != FOCUS_AFTER_DESCENDANTS ||
                    // No focusable descendants
                    (focusableCount == views.size())) {
        // Note that we can't call the superclass here, because it will
        // add all views in.  So we need to do the same thing View does.
        if (!isFocusable()) {
            return;
        }
        if ((focusableMode & FOCUSABLES_TOUCH_MODE) == FOCUSABLES_TOUCH_MODE &&
                isInTouchMode() && !isFocusableInTouchMode()) {
            return;
        }
        if (views != null) {
            views.add(this);
        }
    }
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:44,代码来源:DirectionalViewpager.java

示例10: addFocusables

import android.view.View; //导入方法依赖的package包/类
/**
 * We only want the current page that is being shown to be focusable.
 */
@Override
public void addFocusables(ArrayList<View> views, int direction, int focusableMode) {
	final int focusableCount = views.size();

	final int descendantFocusability = getDescendantFocusability();

	if (descendantFocusability != FOCUS_BLOCK_DESCENDANTS) {
		for (int i = 0; i < getChildCount(); i++) {
			final View child = getChildAt(i);
			if (child.getVisibility() == VISIBLE) {
				ItemInfo ii = infoForChild(child);
				if (ii != null && ii.position == mCurItem) {
					child.addFocusables(views, direction, focusableMode);
				}
			}
		}
	}

	// we add ourselves (if focusable) in all cases except for when we are
	// FOCUS_AFTER_DESCENDANTS and there are some descendants focusable.
	// this is
	// to avoid the focus search finding layouts when a more precise search
	// among the focusable children would be more interesting.
	if (descendantFocusability != FOCUS_AFTER_DESCENDANTS ||
		// No focusable descendants
		(focusableCount == views.size())) {
		// Note that we can't call the superclass here, because it will
		// add all views in. So we need to do the same thing View does.
		if (!isFocusable()) {
			return;
		}
		if ((focusableMode & FOCUSABLES_TOUCH_MODE) == FOCUSABLES_TOUCH_MODE && isInTouchMode()
			&& !isFocusableInTouchMode()) {
			return;
		}
		if (views != null) {
			views.add(this);
		}
	}
}
 
开发者ID:fengshihao,项目名称:WebPager,代码行数:44,代码来源:CustomViewPager.java

示例11: addFocusables

import android.view.View; //导入方法依赖的package包/类
/**
 * We only want the current page that is being shown to be focusable.
 */
@Override
public void addFocusables(ArrayList<View> views, int direction, int focusableMode) {
    final int focusableCount = views.size();

    final int descendantFocusability = getDescendantFocusability();

    if (descendantFocusability != FOCUS_BLOCK_DESCENDANTS) {
        for (int i = 0; i < getChildCount(); i++) {
            final View child = getChildAt(i);
            if (child.getVisibility() == VISIBLE) {
                ItemInfo ii = infoForChild(child);
                if (ii != null && ii.position == mCurItem) {
                    child.addFocusables(views, direction, focusableMode);
                }
            }
        }
    }

    // we add ourselves (if focusable) in all cases except for when we are
    // FOCUS_AFTER_DESCENDANTS and there are some descendants focusable.  this is
    // to avoid the focus search finding layouts when a more precise search
    // among the focusable children would be more interesting.
    if (
        descendantFocusability != FOCUS_AFTER_DESCENDANTS ||
            // No focusable descendants
            (focusableCount == views.size())) {
        // Note that we can't call the superclass here, because it will
        // add all views in.  So we need to do the same thing View does.
        if (!isFocusable()) {
            return;
        }
        if ((focusableMode & FOCUSABLES_TOUCH_MODE) == FOCUSABLES_TOUCH_MODE &&
                isInTouchMode() && !isFocusableInTouchMode()) {
            return;
        }
        if (views != null) {
            views.add(this);
        }
    }
}
 
开发者ID:benniaobuguai,项目名称:android-project-gallery,代码行数:44,代码来源:ViewPagerCompat.java


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