From a5fc6f006f67867417b7a427de6e7394c4312dec Mon Sep 17 00:00:00 2001 From: Todd Kennedy Date: Tue, 14 Apr 2015 18:22:54 -0700 Subject: 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 --- core/java/android/app/FragmentContainer.java | 38 ++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 core/java/android/app/FragmentContainer.java (limited to 'core/java/android/app/FragmentContainer.java') 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(); +} -- cgit v1.1