public override void onLogMessage(int level, string area, string message) { switch (level) { case Log.DEBUG: Log.d(area, message); break; case Log.ERROR: Log.e(area, message); break; case Log.INFO: Log.i(area, message); break; case Log.VERBOSE: Log.v(area, message); break; case Log.WARN: Log.w(area, message); break; } }
private void init() { Log.v(TAG, "init new canvas"); DESK_LABEL_PAINT.Color = Color.WHITE; DESK_LABEL_PAINT.TextSize = 50; DESK_LABEL_PAINT.TextAlign = Paint.Align.CENTER; DESK_LABEL_PAINT.Typeface = Typeface.DEFAULT; // This view's height and width aren't known until they're measured once. Add a listener for // that time so we can calculate the conversion factor. this.ViewTreeObserver.addOnGlobalLayoutListener(new OnGlobalLayoutListenerAnonymousInnerClassHelper(this)); }
public override void onCreate(Bundle savedInstanceState) { base.onCreate(savedInstanceState); Intent intent = Intent; string url = intent.getStringExtra("url"); ContentView = R.layout.adobepass_webview_activity_main; webView = (WebView)findViewById(R.id.sampleWebView); webView.WebViewClient = webViewClient; webView.Settings.JavaScriptEnabled = true; webView.Settings.JavaScriptCanOpenWindowsAutomatically = true; Log.v(TAG, "Loading: " + url); webView.loadUrl(url); }
private void moveThing(OfficeThing touchedThing, int xTouchLogical, int yTouchLogical) { //TODO: make sure these are accurate int newTop = yTouchLogical - mRenderUtil.getModelHeight(touchedThing) / 2; int newLeft = xTouchLogical - mRenderUtil.getModelWidth(touchedThing) / 2; int newBottom = yTouchLogical + mRenderUtil.getModelHeight(touchedThing) / 2; int newRight = xTouchLogical + mRenderUtil.getModelWidth(touchedThing) / 2; if (newTop < 0 || newLeft < 0 || newBottom > LOGICAL_HEIGHT || newRight > LOGICAL_WIDTH) { Log.v(TAG, "Dragging beyond screen edge. Limiting"); } // Limit moves to the boundaries of the screen if (newTop < 0) { newTop = 0; } if (newLeft < 0) { newLeft = 0; } if (newBottom > LOGICAL_HEIGHT) { newTop = LOGICAL_HEIGHT - mRenderUtil.getModelHeight(touchedThing); } if (newRight > LOGICAL_WIDTH) { newLeft = LOGICAL_WIDTH - mRenderUtil.getModelWidth(touchedThing); } // Save the object touchedThing.Top = newTop; touchedThing.Left = newLeft; // Notify listeners if (null != this.mThingChangedListener) { mThingChangedListener.thingChanged(touchedThing.Key, touchedThing); } }
//JAVA TO C# CONVERTER WARNING: 'final' parameters are not available in .NET: //ORIGINAL LINE: @Override public boolean onTouchEvent(final android.view.MotionEvent event) public override bool onTouchEvent(MotionEvent @event) { bool handled = false; OfficeThing touchedThing; int xTouchLogical; int yTouchLogical; int pointerId; int actionIndex = @event.ActionIndex; // get touch event coordinates and make transparent wrapper from it switch (@event.ActionMasked) { case MotionEvent.ACTION_DOWN: // first pointer, clear the pointer mSelectedThing = null; xTouchLogical = screenToModel((int)@event.getX(0)); yTouchLogical = screenToModel((int)@event.getY(0)); // check if we've touched inside something touchedThing = getTouchedThing(xTouchLogical, yTouchLogical); if (touchedThing == null) { mSelectedThingChangeListener.thingChanged(null); break; } mSelectedThing = touchedThing; if (null != mSelectedThingChangeListener) { mSelectedThingChangeListener.thingChanged(touchedThing); } touchedThing.setzIndex(mOfficeLayout.HighestzIndex + 1); Log.v(TAG, "Selected " + touchedThing); handled = true; break; case MotionEvent.ACTION_MOVE: pointerId = @event.getPointerId(actionIndex); if (pointerId > 0) { break; } xTouchLogical = screenToModel((int)@event.getX(actionIndex)); yTouchLogical = screenToModel((int)@event.getY(actionIndex)); touchedThing = mSelectedThing; if (null == touchedThing) { break; } moveThing(touchedThing, xTouchLogical, yTouchLogical); handled = true; break; case MotionEvent.ACTION_UP: mSelectedThing = null; invalidate(); handled = true; break; case MotionEvent.ACTION_CANCEL: handled = true; break; } return(base.onTouchEvent(@event) || handled); }
public override void onKilled() { Log.v(TAG, "SapaSimpleClient will be closed. because of the SapaProcessor was closed."); outerInstance.mService.stop(true); finish(); }