1c9d3f762a070f450a8c6fda459b29f53ad946b70Ian Lake/* 2c9d3f762a070f450a8c6fda459b29f53ad946b70Ian Lake * Copyright (C) 2017 The Android Open Source Project 3c9d3f762a070f450a8c6fda459b29f53ad946b70Ian Lake * 4c9d3f762a070f450a8c6fda459b29f53ad946b70Ian Lake * Licensed under the Apache License, Version 2.0 (the "License"); 5c9d3f762a070f450a8c6fda459b29f53ad946b70Ian Lake * you may not use this file except in compliance with the License. 6c9d3f762a070f450a8c6fda459b29f53ad946b70Ian Lake * You may obtain a copy of the License at 7c9d3f762a070f450a8c6fda459b29f53ad946b70Ian Lake * 8c9d3f762a070f450a8c6fda459b29f53ad946b70Ian Lake * http://www.apache.org/licenses/LICENSE-2.0 9c9d3f762a070f450a8c6fda459b29f53ad946b70Ian Lake * 10c9d3f762a070f450a8c6fda459b29f53ad946b70Ian Lake * Unless required by applicable law or agreed to in writing, software 11c9d3f762a070f450a8c6fda459b29f53ad946b70Ian Lake * distributed under the License is distributed on an "AS IS" BASIS, 12c9d3f762a070f450a8c6fda459b29f53ad946b70Ian Lake * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13c9d3f762a070f450a8c6fda459b29f53ad946b70Ian Lake * See the License for the specific language governing permissions and 14c9d3f762a070f450a8c6fda459b29f53ad946b70Ian Lake * limitations under the License. 15c9d3f762a070f450a8c6fda459b29f53ad946b70Ian Lake */ 16c9d3f762a070f450a8c6fda459b29f53ad946b70Ian Lake 171503d52153986fdcfe7e744795010708b7410892Ian Lakepackage androidx.navigation; 18c9d3f762a070f450a8c6fda459b29f53ad946b70Ian Lake 19c9d3f762a070f450a8c6fda459b29f53ad946b70Ian Lakeimport android.os.Bundle; 2051c1fe23339181415ed6837f64218b29f677cd59Ian Lakeimport android.support.annotation.NonNull; 2151c1fe23339181415ed6837f64218b29f677cd59Ian Lakeimport android.support.annotation.Nullable; 22c9d3f762a070f450a8c6fda459b29f53ad946b70Ian Lake 23c9d3f762a070f450a8c6fda459b29f53ad946b70Ian Lake/** 24c9d3f762a070f450a8c6fda459b29f53ad946b70Ian Lake * An empty {@link Navigator} used to test {@link SimpleNavigatorProvider}. 25c9d3f762a070f450a8c6fda459b29f53ad946b70Ian Lake */ 26c9d3f762a070f450a8c6fda459b29f53ad946b70Ian Lake@Navigator.Name(EmptyNavigator.NAME) 27c9d3f762a070f450a8c6fda459b29f53ad946b70Ian Lakeclass EmptyNavigator extends Navigator<NavDestination> { 28c9d3f762a070f450a8c6fda459b29f53ad946b70Ian Lake static final String NAME = "empty"; 29c9d3f762a070f450a8c6fda459b29f53ad946b70Ian Lake 3051c1fe23339181415ed6837f64218b29f677cd59Ian Lake @NonNull 31c9d3f762a070f450a8c6fda459b29f53ad946b70Ian Lake @Override 32c9d3f762a070f450a8c6fda459b29f53ad946b70Ian Lake public NavDestination createDestination() { 33c9d3f762a070f450a8c6fda459b29f53ad946b70Ian Lake return new NavDestination(this); 34c9d3f762a070f450a8c6fda459b29f53ad946b70Ian Lake } 35c9d3f762a070f450a8c6fda459b29f53ad946b70Ian Lake 36c9d3f762a070f450a8c6fda459b29f53ad946b70Ian Lake @Override 3751c1fe23339181415ed6837f64218b29f677cd59Ian Lake public void navigate(@NonNull NavDestination destination, @Nullable Bundle args, 3851c1fe23339181415ed6837f64218b29f677cd59Ian Lake @Nullable NavOptions navOptions) { 39c9d3f762a070f450a8c6fda459b29f53ad946b70Ian Lake throw new IllegalStateException("navigate is not supported"); 40c9d3f762a070f450a8c6fda459b29f53ad946b70Ian Lake } 41c9d3f762a070f450a8c6fda459b29f53ad946b70Ian Lake 42c9d3f762a070f450a8c6fda459b29f53ad946b70Ian Lake @Override 43c9d3f762a070f450a8c6fda459b29f53ad946b70Ian Lake public boolean popBackStack() { 44c9d3f762a070f450a8c6fda459b29f53ad946b70Ian Lake throw new IllegalStateException("popBackStack is not supported"); 45c9d3f762a070f450a8c6fda459b29f53ad946b70Ian Lake } 46c9d3f762a070f450a8c6fda459b29f53ad946b70Ian Lake} 47