question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

The UI of password page changes and shrinks sometimes.

See original GitHub issue

nexus5x_7 1 2

Activity File

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

import com.declaree.declaree.R; import com.kevalpatel.passcodeview.KeyNamesBuilder; import com.kevalpatel.passcodeview.PinView; import com.kevalpatel.passcodeview.indicators.CircleIndicator; import com.kevalpatel.passcodeview.interfaces.AuthenticationListener; import com.kevalpatel.passcodeview.keys.RoundKey;

public class PinActivity extends AppCompatActivity {

private int failureCount = 0;
private boolean success = false;

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_pin);

    PinView pinView = findViewById(R.id.pin_view);
    pinView.setCorrectPin(new int[]{1, 2, 3, 4});

    pinView.setKeyNames(new KeyNamesBuilder()
            .setKeyOne(this, R.string.key_1)
            .setKeyTwo(this, R.string.key_2)
            .setKeyThree(this, R.string.key_3)
            .setKeyFour(this, R.string.key_4)
            .setKeyFive(this, R.string.key_5)
            .setKeySix(this, R.string.key_6)
            .setKeySeven(this, R.string.key_7)
            .setKeyEight(this, R.string.key_8)
            .setKeyNine(this, R.string.key_9)
            .setKeyZero(this, R.string.key_0));

    pinView.setKey(new RoundKey.Builder(pinView)
            .setKeyPadding(R.dimen.key_padding)
            .setKeyStrokeColorResource(R.color.colorAccent)
            .setKeyStrokeWidth(R.dimen.key_stroke_width)
            .setKeyTextColorResource(R.color.colorPrimaryDark)
            .setKeyTextSize(R.dimen.key_text_size)
            .build());

    pinView.setIndicator(new CircleIndicator.Builder(pinView)
            .setIndicatorRadius(R.dimen.indicator_radius)
            .setIndicatorFilledColorResource(R.color.colorPrimaryDark)
            .setIndicatorStrokeColorResource(R.color.colorAccent)
            .setIndicatorStrokeWidth(R.dimen.indicator_stroke_width)
            .build());


    pinView.setTitle("Use fingerprint or enter PIN to unlock");

    pinView.setAuthenticationListener(new AuthenticationListener() {
        @Override
        public void onAuthenticationSuccessful() {
            //User authenticated successfully.
            //Navigate to next screens.
            Toast.makeText(PinActivity.this, "Success", Toast.LENGTH_SHORT).show();
            success = true;
            onBackPressed();
        }

        @Override
        public void onAuthenticationFailed() {
            //Calls whenever authentication is failed or user is unauthorized.
            //Do something if you want to handle unauthorized user.
            failureCount++;
            success = false;
            if (failureCount > 4)
                Toast.makeText(PinActivity.this, "You are logged out as entered wrong password", Toast.LENGTH_SHORT).show();
            
        }
    });

}

@Override
public void onBackPressed() {
    if (success)
        super.onBackPressed();
}

} `

UI file code

`<?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" android:layout_width="match_parent" android:layout_height="match_parent" >

<ImageView
    android:id="@+id/imageView"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:src="@drawable/logo_dark"
    android:visibility="gone"
    android:contentDescription="@string/app_name"/>

<com.kevalpatel.passcodeview.PinView
    android:id="@+id/pin_view"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:layout_below="@id/imageView"
    app:dividerColor="@color/colorPrimaryDark"
    app:fingerprintDefaultText="Scan your finger to unlock application"
    app:fingerprintEnable="true"
    app:fingerprintTextColor="@color/colorPrimaryDark"
    app:fingerprintTextSize="@dimen/finger_print_text_size"
    app:titleTextColor="@android:color/white"/>
</RelativeLayout> `

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:1
  • Comments:8 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
AkshayPathakcommented, Dec 18, 2017

Same issue, can we get an update on this @kevalpatel2106?

0reactions
kevalpatel2106commented, Feb 6, 2018

Version 1.2.1 released with the fix.

On 06-Feb-2018 8:05 AM, “Mohammed Mansoor” notifications@github.com wrote:

I removed the plugin and installed, still getting same issue. Haven’t you update the version after meging this or i’m doing in wrong way?

— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub https://github.com/kevalpatel2106/PasscodeView/issues/6#issuecomment-363291165, or mute the thread https://github.com/notifications/unsubscribe-auth/ATIYAv6aI7aMINKipegCZsWT4K9_XTO2ks5tR7qAgaJpZM4PrpLH .

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to make sure the UI always shrinks and fit to the window ...
I want to shrink my UI and make it fit on multiple devices irrespective of the device resolution, so that there wont be...
Read more >
Password Creation: 3 Ways To Make It Easier
The Solution: Allow users to unmask the password. Seeing the password will support memory and will allow users to check their work. On...
Read more >
Is having the username and password fields on different ...
Most sites do not prematurely end the login sequence if something is incorrectly entered. The end-user enters all information in the various ...
Read more >
Release Notes - LastPass
Additionally, a new "Change password" option is available when you edit an at-risk password, which will guide you through the process of updating...
Read more >
Sign-in form best practices - web.dev
A common mistake is to wrap a whole web page in a single form, but this is liable to cause problems for browser...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found