1 /* 2 * Copyright (C) 2017 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.example.android.autofillframework.app 17 18 import android.os.Bundle 19 import android.support.v7.app.AppCompatActivity 20 import android.view.View 21 import com.example.android.autofillframework.R 22 import kotlinx.android.synthetic.main.activity_main.creditCardCheckoutButton 23 import kotlinx.android.synthetic.main.activity_main.creditCardCompoundViewButton 24 import kotlinx.android.synthetic.main.activity_main.emailComposeButton 25 import kotlinx.android.synthetic.main.activity_main.standardLoginWithAutoCompleteButton 26 import kotlinx.android.synthetic.main.activity_main.standardViewSignInButton 27 import kotlinx.android.synthetic.main.activity_main.virtualViewSignInButton 28 29 /** 30 * This is used to launch sample activities that showcase autofill. 31 */ 32 class MainActivity : AppCompatActivity() { 33 34 override fun onCreate(savedInstanceState: Bundle?) { 35 super.onCreate(savedInstanceState) 36 setContentView(R.layout.activity_main) 37 standardViewSignInButton.setNavigationButtonClickListener(View.OnClickListener { 38 startActivity(StandardSignInActivity.getStartActivityIntent(this@MainActivity)) 39 }) 40 virtualViewSignInButton.setNavigationButtonClickListener(View.OnClickListener { 41 startActivity(VirtualSignInActivity.getStartActivityIntent(this@MainActivity)) 42 }) 43 creditCardCheckoutButton.setNavigationButtonClickListener(View.OnClickListener { 44 startActivity(CreditCardActivity.getStartActivityIntent(this@MainActivity)) 45 }) 46 standardLoginWithAutoCompleteButton.setNavigationButtonClickListener(View.OnClickListener { 47 startActivity(StandardAutoCompleteSignInActivity.getStartActivityIntent(this@MainActivity)) 48 }) 49 emailComposeButton.setNavigationButtonClickListener(View.OnClickListener { 50 startActivity(EmailComposeActivity.getStartActivityIntent(this@MainActivity)) 51 }) 52 creditCardCompoundViewButton.setNavigationButtonClickListener(View.OnClickListener { 53 startActivity(CreditCardCompoundViewActivity.getStartActivityIntent(this@MainActivity)) 54 }) 55 } 56 }