• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // CHECKSTYLE:OFF Generated code
2 /* This file is auto-generated from GuidedStepFragmentTestActivity.java.  DO NOT MODIFY. */
3 
4 /*
5  * Copyright (C) 2016 The Android Open Source Project
6  *
7  * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
8  * in compliance with the License. You may obtain a copy of the License at
9  *
10  * http://www.apache.org/licenses/LICENSE-2.0
11  *
12  * Unless required by applicable law or agreed to in writing, software distributed under the License
13  * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
14  * or implied. See the License for the specific language governing permissions and limitations under
15  * the License.
16  */
17 
18 package android.support.v17.leanback.app;
19 
20 import android.support.v4.app.FragmentActivity;
21 import android.content.Intent;
22 import android.os.Bundle;
23 
24 /**
25  * @hide from javadoc
26  */
27 public class GuidedStepSupportFragmentTestActivity extends FragmentActivity {
28 
29     /**
30      * Frst Test that will be included in this Activity
31      */
32     public static final String EXTRA_TEST_NAME = "testName";
33     /**
34      * True(default) to addAsRoot() for first Test, false to use add()
35      */
36     public static final String EXTRA_ADD_AS_ROOT = "addAsRoot";
37 
38     @Override
onCreate(Bundle savedInstanceState)39     protected void onCreate(Bundle savedInstanceState) {
40         super.onCreate(savedInstanceState);
41 
42         Intent intent = getIntent();
43 
44         if (savedInstanceState == null) {
45             String firstTestName = intent.getStringExtra(EXTRA_TEST_NAME);
46             if (firstTestName != null) {
47                 GuidedStepTestSupportFragment testFragment = new GuidedStepTestSupportFragment(firstTestName);
48                 if (intent.getBooleanExtra(EXTRA_ADD_AS_ROOT, true)) {
49                     GuidedStepTestSupportFragment.addAsRoot(this, testFragment, android.R.id.content);
50                 } else {
51                     GuidedStepTestSupportFragment.add(getSupportFragmentManager(), testFragment,
52                             android.R.id.content);
53                 }
54             }
55         }
56     }
57 }
58