当前位置: 首页>>代码示例>>Java>>正文


Java AccessibilityManager类代码示例

本文整理汇总了Java中android.view.accessibility.AccessibilityManager的典型用法代码示例。如果您正苦于以下问题:Java AccessibilityManager类的具体用法?Java AccessibilityManager怎么用?Java AccessibilityManager使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


AccessibilityManager类属于android.view.accessibility包,在下文中一共展示了AccessibilityManager类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: IsAccessibilityServiceEnabled

import android.view.accessibility.AccessibilityManager; //导入依赖的package包/类
public boolean IsAccessibilityServiceEnabled(@NonNull String serviceId) {
    Logger.getInstance().Debug(TAG, String.format(Locale.getDefault(), "IsAccessibilityServiceEnabled for serviceId %s", serviceId));

    AccessibilityManager accessibilityManager = (AccessibilityManager) _context.getSystemService(Context.ACCESSIBILITY_SERVICE);
    if (accessibilityManager == null) {
        Logger.getInstance().Error(TAG, "accessibilityManager is null!");
        return false;
    }

    List<AccessibilityServiceInfo> runningServices = accessibilityManager.getEnabledAccessibilityServiceList(AccessibilityEvent.TYPES_ALL_MASK);
    for (AccessibilityServiceInfo service : runningServices) {
        Logger.getInstance().Debug(TAG, String.format(Locale.getDefault(), "Found active service %s", service.getId()));
        if (serviceId.equals(service.getId())) {
            return true;
        }
    }

    return false;
}
 
开发者ID:GuepardoApps,项目名称:LucaHome-AndroidApplication,代码行数:20,代码来源:AndroidSystemController.java

示例2: createHotseatAlphaAnimator

import android.view.accessibility.AccessibilityManager; //导入依赖的package包/类
public ValueAnimator createHotseatAlphaAnimator(float finalValue) {
    if (Float.compare(finalValue, mHotseatAlpha[HOTSEAT_STATE_ALPHA_INDEX]) == 0) {
        // Return a dummy animator to avoid null checks.
        return ValueAnimator.ofFloat(0, 0);
    } else {
        ValueAnimator animator = ValueAnimator
                .ofFloat(mHotseatAlpha[HOTSEAT_STATE_ALPHA_INDEX], finalValue);
        animator.addUpdateListener(new AnimatorUpdateListener() {
            @Override
            public void onAnimationUpdate(ValueAnimator valueAnimator) {
                float value = (Float) valueAnimator.getAnimatedValue();
                setHotseatAlphaAtIndex(value, HOTSEAT_STATE_ALPHA_INDEX);
            }
        });

        AccessibilityManager am = (AccessibilityManager)
                mLauncher.getSystemService(Context.ACCESSIBILITY_SERVICE);
        final boolean accessibilityEnabled = am.isEnabled();
        animator.addUpdateListener(
                new AlphaUpdateListener(mLauncher.getHotseat(), accessibilityEnabled));
        animator.addUpdateListener(
                new AlphaUpdateListener(mPageIndicator, accessibilityEnabled));
        return animator;
    }
}
 
开发者ID:enricocid,项目名称:LaunchEnr,代码行数:26,代码来源:Workspace.java

示例3: onHoverEvent

import android.view.accessibility.AccessibilityManager; //导入依赖的package包/类
@Override
public boolean onHoverEvent(MotionEvent event) {
    if (((AccessibilityManager) getContext().getSystemService(Context.ACCESSIBILITY_SERVICE)).isTouchExplorationEnabled()) {
        final int action = event.getAction();
        switch (action) {
            case MotionEvent.ACTION_HOVER_ENTER:
                event.setAction(MotionEvent.ACTION_DOWN);
                break;
            case MotionEvent.ACTION_HOVER_MOVE:
                event.setAction(MotionEvent.ACTION_MOVE);
                break;
            case MotionEvent.ACTION_HOVER_EXIT:
                event.setAction(MotionEvent.ACTION_UP);
                break;
        }
        onTouchEvent(event);
        event.setAction(action);
    }
    super.onHoverEvent(event);
    return true;
}
 
开发者ID:treasure-lau,项目名称:CSipSimple,代码行数:22,代码来源:GlowPadView.java

示例4: sendScrollAccessibilityEvent

import android.view.accessibility.AccessibilityManager; //导入依赖的package包/类
private void sendScrollAccessibilityEvent() {
    AccessibilityManager am =
            (AccessibilityManager) getContext().getSystemService(Context.ACCESSIBILITY_SERVICE);
    if (am.isEnabled()) {
        if (mCurrentPage != getNextPage()) {
            AccessibilityEvent ev =
                    AccessibilityEvent.obtain(AccessibilityEvent.TYPE_VIEW_SCROLLED);
            ev.setScrollable(true);
            ev.setScrollX(getScrollX());
            ev.setScrollY(getScrollY());
            ev.setMaxScrollX(mMaxScrollX);
            ev.setMaxScrollY(0);

            sendAccessibilityEventUnchecked(ev);
        }
    }
}
 
开发者ID:TeamBrainStorm,项目名称:SimpleUILauncher,代码行数:18,代码来源:PagedView.java

