blob: b115f8101ba40e83d379354c422b99d9cf56d556 [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;
Erfan Abdic0f54a32022-02-21 20:33:31 +033023import android.widget.Button;
Erfan Abdi618dfb22022-02-21 22:49:24 +033024import android.widget.TextView;
cretin453593f032016-04-20 16:21:05 -070025
Erfan Abdic0f54a32022-02-21 20:33:31 +033026import com.google.android.setupcompat.template.FooterButtonStyleUtils;
Timi Rautamäkiab4f1232021-08-23 16:56:13 +000027import com.google.android.setupcompat.util.SystemBarHelper;
28
cretin453593f032016-04-20 16:21:05 -070029public class WelcomeActivity extends BaseSetupWizardActivity {
30
31 public static final String TAG = WelcomeActivity.class.getSimpleName();
32
cretin453593f032016-04-20 16:21:05 -070033 private View mRootView;
cretin453593f032016-04-20 16:21:05 -070034
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);
Erfan Abdic0f54a32022-02-21 20:33:31 +033042 Button startButton = findViewById(R.id.start);
43 Button emergButton = findViewById(R.id.emerg_dialer);
44 startButton.setOnClickListener(view -> onNextPressed());
45 emergButton.setOnClickListener(view -> startEmergencyDialer());
Timi Rautamäkif6dbf842021-08-24 19:19:25 +000046 findViewById(R.id.launch_accessibility)
47 .setOnClickListener(view -> startAccessibilitySettings());
Erfan Abdic0f54a32022-02-21 20:33:31 +033048
49 FooterButtonStyleUtils.applyPrimaryButtonPartnerResource(this, startButton, true);
50 FooterButtonStyleUtils.applySecondaryButtonPartnerResource(this, emergButton, true);
Erfan Abdi618dfb22022-02-21 22:49:24 +033051
52 TextView welcomeTitle = findViewById(R.id.welcome_title);
53 welcomeTitle.setText(getString(R.string.setup_welcome_message,
54 getString(R.string.os_name)));
cretin453593f032016-04-20 16:21:05 -070055 }
56
57 @Override
Michael Bestasb7b34b92021-08-25 19:13:30 +030058 public void onBackPressed() {
59 }
cretin45d4cea552016-04-25 11:00:04 -070060
61 @Override
cretin45d4cea552016-04-25 11:00:04 -070062 protected int getLayoutResId() {
63 return R.layout.welcome_activity;
64 }
cretin453593f032016-04-20 16:21:05 -070065}