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


Java AccessibilityManager.addAccessibilityStateChangeListener方法代码示例

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


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

示例1: 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

示例2: checkAndStartService

import android.view.accessibility.AccessibilityManager; //导入方法依赖的package包/类
private void checkAndStartService() {
    accessibilityManager = (AccessibilityManager) getSystemService(ACCESSIBILITY_SERVICE);
    accessibilityManager.addAccessibilityStateChangeListener(new AccessibilityManager.AccessibilityStateChangeListener() {
        @Override
        public void onAccessibilityStateChanged(boolean b) {
            Log.d(TAG,"onAccessibilityStateChanged b = "+b);
            if(b){
                goWecaht();
            }else{
                openService();
            }
        }
    });

    name = sendName.getText().toString();
    content = sendContent.getText().toString();

    if(TextUtils.isEmpty(name)){
        Toast.makeText(this,"联系人不能为空",Toast.LENGTH_SHORT).show();
        return;
    }
    if(TextUtils.isEmpty(content)) {
        Toast.makeText(this,"内容不能为空",Toast.LENGTH_SHORT).show();
        return;
    }
    SharedPreferencesUtils.init(this, Contant.CONTACT).putString("friend",name);
    SharedPreferencesUtils.init(this, Contant.CONTACT).putString("content",content);

    if(!accessibilityManager.isEnabled()){
        openService();
    }else{
        goWecaht();
    }
}
 
开发者ID:xmlxin,项目名称:ReplyMessage,代码行数:35,代码来源:SendMsgWx.java

示例3: checkAndStartService

import android.view.accessibility.AccessibilityManager; //导入方法依赖的package包/类
private void checkAndStartService() {
    accessibilityManager = (AccessibilityManager) getSystemService(ACCESSIBILITY_SERVICE);
    accessibilityManager.addAccessibilityStateChangeListener(new AccessibilityManager.AccessibilityStateChangeListener() {
        @Override
        public void onAccessibilityStateChanged(boolean b) {
            Log.d(TAG,"onAccessibilityStateChanged b = "+b);
            if(b){
                goWecaht();
            }else{
                openService();
            }
        }
    });

    name = sendName.getText().toString();
    content = sendContent.getText().toString();

    if(TextUtils.isEmpty(name)){
        Toast.makeText(this,"联系人不能为空",Toast.LENGTH_SHORT).show();
        return;
    }
    if(TextUtils.isEmpty(content)) {
        Toast.makeText(this,"内容不能为空",Toast.LENGTH_SHORT).show();
        return;
    }

    if(!accessibilityManager.isEnabled()){
        openService();
    }else{
        goWecaht();
    }
}
 
开发者ID:xmlxin,项目名称:ReplyMessage,代码行数:33,代码来源:SendMsgqq.java

示例4: onCreate

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

    if (!EventBus.getDefault().isRegistered(this)) {
        EventBus.getDefault().register(this);
    }

    accessibilityManager = (AccessibilityManager) getSystemService(Context.ACCESSIBILITY_SERVICE);
    accessibilityManager.addAccessibilityStateChangeListener(this);

    motionClickIntent = new Intent(this, MotionClickService.class);

    screenRecodeIntent = new Intent(this, ScreenRecodeService.class);

    startAllService();

}
 
开发者ID:kaixuanluo,项目名称:pc-android-controller-android,代码行数:19,代码来源:MainService.java

示例5: postInflationStartup

import android.view.accessibility.AccessibilityManager; //导入方法依赖的package包/类
@SuppressLint("NewApi")
@Override
public void postInflationStartup() {
    super.postInflationStartup();

    mSnackbarManager = new SnackbarManager(this);
    mDataUseSnackbarController = new DataUseSnackbarController(this, getSnackbarManager());

    mAssistStatusHandler = createAssistStatusHandler();
    if (mAssistStatusHandler != null) {
        if (mTabModelSelector != null) {
            mAssistStatusHandler.setTabModelSelector(mTabModelSelector);
        }
        mAssistStatusHandler.updateAssistState();
    }

    // If a user had ALLOW_LOW_END_DEVICE_UI explicitly set to false then we manually override
    // SysUtils.isLowEndDevice() with a switch so that they continue to see the normal UI. This
    // is only the case for grandfathered-in svelte users. We no longer do so for newer users.
    if (!ChromePreferenceManager.getInstance(this).getAllowLowEndDeviceUi()) {
        CommandLine.getInstance().appendSwitch(
                BaseSwitches.DISABLE_LOW_END_DEVICE_MODE);
    }

    AccessibilityManager manager = (AccessibilityManager)
            getBaseContext().getSystemService(Context.ACCESSIBILITY_SERVICE);
    manager.addAccessibilityStateChangeListener(this);
    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
        mTouchExplorationStateChangeListener = new TouchExplorationStateChangeListener() {
            @Override
            public void onTouchExplorationStateChanged(boolean enabled) {
                checkAccessibility();
            }
        };
        manager.addTouchExplorationStateChangeListener(mTouchExplorationStateChangeListener);
    }

    // Make the activity listen to policy change events
    CombinedPolicyProvider.get().addPolicyChangeListener(this);

    // Set up the animation placeholder to be the SurfaceView. This disables the
    // SurfaceView's 'hole' clipping during animations that are notified to the window.
    mWindowAndroid.setAnimationPlaceholderView(mCompositorViewHolder.getSurfaceView());

    // Inform the WindowAndroid of the keyboard accessory view.
    mWindowAndroid.setKeyboardAccessoryView((ViewGroup) findViewById(R.id.keyboard_accessory));
    initializeToolbar();
    initializeTabModels();
    if (!isFinishing() && getFullscreenManager() != null) {
        getFullscreenManager().initialize(
                (ControlContainer) findViewById(R.id.control_container),
                getTabModelSelector(),
                getControlContainerHeightResource());
    }
}
 
开发者ID:rkshuai,项目名称:chromium-for-android-56-debug-video,代码行数:56,代码来源:ChromeActivity.java

示例6: addAccessibilityStateChangeListener

import android.view.accessibility.AccessibilityManager; //导入方法依赖的package包/类
public static boolean addAccessibilityStateChangeListener(AccessibilityManager manager, Object listener) {
    return manager.addAccessibilityStateChangeListener((AccessibilityStateChangeListener) listener);
}
 
开发者ID:JackChan1999,项目名称:boohee_v5.6,代码行数:4,代码来源:AccessibilityManagerCompatIcs.java


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