use of com.andframe.fragment.AfFragment in project AndFrameWorks by scwang90.
the class AfActivity method onKeyUp.
/**
* 转发 onKeyUp 事件给 AfFragment
*/
@Override
@SuppressLint("NewApi")
public boolean onKeyUp(int keyCode, KeyEvent event) {
boolean isHandled = false;
List<Fragment> fragments = getSupportFragmentManager().getFragments();
fragments = fragments == null ? new ArrayList<>() : fragments;
for (Fragment fragment : fragments) {
if (fragment != null && fragment.getUserVisibleHint() && fragment instanceof AfFragment) {
AfFragment afment = (AfFragment) fragment;
isHandled = afment.onKeyUp(keyCode, event) || isHandled;
}
}
return isHandled || super.onKeyUp(keyCode, event);
}
use of com.andframe.fragment.AfFragment in project AndFrameWorks by scwang90.
the class AfActivity method onKeyShortcut.
/**
* 转发 onKeyShortcut 事件给 AfFragment
*/
@Override
@SuppressLint("NewApi")
public boolean onKeyShortcut(int keyCode, KeyEvent event) {
boolean isHandled = false;
List<Fragment> fragments = getSupportFragmentManager().getFragments();
fragments = fragments == null ? new ArrayList<>() : fragments;
for (Fragment fragment : fragments) {
if (fragment != null && fragment.getUserVisibleHint() && fragment instanceof AfFragment) {
AfFragment afment = (AfFragment) fragment;
isHandled = afment.onKeyShortcut(keyCode, event) || isHandled;
}
}
return isHandled || super.onKeyShortcut(keyCode, event);
}
Aggregations