1 /* 2 * Copyright (C) 2019 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 package com.android.car.settings.security; 17 18 import android.os.Bundle; 19 import android.view.View; 20 import android.widget.ProgressBar; 21 22 import com.android.car.settings.R; 23 import com.android.car.settings.common.SettingsFragment; 24 25 /** 26 * Add trusted device fragment which displays the progress and show the companion app information 27 * to user. 28 */ 29 public class AddTrustedDeviceProgressFragment extends SettingsFragment { 30 private ProgressBar mProgressBar; 31 32 @Override getPreferenceScreenResId()33 protected int getPreferenceScreenResId() { 34 return R.xml.add_trusted_device_progress_fragment; 35 } 36 37 @Override onActivityCreated(Bundle savedInstanceState)38 public void onActivityCreated(Bundle savedInstanceState) { 39 super.onActivityCreated(savedInstanceState); 40 mProgressBar = getToolbar().getProgressBar(); 41 mProgressBar.setVisibility(View.VISIBLE); 42 } 43 44 @Override onStart()45 public void onStart() { 46 super.onStart(); 47 mProgressBar.setVisibility(View.VISIBLE); 48 } 49 50 @Override onStop()51 public void onStop() { 52 super.onStop(); 53 mProgressBar.setVisibility(View.GONE); 54 } 55 } 56 57