/// <summary> /// Executes the chart demo. </summary> /// <param name="context"> the context </param> /// <returns> the built intent </returns> public override Intent execute(Context context) { CategorySeries category = new CategorySeries("Weight indic"); category.add("Current", 75); category.add("Minimum", 65); category.add("Maximum", 90); DialRenderer renderer = new DialRenderer(); renderer.ChartTitleTextSize = 20; renderer.LabelsTextSize = 15; renderer.LegendTextSize = 15; renderer.Margins = new int[] {20, 30, 15, 0}; SimpleSeriesRenderer r = new SimpleSeriesRenderer(); r.Color = Color.BLUE; renderer.addSeriesRenderer(r); r = new SimpleSeriesRenderer(); r.Color = Color.rgb(0, 150, 0); renderer.addSeriesRenderer(r); r = new SimpleSeriesRenderer(); r.Color = Color.GREEN; renderer.addSeriesRenderer(r); renderer.LabelsTextSize = 10; renderer.LabelsColor = Color.WHITE; renderer.ShowLabels = true; renderer.VisualTypes = new DialRenderer.Type[] {DialRenderer.Type.ARROW, DialRenderer.Type.NEEDLE, DialRenderer.Type.NEEDLE}; renderer.MinValue = 0; renderer.MaxValue = 150; return ChartFactory.getDialChartIntent(context, category, renderer, "Weight indicator"); }
/// <summary>Construct an empty Toast object.</summary> /// <remarks> /// Construct an empty Toast object. You must call /// <see cref="setView(android.view.View)">setView(android.view.View)</see> /// before you /// can call /// <see cref="show()">show()</see> /// . /// </remarks> /// <param name="context"> /// The context to use. Usually your /// <see cref="android.app.Application">android.app.Application</see> /// or /// <see cref="android.app.Activity">android.app.Activity</see> /// object. /// </param> public Toast(android.content.Context context) { mContext = context; mTN = new android.widget.Toast.TN(); mTN.mY = context.getResources().getDimensionPixelSize([email protected]_y_offset ); }
public static Drawable getDrawableWithNumber(Drawable baseDrawable, int number, int iconSize, Context context) { if (number < 0 || number > 9) { number = 0; } Drawable numberDrawable = context.Resources.getDrawable(R.drawable.number_round); if (numberDrawable == null) { return baseDrawable; } int appIconShift = context.Resources.getDimensionPixelOffset(R.dimen.ord_app_icon_shift); Bitmap bitmap = Bitmap.createBitmap(iconSize, iconSize, Bitmap.Config.ARGB_8888); Canvas canvas = new Canvas(bitmap); int textSize = context.Resources.getDimensionPixelSize(R.dimen.number_icon_text_size); int textColor = context.Resources.getColor(R.color.fc_app_icon_number_color); TextDrawable textDrawable = new TextDrawable(number.ToString(), textSize, textColor); baseDrawable.setBounds(0, 0, iconSize, iconSize); baseDrawable.draw(canvas); numberDrawable.setBounds(iconSize - (appIconShift + numberDrawable.IntrinsicWidth), appIconShift, iconSize - (appIconShift), appIconShift + numberDrawable.IntrinsicHeight); numberDrawable.draw(canvas); textDrawable.setBounds(iconSize - (appIconShift + numberDrawable.IntrinsicWidth), appIconShift, iconSize - (appIconShift), appIconShift + numberDrawable.IntrinsicHeight); textDrawable.draw(canvas); return new BitmapDrawable(context.Resources, bitmap); }
private static void setRoomNameFieldInDialog(EditText roomNameEditText, AlertDialog.Builder alertDialogBuilder, Context context) { roomNameEditText.Hint = "room name"; int horizontalPadding = context.Resources.getDimensionPixelOffset(R.dimen.activity_horizontal_margin); int verticalPadding = context.Resources.getDimensionPixelOffset(R.dimen.activity_vertical_margin); alertDialogBuilder.setView(roomNameEditText, horizontalPadding, verticalPadding, horizontalPadding, 0); }
//JAVA TO C# CONVERTER WARNING: 'final' parameters are not available in .NET: //ORIGINAL LINE: public static CharSequence parse(android.content.Context context, java.util.List<IconFontDescriptorWrapper> iconFontDescriptors, CharSequence text, final android.widget.TextView target) public static CharSequence parse(Context context, IList<IconFontDescriptorWrapper> iconFontDescriptors, CharSequence text, TextView target) { context = context.ApplicationContext; // Analyse the text and replace {} blocks with the appropriate character // Retain all transformations in the accumulator //JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final': //ORIGINAL LINE: final android.text.SpannableStringBuilder spannableBuilder = new android.text.SpannableStringBuilder(text); SpannableStringBuilder spannableBuilder = new SpannableStringBuilder(text); recursivePrepareSpannableIndexes(context, text.ToString(), spannableBuilder, iconFontDescriptors, 0); bool isAnimated = hasAnimatedSpans(spannableBuilder); // If animated, periodically invalidate the TextView so that the // CustomTypefaceSpan can redraw itself if (isAnimated) { if (target == null) { throw new System.ArgumentException("You can't use \"spin\" without providing the target TextView."); } if (!(target is HasOnViewAttachListener)) { throw new System.ArgumentException(target.GetType().Name + " does not implement " + "HasOnViewAttachListener. Please use IconTextView, IconButton or IconToggleButton."); } ((HasOnViewAttachListener) target).OnViewAttachListener = new HasOnViewAttachListener_OnViewAttachListenerAnonymousInnerClassHelper(target); } else if (target is HasOnViewAttachListener) { ((HasOnViewAttachListener) target).OnViewAttachListener = null; } return spannableBuilder; }
public override void onReceive(Context context, Intent intent) { //JAVA TO C# CONVERTER WARNING: The .NET Type.FullName property will not always yield results identical to the Java Class.getName method: ComponentName comp = new ComponentName(context.PackageName, typeof(GcmIntentService).FullName); startWakefulService(context, (intent.setComponent(comp))); ResultCode = Activity.RESULT_OK; }
public Zoo(Context context) { realmConfig = (new RealmConfiguration.Builder(context)).name("library.zoo.realm").setModules(new AllAnimalsModule()).build(); // Always use explicit modules in library projects - So always use a unique name - Beware this is the app context // Reset Realm Realm.deleteRealm(realmConfig); }
public virtual void initForMenu(android.content.Context context, [email protected] menu) { mContext = context; mInflater = android.view.LayoutInflater.from(mContext); mMenu = menu; }
/// <summary>Set the base context for this ContextWrapper.</summary> /// <remarks> /// Set the base context for this ContextWrapper. All calls will then be /// delegated to the base context. Throws /// IllegalStateException if a base context has already been set. /// </remarks> /// <param name="base">The new base context for this wrapper.</param> protected internal virtual void attachBaseContext(android.content.Context @base) { if (mBase != null) { throw new System.InvalidOperationException("Base context already set"); } mBase = @base; }
public ChordLogView(Context context, AttributeSet attr) : base(context, attr) { logTextView = new TextView(context); LinearLayout.LayoutParams lp = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT, LinearLayout.LayoutParams.WRAP_CONTENT); logTextView.setPadding(6, 0, 3, 0); logTextView.LayoutParams = lp; addView(logTextView); }
/// <summary>Construct a new BaseMenuPresenter.</summary> /// <remarks>Construct a new BaseMenuPresenter.</remarks> /// <param name="context">Context for generating system-supplied views</param> /// <param name="menuLayoutRes">Layout resource ID for the menu container view</param> /// <param name="itemLayoutRes">Layout resource ID for a single item view</param> public BaseMenuPresenter(android.content.Context context, int menuLayoutRes, int itemLayoutRes) { mSystemContext = context; mSystemInflater = android.view.LayoutInflater.from(context); mMenuLayoutRes = menuLayoutRes; mItemLayoutRes = itemLayoutRes; }
public FcRecycleView(Context context, AttributeSet attrs, int defStyle) : base(context, attrs, defStyle) { if (attrs != null) { TypedArray array = context.obtainStyledAttributes(attrs, R.styleable.FcRecycleView, 0, 0); mMaxWidth = array.getLayoutDimension(R.styleable.FcRecycleView_max_width, LayoutParams.MATCH_PARENT); array.recycle(); } }
public override void onReceive(Context context, Intent intent) { bool isConnected = intent.getBooleanExtra("isConnected", false); Log.d(TAG, "Connected : " + isConnected); Toast.makeTextuniquetempvar.show(); }
public KeyButton(Context context, AttributeSet attrs) : base(context, attrs) { TypedArray a = context.obtainStyledAttributes(attrs, R.styleable.KeyButton); mNote = a.getInteger(R.styleable.KeyButton_note, 69); mVelocity = a.getInteger(R.styleable.KeyButton_velocity, 80); a.recycle(); }
/// <summary> /// Create an IconDrawable. </summary> /// <param name="context"> Your activity or application context. </param> /// <param name="iconKey"> The icon key you want this drawable to display. </param> /// <exception cref="IllegalArgumentException"> if the key doesn't match any icon. </exception> public IconDrawable(Context context, string iconKey) { Icon icon = Iconify.findIconForKey(iconKey); if (icon == null) { throw new System.ArgumentException("No icon with that key \"" + iconKey + "\"."); } init(context, icon); }
public static float getPxFromDimen(Context context, string resName) { Resources resources = context.Resources; int resId = resources.getIdentifier(resName, "dimen", context.PackageName); if (resId <= 0) { return -1; } return resources.getDimension(resId); }
public ActionMenuItem(android.content.Context context, int group, int id, int categoryOrder , int ordering, java.lang.CharSequence title) { mContext = context; mId = id; mGroup = group; mCategoryOrder = categoryOrder; mOrdering = ordering; mTitle = title; }
public static int getColorFromResource(Context context, string resName) { Resources resources = context.Resources; int resId = resources.getIdentifier(resName, "color", context.PackageName); if (resId <= 0) { return int.MaxValue; } return resources.getColor(resId); }
/// <summary>Construct a new PopupMenu.</summary> /// <remarks>Construct a new PopupMenu.</remarks> /// <param name="context">Context for the PopupMenu.</param> /// <param name="anchor"> /// Anchor view for this popup. The popup will appear below the anchor if there /// is room, or above it if there is not. /// </param> public PopupMenu(android.content.Context context, android.view.View anchor) { // TODO Theme? mContext = context; mMenu = new [email protected](context); mMenu.setCallback(this); mAnchor = anchor; mPopup = new [email protected](context, mMenu, anchor); mPopup.setCallback(this); }
public override void onReceive(Context context, Intent intent) { string data = intent.getStringExtra("extra_action_data"); if (data != null) { Toast.makeText(context, data, Toast.LENGTH_SHORT).show(); } }
private void init(android.database.Cursor cursor, android.content.Context context , bool autoRequery) { mContext = context; mHandler = new android.os.Handler(); mAutoRequery = autoRequery; mGroupCursorHelper = new android.widget.CursorTreeAdapter.MyCursorHelper(this, cursor ); mChildrenCursorHelpers = new android.util.SparseArray<android.widget.CursorTreeAdapter .MyCursorHelper>(); }
public override void onUpdate(Context context, SlookCocktailManager cocktailBarManager, int[] cocktailIds) { RemoteViews rv = new RemoteViews(context.PackageName, R.layout.sample_panel); string str = context.Resources.getString([email protected]_text); rv.setTextViewText(R.id.text, str); setPendingIntent(context, rv); for (int i = 0; i < cocktailIds.Length; i++) { cocktailBarManager.updateCocktail(cocktailIds[i], rv); } }
/// <summary> /// Called when a push message is received or message download completes. </summary> /// <param name="context"> context. </param> /// <param name="intent"> intent. </param> private void onMessage(Context context, Intent intent) { string type = intent.getStringExtra(INTENT_EXTRA_TYPE); if (INTENT_EXTRA_TYPE_PUSH.Equals(type)) { EngagementReachAgent.getInstance(context).onContentReceived(intent.Extras); } else if (INTENT_EXTRA_TYPE_DLC.Equals(type)) { EngagementReachAgent.getInstance(context).onMessageDownloaded(intent.Extras); } }
public FaceRectView(Context context, AttributeSet attrs, int defStyle) : base(context, attrs, defStyle) { mPaint = new Paint(); mPaint.Style = Paint.Style.STROKE; mMatrix = new Matrix(); mAspectRatio = new Matrix(); mRevisionZoomRect = new RectF(); mActualRect = new RectF(); mBoundRect = new RectF(); }
public MenuPopupHelper(android.content.Context context, [email protected] menu, android.view.View anchorView, bool overflowOnly) { mContext = context; mInflater = android.view.LayoutInflater.from(context); mMenu = menu; mOverflowOnly = overflowOnly; android.content.res.Resources res = context.getResources(); mPopupMaxWidth = System.Math.Max(res.getDisplayMetrics().widthPixels / 2, res.getDimensionPixelSize ([email protected]_prefDialogWidth)); mAnchorView = anchorView; menu.addMenuPresenter(this); }
public static AlertDialog createConnectDialog(EditText participantEditText, DialogInterface.OnClickListener callParticipantsClickListener, DialogInterface.OnClickListener cancelClickListener, Context context) { AlertDialog.Builder alertDialogBuilder = new AlertDialog.Builder(context); alertDialogBuilder.Icon = R.drawable.ic_call_black_24dp; alertDialogBuilder.Title = "Connect to a room"; alertDialogBuilder.setPositiveButton("Connect", callParticipantsClickListener); alertDialogBuilder.setNegativeButton("Cancel", cancelClickListener); alertDialogBuilder.Cancelable = false; setRoomNameFieldInDialog(participantEditText, alertDialogBuilder, context); return alertDialogBuilder.create(); }
public ListMenuItemView(android.content.Context context, android.util.AttributeSet attrs, int defStyle) : base(context, attrs) { android.content.res.TypedArray a = context.obtainStyledAttributes(attrs, [email protected] .styleable.MenuView, defStyle, 0); mBackground = a.getDrawable([email protected]_itemBackground ); mTextAppearance = a.getResourceId([email protected]_itemTextAppearance , -1); mPreserveIconSpacing = a.getBoolean([email protected]_preserveIconSpacing , false); mTextAppearanceContext = context; a.recycle(); }
public virtual Typeface getTypeface(Context context) { if (cachedTypeface != null) { return cachedTypeface; } lock (this) { if (cachedTypeface != null) { return cachedTypeface; } cachedTypeface = Typeface.createFromAsset(context.Assets, iconFontDescriptor.ttfFileName()); return cachedTypeface; } }
public override void onReceive(Context context, Intent intent) { /* Handle push message */ string category = intent.getStringExtra("category"); string body = intent.getStringExtra("body"); string type = intent.getStringExtra("type"); if (body == null || type == null) { return; } /* If text then use onDataPushStringReceived function */ bool? result; if (type.Equals("text/plain")) { result = onDataPushStringReceived(context, category, body); } /* If base64 or binary file then use onDataPushBinaryReceived function */ else if (type.Equals("text/base64")) { result = onDataPushBase64Received(context, category, Base64.decode(body, DEFAULT), body); } /* Unknown type */ else { return; } /* Set result if defined */ if (result == null) { return; } int code; if (result.Value) { code = RESULT_OK; } else { code = RESULT_CANCELED; } setResult(code, null, null); }
public IconMenuItemView(android.content.Context context, android.util.AttributeSet attrs, int defStyle) : base(context, attrs) { if (sPrependShortcutLabel == null) { sPrependShortcutLabel = getResources().getString([email protected][email protected]_shortcut_label ); } android.content.res.TypedArray a = context.obtainStyledAttributes(attrs, [email protected] .styleable.MenuView, defStyle, 0); mDisabledAlpha = a.getFloat([email protected]_itemIconDisabledAlpha , 0.8f); mTextAppearance = a.getResourceId([email protected]_itemTextAppearance , -1); mTextAppearanceContext = context; a.recycle(); }
public static void installPackage(android.content.Context arg0, java.io.File arg1) { global::MonoJavaBridge.JNIEnv @__env = global::MonoJavaBridge.JNIEnv.ThreadEnv; @__env.CallStaticVoidMethod(android.os.RecoverySystem.staticClass, global::android.os.RecoverySystem._installPackage6700, global::MonoJavaBridge.JavaBridge.ConvertToValue(arg0), global::MonoJavaBridge.JavaBridge.ConvertToValue(arg1)); }
public SlidingTab(android.content.Context context) : this(context, null) { throw new System.NotImplementedException(); }
public SlidingTab(android.content.Context context, android.util.AttributeSet attrs ) : base(context, attrs) { throw new System.NotImplementedException(); }
public VideoView(android.content.Context arg0) : base(global::MonoJavaBridge.JNIEnv.ThreadEnv) { global::MonoJavaBridge.JNIEnv @__env = global::MonoJavaBridge.JNIEnv.ThreadEnv; global::MonoJavaBridge.JniLocalHandle handle = @__env.NewObject(android.widget.VideoView.staticClass, global::android.widget.VideoView._VideoView12394, global::MonoJavaBridge.JavaBridge.ConvertToValue(arg0)); Init(@__env, handle); }
public TabWidget(android.content.Context context) : this(context, null) { }
public TabWidget(android.content.Context context, android.util.AttributeSet attrs ) : this(context, attrs, [email protected]) { }
public ClipboardManager(android.content.Context context, android.os.Handler handler ) { throw new System.NotImplementedException(); }
public WeightedLinearLayout(android.content.Context context) : base(context) { }
public SuggestionSpan(android.content.Context context, string[] suggestions, int flags) : this(context, null, suggestions, flags, null) { throw new System.NotImplementedException(); }
public SuggestionSpan(android.content.Context context, System.Globalization.CultureInfo locale, string[] suggestions, int flags, System.Type notificationTargetClass) { throw new System.NotImplementedException(); }
private void initStyle(android.content.Context context) { throw new System.NotImplementedException(); }
public static void rebootWipeUserData(android.content.Context arg0) { global::MonoJavaBridge.JNIEnv @__env = global::MonoJavaBridge.JNIEnv.ThreadEnv; @__env.CallStaticVoidMethod(android.os.RecoverySystem.staticClass, global::android.os.RecoverySystem._rebootWipeUserData6701, global::MonoJavaBridge.JavaBridge.ConvertToValue(arg0)); }