示例5: AdapterView

import android.view.accessibility.AccessibilityManager; //导入依赖的package包/类
@TargetApi(16)
public AdapterView(Context context, AttributeSet attrs, int defStyle) {
    super(context, attrs, defStyle);
    this.mFirstPosition = 0;
    this.mSyncColId = Long.MIN_VALUE;
    this.mNeedSync = false;
    this.mInLayout = false;
    this.mNextSelectedPosition = -1;
    this.mNextSelectedColId = Long.MIN_VALUE;
    this.mSelectedPosition = -1;
    this.mSelectedColId = Long.MIN_VALUE;
    this.mOldSelectedPosition = -1;
    this.mOldSelectedColId = Long.MIN_VALUE;
    this.mBlockLayoutRequests = false;
    if (VERSION.SDK_INT >= 16 && getImportantForAccessibility() == 0) {
        setImportantForAccessibility(1);
    }
    if (!isInEditMode()) {
        this.mAccessibilityManager = (AccessibilityManager) getContext().getSystemService("accessibility");
    }
}
 
开发者ID:JackChan1999,项目名称:letv,代码行数:22,代码来源:AdapterView.java

示例6: onFinishInflate

import android.view.accessibility.AccessibilityManager; //导入依赖的package包/类
@Override
protected void onFinishInflate() {
  setupKeypad();
  mDigits = (EditText) findViewById(R.id.digits);
  mDelete = (ImageButton) findViewById(R.id.deleteButton);
  mOverflowMenuButton = findViewById(R.id.dialpad_overflow);
  mRateContainer = (ViewGroup) findViewById(R.id.rate_container);
  mIldCountry = (TextView) mRateContainer.findViewById(R.id.ild_country);
  mIldRate = (TextView) mRateContainer.findViewById(R.id.ild_rate);

  AccessibilityManager accessibilityManager =
      (AccessibilityManager) getContext().getSystemService(Context.ACCESSIBILITY_SERVICE);
  if (accessibilityManager.isEnabled()) {
    // The text view must be selected to send accessibility events.
    mDigits.setSelected(true);
  }
}
 
开发者ID:dialogs,项目名称:android-dialer,代码行数:18,代码来源:DialpadView.java

示例7: aktivitetOnCreate

import android.view.accessibility.AccessibilityManager; //导入依赖的package包/类
public void aktivitetOnCreate(Basisaktivitet ctx) {
  ctx.getResources().updateConfiguration(App.sprogKonfig, null);

  // Forgrundsinitialisering der skal ske før app'en bliver synlig første gang
  // - muligvis aldrig hvis app'en kun betjenes via levende ikon, eller kun er aktiv i baggrunden

  if (App.color!=null) return; // initialisering allerede sket
  App.color = new DRFarver();
  accessibilityManager = (AccessibilityManager) ctx.getSystemService(Context.ACCESSIBILITY_SERVICE); // tager tid i test

  skrift_gibson = Typeface.DEFAULT;
  skrift_gibson_fed = Typeface.DEFAULT_BOLD;
  skrift_georgia = Typeface.SERIF;
  skrift_gibson_fed_span = new EgenTypefaceSpan("Gibson fed", App.skrift_gibson_fed);

  AppOpdatering.APK_URL = res.getString(R.string.AppOpdatering_APK_URL);
  if (!EMULATOR) AppOpdatering.tjekForNyAPK(ctx);
  Log.d("onCreate tog " + (System.currentTimeMillis() - TIDSSTEMPEL_VED_OPSTART) + " ms");
}
 
开发者ID:nordfalk,项目名称:EsperantoRadio,代码行数:20,代码来源:App.java

示例8: onHoverEvent

import android.view.accessibility.AccessibilityManager; //导入依赖的package包/类
@Override
public boolean onHoverEvent(MotionEvent event) {

    if (Build.VERSION.SDK_INT >= 11) {
        if (((AccessibilityManager) getContext().getSystemService(
                Context.ACCESSIBILITY_SERVICE)).isTouchExplorationEnabled()) {
            final int action = event.getAction();
            switch (action) {
                case MotionEvent.ACTION_HOVER_ENTER:
                    event.setAction(MotionEvent.ACTION_DOWN);
                    break;
                case MotionEvent.ACTION_HOVER_MOVE:
                    event.setAction(MotionEvent.ACTION_MOVE);
                    break;
                case MotionEvent.ACTION_HOVER_EXIT:
                    event.setAction(MotionEvent.ACTION_UP);
                    break;
            }
            onTouchEvent(event);
            event.setAction(action);
        }
    }
    return super.onHoverEvent(event);
}
 
开发者ID:Dnet3,项目名称:CustomAndroidOneSheeld,代码行数:25,代码来源:LockPatternViewEx.java

示例9: onCreate

