public abstract class TuSdkFragment extends androidx.fragment.app.Fragment implements android.view.ViewTreeObserver.OnPreDrawListener, TuSdkOrientationEventListener.TuSdkOrientationDelegate, TuSdkNavigatorBar.TuSdkNavigatorBarDelegate
构造器和说明 |
---|
TuSdkFragment() |
限定符和类型 | 方法和说明 |
---|---|
void |
addOrientationListener()
添加设备旋转通知
|
int |
backStackEntryCount()
获取后退堆栈总数
|
void |
bindSoftInputEvent()
绑定软键盘事件
|
void |
dismissActivity()
收回控制器
|
void |
dismissActivityWithAnim()
使用动画收回控制器
|
void |
dismissActivityWithAnim(ActivityAnimType animType)
收回控制器
|
boolean |
equalViewIds(android.view.View aView,
android.view.View bView)
判断视图ID是否相等
|
void |
filpModalNavigationActivity(java.lang.Class<?> activityClazz,
androidx.fragment.app.Fragment fragment,
boolean wantFullScreen,
boolean isDestory)
翻转启动新的Activity
|
ActivityAnimType |
getDismissAnimType()
获取Activity结束动画
|
TuSdkNavigatorBar.NavigatorBarButtonInterface |
getNavButton(TuSdkNavigatorBar.NavigatorBarButtonType type)
获取导航按钮
|
androidx.fragment.app.Fragment |
getOriginFragment()
来源Fragment
|
int |
getResColor(int resId)
获取颜色
|
java.lang.String |
getResString(int resId)
获取资源字符串
|
java.lang.String |
getResString(int resId,
java.lang.Object... formatArgs)
获取资源字符串
|
java.lang.String |
getResString(java.lang.String name)
获取资源字符串
|
java.lang.String |
getResString(java.lang.String name,
java.lang.Object... formatArgs)
获取资源字符串
|
<T extends android.view.ViewGroup> |
getRootView()
获取根视图
|
int |
getRootViewLayoutId()
根视图布局资源ID
|
TuSdkFragmentActivity |
getSdkActivity()
获取sdk activity
|
java.lang.String |
getTitle()
获取导航标题
|
<T extends android.view.View> |
getViewById(int id)
查找视图
|
<T extends android.view.View> |
getViewById(java.lang.String name)
查找视图
|
int |
getViewId(android.view.View view)
获取视图ID
|
protected abstract void |
initCreateView()
初始化创建视图
|
boolean |
isBackButtonShowed()
后退按钮是否显示
|
boolean |
isFragmentPause()
是否为Fragment暂停事件
|
boolean |
isFullScreen()
是否为全屏显示
|
boolean |
isSupportSlideBack()
是否支持滑动返回
|
protected abstract void |
loadView(android.view.ViewGroup view)
加载视图
|
void |
navigatorBarBackAction(TuSdkNavigatorBar.NavigatorBarButtonInterface button)
导航点击后退事件
|
void |
navigatorBarCancelAction(TuSdkNavigatorBar.NavigatorBarButtonInterface button)
导航栏取消事件
|
int |
navigatorBarHeight()
获取导航栏高度
|
void |
navigatorBarLeftAction(TuSdkNavigatorBar.NavigatorBarButtonInterface button)
导航栏左边按钮点击事件
|
protected void |
navigatorBarLoaded(TuSdkNavigatorBar navigatorBar)
导航栏加载完成
|
void |
navigatorBarRightAction(TuSdkNavigatorBar.NavigatorBarButtonInterface button)
导航栏右边按钮点击事件
|
void |
navSearchViewSearch(java.lang.String keyword)
提交搜索
|
void |
navSearchViewSetDelegate(TuSdkSearchView.TuSdkSearchViewDelegate delegate)
设置搜索视图委托
|
void |
navSegmentedAddTexts(int... titleResid)
添加分段标题
|
void |
navSegmentedAddTexts(java.lang.String... titles)
添加分段标题
|
void |
navSegmentedSetDelegate(TuSdkSegmented.TuSdkSegmentedDelegate delegate)
添加分段委托
|
void |
navSegmentedSetected(int index)
设置导航栏分段视图选中项
|
void |
onAttach(android.app.Activity activity)
加载Fragment
|
boolean |
onBackForSlide()
滑动后退事件
|
boolean |
onBackPressed()
后退事件
|
android.view.animation.Animation |
onCreateAnimation(int transit,
boolean enter,
int nextAnim)
监听Fragment动画执行完成
|
android.view.View |
onCreateView(android.view.LayoutInflater inflater,
android.view.ViewGroup container,
android.os.Bundle savedInstanceState)
创建视图
|
void |
onDestroy() |
void |
onDestroyView() |
void |
onDetach() |
protected void |
onFragmentAnimationEnd(boolean enter,
boolean isAnimationLoaded)
Fragment动画执行完成
|
boolean |
onKeyUp(int keyCode,
android.view.KeyEvent event)
按键放开
|
void |
onNavigatorBarButtonClicked(TuSdkNavigatorBar.NavigatorBarButtonInterface button)
导航按钮点击事件
|
void |
onOrientationChanged(InterfaceOrientation orien)
设备旋转通知
|
void |
onPause() |
void |
onPauseFragment()
Fragment切走,马上进入下一个Fragment
|
boolean |
onPreDraw()
监视视图是否已经加载完成
|
void |
onRefreshData(int typeId)
刷新数据
|
void |
onResume() |
void |
onResumeFragment()
Fragment切换为当前
|
void |
popFragment()
弹出Fragment
|
void |
popFragment(java.lang.String flag)
弹出到指定的Fragment
|
void |
popFragmentRoot()
弹出到根Fragment
|
void |
presentActivity(java.lang.Class<?> activity,
ActivityAnimType animType,
boolean isDestory)
开启新的Activity
|
void |
presentActivity(TuSdkIntent intent,
ActivityAnimType animType,
boolean isDestory)
开启新的Activity
|
void |
presentModalNavigationActivity(java.lang.Class<?> activityClazz,
java.lang.Class<?> fragmentClazz,
ActivityAnimType presentAnim,
ActivityAnimType dismissAnim,
boolean wantFullScreen)
启动新的Activity
|
void |
presentModalNavigationActivity(java.lang.Class<?> activityClazz,
androidx.fragment.app.Fragment fragment,
ActivityAnimType presentAnim,
ActivityAnimType dismissAnim,
boolean wantFullScreen)
启动新的Activity
|
void |
presentModalNavigationActivity(java.lang.Class<?> activityClazz,
androidx.fragment.app.Fragment fragment,
ActivityAnimType presentAnim,
ActivityAnimType dismissAnim,
boolean wantFullScreen,
boolean isDestory)
启动新的Activity
|
void |
pushFragment(androidx.fragment.app.Fragment fragment)
加载Fragment
|
void |
refreshOriginFragment(int typeId)
刷新来源Fragment
|
<T extends androidx.fragment.app.Fragment> |
replaceFragment(androidx.fragment.app.Fragment fragment,
ActivityAnimType replaceType)
替换Fragment 不添加后退行为
|
void |
runOnUiThread(java.lang.Runnable action)
在UI线程中执行
|
void |
setIsSupportSlideBack(boolean isSupport)
是否支持滑动返回
|
void |
setNavigatorBarId(int barId,
int backButtonId,
int buttonLayoutId)
设置导航栏资源
|
void |
setNavigatorBarOnButtom()
设置导航栏在下边显示
|
TuSdkNavigatorButton |
setNavLeftButton(java.lang.String title,
TuSdkNavigatorBar.TuSdkNavButtonStyleInterface style)
设置导航左边按钮
|
TuSdkNavigatorButton |
setNavLeftButton(TuSdkNavigatorBar.TuSdkNavButtonStyleInterface style)
设置导航左边图片按钮
|
TuSdkNavigatorButton |
setNavRightButton(java.lang.String title,
TuSdkNavigatorBar.TuSdkNavButtonStyleInterface style)
设置导航右边按钮
|
TuSdkNavigatorButton |
setNavRightButton(TuSdkNavigatorBar.TuSdkNavButtonStyleInterface style)
设置导航右边图片按钮
|
void |
setOriginFragment(androidx.fragment.app.Fragment originFragment)
来源Fragment
|
void |
setRequestedOrientation(int requestedOrientation)
设置屏幕是否允许旋转
|
void |
setRootViewLayoutId(int rootViewLayoutId)
设置根视图布局资源ID
|
void |
setTitle(int titleId)
设置导航标题
|
void |
setTitle(java.lang.String title)
设置导航标题
|
void |
showBackButton(boolean isShow)
隐藏后退按钮
|
void |
showNavigatorBar(boolean isShowed,
boolean needAnim)
显示导航栏
|
void |
showView(android.view.View view,
boolean isShow)
显示或隐藏视图 不占位
|
void |
showViewIn(android.view.View view,
boolean isShow)
显示或隐藏视图 占位
|
protected abstract void |
viewDidLoad(android.view.ViewGroup view)
初始化视图
|
void |
wantFullScreen(boolean isFullScreen)
设置是否全屏
|
dump, equals, getActivity, getAllowEnterTransitionOverlap, getAllowReturnTransitionOverlap, getArguments, getChildFragmentManager, getContext, getEnterTransition, getExitTransition, getFragmentManager, getHost, getId, getLayoutInflater, getLayoutInflater, getLifecycle, getLoaderManager, getParentFragment, getReenterTransition, getResources, getRetainInstance, getReturnTransition, getSharedElementEnterTransition, getSharedElementReturnTransition, getString, getString, getTag, getTargetFragment, getTargetRequestCode, getText, getUserVisibleHint, getView, getViewLifecycleOwner, getViewLifecycleOwnerLiveData, getViewModelStore, hashCode, hasOptionsMenu, instantiate, instantiate, isAdded, isDetached, isHidden, isInLayout, isMenuVisible, isRemoving, isResumed, isStateSaved, isVisible, onActivityCreated, onActivityResult, onAttach, onAttachFragment, onConfigurationChanged, onContextItemSelected, onCreate, onCreateAnimator, onCreateContextMenu, onCreateOptionsMenu, onDestroyOptionsMenu, onGetLayoutInflater, onHiddenChanged, onInflate, onInflate, onLowMemory, onMultiWindowModeChanged, onOptionsItemSelected, onOptionsMenuClosed, onPictureInPictureModeChanged, onPrepareOptionsMenu, onRequestPermissionsResult, onSaveInstanceState, onStart, onStop, onViewCreated, onViewStateRestored, postponeEnterTransition, registerForContextMenu, requestPermissions, requireActivity, requireContext, requireFragmentManager, requireHost, setAllowEnterTransitionOverlap, setAllowReturnTransitionOverlap, setArguments, setEnterSharedElementCallback, setEnterTransition, setExitSharedElementCallback, setExitTransition, setHasOptionsMenu, setInitialSavedState, setMenuVisibility, setReenterTransition, setRetainInstance, setReturnTransition, setSharedElementEnterTransition, setSharedElementReturnTransition, setTargetFragment, setUserVisibleHint, shouldShowRequestPermissionRationale, startActivity, startActivity, startActivityForResult, startActivityForResult, startIntentSenderForResult, startPostponedEnterTransition, toString, unregisterForContextMenu
public void setRootViewLayoutId(int rootViewLayoutId)
rootViewLayoutId
- the rootViewLayoutId to setpublic int getRootViewLayoutId()
public boolean isSupportSlideBack()
public void setIsSupportSlideBack(boolean isSupport)
isSupport
- public void setNavigatorBarId(int barId, int backButtonId, int buttonLayoutId)
barId
- 导航栏视图IDbackButtonId
- 导航栏后退按钮IDbuttonLayoutId
- 导航栏按钮布局IDpublic androidx.fragment.app.Fragment getOriginFragment()
public void setOriginFragment(androidx.fragment.app.Fragment originFragment)
originFragment
- public TuSdkFragmentActivity getSdkActivity()
public android.view.View onCreateView(android.view.LayoutInflater inflater, android.view.ViewGroup container, android.os.Bundle savedInstanceState)
onCreateView
在类中 androidx.fragment.app.Fragment
protected abstract void initCreateView()
public android.view.animation.Animation onCreateAnimation(int transit, boolean enter, int nextAnim)
onCreateAnimation
在类中 androidx.fragment.app.Fragment
protected void onFragmentAnimationEnd(boolean enter, boolean isAnimationLoaded)
enter
- 是否为进入动画isAnimationLoaded
- 是否Fragment动画已经执行完成过protected abstract void loadView(android.view.ViewGroup view)
view
- public boolean onPreDraw()
onPreDraw
在接口中 android.view.ViewTreeObserver.OnPreDrawListener
protected void navigatorBarLoaded(TuSdkNavigatorBar navigatorBar)
navigatorBar
- protected abstract void viewDidLoad(android.view.ViewGroup view)
view
- public void onResume()
onResume
在类中 androidx.fragment.app.Fragment
public void onPause()
onPause
在类中 androidx.fragment.app.Fragment
public void onDestroyView()
onDestroyView
在类中 androidx.fragment.app.Fragment
public void onDetach()
onDetach
在类中 androidx.fragment.app.Fragment
public void onDestroy()
onDestroy
在类中 androidx.fragment.app.Fragment
public void onPauseFragment()
public void onResumeFragment()
public boolean isFragmentPause()
public boolean onBackPressed()
public boolean onBackForSlide()
public void onAttach(android.app.Activity activity)
onAttach
在类中 androidx.fragment.app.Fragment
public void onRefreshData(int typeId)
typeId
- 刷新类型public void refreshOriginFragment(int typeId)
typeId
- 刷新类型public boolean onKeyUp(int keyCode, android.view.KeyEvent event)
keyCode
- event
- public <T extends android.view.View> T getViewById(int id)
id
- public <T extends android.view.View> T getViewById(java.lang.String name)
name
- public int getViewId(android.view.View view)
view
- public boolean equalViewIds(android.view.View aView, android.view.View bView)
aView
- bView
- public <T extends android.view.ViewGroup> T getRootView()
public java.lang.String getResString(int resId)
resId
- 资源IDpublic java.lang.String getResString(int resId, java.lang.Object... formatArgs)
resId
- 资源IDformatArgs
- 格式化参数public java.lang.String getResString(java.lang.String name)
name
- 资源名称public java.lang.String getResString(java.lang.String name, java.lang.Object... formatArgs)
resId
- 资源IDformatArgs
- 格式化参数public int getResColor(int resId)
context
- resId
- 资源IDpublic void wantFullScreen(boolean isFullScreen)
isFullScreen
- public boolean isFullScreen()
public void bindSoftInputEvent()
public void setRequestedOrientation(int requestedOrientation)
requestedOrientation
- public void runOnUiThread(java.lang.Runnable action)
action
- public void showView(android.view.View view, boolean isShow)
view
- isShow
- public void showViewIn(android.view.View view, boolean isShow)
view
- isShow
- public int backStackEntryCount()
public void pushFragment(androidx.fragment.app.Fragment fragment)
fragment
- public <T extends androidx.fragment.app.Fragment> void replaceFragment(androidx.fragment.app.Fragment fragment, ActivityAnimType replaceType)
fragment
- replaceType
- 替换时动画public void popFragment()
public void popFragment(java.lang.String flag)
flag
- public void popFragmentRoot()
public void dismissActivity()
public void dismissActivityWithAnim()
public void dismissActivityWithAnim(ActivityAnimType animType)
animType
- public ActivityAnimType getDismissAnimType()
public void addOrientationListener()
public void onOrientationChanged(InterfaceOrientation orien)
public void setTitle(java.lang.String title)
title
- public void setTitle(int titleId)
titleId
- public java.lang.String getTitle()
public void setNavigatorBarOnButtom()
public int navigatorBarHeight()
public void showBackButton(boolean isShow)
isShow
- public boolean isBackButtonShowed()
public TuSdkNavigatorButton setNavLeftButton(TuSdkNavigatorBar.TuSdkNavButtonStyleInterface style)
style
- 样式public TuSdkNavigatorButton setNavLeftButton(java.lang.String title, TuSdkNavigatorBar.TuSdkNavButtonStyleInterface style)
title
- 标题style
- 按钮样式public TuSdkNavigatorButton setNavRightButton(TuSdkNavigatorBar.TuSdkNavButtonStyleInterface style)
style
- 样式public TuSdkNavigatorButton setNavRightButton(java.lang.String title, TuSdkNavigatorBar.TuSdkNavButtonStyleInterface style)
title
- 标题style
- 按钮样式public TuSdkNavigatorBar.NavigatorBarButtonInterface getNavButton(TuSdkNavigatorBar.NavigatorBarButtonType type)
type
- public void navigatorBarBackAction(TuSdkNavigatorBar.NavigatorBarButtonInterface button)
button
- public void navigatorBarCancelAction(TuSdkNavigatorBar.NavigatorBarButtonInterface button)
button
- public void navigatorBarLeftAction(TuSdkNavigatorBar.NavigatorBarButtonInterface button)
button
- public void navigatorBarRightAction(TuSdkNavigatorBar.NavigatorBarButtonInterface button)
button
- public void onNavigatorBarButtonClicked(TuSdkNavigatorBar.NavigatorBarButtonInterface button)
public void showNavigatorBar(boolean isShowed, boolean needAnim)
isShowed
- 是否显示needAnim
- 是否需要动画public void navSegmentedAddTexts(java.lang.String... titles)
titles
- public void navSegmentedAddTexts(int... titleResid)
titleResid
- public void navSegmentedSetDelegate(TuSdkSegmented.TuSdkSegmentedDelegate delegate)
delegate
- public void navSegmentedSetected(int index)
delegate
- public void navSearchViewSetDelegate(TuSdkSearchView.TuSdkSearchViewDelegate delegate)
delegate
- public void navSearchViewSearch(java.lang.String keyword)
keyword
- public void presentActivity(TuSdkIntent intent, ActivityAnimType animType, boolean isDestory)
intent
- animType
- isDestory
- public void presentActivity(java.lang.Class<?> activity, ActivityAnimType animType, boolean isDestory)
activity
- 开启对象animType
- 动画isDestory
- 是否销毁自己public void presentModalNavigationActivity(java.lang.Class<?> activityClazz, androidx.fragment.app.Fragment fragment, ActivityAnimType presentAnim, ActivityAnimType dismissAnim, boolean wantFullScreen, boolean isDestory)
activityClazz
- 新Activity类对象fragment
- 加载的fragment实例presentAnim
- 弹出时动画dismissAnim
- 退出时动画wantFullScreen
- 是否需要全屏isDestory
- 是否销毁自己public void presentModalNavigationActivity(java.lang.Class<?> activityClazz, androidx.fragment.app.Fragment fragment, ActivityAnimType presentAnim, ActivityAnimType dismissAnim, boolean wantFullScreen)
activityClazz
- 新Activity类对象fragment
- 加载的fragment实例presentAnim
- 弹出时动画dismissAnim
- 退出时动画wantFullScreen
- 是否需要全屏public void presentModalNavigationActivity(java.lang.Class<?> activityClazz, java.lang.Class<?> fragmentClazz, ActivityAnimType presentAnim, ActivityAnimType dismissAnim, boolean wantFullScreen)
activityClazz
- 新Activity类对象fragmentClazz
- 加载的fragment类对象presentAnim
- 弹出时动画dismissAnim
- 退出时动画wantFullScreen
- 是否需要全屏public void filpModalNavigationActivity(java.lang.Class<?> activityClazz, androidx.fragment.app.Fragment fragment, boolean wantFullScreen, boolean isDestory)
activityClazz
- 新Activity类对象fragment
- 加载的fragment类对象wantFullScreen
- 是否需要全屏isDestory
- 是否销毁自己