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 17 package com.android.settings.fingerprint; 18 19 import android.content.Intent; 20 import android.content.res.Resources; 21 import android.view.View; 22 import android.widget.Button; 23 24 import com.android.internal.logging.MetricsLogger; 25 import com.android.settings.R; 26 import com.android.settings.SetupChooseLockGeneric; 27 import com.android.settings.SetupWizardUtils; 28 import com.android.setupwizardlib.view.NavigationBar; 29 30 public class SetupFingerprintEnrollOnboard extends FingerprintEnrollOnboard 31 implements NavigationBar.NavigationBarListener { 32 33 @Override getChooseLockIntent()34 protected Intent getChooseLockIntent() { 35 Intent intent = new Intent(this, SetupChooseLockGeneric.class); 36 SetupWizardUtils.copySetupExtras(getIntent(), intent); 37 return intent; 38 } 39 40 @Override getFindSensorIntent()41 protected Intent getFindSensorIntent() { 42 final Intent intent = new Intent(this, SetupFingerprintEnrollFindSensor.class); 43 SetupWizardUtils.copySetupExtras(getIntent(), intent); 44 return intent; 45 } 46 47 @Override onApplyThemeResource(Resources.Theme theme, int resid, boolean first)48 protected void onApplyThemeResource(Resources.Theme theme, int resid, boolean first) { 49 resid = SetupWizardUtils.getTheme(getIntent()); 50 super.onApplyThemeResource(theme, resid, first); 51 } 52 53 @Override initViews()54 protected void initViews() { 55 SetupWizardUtils.setImmersiveMode(this); 56 57 final View nextButton = findViewById(R.id.next_button); 58 if (nextButton != null) { 59 nextButton.setVisibility(View.GONE); 60 } 61 62 getNavigationBar().setNavigationBarListener(this); 63 } 64 65 @Override getNextButton()66 protected Button getNextButton() { 67 return getNavigationBar().getNextButton(); 68 } 69 70 @Override onNavigateBack()71 public void onNavigateBack() { 72 onBackPressed(); 73 } 74 75 @Override onNavigateNext()76 public void onNavigateNext() { 77 onNextButtonClick(); 78 } 79 80 @Override getMetricsCategory()81 protected int getMetricsCategory() { 82 return MetricsLogger.FINGERPRINT_ENROLL_ONBOARD_SETUP; 83 } 84 } 85