1// CHECKSTYLE:OFF Generated code
2/* This file is auto-generated from RowsActivity.java.  DO NOT MODIFY. */
3
4/*
5 * Copyright (C) 2014 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 */
17package com.example.android.leanback;
18
19import android.support.v4.app.FragmentActivity;
20import android.content.Intent;
21import android.os.Bundle;
22import android.support.v17.leanback.widget.BrowseFrameLayout;
23import android.support.v17.leanback.widget.TitleHelper;
24import android.support.v17.leanback.widget.TitleView;
25import android.view.View;
26
27public class RowsSupportActivity extends FragmentActivity
28{
29    private RowsSupportFragment mRowsSupportFragment;
30
31    /** Called when the activity is first created. */
32    @Override
33    public void onCreate(Bundle savedInstanceState) {
34        super.onCreate(savedInstanceState);
35        setContentView(R.layout.rows_support);
36
37        mRowsSupportFragment = (RowsSupportFragment) getSupportFragmentManager().findFragmentById(
38                R.id.main_rows_fragment);
39
40        setupTitleFragment();
41    }
42
43    private void setupTitleFragment() {
44        TitleView titleView = findViewById(R.id.title);
45        titleView.setTitle("RowsSupportFragment");
46        titleView.setOnSearchClickedListener(new View.OnClickListener() {
47            @Override
48            public void onClick(View view) {
49                Intent intent = new Intent(RowsSupportActivity.this, SearchSupportActivity.class);
50                startActivity(intent);
51            }
52        });
53
54        BrowseFrameLayout frameLayout = findViewById(R.id.rows_frame);
55        TitleHelper titleHelper = new TitleHelper(frameLayout, titleView);
56        frameLayout.setOnFocusSearchListener(titleHelper.getOnFocusSearchListener());
57        mRowsSupportFragment.setTitleHelper(titleHelper);
58    }
59}
60