blob: 9214803c4b667d7a74c2c16099fa5d4dd86eabc5 [file] [log] [blame]
cretin453593f032016-04-20 16:21:05 -07001/*
2 * Copyright (C) 2016 The CyanogenMod Project
Timi Rautamäki5e2f7f22021-08-21 08:58:14 +00003 * Copyright (C) 2017-2021 The LineageOS Project
cretin453593f032016-04-20 16:21:05 -07004 *
5 * Licensed under the Apache License, Version 2.0 (the "License");
6 * you may not use this file except in compliance with the License.
7 * You may obtain a copy of the License at
8 *
9 * http://www.apache.org/licenses/LICENSE-2.0
10 *
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
16 */
17
Michael Bestasc83309e2018-02-03 17:42:13 +020018package org.lineageos.setupwizard;
cretin453593f032016-04-20 16:21:05 -070019
cretin453593f032016-04-20 16:21:05 -070020import android.os.Bundle;
21import android.view.MotionEvent;
22import android.view.View;
23
Timi Rautamäkiab4f1232021-08-23 16:56:13 +000024import com.google.android.setupcompat.util.SystemBarHelper;
25
Michael Bestasc83309e2018-02-03 17:42:13 +020026import org.lineageos.setupwizard.util.EnableAccessibilityController;
cretin453593f032016-04-20 16:21:05 -070027
28public class WelcomeActivity extends BaseSetupWizardActivity {
29
30 public static final String TAG = WelcomeActivity.class.getSimpleName();
31
cretin453593f032016-04-20 16:21:05 -070032 private View mRootView;
33 private EnableAccessibilityController mEnableAccessibilityController;
34
35 @Override
36 protected void onCreate(Bundle savedInstanceState) {
37 super.onCreate(savedInstanceState);
Timi Rautamäkiab4f1232021-08-23 16:56:13 +000038 SystemBarHelper.setBackButtonVisible(getWindow(), false);
Timi Rautamäki5e2f7f22021-08-21 08:58:14 +000039 mRootView = findViewById(R.id.setup_wizard_layout);
Timi Rautamäkiab4f1232021-08-23 16:56:13 +000040 setNextText(R.string.start);
Timi Rautamäki44fb45c2021-08-22 18:27:26 +000041 setSkipText(R.string.emergency_call);
Timi Rautamäkiab4f1232021-08-23 16:56:13 +000042 findViewById(R.id.start).setOnClickListener(view -> onNextPressed());
43 findViewById(R.id.emerg_dialer)
44 .setOnClickListener(view -> startEmergencyDialer());
Timi Rautamäkif6dbf842021-08-24 19:19:25 +000045 findViewById(R.id.launch_accessibility)
46 .setOnClickListener(view -> startAccessibilitySettings());
cretin453593f032016-04-20 16:21:05 -070047 mEnableAccessibilityController =
48 EnableAccessibilityController.getInstance(getApplicationContext());
Michael W2236d292018-07-15 15:09:20 +020049 mRootView.setOnTouchListener((v, event) ->
50 mEnableAccessibilityController.onTouchEvent(event));
51
cretin453593f032016-04-20 16:21:05 -070052 }
53
54 @Override
cretin45d4cea552016-04-25 11:00:04 -070055 public void onBackPressed() {}
56
57 @Override
cretin45d4cea552016-04-25 11:00:04 -070058 protected int getLayoutResId() {
59 return R.layout.welcome_activity;
60 }
cretin453593f032016-04-20 16:21:05 -070061}