當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。