use of com.andframe.fragment.AfFragment in project AndFrameWorks by scwang90.
the class AfActivity method onKeyMultiple.
/**
* 转发 onKeyMultiple 事件给 AfFragment
*/
@Override
public boolean onKeyMultiple(int keyCode, int repeatCount, 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.onKeyMultiple(keyCode, repeatCount, event) || isHandled;
}
}
return isHandled || super.onKeyMultiple(keyCode, repeatCount, event);
}
use of com.andframe.fragment.AfFragment in project AndFrameWorks by scwang90.
the class AfActivity method onKeyDown.
/**
* 转发 onKeyDown 事件给 AfFragment
*/
@Override
public boolean onKeyDown(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.onKeyDown(keyCode, event) || isHandled;
}
}
return isHandled || super.onKeyDown(keyCode, event);
}
use of com.andframe.fragment.AfFragment in project AndFrameWorks by scwang90.
the class AfActivity method onNewIntent.
@Override
protected void onNewIntent(Intent intent) {
super.onNewIntent(intent);
setIntent(intent);
Injecter.doInjectExtra(this);
LifeCycleInjecter.injectonNewIntent(this, intent);
List<Fragment> fragments = getSupportFragmentManager().getFragments();
fragments = fragments == null ? new ArrayList<>() : fragments;
for (Fragment fragment : fragments) {
if (fragment != null && fragment instanceof AfFragment) {
AfFragment afment = (AfFragment) fragment;
afment.onNewIntent(intent);
}
}
}
use of com.andframe.fragment.AfFragment in project AndFrameWorks by scwang90.
the class AfActivity method onBackKeyPressed.
/**
* 转发 onBackPressed 事件给 AfFragment
*/
protected boolean onBackKeyPressed() {
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.onBackPressed() || isHandled;
}
}
return isHandled;
}
use of com.andframe.fragment.AfFragment in project AndFrameWorks by scwang90.
the class AfActivity method onKeyLongPress.
/**
* 转发 onKeyLongPress 事件给 AfFragment
*/
@Override
public boolean onKeyLongPress(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.onKeyLongPress(keyCode, event) || isHandled;
}
}
return isHandled || super.onKeyLongPress(keyCode, event);
}
Aggregations