public XobotWindow (Context context) : base (context) { layout_inflater = new XobotLayoutInflater (context); view = new DecorView (context); attach_info = new View.AttachInfo (this); }
public PathFillTypes (Context context) : base (context) { mPath = new Path (); mPath.addCircle (40, 40, 45, Path.Direction.CCW); mPath.addCircle (80, 80, 45, Path.Direction.CCW); }
public CardboardOverlayView(Context context, AttributeSet attrs) : base(context, attrs) { setOrientation(HORIZONTAL); LayoutParams @params = new LayoutParams( LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT, 1.0f); @params.setMargins(0, 0, 0, 0); leftView = new CardboardOverlayEyeView(context, attrs); leftView.setLayoutParams(@params); addView(leftView); rightView = new CardboardOverlayEyeView(context, attrs); rightView.setLayoutParams(@params); addView(rightView); // Set some reasonable defaults. setDepthOffset(0.016f); setColor(Color.rgb(150, 255, 180)); setVisibility(View.VISIBLE); textFadeAnimation = new AlphaAnimation(1.0f, 0.0f); textFadeAnimation.setDuration(5000); }
public Vertices (Context context) : base (context) { Bitmap bm = GetResourceBitmap (R.drawable.beach); Shader s = new BitmapShader (bm, Shader.TileMode.CLAMP, Shader.TileMode.CLAMP); mPaint.setShader (s); float w = bm.getWidth (); float h = bm.getHeight (); // construct our mesh setXY (mTexs, 0, w / 2, h / 2); setXY (mTexs, 1, 0, 0); setXY (mTexs, 2, w, 0); setXY (mTexs, 3, w, h); setXY (mTexs, 4, 0, h); setXY (mVerts, 0, w / 2, h / 2); setXY (mVerts, 1, 0, 0); setXY (mVerts, 2, w, 0); setXY (mVerts, 3, w, h); setXY (mVerts, 4, 0, h); mMatrix.setScale (0.8f, 0.8f); mMatrix.preTranslate (20, 20); mMatrix.invert (mInverse); }
/// <summary>Get an AccessibilityManager instance (create one if necessary).</summary> /// <remarks>Get an AccessibilityManager instance (create one if necessary).</remarks> /// <hide></hide> public static AccessibilityManager getInstance (Context context) { lock (sInstanceSync) { if (sInstance == null) { sInstance = new AccessibilityManager (context); } } return sInstance; }
internal virtual int getPrefs (Context context) { lock (this) { if (!mPrefsInited || mResolver == null || mResolver.get () == null) { initPrefs (context); } } return mPrefs; }
// r(20814): /data/local/tmp/AndroidNFCBroadcastReceiver.Activities-debug.apk (at Binary XML file line #16): // <receiver> does not have valid android:name // Failure [INSTALL_PARSE_FAILED_MANIFEST_MALFORMED] // http://stackoverflow.com/questions/16645632/programmatic-vs-static-broadcast-recievers-in-android // http://stackoverflow.com/questions/4853622/android-nfc-tag-received-with-broadcastreceiver // http://stackoverflow.com/questions/6829655/nfc-broadcast-problem // You can't capture those intents with a BroadcastReceiver, because only Activities // can receive NFC intents. You can find more information about it in the NFC guide. public override void onReceive(Context arg0, Intent arg1) { var context = ThreadLocalContextReference.CurrentContext; var action = arg1.getAction(); Console.WriteLine("AtDiscovered " + new { action }); }
public Preview(Context context) : base(context) { mHolder = getHolder(); mHolder.addCallback(this); // http://developer.android.com/reference/android/view/SurfaceHolder.html#SURFACE_TYPE_PUSH_BUFFERS mHolder.setType(3); }
public GLES3JNIView(Context context) : base(context) { // Pick an EGLConfig with RGB8 color, 16-bit depth, no stencil, // supporting OpenGL ES 2.0 or later backwards-compatible versions. setEGLConfigChooser(8, 8, 8, 0, 16, 0); setEGLContextClientVersion(2); setRenderer(new Renderer()); }
internal void attach (Context context, Application application, Window window) { mApplication = application; mWindow = window; attachBaseContext (context); mFragments.attachActivity (this); mWindow.setCallback (this); }
public Regions (Context context) : base (context) { mPaint.setAntiAlias (true); mPaint.setTextSize (16); mPaint.setTextAlign (Paint.Align.CENTER); mRect1.set (10, 10, 100, 80); mRect2.set (50, 50, 130, 110); }
public PolyToPoly (Context context) : base (context) { // for when the style is STROKE mPaint.setStrokeWidth (4); // for when we draw text mPaint.setTextSize (40); mPaint.setTextAlign (Paint.Align.CENTER); mFontMetrics = mPaint.getFontMetrics (); }
public Clipping (Context context) : base (context) { mPaint = new Paint (); mPaint.setAntiAlias (true); mPaint.setStrokeWidth (6); mPaint.setTextSize (16); mPaint.setTextAlign (Paint.Align.RIGHT); mPath = new Path (); }
public AlphaBitmap (Context context) : base (context) { mBitmap = GetResourceBitmap (R.drawable.app_sample_code); mBitmap2 = mBitmap.extractAlpha (); mBitmap3 = Bitmap.createBitmap (200, 200, Bitmap.Config.ALPHA_8); drawIntoBitmap (mBitmap3); mShader = new LinearGradient (0, 0, 100, 70, new int[] { Color.RED, Color.GREEN, Color.BLUE }, null, Shader.TileMode.MIRROR); }
public RoundRects (Context context) : base (context) { mRect = new Rect (0, 0, 120, 120); int[] colors = { unchecked((int)0xFFFF0000), unchecked((int)0xFF00FF00), unchecked((int)0xFF0000FF) }; mDrawable = new GradientDrawable (GradientDrawable.Orientation.TL_BR, colors); mDrawable.setShape (GradientDrawable.RECTANGLE); mDrawable.setGradientRadius ((float)(Math.Sqrt (2) * 60)); }
public override void onReceive(Context arg0, Intent arg1) { var context = ThreadLocalContextReference.CurrentContext; var uri = arg1.getData(); var packageName = uri.getSchemeSpecificPart(); Console.WriteLine("AtInstall " + new { packageName }); // I/System.Console( 3900): AtInstall { arg1 = Intent { act=android.intent.action.PACKAGE_REPLACED dat=package:NASDAQSNA.Activities flg=0x8000010 cmp=ReinstallNotification.Activities/.AtInstall (has extras) }, packageName = NASDAQSNA.Activities } History.Add(packageName); }
public HelloOpenGLES20SurfaceView(Context context) : base(context) { // Create an OpenGL ES 2.0 context. setEGLContextClientVersion(2); // set the mRenderer member mRenderer = new HelloOpenGLES20Renderer(); setRenderer(mRenderer); // Render the view only when there is a change setRenderMode(GLSurfaceView.RENDERMODE_WHEN_DIRTY); }
public PathEffects (Context context) : base (context) { mPaint = new Paint (Paint.ANTI_ALIAS_FLAG); mPaint.setStyle (Paint.Style.STROKE); mPaint.setStrokeWidth (6); mPath = makeFollowPath (); mEffects = new PathEffect[6]; mColors = new int[] { Color.BLACK, Color.RED, Color.BLUE, Color.GREEN, Color.MAGENTA, Color.BLACK }; }
public override void onReceive(Context arg0, Intent intent) { Log.d(TAG, "!@#!@ConsoleReceiver action:" + intent); if (intent.getAction() == CONSOLE_INTENT) { // Unity apps will not have a VrActivity, so they can only use console functions that are ok // with a NULL appPtr. if (activity is VrActivity) { nativeConsoleCommand(((VrActivity)activity).appPtr, intent.getStringExtra(CONSOLE_STRING_EXTRA)); } else { nativeConsoleCommand(((long)0), intent.getStringExtra(CONSOLE_STRING_EXTRA)); } } }
public ColorFilters (Context context) : base (context) { mDrawable = getResources ().getDrawable (R.drawable.btn_default_normal); mDrawable.setBounds (0, 0, 150, 48); mDrawable.setDither (true); int[] resIDs = new int[] { R.drawable.btn_circle_normal, R.drawable.btn_check_off, R.drawable.btn_check_on }; mDrawables = new Drawable[resIDs.Length]; Drawable prev = mDrawable; for (int i = 0; i < resIDs.Length; i++) { mDrawables [i] = getResources ().getDrawable (resIDs [i]); mDrawables [i].setDither (true); addToTheRight (mDrawables [i], prev); prev = mDrawables [i]; } mPaint = new Paint (); mPaint.setAntiAlias (true); mPaint.setTextSize (16); mPaint.setTextAlign (Paint.Align.CENTER); mPaint2 = new Paint (mPaint); mPaint2.setAlpha (64); Paint.FontMetrics fm = mPaint.getFontMetrics (); mPaintTextOffset = (fm.descent + fm.ascent) * 0.5f; mColors = new uint[] { 0, 0xCC0000FF, 0x880000FF, 0x440000FF, 0xFFCCCCFF, 0xFF8888FF, 0xFF4444FF }; mModes = new PorterDuff.Mode[] { PorterDuff.Mode.SRC_ATOP, PorterDuff.Mode.MULTIPLY, }; mModeIndex = 0; updateTitle (); }
public Xfermodes (Context context) : base (context) { mSrcB = makeSrc (W, H); mDstB = makeDst (W, H); // make a ckeckerboard pattern int[] colors = new int[] { unchecked((int)0xFFFFFFFF), unchecked((int)0xFFCCCCCC), unchecked((int)0xFFCCCCCC), unchecked((int)0xFFFFFFFF) }; Bitmap bm = Bitmap.createBitmap (colors, 2, 2, Bitmap.Config.RGB_565); mBG = new BitmapShader (bm, Shader.TileMode.REPEAT, Shader.TileMode.REPEAT); Matrix m = new Matrix (); m.setScale (6, 6); mBG.setLocalMatrix (m); }
public Arcs (Context context) : base (context) { mPaints = new Paint[4]; mUseCenters = new bool[4]; mOvals = new RectF[4]; mPaints [0] = new Paint (); mPaints [0].setAntiAlias (true); mPaints [0].setStyle (Paint.Style.FILL); mPaints [0].setColor (unchecked((int)0x88FF0000)); mUseCenters [0] = false; mPaints [1] = new Paint (mPaints [0]); mPaints [1].setColor (unchecked((int)0x8800FF00)); mUseCenters [1] = true; mPaints [2] = new Paint (mPaints [0]); mPaints [2].setStyle (Paint.Style.STROKE); mPaints [2].setStrokeWidth (4); mPaints [2].setColor (unchecked((int)0x880000FF)); mUseCenters [2] = false; mPaints [3] = new Paint (mPaints [2]); mPaints [3].setColor (unchecked((int)0x88888888)); mUseCenters [3] = true; mBigOval = new RectF (40, 10, 280, 250); mOvals [0] = new RectF (10, 270, 70, 330); mOvals [1] = new RectF (90, 270, 150, 330); mOvals [2] = new RectF (170, 270, 230, 330); mOvals [3] = new RectF (250, 270, 310, 330); mFramePaint = new Paint (); mFramePaint.setAntiAlias (true); mFramePaint.setStyle (Paint.Style.STROKE); mFramePaint.setStrokeWidth (0); // AddTimer (50); }
public void InternalSetContext(Context c) { this.xContext = c; InternalBeforeSetContext(c); var a = this.Controls.InternalItems; for (int i = 0; i < a.size(); i++) { var x = a.get(i); var u = x as __Control; if (u != null) u.InternalSetContext(c); } InternalAfterSetContext(c); InternalAttachChildren(); }
public BitmapMesh (Context context) : base (context) { mBitmap = GetResourceBitmap (R.drawable.beach); float w = mBitmap.getWidth (); float h = mBitmap.getHeight (); // construct our mesh int index = 0; for (int y = 0; y <= HEIGHT; y++) { float fy = h * y / HEIGHT; for (int x = 0; x <= WIDTH; x++) { float fx = w * x / WIDTH; setXY (mVerts, index, fx, fy); setXY (mOrig, index, fx, fy); index += 1; } } mMatrix.setTranslate (10, 10); mMatrix.invert (mInverse); }
public static unsafe Texture LoadResource(Context context, int resource) { Texture ret = new Texture(); uint tex; gl.GenTextures(1, &tex); ret.myName = tex; gl.BindTexture(gl.GL_TEXTURE_2D, ret.myName); // do stuff to load it var inputStream = context.getResources().openRawResource(resource); try { var bitmap = BitmapFactory.decodeStream(inputStream); ret.myWidth = bitmap.Width; ret.myHeight = bitmap.Height; GLUtils.texImage2D(GLES20.GL_TEXTURE_2D, 0, bitmap, 0); } finally { inputStream.close(); } gl.TexParameteri(gl.GL_TEXTURE_2D, gl.GL_TEXTURE_MIN_FILTER, gl.GL_LINEAR); gl.TexParameteri(gl.GL_TEXTURE_2D, gl.GL_TEXTURE_MAG_FILTER, gl.GL_LINEAR); ret.myPositionCoords = new float[] { 0, -ret.Height, 0, 0, 0, 0, ret.myWidth, -ret.myHeight, 0, ret.myWidth, 0, 0 }; return ret; }
public static int loadTexture(Context context, int resourceId) { int[] textureHandle = new int[1]; GLES20.glGenTextures(1, textureHandle, 0); if (textureHandle[0] != 0) { BitmapFactory.Options options = new BitmapFactory.Options(); options.inScaled = false; // No pre-scaling // Read in the resource Bitmap bitmap = BitmapFactory.decodeResource(context.getResources(), resourceId, options); // Bind to the texture in OpenGL GLES20.glBindTexture(GLES20.GL_TEXTURE_2D, textureHandle[0]); // Set filtering GLES20.glTexParameteri(GLES20.GL_TEXTURE_2D, GLES20.GL_TEXTURE_MIN_FILTER, GLES20.GL_NEAREST); GLES20.glTexParameteri(GLES20.GL_TEXTURE_2D, GLES20.GL_TEXTURE_MAG_FILTER, GLES20.GL_NEAREST); // Load the bitmap into the bound texture. GLUtils.texImage2D(GLES20.GL_TEXTURE_2D, 0, bitmap, 0); // Recycle the bitmap, since its data has been loaded into OpenGL. bitmap.recycle(); } if (textureHandle[0] == 0) { //throw new RuntimeException("Error loading texture."); throw null; } return textureHandle[0]; }
public VortexView(Context context) : base(context) { _renderer = new VortexRenderer(); setRenderer(_renderer); }
public Box (Context context) : base (context) { }
//location: class PopupWebView.Library.XWindow //super(class35.context); public XWindow(Context xcontext) : base(xcontext) { // ? mContext = null; }
public DrawPoints (Context context) : base (context) { buildPoints (); }
// html hud? // http://stackoverflow.com/questions/6927286/force-a-view-to-redraw-itself public DrawOnTop(android.content.Context context) : base(context) { }