• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (C) 2019 The Android Open Source Project
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *      http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
17 package com.android.car.settings.common;
18 
19 import androidx.fragment.app.Fragment;
20 
21 import com.android.car.ui.toolbar.ToolbarController;
22 
23 /**
24  * Implemented by Settings {@link android.app.Activity} instances to host Settings {@link Fragment}
25  * instances.
26  */
27 public interface FragmentHost {
28     /**
29      * Launches a Fragment in the main container of the current Activity.
30      */
launchFragment(Fragment fragment)31     void launchFragment(Fragment fragment);
32 
33     /**
34      * Pops the top off the Fragment stack.
35      */
goBack()36     void goBack();
37 
38     /**
39      * Shows a message to inform the user that the current feature is not available when driving.
40      */
showBlockingMessage()41     void showBlockingMessage();
42 
43     /**
44      * Returns the currently modifiable toolbar for the activity.
45      */
getToolbar()46     ToolbarController getToolbar();
47 }
48