package com.yuqirong.screenlockview.activity;

import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.widget.Toast;

import com.yuqirong.screenlockview.R;
import com.yuqirong.screenlockview.view.ScreenLockView;

public class MainActivity extends AppCompatActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        ScreenLockView slv = (ScreenLockView) findViewById(R.id.slv);
        if (slv != null) {
            slv.setOnScreenLockListener(new ScreenLockView.OnScreenLockListener() {
                @Override
                public void getStringPassword(String password) {

                }

                @Override
                public void isPassword(boolean flag) {
                    String content;
                    if (flag) {
                        content = "password is correct";
                    } else {
                        content = "password is incorrect";
                    }
                    Toast.makeText(MainActivity.this, content, Toast.LENGTH_SHORT).show();
                }
            });
        }
    }


}
