1 /* 2 * Copyright (C) 2016 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.cts.verifier.sensors.sixdof.Dialogs; 17 18 import com.android.cts.verifier.R; 19 import com.android.cts.verifier.sensors.sixdof.Utils.ResultObjects.ResultObject; 20 21 import android.app.Dialog; 22 import android.os.Bundle; 23 import android.app.AlertDialog; 24 import android.view.LayoutInflater; 25 import android.widget.TextView; 26 27 /** 28 * Dialog that displays the results of the first test. 29 */ 30 public class AccuracyResultDialog extends BaseResultsDialog { 31 32 public static AccuracyResultDialog newInstance(ResultObject resultObject) { 33 AccuracyResultDialog dialog = new AccuracyResultDialog(); 34 dialog.setup(resultObject); 35 return dialog; 36 } 37 38 @Override 39 public Dialog onCreateDialog(Bundle savedInstanceState) { 40 mBuilder = new AlertDialog.Builder(getActivity()); 41 // Get the layout inflater. 42 LayoutInflater inflater = getActivity().getLayoutInflater(); 43 mRootView = inflater.inflate(R.layout.dialog_result_accuracy, null); 44 45 mTextViews.put(ResultType.WAYPOINT, (TextView) mRootView.findViewById(R.id.tvWaypointResult)); 46 mTextViews.put(ResultType.PATH, (TextView) mRootView.findViewById(R.id.tvPathResult)); 47 48 // Parent class will actually create the dialog. 49 return super.onCreateDialog(savedInstanceState); 50 } 51 } 52