1/*
2 * Copyright (C) 2015 The Android Open Source Project
3 *
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
7 *
8 *      http://www.apache.org/licenses/LICENSE-2.0
9 *
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
15 */
16
17package com.android.settings.fingerprint;
18
19import android.content.Intent;
20import android.content.res.Resources;
21import android.view.View;
22import android.widget.Button;
23import android.widget.TextView;
24
25import com.android.settings.ChooseLockSettingsHelper;
26import com.android.settings.R;
27import com.android.settings.SetupWizardUtils;
28import com.android.setupwizardlib.view.NavigationBar;
29
30public class SetupFingerprintEnrollFinish extends FingerprintEnrollFinish
31        implements NavigationBar.NavigationBarListener {
32
33    @Override
34    protected Intent getEnrollingIntent() {
35        Intent intent = new Intent(this, SetupFingerprintEnrollEnrolling.class);
36        intent.putExtra(ChooseLockSettingsHelper.EXTRA_KEY_CHALLENGE_TOKEN, mToken);
37        SetupWizardUtils.copySetupExtras(getIntent(), intent);
38        return intent;
39    }
40
41    @Override
42    protected void onApplyThemeResource(Resources.Theme theme, int resid, boolean first) {
43        resid = SetupWizardUtils.getTheme(getIntent());
44        super.onApplyThemeResource(theme, resid, first);
45    }
46
47    @Override
48    protected void initViews() {
49        SetupWizardUtils.setImmersiveMode(this);
50
51        final View nextButton = findViewById(R.id.next_button);
52        if (nextButton != null) {
53            nextButton.setVisibility(View.GONE);
54        }
55
56        final NavigationBar navigationBar = getNavigationBar();
57        navigationBar.setNavigationBarListener(this);
58        navigationBar.getBackButton().setVisibility(View.GONE);
59
60        final TextView message = (TextView) findViewById(R.id.message);
61        message.setText(R.string.setup_fingerprint_enroll_finish_message);
62
63        final TextView secondaryMessage = (TextView) findViewById(R.id.message_secondary);
64        secondaryMessage.setVisibility(View.VISIBLE);
65    }
66
67    @Override
68    protected Button getNextButton() {
69        return getNavigationBar().getNextButton();
70    }
71
72    @Override
73    public void onNavigateBack() {
74        onBackPressed();
75    }
76
77    @Override
78    public void onNavigateNext() {
79        onNextButtonClick();
80    }
81}
82