• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 RobustnessResultDialog extends BaseResultsDialog {
31 
newInstance(ResultObject resultObject)32     public static RobustnessResultDialog newInstance(ResultObject resultObject) {
33         RobustnessResultDialog dialog = new RobustnessResultDialog();
34         dialog.setup(resultObject);
35         return dialog;
36     }
37 
38     @Override
onCreateDialog(Bundle savedInstanceState)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_robustness, 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         mTextViews.put(ResultType.TIME, (TextView) mRootView.findViewById(R.id.tvTimeResult));
48         mTextViews.put(ResultType.ROTATION, (TextView) mRootView.findViewById(R.id.tvRotationResult));
49 
50         return super.onCreateDialog(savedInstanceState);
51     }
52 }
53