Show hide password android

Show hide password android

Show/Hide Password EditText is a very simple extension of Android’s EditText that puts a clickable hide/show icon in the right hand side of the EditText that allows showing of the password.

Latest commit

Git stats

Files

Failed to load latest commit information.

readme.md

#Show/Hide Password EditText

#In Android Support Library, revision 24.2.0 (August 2016) TextInputLayout adds support for the password visibility toggle. Marking showhidepasswordedittext as Deprecated at of 18th Aug 2016.

Inputting text on mobile devices with their smaller keyboards can be error prone and when the password is obscured it can lead to failed login attempts that can frustrate users. Show/Hide Password EditText is a very simple extension of Android’s EditText that puts a clickable hide/show icon in the right hand side of the EditText that allows showing of the password.

  • Use custom fonts/typefaces
  • Customise the show/hide icon
  • Tint the show/hide icon
  • Use either android:inputType=»textPassword» or android:inputType=»numberPassword»
  • Compatible with TextInputLayout from the Design Support lib.
  • Supports back to API 9+ (Gingerbread)
  • Password visibility survives configuration changes

It’s just like the regular EditText.

Also see several examples in the sample project.

Add as dependency

This library is not yet released in Maven Central, until then you can add as a library module or use JitPack.io

add remote maven url

then add a library dependency. Remember to check for latest release here

Customise the hide/show icons via custom attributes

You can also tint icon

  • xml-attribute app:tint_color=»@android:color/holo_orange_dark»
  • runtime using setTintColor(int color)

Increase the size of the touch area that makes the view toggle app:additionalTouchTargetSize=50dp

About

Show/Hide Password EditText is a very simple extension of Android’s EditText that puts a clickable hide/show icon in the right hand side of the EditText that allows showing of the password.

Источник

Show and Hide Android EditText Password

Previously we had posted some posts like simple android contact form, material design login screen XML ui design, material design sign up/registration for android, floating label for android using design support library etc. In this tutorial, you will learn to show and hide edittext password in android application. Mobile screen is very small in comparison to desktop so there can be error while typing password in mobile, it is better to put show password option. Here you will learn to put an eye icon for show and hide password.

There are different ways to show and hide password in android like using toggle button, check box, using image icon and so on. But using eye icon is best way to show and hide password and you will learn it here.

Android Example: How to Show and Hide Password in Android Using Eye Icon

Let’s start by adding compile ‘com.android.support:appcompat-v7:23.2.0’ and compile ‘com.github.scottyab:showhidepasswordedittext:0.6’ dependencies in your build.gradle file. Build.gradle file will look like below.

Читайте также:  Андроид пишет вход не выполнен

XML Layout File

Open your XML layout file and add TextInputLayout widget using design support library. Inside TextInputLayout com.scottyab.showhidepasswordedittext.ShowHidePasswordEditText with app:drawable_hide, app:drawable_show and app:tint_color attributes. Following is the complete content of XML layout file.

res/layout/hide_show_android_edittext_password.xml

Java Activity File

Following is the code of java activity file.

Источник

Как скрыть и показать пароль на нажатие кнопки в Android?

При нажатии кнопки хотите видеть пароль, иначе он должен быть скрыт или, скажем, пунктирный. Я применил следующий код, но он не работает. Любая помощь будет оценена.

6 ответов

Вы использовали OnTouchListener , который дает вам MotionEvent . Используй их! Нет необходимости проверять, что кнопка нажата снова, пока вы нажимаете ее MotionEvent .

Чтобы увидеть поле пароля с паролем: inputType = TYPE_CLASS_TEXT | TYPE_TEXT_VARIATION_VISIBLE_PASSWORD

Когда кнопка нажата MotionEvent.ACTION_UP , чтобы вы могли видеть текст. Когда MotionEvent.ACTION_DOWN сохраните это как было в начале.

Вы не должны изобретать велосипед. Используй это:

Атрибут app:passwordToggleEnabled показывает / скрывает нужную кнопку. Обратите внимание, что вы также должны добавить эту строку в build.gradle вашего приложения:

Улучшенный вид ввода пароля: переключение видимости пароля. Привет! Я решил продолжить вести блог с некоторой задержкой, чтобы рассказать больше о разработке Android. Сегодня давайте начнем с простого: поля ввода пароля.