import android.view.accessibility.AccessibilityManager; //导入依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    //CrashReport.initCrashReport(getApplicationContext(), "900019352", false);
    Bugly.init(getApplicationContext(), "900019352", false);
    setContentView(R.layout.activity_main);
    pluginStatusText = (TextView) findViewById(R.id.layout_control_accessibility_text);
    pluginStatusIcon = (ImageView) findViewById(R.id.layout_control_accessibility_icon);

    handleMaterialStatusBar();

    explicitlyLoadPreferences();

    //监听AccessibilityService 变化
    accessibilityManager = (AccessibilityManager) getSystemService(Context.ACCESSIBILITY_SERVICE);
    accessibilityManager.addAccessibilityStateChangeListener(this);
    updateServiceStatus();
}
 
开发者ID:KoreHuang,项目名称:WeChatLuckyMoney,代码行数:19,代码来源:MainActivity.java

示例10: isTouchExplorationEnabled

import android.view.accessibility.AccessibilityManager; //导入依赖的package包/类
public static boolean isTouchExplorationEnabled(AccessibilityManager accessibilityManager) {
    if (Build.VERSION.SDK_INT >= 14) {
        return accessibilityManager.isTouchExplorationEnabled();
    } else {
        return false;
    }
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:8,代码来源:Utils.java

示例11: onDestroy

import android.view.accessibility.AccessibilityManager; //导入依赖的package包/类
@Override
public void onDestroy() {
    super.onDestroy();

    mWorkspace.removeCallbacks(mBuildLayersRunnable);
    mWorkspace.removeFolderListeners();

    // Stop callbacks from LauncherModel
    // It's possible to receive onDestroy after a new Launcher activity has
    // been created. In this case, don't interfere with the new Launcher.
    if (mModel.isCurrentCallbacks(this)) {
        mModel.stopLoader();
        LauncherAppState.getInstance(this).setLauncher(null);
    }

    if (mRotationPrefChangeHandler != null) {
        mSharedPrefs.unregisterOnSharedPreferenceChangeListener(mRotationPrefChangeHandler);
    }

    try {
        mAppWidgetHost.stopListening();
    } catch (NullPointerException ex) {
        ex.printStackTrace();
    }
    mAppWidgetHost = null;

    TextKeyListener.getInstance().release();

    ((AccessibilityManager) getSystemService(ACCESSIBILITY_SERVICE))
            .removeAccessibilityStateChangeListener(this);

    LauncherAnimUtils.onDestroyActivity();

    if (mLauncherCallbacks != null) {
        mLauncherCallbacks.onDestroy();
    }
}
 
开发者ID:enricocid,项目名称:LaunchEnr,代码行数:38,代码来源:Launcher.java

示例12: getAnimationToState

import android.view.accessibility.AccessibilityManager; //导入依赖的package包/类
public AnimatorSet getAnimationToState(Workspace.State fromState, Workspace.State toState,
        boolean animated, AnimationLayerSet layerViews) {
    AccessibilityManager am = (AccessibilityManager)
            mLauncher.getSystemService(Context.ACCESSIBILITY_SERVICE);
    final boolean accessibilityEnabled = am.isEnabled();
    TransitionStates states = new TransitionStates(fromState, toState);
    int workspaceDuration = getAnimationDuration(states);
    animateWorkspace(states, animated, workspaceDuration, layerViews,
            accessibilityEnabled);
    animateBackgroundGradient(states, animated, BACKGROUND_FADE_OUT_DURATION);
    return mStateAnimator;
}
 
开发者ID:enricocid,项目名称:LaunchEnr,代码行数:13,代码来源:WorkspaceStateTransitionAnimation.java

示例13: setup

import android.view.accessibility.AccessibilityManager; //导入依赖的package包/类
public void setup(Launcher launcher, DragController dragController,
        AllAppsTransitionController allAppsTransitionController) {
    mLauncher = launcher;
    mDragController = dragController;
    mAllAppsController = allAppsTransitionController;

    boolean isAccessibilityEnabled = ((AccessibilityManager) mLauncher.getSystemService(
            Context.ACCESSIBILITY_SERVICE)).isEnabled();
    onAccessibilityStateChanged(isAccessibilityEnabled);
}
 
开发者ID:enricocid,项目名称:LaunchEnr,代码行数:11,代码来源:DragLayer.java

示例14: createFor

import android.view.accessibility.AccessibilityManager; //导入依赖的package包/类
public static DragViewStateAnnouncer createFor(View v) {
    if (((AccessibilityManager) v.getContext().getSystemService(Context.ACCESSIBILITY_SERVICE))
            .isEnabled()) {
        return new DragViewStateAnnouncer(v);
    } else {
        return null;
    }
}
 
开发者ID:enricocid,项目名称:LaunchEnr,代码行数:9,代码来源:DragViewStateAnnouncer.java

示例15: run

import android.view.accessibility.AccessibilityManager; //导入依赖的package包/类
@Override
public void run() {
    AccessibilityManager am = (AccessibilityManager)
            getContext().getSystemService(Context.ACCESSIBILITY_SERVICE);
    boolean accessibilityEnabled = am.isEnabled();
    AlphaUpdateListener.updateVisibility(DropTargetBar.this, accessibilityEnabled);
}
 
开发者ID:enricocid,项目名称:LaunchEnr,代码行数:8,代码来源:DropTargetBar.java


注:本文中的android.view.accessibility.AccessibilityManager类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。