Example usage for android.content Context ACCESSIBILITY_SERVICE

List of usage examples for android.content Context ACCESSIBILITY_SERVICE

Introduction

In this page you can find the example usage for android.content Context ACCESSIBILITY_SERVICE.

Prototype

String ACCESSIBILITY_SERVICE

To view the source code for android.content Context ACCESSIBILITY_SERVICE.

Click Source Link

Document

Use with #getSystemService(String) to retrieve a android.view.accessibility.AccessibilityManager for giving the user feedback for UI events through the registered event listeners.

Usage

From source file:com.android.launcher3.Utilities.java

public static void sendCustomAccessibilityEvent(View target, int type, String text) {
    AccessibilityManager accessibilityManager = (AccessibilityManager) target.getContext()
            .getSystemService(Context.ACCESSIBILITY_SERVICE);
    if (accessibilityManager.isEnabled()) {
        AccessibilityEvent event = AccessibilityEvent.obtain(type);
        target.onInitializeAccessibilityEvent(event);
        event.getText().add(text);/*from  www.  j  a  v a2s  .com*/
        accessibilityManager.sendAccessibilityEvent(event);
    }
}

From source file:cc.flydev.launcher.Workspace.java

@Override
protected OnClickListener getPageIndicatorClickListener() {
    AccessibilityManager am = (AccessibilityManager) getContext()
            .getSystemService(Context.ACCESSIBILITY_SERVICE);
    if (!am.isTouchExplorationEnabled()) {
        return null;
    }//from w  w w.ja  v a 2 s. c  o m
    OnClickListener listener = new OnClickListener() {
        @Override
        public void onClick(View arg0) {
            enterOverviewMode();
        }
    };
    return listener;
}

From source file:cc.flydev.launcher.Workspace.java

protected void onResume() {
    if (getPageIndicator() != null) {
        // In case accessibility state has changed, we need to perform this on every
        // attach to window
        OnClickListener listener = getPageIndicatorClickListener();
        if (listener != null) {
            getPageIndicator().setOnClickListener(listener);
        }//from  www .j a  v  a 2 s .c om
    }
    AccessibilityManager am = (AccessibilityManager) getContext()
            .getSystemService(Context.ACCESSIBILITY_SERVICE);
    sAccessibilityEnabled = am.isEnabled();
}

From source file:com.example.launcher3.Workspace.java

protected void onResume() {
    if (getPageIndicator() != null) {
        // In case accessibility state has changed, we need to perform this
        // on every
        // attach to window
        OnClickListener listener = getPageIndicatorClickListener();
        if (listener != null) {
            getPageIndicator().setOnClickListener(listener);
        }// w  ww .  j av a2  s . c o  m
    }
    AccessibilityManager am = (AccessibilityManager) getContext()
            .getSystemService(Context.ACCESSIBILITY_SERVICE);
    sAccessibilityEnabled = am.isEnabled();
}

From source file:com.klinker.android.launcher.launcher3.Workspace.java

@Override
protected OnClickListener getPageIndicatorClickListener() {
    AccessibilityManager am = (AccessibilityManager) getContext()
            .getSystemService(Context.ACCESSIBILITY_SERVICE);
    if (!am.isTouchExplorationEnabled()) {
        return null;
    }/*from  w w w . java2 s.c om*/
    OnClickListener listener = new OnClickListener() {
        @Override
        public void onClick(View arg0) {
            mLauncher.showOverviewMode(true);
        }
    };
    return listener;
}

From source file:com.aidy.launcher3.ui.workspace.Workspace.java

public void onResume() {
    if (getPageIndicator() != null) {
        // In case accessibility state has changed, we need to perform this
        // on every
        // attach to window
        OnClickListener listener = getPageIndicatorClickListener();
        if (listener != null) {
            getPageIndicator().setOnClickListener(listener);
        }/*from   ww  w  .ja  v a 2  s .co  m*/
    }
    AccessibilityManager am = (AccessibilityManager) getContext()
            .getSystemService(Context.ACCESSIBILITY_SERVICE);
    sAccessibilityEnabled = am.isEnabled();
}