Улучшенный ввод пароля. Обычно формы входа или регистрации в пользовательском интерфейсе имеют поле для ввода пароля. А Android SDK предоставляет простой способ иметь поле ввода со скрытыми символами: EditText с inputType=»textPassword» . Очень просто. Однако, если вам нужно ввести какой-нибудь длинный и сложный пароль, это может быть немного утомительно: набрать тип довольно просто, а затем вам нужно снова начать вводить пароль.

Решение. Таким образом, чтобы упростить ввод пароля, мы можем реализовать простое, но очень эффективное решение: показывать значок справа от поля ввода, когда вы нажимаете на значок — введенный пароль становится видимым, когда вы поднимаете палец вверх — он снова показывает только неясные персонажи. Просто, эффективно и безопасно!

Существует по крайней мере три очевидных возможных способа добиться этого: скомпоновать представления Android SDK по умолчанию в макете и поместить логику поведения в родительский Fragment / Activity, создать составную ViewGroup для инкапсуляции макета, а логику поведения — создать подкласс EditText, который будет управлять настраиваемым рисованием в правая сторона зрения

Все эти три способа будут работать на вас. Первоначально я сделал первый способ по нескольким причинам, таким как: я не люблю создавать дополнительные сущности без реальной необходимости в этом. Что-то вроде принципа бритвы Оккама. 🙂 мне нужно иметь его только в одном месте

Конечно, если вам нужно иметь несколько одинаковых расширенных представлений пароля в разных местах, выберите 2-й или 3-й (желательно, потому что иерархия представлений плоская).

Реализация. Таким образом, простейшая реализация расширенного представления пароля с представлениями Android SDK по умолчанию может выглядеть так:

В макете знака XML (тривиальные и не относящиеся к теме параметры, такие как отступы, опущены):

В родительском фрагменте / активности:

2.1 . Для хорошего UX давайте добавим прослушиватель с измененным текстом, чтобы показать видимость пароля, если есть какое-то введенное значение пароля, и скрыть его для просмотра пустого пароля:

2.2 . Установите сенсорный слушатель для просмотра видимости пароля, чтобы реагировать на прикосновения

Слушатель касания применяет режим видимых символов, если палец находится внутри видимости, и применяет режим оригинального пароля обратно, когда палец вверх или покидает видимость. Также мы позаботимся о сохранении позиции курсора, чтобы пользователь мог переключать режим видимости в любое время без потери текущей позиции курсора ввода.

Читайте также:  Помощь с планшетами андроид

Это оно! Как я уже сказал, его очень просто реализовать, но он значительно улучшает UX!

Источник

[Android][Guide]Hacking And Bypassing Android Password/Pattern/Face/PI

piraterex

Senior Member

Requirements:
The Device Needs To Have Usb Debugging Enabled
In Case Usb Debugging Isn’t Enabled And You Have Recovery,you Can Run The Same Instructions From Recovery
For Some Methods Root Is Not Required (Though It Will Be Better If Device Is Rooted)

If None Of This Methods Works For You — Unfortunally You Probably Must Full Wipe Your Device

Solution For Everyone With Recovery (Cwm, Twrp, Xrec,Etc. ) Installed:

1. Download this zip Pattern Password Disable (Download from attachments) on to your sdcard (using your PC, as you cant get into your phone, right )
2. Insert the sdcard into your phone
3. Reboot into recovery mode
4. Flash the zip
5. Reboot
6. Done!

Note : If You See The Gesture Pattern Grid Or Password After Restarting, Don’t Worry. Just Try Any Random Pattern Or Password And it Should Unlock.

METHOD 2
Solution For Everyone Without Recovery Installed — ADB :

What You Need:
=>A computer running a Linux distro or Windows+Cygwin
=>USB cable to connect your phone to the PC
=>Adb installed

How to install adb:
1. Open Terminal
2. Type:

Hit [Enter]
3. Follow the instructions until everything is installed.

INSTRUCTIONS:
1. Connect you (turned on) Phone to the Computer via USB.
2. Open a terminal window.
3. Type:

4. Done. Now You Just Have To Reboot.

Note : If You See The Gesture Pattern Grid Or Password After Restarting, Don’t Worry. Just Try Any Random Pattern Or Password And it Should Unlock.

METHOD 3
Solution For Everyone Before Lock Accident :

