Skip to content

Commit 3928566

Browse files
committed
fixed forgot password bug
1 parent 8beb07a commit 3928566

File tree

6 files changed

+21
-4
lines changed

6 files changed

+21
-4
lines changed

.idea/caches/gradle_models.ser

-6 Bytes
Binary file not shown.

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ Add the dependency
2323

2424
```
2525
dependencies {
26-
implementation 'com.github.p32929:AndroidAppLockscreen:1.1'
26+
implementation 'com.github.p32929:AndroidAppLockscreen:1.2'
2727
}
2828
```
2929

app/src/main/java/p32929/passcodelock/MainActivity.java

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
package p32929.passcodelock;
22

3-
import android.graphics.Color;
43
import android.os.Bundle;
54
import android.view.View;
5+
import android.widget.Toast;
66

77
import p32929.easypasscodelock.Utils.EasyLock;
88
import p32929.easypasscodelock.Utils.LockscreenHandler;
@@ -16,6 +16,13 @@ protected void onCreate(Bundle savedInstanceState) {
1616

1717
// EasyLock.setBackgroundColor(Color.BLUE);
1818
EasyLock.checkPassword(this);
19+
20+
EasyLock.forgotPassword(new View.OnClickListener() {
21+
@Override
22+
public void onClick(View view) {
23+
Toast.makeText(MainActivity.this, "Clicked on forgot password", Toast.LENGTH_SHORT).show();
24+
}
25+
});
1926
}
2027

2128

@@ -34,4 +41,6 @@ public void disable(View view) {
3441
public void checkPass(View view) {
3542
EasyLock.checkPassword(this);
3643
}
44+
45+
3746
}

easypasscodelock/src/main/java/p32929/easypasscodelock/Activities/LockscreenActivity.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ public class LockscreenActivity extends LockscreenHandler implements ActivityCha
3333
R.id.lbtn9,
3434
R.id.lbtn0
3535
};
36-
private TextView textViewDot, textViewHAHA;
36+
private TextView textViewDot, textViewHAHA, textViewForgotPassword;
3737
private Button buttonTick;
3838
private ImageButton imageButtonDelete;
3939
private RelativeLayout relativeLayoutBackground;
@@ -71,11 +71,14 @@ protected void onCreate(Bundle savedInstanceState) {
7171
private void initViews() {
7272
textViewHAHA = findViewById(R.id.haha_text);
7373
textViewDot = findViewById(R.id.dotText);
74+
textViewForgotPassword = findViewById(R.id.forgot_pass_textview);
7475
buttonTick = findViewById(R.id.lbtnTick);
7576
imageButtonDelete = findViewById(R.id.lbtnDelete);
7677
relativeLayoutBackground = findViewById(R.id.background_layout);
7778
relativeLayoutBackground.setBackgroundColor(EasyLock.backgroundColor);
7879

80+
textViewForgotPassword.setOnClickListener(EasyLock.onClickListener);
81+
7982
imageButtonDelete.setOnClickListener(new View.OnClickListener() {
8083
@Override
8184
public void onClick(View view) {

easypasscodelock/src/main/java/p32929/easypasscodelock/Utils/EasyLock.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
import android.content.Context;
44
import android.content.Intent;
55
import android.graphics.Color;
6+
import android.view.View;
67

78
import p32929.easypasscodelock.Activities.LockscreenActivity;
89
import p32929.easypasscodelock.Interfaces.ActivityChanger;
@@ -14,6 +15,7 @@
1415
public class EasyLock {
1516
private static ActivityChanger activityChanger;
1617
public static int backgroundColor = Color.parseColor("#019689");
18+
public static View.OnClickListener onClickListener;
1719

1820
private static void init(Context context) {
1921
FayazSP.init(context);
@@ -59,4 +61,8 @@ public static void setBackgroundColor(int backgroundColor) {
5961
EasyLock.backgroundColor = backgroundColor;
6062
}
6163

64+
public static void forgotPassword(View.OnClickListener onClickListener) {
65+
EasyLock.onClickListener = onClickListener;
66+
}
67+
6268
}

easypasscodelock/src/main/res/layout/activity_easy_lockscreen.xml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -261,7 +261,6 @@
261261
android:layout_alignParentBottom="true"
262262
android:layout_centerHorizontal="true"
263263
android:layout_marginBottom="@dimen/forgot_password_margin_bottom"
264-
android:onClick="forgotPassword"
265264
android:text="Forgot password?"
266265
android:textAlignment="center"
267266
android:textColor="#FFFFFF"

0 commit comments

Comments
 (0)