From source file:org.mozilla.gecko.GeckoAppShell.java

public static void emitGeckoAccessibilityEvent(int eventType, String role, String text, String description,
        boolean enabled, boolean checked, boolean password) {
    AccessibilityManager accessibilityManager = (AccessibilityManager) GeckoApp.mAppContext
            .getSystemService(Context.ACCESSIBILITY_SERVICE);

    if (!accessibilityManager.isEnabled())
        return;//from   w  ww.  j  a  va  2  s  .  c om

    LayerController layerController = GeckoApp.mAppContext.getLayerController();
    LayerView layerView = layerController.getView();

    AccessibilityEvent event = AccessibilityEvent.obtain(eventType);
    event.setClassName(layerView.getClass().getName() + "$" + role);
    event.setPackageName(GeckoApp.mAppContext.getPackageName());
    event.setEnabled(enabled);
    event.setChecked(checked);
    event.setPassword(password);
    event.setContentDescription(description);
    event.getText().add(text);

    accessibilityManager.sendAccessibilityEvent(event);
}

From source file:com.lb.launcher.Workspace.java

@Override
protected OnClickListener getPageIndicatorClickListener() {
    AccessibilityManager am = (AccessibilityManager) getContext()
            .getSystemService(Context.ACCESSIBILITY_SERVICE);
    if (!am.isTouchExplorationEnabled()) {
        return null;
    }/*from   ww  w. j av a 2 s.c  om*/
    OnClickListener listener = new OnClickListener() {
        @Override
        public void onClick(View arg0) {
            Log.v(getClass().toString() + ":anon:onClick:", arg0.toString()); // added by H.Yasui 2016/11/

            enterOverviewMode();
        }
    };
    return listener;
}

From source file:myblog.richard.vewe.launcher3.Workspace.java

@Override
protected OnClickListener getPageIndicatorClickListener() {
    AccessibilityManager am = (AccessibilityManager) getContext()
            .getSystemService(Context.ACCESSIBILITY_SERVICE);
    if (!am.isTouchExplorationEnabled()) {
        return null;
    }/*ww  w. ja va  2 s. c o  m*/
    OnClickListener listener = new OnClickListener() {
        @Override
        public void onClick(View arg0) {
            enterOverviewMode();
            mLauncher.onEnterOverviewMode();
        }
    };
    return listener;
}

From source file:com.phonemetra.turbo.launcher.Workspace.java

protected void onResume() {
    if (getPageIndicator() != null) {
        // In case accessibility state has changed, we need to perform this on every
        // attach to window
        OnClickListener listener = getPageIndicatorClickListener();
        if (listener != null) {
            getPageIndicator().setOnClickListener(listener);
        }//w  w  w  . j a v a2  s  .c  om
    }
    AccessibilityManager am = (AccessibilityManager) getContext()
            .getSystemService(Context.ACCESSIBILITY_SERVICE);
    sAccessibilityEnabled = am.isEnabled();

    mScrollWallpaper = SettingsProvider.getBoolean(mLauncher,
            SettingsProvider.SETTINGS_UI_HOMESCREEN_SCROLLING_WALLPAPER_SCROLL,
            R.bool.preferences_interface_homescreen_scrolling_wallpaper_scroll_default);

    if (!mScrollWallpaper) {
        if (mWindowToken != null)
            mWallpaperManager.setWallpaperOffsets(mWindowToken, 0f, 0.5f);
    } else {
        mWallpaperOffset.syncWithScroll();
    }

    // Update wallpaper dimensions if they were changed since last onResume
    // (we also always set the wallpaper dimensions in the constructor)
    if (LauncherAppState.getInstance().hasWallpaperChangedSinceLastCheck()) {
        setWallpaperDimension();
    }
    mWallpaperIsLiveWallpaper = mWallpaperManager.getWallpaperInfo() != null;
    // Force the wallpaper offset steps to be set again, because another app might have changed
    // them
    mLastSetWallpaperOffsetSteps = 0f;

    moveAwayFromCustomContentIfRequired();
}