use of android.gesture.GestureOverlayView in project Resurrection_packages_apps_Settings by ResurrectionRemix.
the class GestureAnywhereCreateGestureActivity method onAttachedToWindow.
@Override
public void onAttachedToWindow() {
super.onAttachedToWindow();
if (mGesture != null) {
final GestureOverlayView overlay = (GestureOverlayView) findViewById(R.id.gestures_overlay);
overlay.post(new Runnable() {
@Override
public void run() {
overlay.setGesture(mGesture);
mDoneButton.setEnabled(true);
}
});
}
}
use of android.gesture.GestureOverlayView in project coursera-android by aporter.
the class GesturesActivity method onCreate.
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
mFrame = (FrameLayout) findViewById(R.id.frame);
mBgColor = new Random().nextInt(0xFFFFFF) | 0xFF000000;
mFirstColor = mBgColor;
mFrame.setBackgroundColor(mBgColor);
mLayout = (RelativeLayout) findViewById(R.id.main);
mLayout.setBackgroundColor(mStartBgColor);
mLibrary = GestureLibraries.fromRawResource(this, R.raw.gestures);
if (!mLibrary.load()) {
finish();
}
// Make this the target of gesture detection callbacks
GestureOverlayView gestureView = (GestureOverlayView) findViewById(R.id.gestures_overlay);
gestureView.addOnGesturePerformedListener(this);
}
use of android.gesture.GestureOverlayView in project AndroidSDK-RecipeBook by gabu.
the class Recipe038 method onCreate.
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
// Gestures Builderで作ったジェスチャー情報をロード
mLibrary = GestureLibraries.fromRawResource(this, R.raw.gestures);
if (!mLibrary.load()) {
finish();
}
// GestureOverlayViewにリスナーをセット
GestureOverlayView gestures;
gestures = (GestureOverlayView) findViewById(R.id.gestures);
gestures.addOnGesturePerformedListener(this);
}
use of android.gesture.GestureOverlayView in project Resurrection_packages_apps_Settings by ResurrectionRemix.
the class GestureAnywhereCreateGestureActivity method onRestoreInstanceState.
@Override
protected void onRestoreInstanceState(Bundle savedInstanceState) {
super.onRestoreInstanceState(savedInstanceState);
mGesture = savedInstanceState.getParcelable("gesture");
if (mGesture != null) {
final GestureOverlayView overlay = (GestureOverlayView) findViewById(R.id.gestures_overlay);
overlay.post(new Runnable() {
public void run() {
overlay.setGesture(mGesture);
}
});
mDoneButton.setEnabled(true);
}
}
use of android.gesture.GestureOverlayView in project Resurrection_packages_apps_Settings by ResurrectionRemix.
the class GestureAnywhereCreateGestureActivity method onCreate.
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.ga_create_gesture);
mDoneButton = findViewById(R.id.done);
final Intent intent = getIntent();
mUri = intent.getStringExtra("uri");
mName = intent.getStringExtra("name");
((TextView) findViewById(R.id.gesture_name)).setText(mName);
GestureOverlayView overlay = (GestureOverlayView) findViewById(R.id.gestures_overlay);
overlay.addOnGestureListener(new GesturesProcessor());
final GestureLibrary store = GestureAnywhereBuilderActivity.getStore();
final String gestureName = mName + '|' + mUri;
for (String entry : store.getGestureEntries()) {
if (gestureName.equals(entry)) {
mGesture = store.getGestures(entry).get(0);
mIsExistingGesture = true;
break;
}
}
}
Aggregations