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


Java Sensey类代码示例

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


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

示例1: onPause

import com.github.nisrulz.sensey.Sensey; //导入依赖的package包/类
@Override
protected void onPause() {
    super.onPause();
    PowerManager powerManager = (PowerManager)MainActivity.this.getSystemService(Context.POWER_SERVICE);
    Boolean isSceenAwake = (Build.VERSION.SDK_INT < 20? powerManager.isScreenOn():powerManager.isInteractive());

    if(!isSceenAwake){
        System.gc();
        Sensey.getInstance().stop();
    }
}
 
开发者ID:desaura,项目名称:SimplyLauncher,代码行数:12,代码来源:MainActivity.java

示例2: onTouch

import com.github.nisrulz.sensey.Sensey; //导入依赖的package包/类
@Override public boolean onTouch(View view, MotionEvent event) {
    switch (event.getAction()) {
        case MotionEvent.ACTION_DOWN:
            initialTouchX = event.getRawX();
            initialTouchY = event.getRawY();
            imageView.setPressed(true);
            break;
        case MotionEvent.ACTION_UP:
            setClickable(true);
            if (callback != null) callback.onStoppedMoving();
            onMoving(false);
            imageView.setPressed(false);
            break;
        case MotionEvent.ACTION_MOVE:
            setClickable(false);
            onMoving(true);
            if (callback != null)
                callback.onViewMoving(initialX + (int) (event.getRawX() - initialTouchX), initialY + (int) (event.getRawY() - initialTouchY));
            break;
        case MotionEvent.ACTION_OUTSIDE:
            if (callback != null) callback.onTouchOutside();
            imageView.setPressed(false);
            break;
    }
    Sensey.getInstance().setupDispatchTouchEvent(event);
    return false;
}
 
开发者ID:k0shk0sh,项目名称:FastAccess,代码行数:28,代码来源:FloatingView.java

示例3: onDestroy

import com.github.nisrulz.sensey.Sensey; //导入依赖的package包/类
public void onDestroy() {
    super.onDestroy();
    Sensey.getInstance().stop();
}
 
开发者ID:indianpoptart,项目名称:ProjectLumen,代码行数:5,代码来源:MainActivity.java

示例4: dispatchTouchEvent

import com.github.nisrulz.sensey.Sensey; //导入依赖的package包/类
@Override public boolean dispatchTouchEvent(MotionEvent event) {
    // Setup onTouchEvent for detecting type of touch gesture
    Sensey.getInstance().setupDispatchTouchEvent(event);
    return super.dispatchTouchEvent(event);
}
 
开发者ID:desaura,项目名称:SimplyLauncher,代码行数:6,代码来源:MainActivity.java

示例5: onStop

import com.github.nisrulz.sensey.Sensey; //导入依赖的package包/类
@Override
protected void onStop() {
    super.onStop();
    System.gc();
    Sensey.getInstance().stop();
}
 
开发者ID:desaura,项目名称:SimplyLauncher,代码行数:7,代码来源:MainActivity.java

示例6: onAttachedToWindow

import com.github.nisrulz.sensey.Sensey; //导入依赖的package包/类
@Override protected void onAttachedToWindow() {
    super.onAttachedToWindow();
    Sensey.getInstance().init(getContext().getApplicationContext());
    Sensey.getInstance().startTouchTypeDetection(this);
}
 
开发者ID:k0shk0sh,项目名称:FastAccess,代码行数:6,代码来源:FloatingView.java

示例7: onDetachedFromWindow

import com.github.nisrulz.sensey.Sensey; //导入依赖的package包/类
@Override protected void onDetachedFromWindow() {
    Sensey.getInstance().stopTouchTypeDetection();
    callback = null;
    removeAllViews();
    super.onDetachedFromWindow();
}
 
开发者ID:k0shk0sh,项目名称:FastAccess,代码行数:7,代码来源:FloatingView.java


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