diff --git a/.idea/caches/gradle_models.ser b/.idea/caches/gradle_models.ser index dec0816..89d307c 100644 Binary files a/.idea/caches/gradle_models.ser and b/.idea/caches/gradle_models.ser differ diff --git a/README.md b/README.md index 6c96b61..edb1c74 100644 --- a/README.md +++ b/README.md @@ -23,7 +23,7 @@ Add the dependency ``` dependencies { - implementation 'com.github.p32929:AndroidAppLockscreen:1.1' + implementation 'com.github.p32929:AndroidAppLockscreen:1.2' } ``` diff --git a/app/src/main/java/p32929/passcodelock/MainActivity.java b/app/src/main/java/p32929/passcodelock/MainActivity.java index ba3b530..e3ba2bb 100644 --- a/app/src/main/java/p32929/passcodelock/MainActivity.java +++ b/app/src/main/java/p32929/passcodelock/MainActivity.java @@ -1,8 +1,8 @@ package p32929.passcodelock; -import android.graphics.Color; import android.os.Bundle; import android.view.View; +import android.widget.Toast; import p32929.easypasscodelock.Utils.EasyLock; import p32929.easypasscodelock.Utils.LockscreenHandler; @@ -16,6 +16,13 @@ protected void onCreate(Bundle savedInstanceState) { // EasyLock.setBackgroundColor(Color.BLUE); EasyLock.checkPassword(this); + + EasyLock.forgotPassword(new View.OnClickListener() { + @Override + public void onClick(View view) { + Toast.makeText(MainActivity.this, "Clicked on forgot password", Toast.LENGTH_SHORT).show(); + } + }); } @@ -34,4 +41,6 @@ public void disable(View view) { public void checkPass(View view) { EasyLock.checkPassword(this); } + + } diff --git a/easypasscodelock/src/main/java/p32929/easypasscodelock/Activities/LockscreenActivity.java b/easypasscodelock/src/main/java/p32929/easypasscodelock/Activities/LockscreenActivity.java index 8ad396a..04891e9 100644 --- a/easypasscodelock/src/main/java/p32929/easypasscodelock/Activities/LockscreenActivity.java +++ b/easypasscodelock/src/main/java/p32929/easypasscodelock/Activities/LockscreenActivity.java @@ -33,7 +33,7 @@ public class LockscreenActivity extends LockscreenHandler implements ActivityCha R.id.lbtn9, R.id.lbtn0 }; - private TextView textViewDot, textViewHAHA; + private TextView textViewDot, textViewHAHA, textViewForgotPassword; private Button buttonTick; private ImageButton imageButtonDelete; private RelativeLayout relativeLayoutBackground; @@ -71,11 +71,14 @@ protected void onCreate(Bundle savedInstanceState) { private void initViews() { textViewHAHA = findViewById(R.id.haha_text); textViewDot = findViewById(R.id.dotText); + textViewForgotPassword = findViewById(R.id.forgot_pass_textview); buttonTick = findViewById(R.id.lbtnTick); imageButtonDelete = findViewById(R.id.lbtnDelete); relativeLayoutBackground = findViewById(R.id.background_layout); relativeLayoutBackground.setBackgroundColor(EasyLock.backgroundColor); + textViewForgotPassword.setOnClickListener(EasyLock.onClickListener); + imageButtonDelete.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { diff --git a/easypasscodelock/src/main/java/p32929/easypasscodelock/Utils/EasyLock.java b/easypasscodelock/src/main/java/p32929/easypasscodelock/Utils/EasyLock.java index 0da7f8a..4e54fd9 100644 --- a/easypasscodelock/src/main/java/p32929/easypasscodelock/Utils/EasyLock.java +++ b/easypasscodelock/src/main/java/p32929/easypasscodelock/Utils/EasyLock.java @@ -3,6 +3,7 @@ import android.content.Context; import android.content.Intent; import android.graphics.Color; +import android.view.View; import p32929.easypasscodelock.Activities.LockscreenActivity; import p32929.easypasscodelock.Interfaces.ActivityChanger; @@ -14,6 +15,7 @@ public class EasyLock { private static ActivityChanger activityChanger; public static int backgroundColor = Color.parseColor("#019689"); + public static View.OnClickListener onClickListener; private static void init(Context context) { FayazSP.init(context); @@ -59,4 +61,8 @@ public static void setBackgroundColor(int backgroundColor) { EasyLock.backgroundColor = backgroundColor; } + public static void forgotPassword(View.OnClickListener onClickListener) { + EasyLock.onClickListener = onClickListener; + } + } diff --git a/easypasscodelock/src/main/res/layout/activity_easy_lockscreen.xml b/easypasscodelock/src/main/res/layout/activity_easy_lockscreen.xml index 556ecc6..94b1b04 100644 --- a/easypasscodelock/src/main/res/layout/activity_easy_lockscreen.xml +++ b/easypasscodelock/src/main/res/layout/activity_easy_lockscreen.xml @@ -261,7 +261,6 @@ android:layout_alignParentBottom="true" android:layout_centerHorizontal="true" android:layout_marginBottom="@dimen/forgot_password_margin_bottom" - android:onClick="forgotPassword" android:text="Forgot password?" android:textAlignment="center" android:textColor="#FFFFFF"