diff options
author | Todd Kennedy <toddke@google.com> | 2015-04-14 18:22:54 -0700 |
---|---|---|
committer | Todd Kennedy <toddke@google.com> | 2015-04-30 12:52:32 -0700 |
commit | a5fc6f006f67867417b7a427de6e7394c4312dec (patch) | |
tree | 180ff23b89b1aa406ead814d254889f248e0e5dc /core/java/android/app/FragmentContainer.java | |
parent | 033dc46bb949a9a5e42ed51bbff1e055a7c58ca2 (diff) | |
download | frameworks_base-a5fc6f006f67867417b7a427de6e7394c4312dec.zip frameworks_base-a5fc6f006f67867417b7a427de6e7394c4312dec.tar.gz frameworks_base-a5fc6f006f67867417b7a427de6e7394c4312dec.tar.bz2 |
Remove dependency upon FragmentActivity
The FragmentManagerImpl is intimately tied with a FragmentActivity. In
many cases, we want to be able to create / manage Fragments outside of
a FragmentManager. This defines a FragmentController interface that can
be used by any class to host Fragments.
Bug: 19569654
Change-Id: I6816a5c1815122d206062b9f4584ad460b3d41dd
Diffstat (limited to 'core/java/android/app/FragmentContainer.java')
-rw-r--r-- | core/java/android/app/FragmentContainer.java | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/core/java/android/app/FragmentContainer.java b/core/java/android/app/FragmentContainer.java new file mode 100644 index 0000000..b2e0300 --- /dev/null +++ b/core/java/android/app/FragmentContainer.java @@ -0,0 +1,38 @@ +/* + * Copyright (C) 2015 The Android Open Source Project + * + * 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. + */ + +package android.app; + +import android.annotation.IdRes; +import android.annotation.Nullable; +import android.view.View; + +/** + * Callbacks to a {@link Fragment}'s container. + */ +public abstract class FragmentContainer { + /** + * Return the view with the given resource ID. May return {@code null} if the + * view is not a child of this container. + */ + @Nullable + public abstract View onFindViewById(@IdRes int id); + + /** + * Return {@code true} if the container holds any view. + */ + public abstract boolean onHasView(); +} |