本文整理汇总了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();
}
}
示例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;
}
示例3: onDestroy
import com.github.nisrulz.sensey.Sensey; //导入依赖的package包/类
public void onDestroy() {
super.onDestroy();
Sensey.getInstance().stop();
}
示例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);
}
示例5: onStop
import com.github.nisrulz.sensey.Sensey; //导入依赖的package包/类
@Override
protected void onStop() {
super.onStop();
System.gc();
Sensey.getInstance().stop();
}
示例6: onAttachedToWindow
import com.github.nisrulz.sensey.Sensey; //导入依赖的package包/类
@Override protected void onAttachedToWindow() {
super.onAttachedToWindow();
Sensey.getInstance().init(getContext().getApplicationContext());
Sensey.getInstance().startTouchTypeDetection(this);
}
示例7: onDetachedFromWindow
import com.github.nisrulz.sensey.Sensey; //导入依赖的package包/类
@Override protected void onDetachedFromWindow() {
Sensey.getInstance().stopTouchTypeDetection();
callback = null;
removeAllViews();
super.onDetachedFromWindow();
}