public abstract class BaseFragmentLifecycleProceed extends BaseCallbacks.BaseLifecycleProceed
BaseCallbacks.BaseLifecycleProceed
class to provide the Fragment
lifecycle support.
For the moment supported lifecycle is close to the BaseActivityLifecycleProceed.ActivityLifecycle
but will likely expand in future releases.Modifier and Type | Class and Description |
---|---|
static class |
BaseFragmentLifecycleProceed.BaseFragmentCallbacks
Extends the
BaseCallbacks.BaseCacheCallbacks class to provide the fragment life cycle callbacks support. |
static class |
BaseFragmentLifecycleProceed.FragmentLifecycle
The
Fragment lifecycle. |
Constructor and Description |
---|
BaseFragmentLifecycleProceed()
Initialises a newly created
BaseFragmentLifecycleProceed object. |
Modifier and Type | Method and Description |
---|---|
protected static void |
apply(BaseFragmentLifecycleProceed.FragmentLifecycle lifeCycle,
Fragment fragment,
Bundle state)
Applies registered callbacks to the given fragment.
|
static Collection<BaseFragmentLifecycleProceed.BaseFragmentCallbacks> |
getCallbacks()
Returns the collection of registered callbacks handlers.
|
static void |
onActivityCreated(Fragment fragment,
Bundle savedInstanceState)
Called by the Yakhont Weaver to apply registered callbacks to the given fragment.
|
static void |
onCreated(Fragment fragment,
Bundle savedInstanceState)
Called by the Yakhont Weaver to apply registered callbacks to the given fragment.
|
static void |
onDestroyed(Fragment fragment)
Called by the Yakhont Weaver to apply registered callbacks to the given fragment.
|
static void |
onPaused(Fragment fragment)
Called by the Yakhont Weaver to apply registered callbacks to the given fragment.
|
static void |
onResumed(Fragment fragment)
Called by the Yakhont Weaver to apply registered callbacks to the given fragment.
|
static void |
onSaveInstanceState(Fragment fragment,
Bundle outState)
Called by the Yakhont Weaver to apply registered callbacks to the given fragment.
|
static void |
onStarted(Fragment fragment)
Called by the Yakhont Weaver to apply registered callbacks to the given fragment.
|
static void |
onStopped(Fragment fragment)
Called by the Yakhont Weaver to apply registered callbacks to the given fragment.
|
static boolean |
register(BaseFragmentLifecycleProceed.BaseFragmentCallbacks callbacks)
Registers the callbacks handler.
|
static void |
setActive(boolean active)
Activates Yakhont Weaver.
|
static boolean |
unregister(Class<? extends BaseFragmentLifecycleProceed.BaseFragmentCallbacks> callbacksClass)
Unregisters the callbacks handler.
|
register
proceed, register, unregister
public BaseFragmentLifecycleProceed()
BaseFragmentLifecycleProceed
object.public static Collection<BaseFragmentLifecycleProceed.BaseFragmentCallbacks> getCallbacks()
public static boolean register(@NonNull BaseFragmentLifecycleProceed.BaseFragmentCallbacks callbacks)
callbacks
- The callbacks handler to registertrue
if the callbacks handler was successfully registered, false
otherwisepublic static boolean unregister(@NonNull Class<? extends BaseFragmentLifecycleProceed.BaseFragmentCallbacks> callbacksClass)
callbacksClass
- The class of the callbacks handler to unregistertrue
if the callbacks handler was successfully unregistered, false
otherwiseprotected static void apply(@NonNull BaseFragmentLifecycleProceed.FragmentLifecycle lifeCycle, @NonNull Fragment fragment, Bundle state)
lifeCycle
- The fragment statefragment
- The fragment to apply callbacks tostate
- The additional information concerning the fragment statepublic static void setActive(boolean active)
active
- true
to activate Yakhont Weaver, false
otherwisepublic static void onCreated(@NonNull Fragment fragment, Bundle savedInstanceState)
CREATED
.fragment
- The fragment to apply callbacks tosavedInstanceState
- The additional information concerning the fragment statepublic static void onDestroyed(@NonNull Fragment fragment)
DESTROYED
.fragment
- The fragment to apply callbacks topublic static void onSaveInstanceState(@NonNull Fragment fragment, Bundle outState)
SAVE_INSTANCE_STATE
.fragment
- The fragment to apply callbacks tooutState
- The additional information concerning the fragment statepublic static void onResumed(@NonNull Fragment fragment)
RESUMED
.fragment
- The fragment to apply callbacks topublic static void onPaused(@NonNull Fragment fragment)
PAUSED
.fragment
- The fragment to apply callbacks topublic static void onStarted(@NonNull Fragment fragment)
STARTED
.fragment
- The fragment to apply callbacks topublic static void onStopped(@NonNull Fragment fragment)
STOPPED
.fragment
- The fragment to apply callbacks topublic static void onActivityCreated(@NonNull Fragment fragment, Bundle savedInstanceState)
ACTIVITY_CREATED
.fragment
- The fragment to apply callbacks to
Copyright © 2015-2017 akha, a.k.a. Alexander Kharitonov
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.