1// CHECKSTYLE:OFF Generated code
2/* This file is auto-generated from BrowseSupportFragmentTestActivity.java.  DO NOT MODIFY. */
3
4/*
5 * Copyright (C) 2015 The Android Open Source Project
6 *
7 * Licensed under the Apache License, Version 2.0 (the "License");
8 * you may not use this file except in compliance with the License.
9 * You may obtain a copy of the License at
10 *
11 *      http://www.apache.org/licenses/LICENSE-2.0
12 *
13 * Unless required by applicable law or agreed to in writing, software
14 * distributed under the License is distributed on an "AS IS" BASIS,
15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 * See the License for the specific language governing permissions and
17 * limitations under the License.
18 */
19package androidx.leanback.app;
20
21import android.app.Activity;
22import android.app.FragmentTransaction;
23import android.content.Intent;
24import android.os.Bundle;
25
26import androidx.leanback.test.R;
27
28public class BrowseFragmentTestActivity extends Activity {
29
30    public static final String EXTRA_ADD_TO_BACKSTACK = "addToBackStack";
31    public static final String EXTRA_NUM_ROWS = "numRows";
32    public static final String EXTRA_REPEAT_PER_ROW = "repeatPerRow";
33    public static final String EXTRA_LOAD_DATA_DELAY = "loadDataDelay";
34    public static final String EXTRA_TEST_ENTRANCE_TRANSITION = "testEntranceTransition";
35    public static final String EXTRA_SET_ADAPTER_AFTER_DATA_LOAD = "set_adapter_after_data_load";
36    public static final String EXTRA_HEADERS_STATE = "headers_state";
37
38    @Override
39    public void onCreate(Bundle savedInstanceState) {
40        super.onCreate(savedInstanceState);
41        Intent intent = getIntent();
42
43        setContentView(R.layout.browse);
44        if (savedInstanceState == null) {
45            Bundle arguments = new Bundle();
46            arguments.putAll(intent.getExtras());
47            BrowseTestFragment fragment = new BrowseTestFragment();
48            fragment.setArguments(arguments);
49            FragmentTransaction ft = getFragmentManager().beginTransaction();
50            ft.replace(R.id.main_frame, fragment);
51            if (intent.getBooleanExtra(EXTRA_ADD_TO_BACKSTACK, false)) {
52                ft.addToBackStack(null);
53            }
54            ft.commit();
55        }
56    }
57
58    public BrowseTestFragment getBrowseTestFragment() {
59        return (BrowseTestFragment) getFragmentManager().findFragmentById(R.id.main_frame);
60    }
61}
62