PinLockView icon indicating copy to clipboard operation
PinLockView copied to clipboard

PinlockView not Displayed in custom Dialog

Open farabiabdelwahe opened this issue 8 years ago • 2 comments

i tried to put the PinlockView in a dialog . but it the dialog showed up blank.

Dialog Layout : `<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:layout_width="match_parent" android:layout_height="wrap_content" android:background="#ffffffff">

<com.andrognito.pinlockview.PinLockView
    android:id="@+id/pin_lock_view"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content" />

</RelativeLayout>`

Method to Display it : public void showDialog(Activity activity) { final Dialog dialog = new Dialog(activity); dialog.requestWindowFeature(Window.FEATURE_NO_TITLE); dialog.setCancelable(false); dialog.setContentView(R.layout.pindialogue);

    final PinLockView mPinLockView = (PinLockView) dialog.findViewById(R.id.pin_lock_view);
    mPinLockView.setPinLength(4);
    mPinLockView.setPinLockListener(new PinLockListener() {
        @Override
        public void onComplete(String pin) {
            if (pin.equals("1234")) {
                dialog.hide();
            }
            else {
                YoYo.with(Techniques.Shake).duration(700).playOn(mPinLockView);
            }
        }

        @Override
        public void onEmpty() {

        }

        @Override
        public void onPinChange(int pinLength, String intermediatePin) {

        }
    });


    dialog.show();
}

farabiabdelwahe avatar Oct 26 '17 04:10 farabiabdelwahe

Same here,@farabiabdelwahe did you solved the problem?

tarslangil avatar Aug 02 '18 20:08 tarslangil

Works good for me with Material-dialogs

victorlapin avatar Sep 27 '18 11:09 victorlapin