18d1f9c9be50439fa3f5f50fbe473e43ba6b77eb6Maurice Lam/* 28d1f9c9be50439fa3f5f50fbe473e43ba6b77eb6Maurice Lam * Copyright (C) 2015 The Android Open Source Project 38d1f9c9be50439fa3f5f50fbe473e43ba6b77eb6Maurice Lam * 48d1f9c9be50439fa3f5f50fbe473e43ba6b77eb6Maurice Lam * Licensed under the Apache License, Version 2.0 (the "License"); 58d1f9c9be50439fa3f5f50fbe473e43ba6b77eb6Maurice Lam * you may not use this file except in compliance with the License. 68d1f9c9be50439fa3f5f50fbe473e43ba6b77eb6Maurice Lam * You may obtain a copy of the License at 78d1f9c9be50439fa3f5f50fbe473e43ba6b77eb6Maurice Lam * 88d1f9c9be50439fa3f5f50fbe473e43ba6b77eb6Maurice Lam * http://www.apache.org/licenses/LICENSE-2.0 98d1f9c9be50439fa3f5f50fbe473e43ba6b77eb6Maurice Lam * 108d1f9c9be50439fa3f5f50fbe473e43ba6b77eb6Maurice Lam * Unless required by applicable law or agreed to in writing, software 118d1f9c9be50439fa3f5f50fbe473e43ba6b77eb6Maurice Lam * distributed under the License is distributed on an "AS IS" BASIS, 128d1f9c9be50439fa3f5f50fbe473e43ba6b77eb6Maurice Lam * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 138d1f9c9be50439fa3f5f50fbe473e43ba6b77eb6Maurice Lam * See the License for the specific language governing permissions and 148d1f9c9be50439fa3f5f50fbe473e43ba6b77eb6Maurice Lam * limitations under the License 158d1f9c9be50439fa3f5f50fbe473e43ba6b77eb6Maurice Lam */ 168d1f9c9be50439fa3f5f50fbe473e43ba6b77eb6Maurice Lam 178d1f9c9be50439fa3f5f50fbe473e43ba6b77eb6Maurice Lampackage com.android.settings.fingerprint; 188d1f9c9be50439fa3f5f50fbe473e43ba6b77eb6Maurice Lam 198d1f9c9be50439fa3f5f50fbe473e43ba6b77eb6Maurice Lamimport android.content.Intent; 208d1f9c9be50439fa3f5f50fbe473e43ba6b77eb6Maurice Lamimport android.content.res.Resources; 218d1f9c9be50439fa3f5f50fbe473e43ba6b77eb6Maurice Lamimport android.view.View; 228d1f9c9be50439fa3f5f50fbe473e43ba6b77eb6Maurice Lamimport android.widget.Button; 235656314acad5d105c357cedd895f78b12476cac8Maurice Lamimport android.widget.TextView; 248d1f9c9be50439fa3f5f50fbe473e43ba6b77eb6Maurice Lam 258d1f9c9be50439fa3f5f50fbe473e43ba6b77eb6Maurice Lamimport com.android.settings.ChooseLockSettingsHelper; 268d1f9c9be50439fa3f5f50fbe473e43ba6b77eb6Maurice Lamimport com.android.settings.R; 278d1f9c9be50439fa3f5f50fbe473e43ba6b77eb6Maurice Lamimport com.android.settings.SetupWizardUtils; 288d1f9c9be50439fa3f5f50fbe473e43ba6b77eb6Maurice Lamimport com.android.setupwizardlib.view.NavigationBar; 298d1f9c9be50439fa3f5f50fbe473e43ba6b77eb6Maurice Lam 308d1f9c9be50439fa3f5f50fbe473e43ba6b77eb6Maurice Lampublic class SetupFingerprintEnrollFinish extends FingerprintEnrollFinish 318d1f9c9be50439fa3f5f50fbe473e43ba6b77eb6Maurice Lam implements NavigationBar.NavigationBarListener { 328d1f9c9be50439fa3f5f50fbe473e43ba6b77eb6Maurice Lam 338d1f9c9be50439fa3f5f50fbe473e43ba6b77eb6Maurice Lam @Override 348d1f9c9be50439fa3f5f50fbe473e43ba6b77eb6Maurice Lam protected Intent getEnrollingIntent() { 358d1f9c9be50439fa3f5f50fbe473e43ba6b77eb6Maurice Lam Intent intent = new Intent(this, SetupFingerprintEnrollEnrolling.class); 368d1f9c9be50439fa3f5f50fbe473e43ba6b77eb6Maurice Lam intent.putExtra(ChooseLockSettingsHelper.EXTRA_KEY_CHALLENGE_TOKEN, mToken); 378d1f9c9be50439fa3f5f50fbe473e43ba6b77eb6Maurice Lam SetupWizardUtils.copySetupExtras(getIntent(), intent); 388d1f9c9be50439fa3f5f50fbe473e43ba6b77eb6Maurice Lam return intent; 398d1f9c9be50439fa3f5f50fbe473e43ba6b77eb6Maurice Lam } 408d1f9c9be50439fa3f5f50fbe473e43ba6b77eb6Maurice Lam 418d1f9c9be50439fa3f5f50fbe473e43ba6b77eb6Maurice Lam @Override 428d1f9c9be50439fa3f5f50fbe473e43ba6b77eb6Maurice Lam protected void onApplyThemeResource(Resources.Theme theme, int resid, boolean first) { 438d1f9c9be50439fa3f5f50fbe473e43ba6b77eb6Maurice Lam resid = SetupWizardUtils.getTheme(getIntent()); 448d1f9c9be50439fa3f5f50fbe473e43ba6b77eb6Maurice Lam super.onApplyThemeResource(theme, resid, first); 458d1f9c9be50439fa3f5f50fbe473e43ba6b77eb6Maurice Lam } 468d1f9c9be50439fa3f5f50fbe473e43ba6b77eb6Maurice Lam 478d1f9c9be50439fa3f5f50fbe473e43ba6b77eb6Maurice Lam @Override 488d1f9c9be50439fa3f5f50fbe473e43ba6b77eb6Maurice Lam protected void initViews() { 498d1f9c9be50439fa3f5f50fbe473e43ba6b77eb6Maurice Lam SetupWizardUtils.setImmersiveMode(this); 508d1f9c9be50439fa3f5f50fbe473e43ba6b77eb6Maurice Lam 518d1f9c9be50439fa3f5f50fbe473e43ba6b77eb6Maurice Lam final View nextButton = findViewById(R.id.next_button); 528d1f9c9be50439fa3f5f50fbe473e43ba6b77eb6Maurice Lam if (nextButton != null) { 538d1f9c9be50439fa3f5f50fbe473e43ba6b77eb6Maurice Lam nextButton.setVisibility(View.GONE); 548d1f9c9be50439fa3f5f50fbe473e43ba6b77eb6Maurice Lam } 558d1f9c9be50439fa3f5f50fbe473e43ba6b77eb6Maurice Lam 568d1f9c9be50439fa3f5f50fbe473e43ba6b77eb6Maurice Lam final NavigationBar navigationBar = getNavigationBar(); 578d1f9c9be50439fa3f5f50fbe473e43ba6b77eb6Maurice Lam navigationBar.setNavigationBarListener(this); 588d1f9c9be50439fa3f5f50fbe473e43ba6b77eb6Maurice Lam navigationBar.getBackButton().setVisibility(View.GONE); 595656314acad5d105c357cedd895f78b12476cac8Maurice Lam 605656314acad5d105c357cedd895f78b12476cac8Maurice Lam final TextView message = (TextView) findViewById(R.id.message); 615656314acad5d105c357cedd895f78b12476cac8Maurice Lam message.setText(R.string.setup_fingerprint_enroll_finish_message); 625656314acad5d105c357cedd895f78b12476cac8Maurice Lam 635656314acad5d105c357cedd895f78b12476cac8Maurice Lam final TextView secondaryMessage = (TextView) findViewById(R.id.message_secondary); 645656314acad5d105c357cedd895f78b12476cac8Maurice Lam secondaryMessage.setVisibility(View.VISIBLE); 658d1f9c9be50439fa3f5f50fbe473e43ba6b77eb6Maurice Lam } 668d1f9c9be50439fa3f5f50fbe473e43ba6b77eb6Maurice Lam 678d1f9c9be50439fa3f5f50fbe473e43ba6b77eb6Maurice Lam @Override 688d1f9c9be50439fa3f5f50fbe473e43ba6b77eb6Maurice Lam protected Button getNextButton() { 698d1f9c9be50439fa3f5f50fbe473e43ba6b77eb6Maurice Lam return getNavigationBar().getNextButton(); 708d1f9c9be50439fa3f5f50fbe473e43ba6b77eb6Maurice Lam } 718d1f9c9be50439fa3f5f50fbe473e43ba6b77eb6Maurice Lam 728d1f9c9be50439fa3f5f50fbe473e43ba6b77eb6Maurice Lam @Override 738d1f9c9be50439fa3f5f50fbe473e43ba6b77eb6Maurice Lam public void onNavigateBack() { 748d1f9c9be50439fa3f5f50fbe473e43ba6b77eb6Maurice Lam onBackPressed(); 758d1f9c9be50439fa3f5f50fbe473e43ba6b77eb6Maurice Lam } 768d1f9c9be50439fa3f5f50fbe473e43ba6b77eb6Maurice Lam 778d1f9c9be50439fa3f5f50fbe473e43ba6b77eb6Maurice Lam @Override 788d1f9c9be50439fa3f5f50fbe473e43ba6b77eb6Maurice Lam public void onNavigateNext() { 798d1f9c9be50439fa3f5f50fbe473e43ba6b77eb6Maurice Lam onNextButtonClick(); 808d1f9c9be50439fa3f5f50fbe473e43ba6b77eb6Maurice Lam } 818d1f9c9be50439fa3f5f50fbe473e43ba6b77eb6Maurice Lam} 82