Open and cancel _android of Android sliding unlock vibration effect

Source: Internet
Author: User

If we need to set the touch vibration switch to open and remove the sliding unlock vibration effect, you need to make the following modifications.


In the Lockscreen method in the Lockscreen.java class

Copy Code code as follows:

else if (munlockwidget instanceof Multiwaveview) {
Multiwaveview Multiwaveview = (multiwaveview) munlockwidget;

Multiwaveview.setvibrateenabled (Settings.System.getInt (Mcontext.getcontentresolver),//by determining whether the touch vibration effect is set to set the shaking of the unlock.
Settings.System.HAPTIC_FEEDBACK_ENABLED, 1)!= 0);

Multiwaveviewmethods multiwaveviewmethods = new Multiwaveviewmethods (Multiwaveview);
Multiwaveview.setontriggerlistener (Multiwaveviewmethods);
Munlockwidgetmethods = Multiwaveviewmethods;


I'm going to join you here.
Copy Code code as follows:

Class Multiwaveviewmethods implements Multiwaveview.ontriggerlistener,
Unlockwidgetcommonmethods {

Private final Multiwaveview Mmultiwaveview;
Private Boolean mcameradisabled;

Multiwaveviewmethods (Multiwaveview multiwaveview) {
Mmultiwaveview = Multiwaveview;

Multiwaveview.setvibrateenabled (Settings.System.getInt) (Mcontext.getcontentresolver (),
Settings.System.HAPTIC_FEEDBACK_ENABLED, 1)!= 0);

Final Boolean cameradisabled = Mlockpatternutils.getdevicepolicymanager ()
. getcameradisabled (NULL);

Because the main use of sliding unlock is to multiwaveview this control, which is set whether the vibration properties.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.