android.view.View.addFocusables()方法的使用及代码示例

x33g5p2x  于2022-01-17 转载在 其他  
字(7.4k)|赞(0)|评价(0)|浏览(623)

本文整理了Java中android.view.View.addFocusables()方法的一些代码示例,展示了View.addFocusables()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。View.addFocusables()方法的具体详情如下:
包路径:android.view.View
类名称:View
方法名:addFocusables

View.addFocusables介绍

暂无

代码示例

代码示例来源:origin: novoda/android-demos

switch (mNavigationMode) {
  case ActionBar.NAVIGATION_MODE_TABS:
    mTabs.getView().addFocusables(views, direction, focusableMode);
    break;
    mSpinner.getView().addFocusables(views, direction, focusableMode);
    break;
      getCustomView().addFocusables(views, direction, focusableMode);

代码示例来源:origin: smuyyh/BookReader

ItemInfo ii = infoForChild(child);
if (ii != null && ii.position == mCurItem) {
  child.addFocusables(views, direction, focusableMode);

代码示例来源:origin: aa112901/remusic

ItemInfo ii = infoForChild(child);
if (ii != null && ii.position == mCurItem) {
  child.addFocusables(views, direction, focusableMode);

代码示例来源:origin: TangoAgency/material-intro-screen

ItemInfo ii = infoForChild(child);
if (ii != null && ii.position == mCurItem) {
  child.addFocusables(views, direction, focusableMode);

代码示例来源:origin: novoda/android-demos

@Override
public void addFocusables(ArrayList<View> views, int direction, int focusableMode) {
  int selectedIndex = mHighlighted - getFirstVisiblePosition();
  if (!hasFocus() &&
      selectedIndex >= 0 && selectedIndex < getChildCount() &&
      direction == FOCUS_LEFT) {
    // This will force focus on the highlighted item.
    setSelection(mHighlighted);
    getChildAt(selectedIndex).addFocusables(views, direction, focusableMode);
  } else {
    super.addFocusables(views, direction, focusableMode);
  }
}

代码示例来源:origin: FolioReader/FolioReader-Android

ItemInfo ii = infoForChild(child);
if (ii != null && ii.position == mCurItem) {
  child.addFocusables(views, direction, focusableMode);

代码示例来源:origin: fookwood/Launcher3

@Override
public void addFocusables(ArrayList<View> views, int direction, int focusableMode) {
  // XXX-RTL: This will be fixed in a future CL
  if (mCurrentPage >= 0 && mCurrentPage < getPageCount()) {
    getPageAt(mCurrentPage).addFocusables(views, direction, focusableMode);
  }
  if (direction == View.FOCUS_LEFT) {
    if (mCurrentPage > 0) {
      getPageAt(mCurrentPage - 1).addFocusables(views, direction, focusableMode);
    }
  } else if (direction == View.FOCUS_RIGHT){
    if (mCurrentPage < getPageCount() - 1) {
      getPageAt(mCurrentPage + 1).addFocusables(views, direction, focusableMode);
    }
  }
}

代码示例来源:origin: enricocid/LaunchEnr

@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);
  }
}

代码示例来源:origin: klinker24/Android-Blur-Launcher

@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);
  }
}

代码示例来源:origin: klinker24/launcher3

@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);
  }
}

代码示例来源:origin: klinker24/Android-Blur-Launcher

@Override
public void addFocusables(ArrayList<View> views, int direction, int focusableMode) {
  // XXX-RTL: This will be fixed in a future CL
  if (mCurrentPage >= 0 && mCurrentPage < getPageCount()) {
    getPageAt(mCurrentPage).addFocusables(views, direction, focusableMode);
  }
  if (direction == View.FOCUS_LEFT) {
    if (mCurrentPage > 0) {
      getPageAt(mCurrentPage - 1).addFocusables(views, direction, focusableMode);
    }
  } else if (direction == View.FOCUS_RIGHT){
    if (mCurrentPage < getPageCount() - 1) {
      getPageAt(mCurrentPage + 1).addFocusables(views, direction, focusableMode);
    }
  }
}

代码示例来源:origin: WeAreFairphone/FP2-Launcher

