Skip to content

Commit

Permalink
fixed forgot password bug
Browse files Browse the repository at this point in the history
  • Loading branch information
p32929 committed Aug 7, 2019
1 parent 8beb07a commit 3928566
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 4 deletions.
Binary file modified .idea/caches/gradle_models.ser
Binary file not shown.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ Add the dependency

```
dependencies {
implementation 'com.github.p32929:AndroidAppLockscreen:1.1'
implementation 'com.github.p32929:AndroidAppLockscreen:1.2'
}
```

Expand Down
11 changes: 10 additions & 1 deletion app/src/main/java/p32929/passcodelock/MainActivity.java
Original file line number Diff line number Diff line change
@@ -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;
Expand All @@ -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();
}
});
}


Expand All @@ -34,4 +41,6 @@ public void disable(View view) {
public void checkPass(View view) {
EasyLock.checkPassword(this);
}


}
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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);
Expand Down Expand Up @@ -59,4 +61,8 @@ public static void setBackgroundColor(int backgroundColor) {
EasyLock.backgroundColor = backgroundColor;
}

public static void forgotPassword(View.OnClickListener onClickListener) {
EasyLock.onClickListener = onClickListener;
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit 3928566

Please sign in to comment.