SMS Bypass — Download Link — Install It On Your Device (Download from attachments)
This App Allows You To Remotely Bypass Your Phone’s Screen Lock By Sending A SMS.
It Removes Your Gesture Pattern Or Password After Receiving A Preset Keyword Along With A Secret Code Via SMS.
SMS Bypass App Requires Root.

INSTRUCTIONS:
1.First, make sure you give permanent root access to the app.
2.Change the secret code to your preferred choice. The default password is : 1234
3.To reset your screen lock, send the following message from another phone:

Note 1 : There is a space between your secret code and reset. Also the secret code is case sensitive.
Note 2 : There is an option available to change the preset keyword. Default is : reset — Your phone will restart and your lock screen will be reset.
Note 3 : If You See The Gesture Pattern Grid Or Password After Restarting, Don’t Worry. Just Try Any Random Pattern Or Password And it Should Unlock.

METHOD 4
Solution For Everyone Via Adb — SQL Command :

INSTRUCTIONS:
=>Type This Commands Separated In Your Terminal (CMD Prompt) :

=>Now You Just Have To Reboot.

Note : If You See The Gesture Pattern Grid Or Password After Restarting, Don’t Worry. Just Try Any Random Pattern Or Password And it Should Unlock.

Читайте также:  Android studio design text

METHOD 5
Solution For Everyone Via Adb — File Removal :

INSTRUCTIONS:
=>Type This Command In Your Terminal (CMD Prompt) :

Note : If You See The Gesture Pattern Grid Or Password After Restarting, Don’t Worry. Just Try Any Random Pattern Or Password And it Should Unlock.

METHOD 6
Solution For Everyone With USB Debugging Enabled :

Primary Step for all method:

  1. Download & Extract to anywhere — Bypass Security Hack (Download from attachments)
  2. Open SQLite Database Browser 2.0.exe in SQLite Database Browser.
  3. Run pull settings.db.cmd inside By-pass security Hacks folder to pull out the setting file out of your phone.
  4. Drag settings.db and drop to SQLite Database Browser 2.0.exe program.
  5. Navigate to Browse data tab, At table there, click to list down the selection & selete secure

Instruction To Remove Pattern Lock:

  1. Now, find lock_pattern_autolock, Delete Record
  2. Close & save database
  3. Run push settings.db.cmd and reboot your phone

Instruction To Remove PIN Lock:

  1. Now, Find Or Create lockscreen.password_type, double-click & change it’s value to 65536, Apply changes!
  2. Now, find lock_pattern_autolock, Delete Record, If doesn’t exist, Ignore
  3. Close & save database
  4. Run push settings.db.cmd and reboot your phone

Instruction To Remove Password Lock:

  1. Now, find lockscreen.password_salt, Delete Record
  2. Now, find lockscreen.password_type, Delete Record
  3. Close & save database
  4. Run push settings.db.cmd and reboot your phone

Note : If You See The Gesture Pattern Grid Or Password After Restarting, Don’t Worry. Just Try Any Random Pattern Or Password And it Should Unlock.

METHOD 7
Solution For Everyone With Recovery Installed :

1.Download and Copy Aroma File manager.zip (Download from attachments or http://forum.xda-developers.com/showthread.php?t=1646108) to your memory card.

2. Open your recovery (press volume Down + Power button or it can be different according to the phones. Generally the phones who have press able button on the middle they have to press all three buttons. Google for you pattern there are lots)

3. There’ll b an option in recovery called “mount”. Go in that option and then mount all the cache and everything it is there.

4. Then select “update” and select “apply update from SD/external” and select aroma file manger.zip file that you downloaded using above QR code above.

5. After Flashing or updating, the aroma file manger will open. Use volume keys for up/down and power button 2 select like you use to get into recovery.

6. In aroma File manager , Go to menu , which is located in bottom strip and then select Settings.

7. Go to bottom n select “mount all partition in startup ” then exit from aroma file manger.

8. Now after exit , re-update that aroma file again and it will open again.

9. Go to data >> and then System.
Then find ‘gesture.key’ (for pattern lock) and ’password.key’ (for password lock) then long touch on gesture.key or password.key and sum option will be prompted , choose delete and delete that file and restart.

Note : If You See The Gesture Pattern Grid Or Password After Restarting, Don’t Worry. Just Try Any Random Pattern Or Password And it Should Unlock.

Источник

Оцените статью