@Override
public void addFocusables(ArrayList<View> views, int direction, int focusableMode) {
  // XXX-RTL: This will be fixed in a future CL
  if (mCurrentPage >= 0 && mCurrentPage < getPageCount()) {
    getPageAt(mCurrentPage).addFocusables(views, direction, focusableMode);
  }
  if (direction == View.FOCUS_LEFT) {
    if (mCurrentPage > 0) {
      getPageAt(mCurrentPage - 1).addFocusables(views, direction, focusableMode);
    }
  } else if (direction == View.FOCUS_RIGHT){
    if (mCurrentPage < getPageCount() - 1) {
      getPageAt(mCurrentPage + 1).addFocusables(views, direction, focusableMode);
    }
  }
}

代码示例来源:origin: klinker24/launcher3

@Override
public void addFocusables(ArrayList<View> views, int direction, int focusableMode) {
  // XXX-RTL: This will be fixed in a future CL
  if (mCurrentPage >= 0 && mCurrentPage < getPageCount()) {
    getPageAt(mCurrentPage).addFocusables(views, direction, focusableMode);
  }
  if (direction == View.FOCUS_LEFT) {
    if (mCurrentPage > 0) {
      getPageAt(mCurrentPage - 1).addFocusables(views, direction, focusableMode);
    }
  } else if (direction == View.FOCUS_RIGHT){
    if (mCurrentPage < getPageCount() - 1) {
      getPageAt(mCurrentPage + 1).addFocusables(views, direction, focusableMode);
    }
  }
}

代码示例来源:origin: enricocid/LaunchEnr

@Override
public void addFocusables(ArrayList<View> views, int direction, int focusableMode) {
  if (getDescendantFocusability() == FOCUS_BLOCK_DESCENDANTS) {
    return;
  }
  // XXX-RTL: This will be fixed in a future CL
  if (mCurrentPage >= 0 && mCurrentPage < getPageCount()) {
    getPageAt(mCurrentPage).addFocusables(views, direction, focusableMode);
  }
  if (direction == View.FOCUS_LEFT) {
    if (mCurrentPage > 0) {
      getPageAt(mCurrentPage - 1).addFocusables(views, direction, focusableMode);
    }
  } else if (direction == View.FOCUS_RIGHT){
    if (mCurrentPage < getPageCount() - 1) {
      getPageAt(mCurrentPage + 1).addFocusables(views, direction, focusableMode);
    }
  }
}

代码示例来源:origin: com.google.android/support-v4

ItemInfo ii = infoForChild(child);
if (ii != null && ii.position == mCurItem) {
  child.addFocusables(views, direction, focusableMode);

代码示例来源:origin: juliome10/DoubleViewPager

ItemInfo ii = infoForChild(child);
if (ii != null && ii.position == mCurItem) {
  child.addFocusables(views, direction, focusableMode);

代码示例来源:origin: open-android/ViewPager

ItemInfo ii = infoForChild(child);
if (ii != null && ii.position == mCurItem) {
  child.addFocusables(views, direction, focusableMode);

代码示例来源:origin: benniaobuguai/android-auto-scroll-viewpager

ItemInfo ii = infoForChild(child);
if (ii != null && ii.position == mCurItem) {
  child.addFocusables(views, direction, focusableMode);

代码示例来源:origin: leveychen/RxBanner

@Override
public boolean onAddFocusables(RecyclerView recyclerView, ArrayList<View> views, int direction, int focusableMode) {
  final int currentPosition = getCurrentPosition();
  final View currentView = findViewByPosition(currentPosition);
  if (currentView == null) return true;
  if (recyclerView.hasFocus()) {
    final int movement = getMovement(direction);
    if (movement != DIRECTION_NO_WHERE) {
      final int targetPosition = movement == DIRECTION_BACKWARD ?
          currentPosition - 1 : currentPosition + 1;
      recyclerView.smoothScrollToPosition(targetPosition);
    }
  } else {
    currentView.addFocusables(views, direction, focusableMode);
  }
  return true;
}

代码示例来源:origin: angcyo/LoopRecyclerView

@Override
public boolean onAddFocusables(RecyclerView recyclerView, ArrayList<View> views, int direction, int focusableMode) {
  final int currentPosition = getCurrentPosition();
  final View currentView = findViewByPosition(currentPosition);
  if (currentView == null) return true;
  if (recyclerView.hasFocus()) {
    final int movement = getMovement(direction);
    if (movement != DIRECTION_NO_WHERE) {
      final int targetPosition = movement == DIRECTION_BACKWARD ?
          currentPosition - 1 : currentPosition + 1;
      recyclerView.smoothScrollToPosition(targetPosition);
    }
  } else {
    currentView.addFocusables(views, direction, focusableMode);
  }
  return true;
}

相关文章

View类方法