本文整理汇总了Java中com.andrognito.patternlockview.utils.PatternLockUtils类的典型用法代码示例。如果您正苦于以下问题:Java PatternLockUtils类的具体用法?Java PatternLockUtils怎么用?Java PatternLockUtils使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
PatternLockUtils类属于com.andrognito.patternlockview.utils包,在下文中一共展示了PatternLockUtils类的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onComplete
import com.andrognito.patternlockview.utils.PatternLockUtils; //导入依赖的package包/类
@Override
public void onComplete(List<PatternLockView.Dot> pattern) {
Log.d(TAG, "Pattern complete: " +
PatternLockUtils.patternToString(mPatternLockView, pattern));
Intent intent = new Intent(LockPatternActivity.this, MainActivity.class);
startActivity(intent);
finish();
}
示例2: onSaveInstanceState
import com.andrognito.patternlockview.utils.PatternLockUtils; //导入依赖的package包/类
@Override
protected Parcelable onSaveInstanceState() {
Parcelable superState = super.onSaveInstanceState();
return new SavedState(superState,
PatternLockUtils.patternToString(this, mPattern),
mPatternViewMode, mInputEnabled, mInStealthMode,
mEnableHapticFeedback);
}
示例3: onRestoreInstanceState
import com.andrognito.patternlockview.utils.PatternLockUtils; //导入依赖的package包/类
@Override
protected void onRestoreInstanceState(Parcelable state) {
final SavedState savedState = (SavedState) state;
super.onRestoreInstanceState(savedState.getSuperState());
setPattern(CORRECT,
PatternLockUtils.stringToPattern(this, savedState.getSerializedPattern()));
mPatternViewMode = savedState.getDisplayMode();
mInputEnabled = savedState.isInputEnabled();
mInStealthMode = savedState.isInStealthMode();
mEnableHapticFeedback = savedState.isTactileFeedbackEnabled();
}
示例4: onComplete
import com.andrognito.patternlockview.utils.PatternLockUtils; //导入依赖的package包/类
@Override
public void onComplete(List<PatternLockView.Dot> pattern) {
String patternToString = PatternLockUtils.patternToString(mPatternLockView, pattern);
Log.d(getClass().getName(), "Pattern complete: " +
patternToString);
if (patternToString.contentEquals(correctPassword)) {
mPatternLockView.setViewMode(PatternLockView.PatternViewMode.CORRECT);
Reprint.cancelAuthentication();
closeThisActivity();
}
else
mPatternLockView.setViewMode(PatternLockView.PatternViewMode.WRONG);
}
示例5: setUpObservables
import com.andrognito.patternlockview.utils.PatternLockUtils; //导入依赖的package包/类
private void setUpObservables() {
RxPatternLockView.patternComplete(mPatternLockView)
.subscribe(new Consumer<PatternLockCompleteEvent>() {
@Override
public void accept(PatternLockCompleteEvent patternLockCompleteEvent) throws Exception {
Log.d(getClass().getName(), "Complete: " + patternLockCompleteEvent.getPattern().toString());
}
});
RxPatternLockView.patternChanges(mPatternLockView)
.subscribe(new Consumer<PatternLockCompoundEvent>() {
@Override
public void accept(PatternLockCompoundEvent event) throws Exception {
if (event.getEventType() == PatternLockCompoundEvent.EventType.PATTERN_STARTED) {
Log.d(getClass().getName(), "Pattern drawing started");
}
else if (event.getEventType() == PatternLockCompoundEvent.EventType.PATTERN_PROGRESS) {
Log.d(getClass().getName(), "Pattern progress: " +
PatternLockUtils.patternToString(mPatternLockView, event.getPattern()));
}
else if (event.getEventType() == PatternLockCompoundEvent.EventType.PATTERN_COMPLETE) {
Log.d(getClass().getName(), "Pattern complete: " +
PatternLockUtils.patternToString(mPatternLockView, event.getPattern()));
}
else if (event.getEventType() == PatternLockCompoundEvent.EventType.PATTERN_CLEARED) {
Log.d(getClass().getName(), "Pattern has been cleared");
}
}
});
}
示例6: onProgress
import com.andrognito.patternlockview.utils.PatternLockUtils; //导入依赖的package包/类
@Override
public void onProgress(List<PatternLockView.Dot> progressPattern) {
Log.d(TAG, "Pattern progress: " +
PatternLockUtils.patternToString(mPatternLockView, progressPattern));
}
示例7: onCreate
import com.andrognito.patternlockview.utils.PatternLockUtils; //导入依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
requestWindowFeature(Window.FEATURE_NO_TITLE);
getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
WindowManager.LayoutParams.FLAG_FULLSCREEN);
setContentView(R.layout.activity_lock_pattern);
mPatternLockView = (PatternLockView) findViewById(R.id.patter_lock_view);
mPatternLockView.setDotCount(3);
mPatternLockView.setDotNormalSize((int) ResourceUtils.getDimensionInPx(this, R.dimen.pattern_lock_dot_size));
mPatternLockView.setDotSelectedSize((int) ResourceUtils.getDimensionInPx(this, R.dimen.pattern_lock_dot_selected_size));
mPatternLockView.setPathWidth((int) ResourceUtils.getDimensionInPx(this, R.dimen.pattern_lock_path_width));
mPatternLockView.setAspectRatioEnabled(true);
mPatternLockView.setAspectRatio(PatternLockView.AspectRatio.ASPECT_RATIO_HEIGHT_BIAS);
mPatternLockView.setViewMode(PatternLockView.PatternViewMode.CORRECT);
mPatternLockView.setDotAnimationDuration(150);
mPatternLockView.setPathEndAnimationDuration(100);
mPatternLockView.setCorrectStateColor(ResourceUtils.getColor(this, R.color.white));
mPatternLockView.setInStealthMode(false);
mPatternLockView.setTactileFeedbackEnabled(true);
mPatternLockView.setInputEnabled(true);
mPatternLockView.addPatternLockListener(mPatternLockViewListener);
RxPatternLockView.patternComplete(mPatternLockView)
.subscribe(new Consumer<PatternLockCompleteEvent>() {
@Override
public void accept(PatternLockCompleteEvent patternLockCompleteEvent) throws Exception {
Log.d(TAG, "Complete: " + patternLockCompleteEvent.getPattern().toString());
}
});
RxPatternLockView.patternChanges(mPatternLockView)
.subscribe(new Consumer<PatternLockCompoundEvent>() {
@Override
public void accept(PatternLockCompoundEvent event) throws Exception {
if (event.getEventType() == PatternLockCompoundEvent.EventType.PATTERN_STARTED) {
Log.d(TAG, "Pattern drawing started");
} else if (event.getEventType() == PatternLockCompoundEvent.EventType.PATTERN_PROGRESS) {
Log.d(TAG, "Pattern progress: " +
PatternLockUtils.patternToString(mPatternLockView, event.getPattern()));
} else if (event.getEventType() == PatternLockCompoundEvent.EventType.PATTERN_COMPLETE) {
Log.d(TAG, "Pattern complete: " +
PatternLockUtils.patternToString(mPatternLockView, event.getPattern()));
} else if (event.getEventType() == PatternLockCompoundEvent.EventType.PATTERN_CLEARED) {
Log.d(TAG, "Pattern has been cleared");
}
}
});
}
示例8: onProgress
import com.andrognito.patternlockview.utils.PatternLockUtils; //导入依赖的package包/类
@Override
public void onProgress(List<PatternLockView.Dot> progressPattern) {
Log.d(getClass().getName(), "Pattern progress: " +
PatternLockUtils.patternToString(mPatternLockView, progressPattern));
}
示例9: onComplete
import com.andrognito.patternlockview.utils.PatternLockUtils; //导入依赖的package包/类
@Override
public void onComplete(List<PatternLockView.Dot> pattern) {
Log.d(getClass().getName(), "Pattern complete: " +
PatternLockUtils.patternToString(mPatternLockView, pattern));
}
示例10: onCreate
import com.andrognito.patternlockview.utils.PatternLockUtils; //导入依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
requestWindowFeature(Window.FEATURE_NO_TITLE);
getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
WindowManager.LayoutParams.FLAG_FULLSCREEN);
setContentView(R.layout.activity_main);
mPatternLockView = (PatternLockView) findViewById(R.id.patter_lock_view);
mPatternLockView.setDotCount(3);
mPatternLockView.setDotNormalSize((int) ResourceUtils.getDimensionInPx(this, R.dimen.pattern_lock_dot_size));
mPatternLockView.setDotSelectedSize((int) ResourceUtils.getDimensionInPx(this, R.dimen.pattern_lock_dot_selected_size));
mPatternLockView.setPathWidth((int) ResourceUtils.getDimensionInPx(this, R.dimen.pattern_lock_path_width));
mPatternLockView.setAspectRatioEnabled(true);
mPatternLockView.setAspectRatio(PatternLockView.AspectRatio.ASPECT_RATIO_HEIGHT_BIAS);
mPatternLockView.setViewMode(PatternLockView.PatternViewMode.CORRECT);
mPatternLockView.setDotAnimationDuration(150);
mPatternLockView.setPathEndAnimationDuration(100);
mPatternLockView.setCorrectStateColor(ResourceUtils.getColor(this, R.color.white));
mPatternLockView.setInStealthMode(false);
mPatternLockView.setTactileFeedbackEnabled(true);
mPatternLockView.setInputEnabled(true);
mPatternLockView.addPatternLockListener(mPatternLockViewListener);
RxPatternLockView.patternComplete(mPatternLockView)
.subscribe(new Consumer<PatternLockCompleteEvent>() {
@Override
public void accept(PatternLockCompleteEvent patternLockCompleteEvent) throws Exception {
Log.d(getClass().getName(), "Complete: " + patternLockCompleteEvent.getPattern().toString());
}
});
RxPatternLockView.patternChanges(mPatternLockView)
.subscribe(new Consumer<PatternLockCompoundEvent>() {
@Override
public void accept(PatternLockCompoundEvent event) throws Exception {
if (event.getEventType() == PatternLockCompoundEvent.EventType.PATTERN_STARTED) {
Log.d(getClass().getName(), "Pattern drawing started");
} else if (event.getEventType() == PatternLockCompoundEvent.EventType.PATTERN_PROGRESS) {
Log.d(getClass().getName(), "Pattern progress: " +
PatternLockUtils.patternToString(mPatternLockView, event.getPattern()));
} else if (event.getEventType() == PatternLockCompoundEvent.EventType.PATTERN_COMPLETE) {
Log.d(getClass().getName(), "Pattern complete: " +
PatternLockUtils.patternToString(mPatternLockView, event.getPattern()));
} else if (event.getEventType() == PatternLockCompoundEvent.EventType.PATTERN_CLEARED) {
Log.d(getClass().getName(), "Pattern has been cleared");
}
}
});
}