• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (C) 2023 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.example.android.vdmdemo.demos;
18 
19 import android.content.Intent;
20 import android.os.Bundle;
21 import android.view.View;
22 
23 import androidx.appcompat.app.AppCompatActivity;
24 
25 /** Launcher activity for all VDM demos. */
26 public class MainActivity extends AppCompatActivity {
27 
28     @Override
onCreate(Bundle savedInstanceState)29     protected void onCreate(Bundle savedInstanceState) {
30         super.onCreate(savedInstanceState);
31         setContentView(R.layout.main_activity);
32     }
33 
34     /** Handles demo launch request. */
onDemoSelected(View view)35     public void onDemoSelected(View view) {
36         switch (view.getId()) {
37             case R.id.activity_policy_demo -> startActivity(
38                     new Intent(this, ActivityPolicyDemoActivity.class));
39             case R.id.home_demo -> startActivity(new Intent(this, HomeDemoActivity.class));
40             case R.id.sensor_demo -> startActivity(new Intent(this, SensorDemoActivity.class));
41             case R.id.display_power_demo -> startActivity(
42                     new Intent(this, DisplayPowerDemoActivity.class));
43             case R.id.rotation_demo -> startActivity(new Intent(this, RotationDemoActivity.class));
44             case R.id.permissions_demo -> startActivity(
45                     new Intent(this, PermissionsDemoActivity.class));
46             case R.id.latency_demo -> startActivity(new Intent(this, LatencyDemoActivity.class));
47             case R.id.vibration_demo -> startActivity(
48                     new Intent(this, VibrationDemoActivity.class));
49             case R.id.stylus_demo -> startActivity(new Intent(this, StylusDemoActivity.class));
50             case R.id.recorder_demo -> startActivity(new Intent(this, RecorderDemoActivity.class));
51         }
52     }
53 }
54