2 * Copyright (C) 2014 The Android Open Source Project
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
8 * http://www.apache.org/licenses/LICENSE-2.0
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
17 package com.android.settings;
19 import android.content.Intent;
20 import android.content.res.Resources;
21 import android.os.Bundle;
22 import android.view.LayoutInflater;
23 import android.view.View;
24 import android.view.ViewGroup;
25 import android.widget.Button;
26 import android.widget.LinearLayout;
28 import com.android.settings.notification.RedactionInterstitial;
31 * Setup Wizard's version of RedactionInterstitial screen. It inherits the logic and basic structure
32 * from RedactionInterstitial class, and should remain similar to that behaviorally. This class
33 * should only overload base methods for minor theme and behavior differences specific to Setup
34 * Wizard. Other changes should be done to RedactionInterstitial class instead and let this class
35 * inherit those changes.
37 public class SetupRedactionInterstitial extends RedactionInterstitial {
40 public Intent getIntent() {
41 Intent modIntent = new Intent(super.getIntent());
42 modIntent.putExtra(EXTRA_SHOW_FRAGMENT,
43 SetupRedactionInterstitialFragment.class.getName());
48 protected boolean isValidFragment(String fragmentName) {
49 return SetupRedactionInterstitialFragment.class.getName().equals(fragmentName);
53 protected void onApplyThemeResource(Resources.Theme theme, int resid, boolean first) {
54 resid = SetupWizardUtils.getTheme(getIntent());
55 super.onApplyThemeResource(theme, resid, first);
59 protected void onCreate(Bundle savedInstance) {
60 super.onCreate(savedInstance);
61 LinearLayout layout = (LinearLayout) findViewById(R.id.content_parent);
62 layout.setFitsSystemWindows(false);
65 public static class SetupRedactionInterstitialFragment extends RedactionInterstitialFragment
66 implements View.OnClickListener {
69 public View onCreateView(LayoutInflater inflater, ViewGroup container,
70 Bundle savedInstanceState) {
71 return inflater.inflate(R.layout.setup_redaction_interstitial, container, false);
75 public void onViewCreated(View view, Bundle savedInstanceState) {
76 super.onViewCreated(view, savedInstanceState);
77 final Button button = (Button) view.findViewById(R.id.redaction_next_button);
78 button.setOnClickListener(this);
82 public void onClick(View v) {
83 if (v.getId() == R.id.redaction_next_button) {
84 final SetupRedactionInterstitial activity =
85 (SetupRedactionInterstitial) getActivity();
86 if (activity != null) {
87 activity.setResult(RESULT_OK, activity.getResultIntentData());