Search in sources :

Example 1 with GestureOverlayView

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);
            }
        });
    }
}
Also used : GestureOverlayView(android.gesture.GestureOverlayView)

Example 2 with GestureOverlayView

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);
}
Also used : Random(java.util.Random) GestureOverlayView(android.gesture.GestureOverlayView)

Example 3 with GestureOverlayView

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);
}
Also used : GestureOverlayView(android.gesture.GestureOverlayView)

Example 4 with GestureOverlayView

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);
    }
}
Also used : GestureOverlayView(android.gesture.GestureOverlayView)

Example 5 with GestureOverlayView

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;
        }
    }
}
Also used : GestureLibrary(android.gesture.GestureLibrary) GestureOverlayView(android.gesture.GestureOverlayView) Intent(android.content.Intent) TextView(android.widget.TextView)

Aggregations

GestureOverlayView (android.gesture.GestureOverlayView)7 TextView (android.widget.TextView)2 SuppressLint (android.annotation.SuppressLint)1 TargetApi (android.annotation.TargetApi)1 Intent (android.content.Intent)1 GestureLibrary (android.gesture.GestureLibrary)1 ToneGenerator (android.media.ToneGenerator)1 View (android.view.View)1 WebView (android.webkit.WebView)1 WebViewClient (android.webkit.WebViewClient)1 Random (java.util.Random)1