public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { if (container == null) { // Currently in a layout without a container, so no reason to create our view. return null; } RelativeLayout view = inflater.Inflate(Resource.Layout.TaskWebView, container, false) as RelativeLayout; view.SetOnTouchListener( this ); WebLayout = new WebLayout( Rock.Mobile.PlatformSpecific.Android.Core.Context ); WebLayout.LayoutParameters = new ViewGroup.LayoutParams( ViewGroup.LayoutParams.MatchParent, ViewGroup.LayoutParams.MatchParent ); WebLayout.SetBackgroundColor( Android.Graphics.Color.Black ); view.AddView( WebLayout ); ResultView = new UIResultView( view, new System.Drawing.RectangleF( 0, 0, NavbarFragment.GetContainerDisplayWidth( ), this.Resources.DisplayMetrics.HeightPixels ), delegate { ResultView.Hide( ); if ( string.IsNullOrEmpty( Url ) == false ) { WebLayout.LoadUrl( Url, PageLoaded ); } } ); return view; }
public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { if (container == null) { // Currently in a layout without a container, so no reason to create our view. return null; } View view = inflater.Inflate(Resource.Layout.Prayer_Post, container, false); view.SetOnTouchListener( this ); view.SetBackgroundColor( Rock.Mobile.UI.Util.GetUIColor( ControlStylingConfig.BackgroundColor ) ); ResultView = new UIResultView( view, new System.Drawing.RectangleF( 0, 0, NavbarFragment.GetContainerDisplayWidth( ), this.Resources.DisplayMetrics.HeightPixels ), delegate { if( Success == true ) { // leave ParentTask.OnClick( this, 0 ); } else { // retry SubmitPrayerRequest( ); } } ); BlockerView = new UIBlockerView( view, new System.Drawing.RectangleF( 0, 0, NavbarFragment.GetContainerDisplayWidth( ), this.Resources.DisplayMetrics.HeightPixels ) ); return view; }
public ItemAdapter(Context context) { inflater = LayoutInflater.from(context); items = new List<SmcItem>(); // dateFormat = new SimpleDateFormat("dd-MM-yyyy"); // lint dateFormat = DateFormat.DateInstance; }
public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { if (container == null) { // Currently in a layout without a container, so no reason to create our view. return null; } JoinGroupView = new UIJoinGroup(); View view = inflater.Inflate(Resource.Layout.JoinGroup, container, false); view.SetOnTouchListener( this ); view.SetBackgroundColor( Rock.Mobile.UI.Util.GetUIColor( ControlStylingConfig.BG_Layer_Color ) ); RelativeLayout backgroundView = view.FindViewById<RelativeLayout>( Resource.Id.view_background ); JoinGroupView.Create( backgroundView, new System.Drawing.RectangleF( 0, 0, NavbarFragment.GetContainerDisplayWidth( ), this.Resources.DisplayMetrics.HeightPixels ) ); // get the native object types so we can hook in necessary support pointers ((View)JoinGroupView.View.PlatformNativeObject).SetOnTouchListener( this ); ((EditText)JoinGroupView.CellPhone.PlatformNativeObject).AddTextChangedListener(new PhoneNumberFormattingTextWatcher()); return view; }
public override View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { // Perform the internal wiring to be able to make use of the BrightcovePlayerFragment. View view = inflater.inflate(R.layout.basic_cast_fragment, container, false); brightcoveVideoView = (BrightcoveVideoView) view.findViewById(R.id.brightcove_video_view); eventEmitter = brightcoveVideoView.EventEmitter; base.onCreateView(inflater, container, savedInstanceState); // Initialize the android_cast_plugin which requires the application id of your Cast // receiver application. string applicationId = Resources.getString([email protected]_id); googleCastComponent = new GoogleCastComponent(eventEmitter, applicationId, Activity); // Initialize the MiniController widget which will allow control of remote media playback. miniController = (MiniController) view.findViewById(R.id.miniController1); IDictionary<string, object> properties = new Dictionary<string, object>(); properties[GoogleCastComponent.CAST_MINICONTROLLER] = miniController; eventEmitter.emit(GoogleCastEventType.SET_MINI_CONTROLLER, properties); // Send the location of the media (url) and its metadata information for remote playback. Resources resources = Resources; string title = resources.getString([email protected]_title); string studio = resources.getString([email protected]_studio); string url = resources.getString([email protected]_url); string thumbnailUrl = resources.getString([email protected]_thumbnail); string imageUrl = resources.getString([email protected]_image); eventEmitter.emit(GoogleCastEventType.SET_MEDIA_METADATA, buildMetadataProperties("subTitle", title, studio, thumbnailUrl, imageUrl, url)); brightcoveVideoView.VideoPath = url; return view; }
public override View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { View rootView = inflater.inflate(R.layout.fragment_async_query, container, false); rootView.findViewById(R.id.translate_button).OnClickListener = this; ListView listView = (ListView) rootView.findViewById(android.R.id.list); dotAdapter = new DotAdapter(Activity); listView.Adapter = dotAdapter; return rootView; }
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes: //ORIGINAL LINE: @Override public android.view.View onCreateView(android.view.LayoutInflater inflater, @Nullable android.view.ViewGroup container, @Nullable android.os.Bundle savedInstanceState) public override View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { View view = inflater.inflate(R.layout.fragment_device_category_list, container, false); IList<IDictionary<string, string>> groupData = new List<IDictionary<string, string>>(); IList<IList<IDictionary<string, string>>> childData = new List<IList<IDictionary<string, string>>>(); string[] deviceCategory = Resources.getStringArray(R.array.device_categories); string[] posPrinterChildren = Resources.getStringArray(R.array.pos_printer_children); for (int i = 0; i < deviceCategory.Length; i++) { IDictionary<string, string> groupMap = new Dictionary<string, string>(); groupData.Add(groupMap); groupMap[KEY_TITLE] = deviceCategory[i]; groupMap[KEY_SUBTITLE] = ""; if (deviceCategory[i].Equals(getString([email protected]_printer))) { IList<IDictionary<string, string>> children = new List<IDictionary<string, string>>(); for (int j = 0; j < posPrinterChildren.Length; j++) { IDictionary<string, string> childMap = new Dictionary<string, string>(); children.Add(childMap); childMap[KEY_TITLE] = posPrinterChildren[j]; childMap[KEY_SUBTITLE] = ""; } childData.Add(children); } else { IList<IDictionary<string, string>> children = new List<IDictionary<string, string>>(); childData.Add(children); } } string[] from = new string[] {KEY_TITLE, KEY_SUBTITLE}; int[] to = new int[] {android.R.id.text1, android.R.id.text2}; ExpandableListAdapter adapter = new SimpleExpandableListAdapter(Activity, groupData, android.R.layout.simple_expandable_list_item_1, from, to, childData, android.R.layout.simple_expandable_list_item_2, from, to); expandableListView = (ExpandableListView) view; expandableListView.OnGroupClickListener = this; expandableListView.OnChildClickListener = this; expandableListView.Adapter = adapter; return view; }
public override void onCreate(Bundle savedInstanceState) { base.onCreate(savedInstanceState); ContentView = R.layout.activity_main; List<string> list = new List<string>(); for (int i = 0; i < ITEMS.Length; i++) { list.Add(ITEMS[i]); } ArrayAdapter<string> adapter = new ArrayAdapter<string>(this, android.R.layout.simple_list_item_1, list); mListView = (ListView) findViewById(android.R.id.list); mListView.Adapter = adapter; mListView.Enabled = false; mLayoutInflater = (LayoutInflater) getSystemService(LAYOUT_INFLATER_SERVICE); }
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes: //ORIGINAL LINE: @Override public android.view.View onCreateView(android.view.LayoutInflater inflater, @Nullable android.view.ViewGroup container, @Nullable android.os.Bundle savedInstanceState) public override View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { View view = inflater.inflate(R.layout.fragment_pos_printer_bitmap, container, false); bitmapPathTextView = (TextView) view.findViewById(R.id.textViewBitmapPath); widthEditText = (EditText) view.findViewById(R.id.editTextWidth); alignmentSpinner = (Spinner) view.findViewById(R.id.spinnerAlignment); view.findViewById(R.id.buttonGallery).OnClickListener = this; view.findViewById(R.id.buttonPrintBitmap).OnClickListener = this; deviceMessagesTextView = (TextView) view.findViewById(R.id.textViewDeviceMessages); deviceMessagesTextView.MovementMethod = new ScrollingMovementMethod(); deviceMessagesTextView.VerticalScrollBarEnabled = true; brightnessTextView = (TextView) view.findViewById(R.id.textViewBrightness); brightnessSeekBar = (SeekBar) view.findViewById(R.id.seekBarBrightness); brightnessSeekBar.OnSeekBarChangeListener = this; return view; }
public override View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { View rootView = inflater.inflate(R.layout.textchat_fragment_layout, container, false); mListView = (ListView) rootView.findViewById(R.id.msgs_list); mSendButton = (Button) rootView.findViewById(R.id.send_button); mMsgCharsView = (TextView) rootView.findViewById(R.id.characteres_msg); mMsgCharsView.Text = maxTextLength.ToString(); mMsgNotificationView = (TextView) rootView.findViewById(R.id.new_msg_notification); mMsgEditText = (EditText) rootView.findViewById(R.id.edit_msg); mMsgDividerView = (View) rootView.findViewById(R.id.divider_notification); mMsgEditText.addTextChangedListener(mTextEditorWatcher); mSendButton.OnClickListener = new OnClickListenerAnonymousInnerClassHelper(this); mMessageAdapter = new MessageAdapter(Activity, R.layout.sent_msg_row_layout, mMsgsList); mListView.Adapter = mMessageAdapter; mMsgNotificationView.OnTouchListener = new OnTouchListenerAnonymousInnerClassHelper(this); return rootView; }
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes: //ORIGINAL LINE: @Override public android.view.View onCreateView(android.view.LayoutInflater inflater, @Nullable android.view.ViewGroup container, @Nullable android.os.Bundle savedInstanceState) public override View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { View view = inflater.inflate(R.layout.fragment_msr, container, false); SharedPreferences settings = Activity.getSharedPreferences(MainActivity.PREFS_NAME, Context.MODE_PRIVATE); logicalNameEditText = (EditText) view.findViewById(R.id.editTextLogicalName); logicalNameEditText.Text = settings.getString(MainActivity.KEY_LOGICAL_NAME_MSR, getString([email protected])); view.findViewById(R.id.buttonOpen).OnClickListener = this; view.findViewById(R.id.buttonClaim).OnClickListener = this; view.findViewById(R.id.buttonRelease).OnClickListener = this; view.findViewById(R.id.buttonClose).OnClickListener = this; view.findViewById(R.id.buttonInfo).OnClickListener = this; view.findViewById(R.id.buttonCheckHealth).OnClickListener = this; view.findViewById(R.id.buttonClearFields).OnClickListener = this; view.findViewById(R.id.buttonRefreshFields).OnClickListener = this; deviceEnabledCheckBox = (CheckBox) view.findViewById(R.id.checkBoxDeviceEnabled); deviceEnabledCheckBox.OnCheckedChangeListener = this; autoDisableCheckBox = (CheckBox) view.findViewById(R.id.checkBoxAutoDisable); autoDisableCheckBox.OnCheckedChangeListener = this; dataEventEnabledCheckBox = (CheckBox) view.findViewById(R.id.checkBoxDataEventEnabled); dataEventEnabledCheckBox.OnCheckedChangeListener = this; RadioGroup radioGroup = (RadioGroup) view.findViewById(R.id.radioGroupDataEncryptionAlgorithm); radioGroup.OnCheckedChangeListener = this; track1DataLengthTextView = (TextView) view.findViewById(R.id.textViewTrack1DataLength); track1DataTextView = (TextView) view.findViewById(R.id.textViewTrack1Data); track2DataLengthTextView = (TextView) view.findViewById(R.id.textViewTrack2DataLength); track2DataTextView = (TextView) view.findViewById(R.id.textViewTrack2Data); track3DataLengthTextView = (TextView) view.findViewById(R.id.textViewTrack3DataLength); track3DataTextView = (TextView) view.findViewById(R.id.textViewTrack3Data); stateTextView = (TextView) view.findViewById(R.id.textViewState); return view; }
public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { return(base.OnCreateView(inflater, container, savedInstanceState)); }
public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { return(inflater.Inflate(Resource.Layout.fragment_card_back, container, false)); }
void ShowImage(Context context, Android.Graphics.Drawables.Drawable image, string status = null, MaskType maskType = MaskType.Black, TimeSpan?timeout = null, Action clickCallback = null, Action cancelCallback = null) { if (timeout == null) { timeout = TimeSpan.Zero; } if (CurrentDialog != null && imageView == null) { DismissCurrent(context); } lock (dialogLock) { if (CurrentDialog == null) { SetupDialog(context, maskType, cancelCallback, (a, d, m) => { var inflater = LayoutInflater.FromContext(context); var view = inflater.Inflate(Resource.Layout.loadingimage, null); if (clickCallback != null) { view.Click += (sender, e) => clickCallback(); } imageView = view.FindViewById <ImageView>(Resource.Id.loadingImage); statusText = view.FindViewById <TextView>(Resource.Id.textViewStatus); if (maskType != MaskType.Black) { view.SetBackgroundResource(Resource.Drawable.roundedbgdark); } imageView.SetImageDrawable(image); if (statusText != null) { statusText.Text = status ?? ""; statusText.Visibility = string.IsNullOrEmpty(status) ? ViewStates.Gone : ViewStates.Visible; } return(view); }); if (timeout > TimeSpan.Zero) { Task.Factory.StartNew(() => { if (!waitDismiss.WaitOne(timeout.Value)) { DismissCurrent(context); } }).ContinueWith(ct => { var ex = ct.Exception; if (ex != null) { Android.Util.Log.Error("AndHUD", ex.ToString()); } }, TaskContinuationOptions.OnlyOnFaulted); } } else { Application.SynchronizationContext.Send(state => { imageView.SetImageDrawable(image); statusText.Text = status ?? ""; }, null); } } }
public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { if (container == null) { // Currently in a layout without a container, so no reason to create our view. return(null); } Point displaySize = new Point( ); Activity.WindowManager.DefaultDisplay.GetSize(displaySize); ScreenSize = new System.Drawing.SizeF(displaySize.X, displaySize.Y); // scale the image to match the view's width ScreenToImageScalar = (float)SourceImage.Width / (float)ScreenSize.Width; // get the scaled dimensions, maintaining aspect ratio float scaledWidth = (float)SourceImage.Width * (1.0f / ScreenToImageScalar); float scaledHeight = (float)SourceImage.Height * (1.0f / ScreenToImageScalar); // now, if the scaled height is too large, re-calc with Height is the dominant, // so we guarantee a fit within the view. if (scaledHeight > ScreenSize.Height) { ScreenToImageScalar = (float)SourceImage.Height / (float)ScreenSize.Height; scaledWidth = (float)SourceImage.Width * (1.0f / ScreenToImageScalar); scaledHeight = (float)SourceImage.Height * (1.0f / ScreenToImageScalar); } ScaledSourceImage = Bitmap.CreateScaledBitmap(SourceImage, (int)scaledWidth, (int)scaledHeight, false); // setup our layout for touch input RelativeLayout view = inflater.Inflate(Resource.Layout.ImageCrop, container, false) as RelativeLayout; view.SetOnTouchListener(this); // create the view that will display the image to crop ImageView = new AspectScaledImageView(Rock.Mobile.PlatformSpecific.Android.Core.Context); ImageView.LayoutParameters = new RelativeLayout.LayoutParams(ViewGroup.LayoutParams.WrapContent, ViewGroup.LayoutParams.WrapContent); ImageView.LayoutParameters.Width = ScaledSourceImage.Width; ImageView.LayoutParameters.Height = ScaledSourceImage.Height; // center the image ImageView.SetX((ScreenSize.Width - ImageView.LayoutParameters.Width) / 2); ImageView.SetY((ScreenSize.Height - ImageView.LayoutParameters.Height) / 2); view.AddView(ImageView); // create the draggable crop view that will let the user pic which part of the image to use. CropView = new View(Rock.Mobile.PlatformSpecific.Android.Core.Context); CropView.LayoutParameters = new LinearLayout.LayoutParams(ViewGroup.LayoutParams.WrapContent, ViewGroup.LayoutParams.WrapContent); // the crop view's dimensions should be based on what the user wanted to crop to. We'll do width, and then height as a scale of width. CropView.LayoutParameters.Width = (int)(scaledWidth < scaledHeight ? scaledWidth : scaledHeight); CropView.LayoutParameters.Height = (int)((float)CropView.LayoutParameters.Width * CropAspectRatio); // the crop view should be a nice outlined rounded rect float _Radius = 3.0f; RoundRectShape rectShape = new RoundRectShape(new float[] { _Radius, _Radius, _Radius, _Radius, _Radius, _Radius, _Radius, _Radius }, null, null); // configure its paint ShapeDrawable border = new ShapeDrawable(rectShape); border.Paint.SetStyle(Paint.Style.Stroke); border.Paint.StrokeWidth = 8; border.Paint.Color = Color.WhiteSmoke; CropView.Background = border; // set our clamp values CropViewMinPos = new PointF((ScreenSize.Width - scaledWidth) / 2, (ScreenSize.Height - scaledHeight) / 2); CropViewMaxPos = new PointF(CropViewMinPos.X + (scaledWidth - CropView.LayoutParameters.Width), CropViewMinPos.Y + (scaledHeight - CropView.LayoutParameters.Height)); view.AddView(CropView); // create a mask layer that will block out the parts of the image that will be cropped MaskLayer = new Rock.Mobile.PlatformSpecific.Android.Graphics.MaskLayer((int)ScreenSize.Width, (int)ScreenSize.Height, CropView.LayoutParameters.Width, CropView.LayoutParameters.Height, Rock.Mobile.PlatformSpecific.Android.Core.Context); MaskLayer.LayoutParameters = new RelativeLayout.LayoutParams((int)ScreenSize.Width, (int)ScreenSize.Height); MaskLayer.Opacity = 0.00f; view.AddView(MaskLayer); // Now setup our bottom area with cancel, crop, and text to explain RelativeLayout bottomBarLayout = new RelativeLayout(Rock.Mobile.PlatformSpecific.Android.Core.Context); bottomBarLayout.LayoutParameters = new RelativeLayout.LayoutParams(ViewGroup.LayoutParams.MatchParent, ViewGroup.LayoutParams.WrapContent); ((RelativeLayout.LayoutParams)bottomBarLayout.LayoutParameters).AddRule(LayoutRules.AlignParentBottom); // set the nav subBar color (including opacity) Color navColor = Rock.Mobile.UI.Util.GetUIColor(PrivateSubNavToolbarConfig.BackgroundColor); navColor.A = (Byte)((float)navColor.A * PrivateSubNavToolbarConfig.Opacity); bottomBarLayout.SetBackgroundColor(navColor); view.AddView(bottomBarLayout); // setup the cancel button (which will undo cropping or take you back to the picture taker) CancelButton = new Button(Rock.Mobile.PlatformSpecific.Android.Core.Context); CancelButton.LayoutParameters = new RelativeLayout.LayoutParams(ViewGroup.LayoutParams.WrapContent, ViewGroup.LayoutParams.WrapContent); CancelButton.Gravity = GravityFlags.Left; ((RelativeLayout.LayoutParams)CancelButton.LayoutParameters).AddRule(LayoutRules.AlignParentLeft); // set the crop button's font Android.Graphics.Typeface fontFace = Rock.Mobile.PlatformSpecific.Android.Graphics.FontManager.Instance.GetFont(PrivateControlStylingConfig.Icon_Font_Secondary); CancelButton.SetTypeface(fontFace, Android.Graphics.TypefaceStyle.Normal); CancelButton.SetTextSize(Android.Util.ComplexUnitType.Dip, PrivateImageCropConfig.CropCancelButton_Size); CancelButton.Text = PrivateImageCropConfig.CropCancelButton_Text; CancelButton.Click += (object sender, EventArgs e) => { // don't allow button presses while animations are going on if (Animating == false) { // if they hit cancel while previewing, go back to editing if (Mode == CropMode.Previewing) { SetMode(CropMode.Editing); } else { // they pressed it while they're in editing mode, so go back to camera mode Activity.OnBackPressed( ); } } }; bottomBarLayout.AddView(CancelButton); // setup the Confirm button, which will use a font to display its graphic ConfirmButton = new Button(Rock.Mobile.PlatformSpecific.Android.Core.Context); ConfirmButton.LayoutParameters = new RelativeLayout.LayoutParams(ViewGroup.LayoutParams.WrapContent, ViewGroup.LayoutParams.WrapContent); ConfirmButton.Gravity = GravityFlags.Right; ((RelativeLayout.LayoutParams)ConfirmButton.LayoutParameters).AddRule(LayoutRules.AlignParentRight); // set the crop button's font fontFace = Rock.Mobile.PlatformSpecific.Android.Graphics.FontManager.Instance.GetFont(PrivateControlStylingConfig.Icon_Font_Secondary); ConfirmButton.SetTypeface(fontFace, Android.Graphics.TypefaceStyle.Normal); ConfirmButton.SetTextSize(Android.Util.ComplexUnitType.Dip, PrivateImageCropConfig.CropOkButton_Size); ConfirmButton.Text = PrivateImageCropConfig.CropOkButton_Text; // when clicked, we should crop the image. ConfirmButton.Click += (object sender, EventArgs e) => { // don't allow button presses while animations are going on if (Animating == false) { // if they pressed confirm while editing, go to preview if (Mode == CropMode.Editing) { SetMode(CropMode.Previewing); } else { // notify the caller SpringboardParent.ModalFragmentDone(CroppedImage); } } }; bottomBarLayout.AddView(ConfirmButton); // start in editing mode (obviously) SetMode(CropMode.Editing); // start the cropper centered MoveCropView(new PointF((ScreenSize.Width - CropView.LayoutParameters.Width) / 2, (ScreenSize.Height - CropView.LayoutParameters.Height) / 2)); MaskLayer.Position = new PointF(CropView.GetX( ), CropView.GetY( )); return(view); }
public AppAdapter(Context context, int textViewResourceId, IList <ActivityInfo> objects) : base(context, textViewResourceId, objects) { MInflater = LayoutInflater.From(context); MPackageManager = context.PackageManager; MTextViewResourceId = textViewResourceId; }
public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { if (container == null) { // Currently in a layout without a container, so no reason to create our view. return null; } View view = inflater.Inflate(Resource.Layout.Connect_Primary, container, false); view.SetOnTouchListener( this ); LinkEntries = ConnectLink.BuildList( ); // insert group finder into the beginning of the list so it's always the first entry ConnectLink groupFinderLink = new ConnectLink( ); groupFinderLink.Title = ConnectStrings.Main_Connect_GroupFinder; groupFinderLink.ImageName = PrivateConnectConfig.GroupFinder_IconImage; LinkEntries.Insert( 0, groupFinderLink ); LinkBillboards = new Bitmap[ LinkEntries.Count ]; ListView = view.FindViewById<ListView>( Resource.Id.connect_primary_list ); ListView.ItemClick += (object sender, AdapterView.ItemClickEventArgs e ) => { // ignore clicks to the top banner if( e.Position > 0 ) { if( e.Position == 1 ) { ParentTask.OnClick( this, 0 ); } else { // if they clicked a non-groupfinder row, get the link they want to visit ParentTask.OnClick( this, e.Position - 1, LinkEntries[ e.Position - 1 ].Url ); } } }; ListView.SetOnTouchListener( this ); ListView.Adapter = new ArrayAdapter( this ); if ( ParentTask.TaskReadyForFragmentDisplay == true ) { SetupDisplay( view ); } return view; }
public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { if (container == null) { // Currently in a layout without a container, so no reason to create our view. return null; } RelativeLayout view = new RelativeLayout( Rock.Mobile.PlatformSpecific.Android.Core.Context ); view.LayoutParameters = new RelativeLayout.LayoutParams( ViewGroup.LayoutParams.MatchParent, ViewGroup.LayoutParams.MatchParent ); view.SetBackgroundColor( Android.Graphics.Color.Black ); view.SetOnTouchListener( this ); ProgressBar = new ProgressBar( Rock.Mobile.PlatformSpecific.Android.Core.Context ); ProgressBar.Indeterminate = true; ProgressBar.SetBackgroundColor( Rock.Mobile.UI.Util.GetUIColor( 0 ) ); ProgressBar.LayoutParameters = new RelativeLayout.LayoutParams( ViewGroup.LayoutParams.WrapContent, ViewGroup.LayoutParams.WrapContent ); ( (RelativeLayout.LayoutParams)ProgressBar.LayoutParameters ).AddRule( LayoutRules.CenterInParent ); view.AddView( ProgressBar ); // setup our media controller for viewing the position of media MediaController = new MediaController( Rock.Mobile.PlatformSpecific.Android.Core.Context ); MediaController.SetAnchorView( view ); MediaController.SetMediaPlayer( this ); ResultView = new UIResultView( view, new System.Drawing.RectangleF( 0, 0, NavbarFragment.GetFullDisplayWidth( ), this.Resources.DisplayMetrics.HeightPixels ), delegate { // we know we're bound, so now just retry. ResultView.Hide( ); PlayerState = MediaPlayerState.Preparing; StartAudio( ); SyncUI( ); }); return view; }
public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { View view = inflater.Inflate(GetLayoutResourceId, container, false); return(view); }
private static View CreateViewFrom(ViewGroup parent) { var ret = LayoutInflater.From(parent.Context).Inflate(Resource.Layout.view_holder_grid_gauge_device_sensor, parent, false); return(ret); }
public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { var ignored = base.OnCreateView(inflater, container, savedInstanceState); return(this.BindingInflate(Resource.Layout.game_inventory, null)); }
public Adapter(Context context) { inflater = (LayoutInflater)context.GetSystemService(Context.LayoutInflaterService); }
public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { View view = inflater.Inflate(Resource.Layout.Fragment2, container, false); db = new Database(); db.CreateDatabase(); string folder = System.Environment.GetFolderPath(System.Environment.SpecialFolder.Personal); Log.Info("DB_PATH", folder); lstData = FindViewById <ListView>(Resource.Id.listView); var edtName = FindViewById <EditText>(Resource.Id.edtName); var edtAddress = FindViewById <EditText>(Resource.Id.edtAddress); var edtCapacity = FindViewById <EditText>(Resource.Id.edtCapacity); var edtAvailability = FindViewById <EditText>(Resource.Id.edtAvailability); var edtState = FindViewById <EditText>(Resource.Id.edtState); var btnAdd = FindViewById <Button>(Resource.Id.btnAdd); var btnEdit = FindViewById <Button>(Resource.Id.btnEdit); var btnDelete = FindViewById <Button>(Resource.Id.btnDelete); LoadData(); //Event btnAdd.Click += delegate { Station station = new Station() { Name = edtName.Text, Address = edtAddress.Text, Capacity = int.Parse(edtCapacity.Text), Availability = int.Parse(edtAvailability.Text), State = edtState.Text }; db.InsertIntoTableStation(station); LoadData(); }; btnEdit.Click += delegate { Station station = new Station() { Id = int.Parse(edtName.Tag.ToString()), Name = edtName.Text, Address = edtAddress.Text, Capacity = int.Parse(edtCapacity.Text), Availability = int.Parse(edtAvailability.Text), State = edtState.Text }; db.UpdateTableStation(station); LoadData(); }; btnDelete.Click += delegate { Station station = new Station() { Id = int.Parse(edtName.Tag.ToString()), Name = edtName.Text, Address = edtAddress.Text, Capacity = int.Parse(edtCapacity.Text), Availability = int.Parse(edtAvailability.Text), State = edtState.Text }; db.DeleteTableStation(station); LoadData(); }; lstData.ItemClick += (s, e) => { //Binding Data var txtName = e.View.FindViewById <TextView>(Resource.Id.textView1); var txtAddress = e.View.FindViewById <TextView>(Resource.Id.textView2); var txtCapacity = e.View.FindViewById <TextView>(Resource.Id.textView3); var txtAvailability = e.View.FindViewById <TextView>(Resource.Id.textView4); var txtState = e.View.FindViewById <TextView>(Resource.Id.textView5); edtName.Text = txtName.Text; edtName.Tag = e.Id; edtAddress.Text = txtAddress.Text; edtCapacity.Text = txtCapacity.Text; edtAvailability.Text = txtAvailability.Text; edtState.Text = txtState.Text; }; return(view); }
public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { var theView = inflater.Inflate(Resource.Layout.StructurePopLayout, container, false); return(theView); }
public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { if (container == null) { // Currently in a layout without a container, so no reason to create our view. return null; } View view = inflater.Inflate(Resource.Layout.Notes_Details, container, false); view.SetOnTouchListener( this ); // setup our message list view MessagesListView = view.FindViewById<ListView>( Resource.Id.notes_details_list ); MessagesListView.SetOnTouchListener( this ); MessagesListView.Divider = null; // load the placeholder and series image SeriesBillboard = null; bool imageExists = TryLoadBanner( NotesTask.FormatBillboardImageName( Series.Name ) ); if ( imageExists == false ) { // use the placeholder and request the image download FileCache.Instance.DownloadFileToCache( Series.BillboardUrl, NotesTask.FormatBillboardImageName( Series.Name ), delegate { TryLoadBanner( NotesTask.FormatBillboardImageName( Series.Name ) ); } ); AsyncLoader.LoadImage( PrivateNoteConfig.NotesMainPlaceholder, true, false, delegate( Bitmap imageBmp ) { if ( FragmentActive == true ) { PlaceholderImage = imageBmp; RefreshList( ); return true; } return false; } ); } return view; }
public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { // Use this to return your custom view for this Fragment return(inflater.Inflate(Resource.Layout.fragment_notifications, container, false)); }
public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { if (container == null) { // Currently in a layout without a container, so no reason to create our view. return null; } View view = inflater.Inflate(Resource.Layout.Prayer_Create, container, false); view.SetOnTouchListener( this ); view.SetBackgroundColor( Rock.Mobile.UI.Util.GetUIColor( ControlStylingConfig.BackgroundColor ) ); // setup the first name background FirstNameBGLayer = view.FindViewById<RelativeLayout>( Resource.Id.first_name_background ); ControlStyling.StyleBGLayer( FirstNameBGLayer ); // LastNameBGLayer = view.FindViewById<RelativeLayout>( Resource.Id.last_name_background ); ControlStyling.StyleBGLayer( LastNameBGLayer ); // setup the prayer request background RequestBGLayer = view.FindViewById<RelativeLayout>( Resource.Id.prayerRequest_background ); ControlStyling.StyleBGLayer( RequestBGLayer ); // // setup the switch background RelativeLayout backgroundLayout = view.FindViewById<RelativeLayout>( Resource.Id.switch_background ); ControlStyling.StyleBGLayer( backgroundLayout ); // setup the category background backgroundLayout = view.FindViewById<RelativeLayout>( Resource.Id.spinner_background ); ControlStyling.StyleBGLayer( backgroundLayout ); // setup the text views FirstNameText = (EditText)view.FindViewById<EditText>( Resource.Id.prayer_create_firstNameText ); ControlStyling.StyleTextField( FirstNameText, PrayerStrings.CreatePrayer_FirstNamePlaceholderText, ControlStylingConfig.Font_Regular, ControlStylingConfig.Medium_FontSize ); FirstNameBGColor = ControlStylingConfig.BG_Layer_Color; FirstNameText.InputType |= Android.Text.InputTypes.TextFlagCapWords; LastNameText = (EditText)view.FindViewById<EditText>( Resource.Id.prayer_create_lastNameText ); ControlStyling.StyleTextField( LastNameText, PrayerStrings.CreatePrayer_LastNamePlaceholderText, ControlStylingConfig.Font_Regular, ControlStylingConfig.Medium_FontSize ); LastNameBGColor = ControlStylingConfig.BG_Layer_Color; LastNameText.InputType |= Android.Text.InputTypes.TextFlagCapWords; RequestText = (EditText)view.FindViewById<EditText>( Resource.Id.prayer_create_requestText ); ControlStyling.StyleTextField( RequestText, PrayerStrings.CreatePrayer_PrayerRequest, ControlStylingConfig.Font_Regular, ControlStylingConfig.Medium_FontSize ); RequestBGColor = ControlStylingConfig.BG_Layer_Color; RequestText.InputType |= Android.Text.InputTypes.TextFlagCapSentences; AnonymousSwitch = (Switch)view.FindViewById<Switch>( Resource.Id.postAnonymousSwitch ); AnonymousSwitch.Checked = false; AnonymousSwitch.CheckedChange += (object sender, CompoundButton.CheckedChangeEventArgs e ) => { if( AnonymousSwitch.Checked == false ) { FirstNameText.Enabled = true; LastNameText.Enabled = true; FirstNameText.SetTextColor( Rock.Mobile.UI.Util.GetUIColor( ControlStylingConfig.TextField_ActiveTextColor ) ); LastNameText.SetTextColor( Rock.Mobile.UI.Util.GetUIColor( ControlStylingConfig.TextField_ActiveTextColor ) ); } else { FirstNameText.Enabled = false; LastNameText.Enabled = false; FirstNameText.SetTextColor( Android.Graphics.Color.DimGray ); LastNameText.SetTextColor( Android.Graphics.Color.DimGray ); } }; PublicSwitch = (Switch)view.FindViewById<Switch>( Resource.Id.makePublicSwitch ); PublicSwitch.Checked = true; TextView postAnonymousLabel = view.FindViewById<TextView>( Resource.Id.postAnonymous ); ControlStyling.StyleUILabel( postAnonymousLabel, ControlStylingConfig.Font_Regular, ControlStylingConfig.Medium_FontSize ); TextView publicLabel = view.FindViewById<TextView>( Resource.Id.makePublic ); ControlStyling.StyleUILabel( publicLabel, ControlStylingConfig.Font_Regular, ControlStylingConfig.Medium_FontSize ); // setup our category spinner Spinner = (Spinner)view.FindViewById<Spinner>( Resource.Id.categorySpinner ); ArrayAdapter adapter = new SpinnerArrayAdapter( Rock.Mobile.PlatformSpecific.Android.Core.Context, Android.Resource.Layout.SimpleListItem1 ); adapter.SetDropDownViewResource( Android.Resource.Layout.SimpleSpinnerDropDownItem ); Spinner.Adapter = adapter; // populate the category foreach ( Rock.Client.Category category in App.Shared.Network.RockGeneralData.Instance.Data.PrayerCategories ) { adapter.Add( category.Name ); } Button submitButton = (Button)view.FindViewById<Button>( Resource.Id.prayer_create_submitButton ); ControlStyling.StyleButton( submitButton, PrayerStrings.CreatePrayer_SubmitButtonText, ControlStylingConfig.Font_Regular, ControlStylingConfig.Small_FontSize ); submitButton.Click += (object sender, EventArgs e ) => { SubmitPrayerRequest( ); }; return view; }
public ImagesViewAdapter(Context context, List <Bitmap> list) : base(list) { Context = context; inflater = LayoutInflater.From(Context); bitmapList = list; }
internal DotAdapter(Context context) { this.inflater = LayoutInflater.from(context); }
public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { var v = inflater.Inflate(Resource.Layout.Tablayout3, container, false); return(v); }
public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { startDay = new DateTime(dateTime.Year, dateTime.Month, dateTime.Day, 0, 0, 0); endDay = new DateTime(dateTime.Year, dateTime.Month, dateTime.Day, 23, 59, 59); View view = inflater.Inflate(Resource.Layout.AddMedicineTherapy, container, false); pillTimes.Clear(); medicineName = view.FindViewById <EditText>(Resource.Id.medicineName); medicineCount = view.FindViewById <EditText>(Resource.Id.medicineCount); //times list pillTimes.Add(new DateTime(2000, 12, 12, 8, 0, 0)); pillTimes.Add(new DateTime(2000, 12, 12, 15, 0, 0)); pillTimes.Add(new DateTime(2000, 12, 12, 22, 0, 0)); pillTimesListView = view.FindViewById <ListView>(Resource.Id.listViewMedicine); pillTimesListView.FastScrollEnabled = true; timeListAdapter = new ListViewTimeAdapter(this.Activity, pillTimes); pillTimesListView.Adapter = timeListAdapter; pillTimesListView.ItemClick += PillTimesListView_ItemClick; //setting pill frequency per day seekbarFrequency = view.FindViewById <SeekBar>(Resource.Id.medicineFrequency); TextView labelFrequency = view.FindViewById <TextView>(Resource.Id.labelFrequency); seekbarFrequency.Progress = 3; labelFrequency.Text = $"Ile razy dziennie: {seekbarFrequency.Progress}"; seekbarFrequency.ProgressChanged += (s, e) => { if (e.Progress < 1) { seekbarFrequency.Progress = 1; } labelFrequency.Text = $"Ile razy dziennie: {seekbarFrequency.Progress}"; pillTimes.Clear(); int delay = 0; if (seekbarFrequency.Progress == 2) { delay = 720; } if (seekbarFrequency.Progress > 2) { delay = 840 / (seekbarFrequency.Progress - 1); } for (int i = 0; i < seekbarFrequency.Progress; i++) { pillTimes.Add(new DateTime(2000, 12, 12, 8, 0, 0).AddMinutes(delay * i)); } timeListAdapter.NotifyDataSetChanged(); }; //start date choosing startDate = view.FindViewById <TextView>(Resource.Id.medicineStartDate); startDate.Click += DateSelect_OnClick; startDate.TextChanged += (s, e) => { startDay = new DateTime(dateTime.Year, dateTime.Month, dateTime.Day, 0, 0, 0); }; //end date choosing endDate = view.FindViewById <TextView>(Resource.Id.medicineEndDate); endDate.Click += DateSelect_OnClick; endDate.TextChanged += (s, e) => { endDay = new DateTime(dateTime.Year, dateTime.Month, dateTime.Day, 23, 59, 59); }; //repeat days choosing Monday = view.FindViewById <TextView>(Resource.Id.labelMedicineMonday); Monday.Selected = true; Monday.Click += ChangeDayStatus; Tuesday = view.FindViewById <TextView>(Resource.Id.labelMedicineTuesday); Tuesday.Selected = true; Tuesday.Click += ChangeDayStatus; Wednesday = view.FindViewById <TextView>(Resource.Id.labelMedicineWednesday); Wednesday.Selected = true; Wednesday.Click += ChangeDayStatus; Thursday = view.FindViewById <TextView>(Resource.Id.labelMedicineThursday); Thursday.Selected = true; Thursday.Click += ChangeDayStatus; Friday = view.FindViewById <TextView>(Resource.Id.labelMedicineFriday); Friday.Selected = true; Friday.Click += ChangeDayStatus; Saturday = view.FindViewById <TextView>(Resource.Id.labelMedicineSaturday); Saturday.Selected = true; Saturday.Click += ChangeDayStatus; Sunday = view.FindViewById <TextView>(Resource.Id.labelMedicineSunday); Sunday.Selected = true; Sunday.Click += ChangeDayStatus; //add button Button buttonAdd = view.FindViewById <Button>(Resource.Id.buttonAdd); buttonAdd.Click += AddMedicineTherapy; Button buttonCancel = view.FindViewById <Button>(Resource.Id.buttonCancel); buttonCancel.Click += (s, e) => { var trans = FragmentManager.BeginTransaction(); trans.Replace(Resource.Id.fragmentContainer, visitListFragment); //trans.AddToBackStack(null); trans.Commit(); }; return(view); }
public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { // Seleccionamos el layout de nuestro Fragmento return(inflater.Inflate(Resource.Layout.guiaFragment, container, false)); }
public ComponentResolver(Context context) { Inflater = (LayoutInflater)context.GetSystemService(Context.LayoutInflaterService); }
public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { View rootView = inflater.Inflate(Resource.Layout.fragment_selectable_nodes, null, false); ViewGroup containerView = rootView.FindViewById <ViewGroup>(Resource.Id.container); rootView.FindViewById(Resource.Id.btn_toggleSelection).Click += (sender, e) => { selectionModeEnabled = !selectionModeEnabled; tView.SelectionModeEnabled = selectionModeEnabled; }; rootView.FindViewById(Resource.Id.btn_selectAll).Click += (sender, e) => { if (!selectionModeEnabled) { Toast.MakeText(Activity, "Enable selection mode first", ToastLength.Short).Show(); } tView.SelectAll(true); }; rootView.FindViewById(Resource.Id.btn_deselectAll).Click += (sender, e) => { if (!selectionModeEnabled) { Toast.MakeText(Activity, "Enable selection mode first", ToastLength.Short).Show(); } tView.DeselectAll(); }; rootView.FindViewById(Resource.Id.btn_checkSelection).Click += (sender, e) => { if (!selectionModeEnabled) { Toast.MakeText(Activity, "Enable selection mode first", ToastLength.Short).Show(); } else { Toast.MakeText(Activity, tView.Selected.Count() + " selected", ToastLength.Short).Show(); } }; TreeNode root = TreeNode.InvokeRoot(); TreeNode s1 = new TreeNode(new IconTreeItem(Resource.String.ic_sd_storage, "Storage1")).SetViewHolder(new ProfileHolder(Activity)); TreeNode s2 = new TreeNode(new IconTreeItem(Resource.String.ic_sd_storage, "Storage2")).SetViewHolder(new ProfileHolder(Activity)); s1.Selectable = false; s2.Selectable = false; TreeNode folder1 = new TreeNode(new IconTreeItem(Resource.String.ic_folder, "Folder 1")).SetViewHolder(new SelectableHeaderHolder(Activity)); TreeNode folder2 = new TreeNode(new IconTreeItem(Resource.String.ic_folder, "Folder 2")).SetViewHolder(new SelectableHeaderHolder(Activity)); TreeNode folder3 = new TreeNode(new IconTreeItem(Resource.String.ic_folder, "Folder 3")).SetViewHolder(new SelectableHeaderHolder(Activity)); fillFolder(folder1); fillFolder(folder2); fillFolder(folder3); s1.AddChildren(folder1, folder2); s2.AddChildren(folder3); root.AddChildren(s1, s2); tView = new AndroidTreeView(Activity, root); tView.SetDefaultAnimation(true); containerView.AddView(tView.View); if (savedInstanceState != null) { string state = savedInstanceState.GetString("tState"); if (!string.IsNullOrEmpty(state)) { tView.RestoreState(state); } } return(rootView); }
protected virtual void LoadView(IShellContext shellContext) { Profile.FrameBegin(); var context = shellContext.AndroidContext; // Android designer can't load fragments or resources from layouts if (context.IsDesignerContext()) { _rootView = new FrameLayout(context); return; } var coordinator = (ViewGroup)LayoutInflater.FromContext(context).Inflate(Resource.Layout.flyoutcontent, null); Profile.FramePartition("Find AppBar"); _appBar = coordinator.FindViewById <AppBarLayout>(Resource.Id.flyoutcontent_appbar); _rootView = coordinator as ViewGroup; Profile.FramePartition("Add Listener"); _appBar.AddOnOffsetChangedListener(this); Profile.FramePartition("Add HeaderView"); _actionBarHeight = (int)context.ToPixels(56); UpdateFlyoutHeader(); UpdateFlyoutContent(); Profile.FramePartition("Initialize BgImage"); var metrics = context.Resources.DisplayMetrics; var width = Math.Min(metrics.WidthPixels, metrics.HeightPixels); using (TypedValue tv = new TypedValue()) { if (context.Theme.ResolveAttribute(global::Android.Resource.Attribute.ActionBarSize, tv, true)) { _actionBarHeight = TypedValue.ComplexToDimensionPixelSize(tv.Data, metrics); } } width -= _actionBarHeight; coordinator.LayoutParameters = new LP(width, LP.MatchParent); _bgImage = new ImageView(context) { LayoutParameters = new LP(coordinator.LayoutParameters) }; Profile.FramePartition("UpdateFlyoutHeaderBehavior"); UpdateFlyoutHeaderBehavior(); _shellContext.Shell.PropertyChanged += OnShellPropertyChanged; Profile.FramePartition("UpdateFlyoutBackground"); UpdateFlyoutBackground(); Profile.FramePartition(nameof(UpdateVerticalScrollMode)); UpdateVerticalScrollMode(); Profile.FramePartition("FlyoutFooter"); UpdateFlyoutFooter(); Profile.FrameEnd(); if (View is ShellFlyoutLayout sfl) { sfl.LayoutChanging += OnFlyoutViewLayoutChanged; } }
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET: //ORIGINAL LINE: @Override public Boolean handleNotification(EngagementReachInteractiveContent content) throws RuntimeException public virtual bool?handleNotification(EngagementReachInteractiveContent content) { /* System notification case */ if (content.SystemNotification) { /* Big picture handling */ Bitmap bigPicture = null; string bigPictureURL = content.NotificationBigPicture; if (bigPictureURL != null && Build.VERSION.SDK_INT >= 16) { /* Schedule picture download if needed, or load picture if download completed. */ long?downloadId = content.DownloadId; if (downloadId == null) { EngagementNotificationUtilsV11.downloadBigPicture(mContext, content); return(null); } else { bigPicture = EngagementNotificationUtilsV11.getBigPicture(mContext, downloadId.Value); } } /* Generate notification identifier */ int notificationId = getNotificationId(content); /* Build notification using support lib to manage compatibility with old Android versions */ NotificationCompat.Builder builder = new NotificationCompat.Builder(mContext); /* Icon for ticker and content icon */ builder.SmallIcon = mNotificationIcon; /* * Large icon, handled only since API Level 11 (needs down scaling if too large because it's * cropped otherwise by the system). */ Bitmap notificationImage = content.NotificationImage; if (notificationImage != null && Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) { builder.LargeIcon = scaleBitmapForLargeIcon(mContext, notificationImage); } /* Texts */ string notificationTitle = content.NotificationTitle; string notificationMessage = content.NotificationMessage; string notificationBigText = content.NotificationBigText; builder.ContentTitle = notificationTitle; builder.ContentText = notificationMessage; /* * Replay: display original date and don't replay all the tickers (be as quiet as possible * when replaying). */ long?notificationFirstDisplayedDate = content.NotificationFirstDisplayedDate; if (notificationFirstDisplayedDate != null) { builder.When = notificationFirstDisplayedDate; } else { builder.Ticker = notificationTitle; } /* Big picture */ if (bigPicture != null) { builder.Style = (new NotificationCompat.BigPictureStyle()).bigPicture(bigPicture).setBigContentTitle(notificationTitle).setSummaryText(notificationMessage); } /* Big text */ else if (notificationBigText != null) { builder.Style = (new NotificationCompat.BigTextStyle()).bigText(notificationBigText); } /* Vibration/sound if not a replay */ if (notificationFirstDisplayedDate == null) { int defaults = 0; if (content.NotificationSound) { defaults |= Notification.DEFAULT_SOUND; } if (content.NotificationVibrate) { defaults |= Notification.DEFAULT_VIBRATE; } builder.Defaults = defaults; } /* Launch the receiver on action */ Intent actionIntent = new Intent(INTENT_ACTION_ACTION_NOTIFICATION); EngagementReachAgent.setContentIdExtra(actionIntent, content); actionIntent.putExtra(INTENT_EXTRA_NOTIFICATION_ID, notificationId); Intent intent = content.Intent; if (intent != null) { actionIntent.putExtra(INTENT_EXTRA_COMPONENT, intent.Component); } actionIntent.Package = mContext.PackageName; PendingIntent contentIntent = PendingIntent.getBroadcast(mContext, (int)content.LocalId, actionIntent, FLAG_CANCEL_CURRENT); builder.ContentIntent = contentIntent; /* Also launch receiver if the notification is exited (clear button) */ Intent exitIntent = new Intent(INTENT_ACTION_EXIT_NOTIFICATION); exitIntent.putExtra(INTENT_EXTRA_NOTIFICATION_ID, notificationId); EngagementReachAgent.setContentIdExtra(exitIntent, content); exitIntent.Package = mContext.PackageName; PendingIntent deleteIntent = PendingIntent.getBroadcast(mContext, (int)content.LocalId, exitIntent, FLAG_CANCEL_CURRENT); builder.DeleteIntent = deleteIntent; /* Can be dismissed ? */ Notification notification = builder.build(); if (!content.NotificationCloseable) { notification.flags |= Notification.FLAG_NO_CLEAR; } /* Allow overriding */ if (onNotificationPrepared(notification, content)) /* * Submit notification, replacing the previous one if any (this should happen only if the * application process is restarted). */ { mNotificationManager.notify(notificationId, notification); } } /* Activity embedded notification case */ else { /* Get activity */ Activity activity = EngagementActivityManager.Instance.CurrentActivity.get(); /* Cannot notify in app if no activity provided */ if (activity == null) { return(false); } /* Get notification area */ string category = content.Category; int areaId = getInAppAreaId(category).Value; View notificationAreaView = activity.findViewById(areaId); /* No notification area, check if we can install overlay */ if (notificationAreaView == null) { /* Check overlay is not disabled in this activity */ Bundle activityConfig = EngagementUtils.getActivityMetaData(activity); if (!activityConfig.getBoolean(METADATA_NOTIFICATION_OVERLAY, true)) { return(false); } /* Inflate overlay layout and get reference to notification area */ View overlay = LayoutInflater.from(mContext).inflate(getOverlayLayoutId(category), null); activity.addContentView(overlay, new LayoutParams(MATCH_PARENT, MATCH_PARENT)); notificationAreaView = activity.findViewById(areaId); } /* Otherwise check if there is an overlay containing the area to restore visibility */ else { View overlay = activity.findViewById(getOverlayViewId(category)); if (overlay != null) { overlay.Visibility = View.VISIBLE; } } /* Make the notification area visible */ notificationAreaView.Visibility = View.VISIBLE; /* Prepare area */ prepareInAppArea(content, notificationAreaView); } /* Success */ return(true); }
void ShowStatus(Context context, bool spinner, string status = null, MaskType maskType = MaskType.Black, TimeSpan?timeout = null, Action clickCallback = null, bool centered = true, Action cancelCallback = null) { if (timeout == null) { timeout = TimeSpan.Zero; } DismissCurrent(context); if (CurrentDialog != null && statusObj == null) { DismissCurrent(context); } lock (dialogLock) { if (CurrentDialog == null) { SetupDialog(context, maskType, cancelCallback, (a, d, m) => { View view; view = LayoutInflater.From(context).Inflate(Resource.Layout.loading, null); if (clickCallback != null) { view.Click += (sender, e) => clickCallback(); } statusObj = new object(); statusText = view.FindViewById <TextView>(Resource.Id.textViewStatus); if (!spinner) { view.FindViewById <ProgressBar>(Resource.Id.loadingProgressBar).Visibility = ViewStates.Gone; } if (maskType != MaskType.Black) { view.SetBackgroundResource(Resource.Drawable.roundedbgdark); } if (statusText != null) { statusText.Text = status ?? ""; statusText.Visibility = string.IsNullOrEmpty(status) ? ViewStates.Gone : ViewStates.Visible; } if (!centered) { d.Window.SetGravity(GravityFlags.Bottom); var p = d.Window.Attributes; p.Y = DpToPx(context, 22); d.Window.Attributes = p; } return(view); }); if (timeout > TimeSpan.Zero) { Task.Factory.StartNew(() => { if (!waitDismiss.WaitOne(timeout.Value)) { DismissCurrent(context); } }).ContinueWith(ct => { var ex = ct.Exception; if (ex != null) { Android.Util.Log.Error("AndHUD", ex.ToString()); } }, TaskContinuationOptions.OnlyOnFaulted); } } else { Application.SynchronizationContext.Send(state => { if (statusText != null) { statusText.Text = status ?? ""; } }, null); } } }
public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { base.OnCreateView( inflater, container, savedInstanceState ); // get the root control from our .axml var layout = inflater.Inflate(Resource.Layout.Notes, container, false) as RelativeLayout; // get the refresh button from the layout RefreshButton = layout.FindViewById<Button>( Resource.Id.refreshButton ); // create our overridden lockable scroll view ScrollView = new LockableScrollView( Rock.Mobile.PlatformSpecific.Android.Core.Context ); ScrollView.ScrollBarStyle = ScrollbarStyles.InsideInset; ScrollView.OverScrollMode = OverScrollMode.Always; ScrollView.VerticalScrollbarPosition = ScrollbarPosition.Default; ScrollView.LayoutParameters = new RelativeLayout.LayoutParams( RelativeLayout.LayoutParams.MatchParent, RelativeLayout.LayoutParams.MatchParent); ScrollView.Notes = this; ((RelativeLayout.LayoutParams)ScrollView.LayoutParameters).AddRule(LayoutRules.CenterHorizontal); ((RelativeLayout.LayoutParams)ScrollView.LayoutParameters).AddRule(LayoutRules.Below, Resource.Id.refreshButton); // add it to our main layout. layout.AddView( ScrollView ); Indicator = layout.FindViewById<ProgressBar>( Resource.Id.progressBar ); Indicator.Visibility = ViewStates.Gone; Indicator.SetBackgroundColor( Rock.Mobile.UI.Util.GetUIColor( 0 ) ); Indicator.BringToFront(); // create the layout that will contain the notes ScrollViewLayout = new RelativeLayout( Rock.Mobile.PlatformSpecific.Android.Core.Context ); ScrollView.AddView( ScrollViewLayout ); ScrollViewLayout.SetOnTouchListener( this ); RefreshButton.Click += (object sender, EventArgs e ) => { DeleteNote( ); PrepareCreateNotes( ); }; // if the refresh button isn't enabled, hide it if ( App.Shared.Network.RockGeneralData.Instance.Data.RefreshButtonEnabled == false ) { RefreshButton.Visibility = ViewStates.Gone; } // get our power management control PowerManager pm = PowerManager.FromContext( Rock.Mobile.PlatformSpecific.Android.Core.Context ); WakeLock = pm.NewWakeLock(WakeLockFlags.Full, "Notes"); ResultView = new UIResultView( layout, new System.Drawing.RectangleF( 0, 0, NavbarFragment.GetContainerDisplayWidth( ), this.Resources.DisplayMetrics.HeightPixels ), OnResultViewDone ); ResultView.Hide( ); // setup the tutorial overlay AnimatingTutorial = false; TutorialOverlay = new ImageView( Rock.Mobile.PlatformSpecific.Android.Core.Context ); TutorialOverlay.LayoutParameters = new ViewGroup.LayoutParams( ViewGroup.LayoutParams.MatchParent, ViewGroup.LayoutParams.MatchParent ); TutorialOverlay.Alpha = 0; TutorialOverlay.SetBackgroundColor( Android.Graphics.Color.Black ); layout.AddView( TutorialOverlay ); NavBarRevealTracker = new NavBarReveal( ParentTask.NavbarFragment.NavToolbar ); return layout; }
public MvxSimpleLayoutInflaterHolder(LayoutInflater layoutInflater) { LayoutInflater = layoutInflater; }
public CityAdapter(Context context) { inflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE); }
public override RecyclerView.ViewHolder OnCreateViewHolder(ViewGroup parent, int viewType) { var view = LayoutInflater.From(parent.Context).Inflate(Resource.Layout.item_card_loja, parent, false); return(new CardInfoLojaViewHolder(view)); }
public override View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { View rootView = inflater.inflate(R.layout.layout_fragment_sub_quality, container, false); mSubQualityContainer = (RelativeLayout) openTokActivity.findViewById(R.id.fragment_sub_quality_container); congestionIndicator = (ImageButton) rootView.findViewById(R.id.congestionIndicator); if (openTokActivity.Resources.Configuration.orientation == Configuration.ORIENTATION_LANDSCAPE) { RelativeLayout.LayoutParams @params = (RelativeLayout.LayoutParams) container.LayoutParams; DisplayMetrics metrics = new DisplayMetrics(); openTokActivity.WindowManager.DefaultDisplay.getMetrics(metrics); @params.width = metrics.widthPixels - openTokActivity.dpToPx(48); container.LayoutParams = @params; } return rootView; }
protected override RepeaterView.ViewHolder OnCreateViewHolder(ViewGroup parent) { var view = LayoutInflater.From(parent.Context).Inflate(Resource.Layout.RepeaterViewItemLayout, parent, false); return(new RepeaterViewViewHolder(view)); }
public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { if (_view != null) { ViewGroup parent = (ViewGroup)_view.Parent; if (parent != null) { parent.RemoveView(_view); } } try { this.Log().Debug("OnCreateView"); _view = inflater.Inflate(Resource.Layout.f_watchlist_and_detail, container, false); this.WireUpControls(_view, "watchlist_and_detail"); var fm = this.FragmentManager; var ft = fm.BeginTransaction(); _list = fm.FindFragmentByTag("watchlist_and_detail_list") as WatchListView; _details = fm.FindFragmentByTag("watchlist_and_detail_detail") as WatchListItemDetailView; // List if (_list == null) { _list = new WatchListView(); _list.ViewModel = ViewModel.ListViewModel; this.Log().Debug("OnCreateView => Add: List"); ft.Add(Resource.Id.watchList_and_detail_listcontainer, _list, "watchlist_and_detail_list"); } else { _list.ViewModel = ViewModel.ListViewModel; this.Log().Debug("OnCreateView => Attach: List"); ft.Attach(_list); } // Detail if (_details == null) { _details = new WatchListItemDetailView(); _details.ViewModel = ViewModel.DetailViewModel; this.Log().Debug("OnCreateView => Add: Detail"); ft.Add(Resource.Id.watchList_and_detail_detailscontainer, _details, "watchlist_and_detail_detail"); } else { _details.ViewModel = ViewModel.DetailViewModel; this.Log().Debug("OnCreateView => Attach: Detail"); ft.Attach(_details); } ft.Commit(); } catch (InflateException e) { /* view is already there, just return view as it is */ } return(_view); }
public override View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { View rootView = inflater.inflate(R.layout.fragment_thread, container, false); dotsView = (DotsView) rootView.findViewById(R.id.dots); return rootView; }
public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { View view = inflater.Inflate(Resource.Layout.single_type_layout, container, false); mainLayout = view.FindViewById <LinearLayout>(Resource.Id.mainLayout); layout1 = view.FindViewById <LinearLayout>(Resource.Id.layout1); layout2 = view.FindViewById <LinearLayout>(Resource.Id.layout2); layout3 = view.FindViewById <LinearLayout>(Resource.Id.layout3); layouts = new List <LinearLayout> { layout1, layout2, layout3, mainLayout }; left = view.FindViewById <TextView>(Resource.Id.leftTop); right = view.FindViewById <TextView>(Resource.Id.rightTop); TextView leftTitle = view.FindViewById <TextView>(Resource.Id.leftTitle); TextView middleTitle = view.FindViewById <TextView>(Resource.Id.middleTitle); TextView rightTitle = view.FindViewById <TextView>(Resource.Id.rightTitle); TextView textView1 = view.FindViewById <TextView>(Resource.Id.textView1); TextView textView2 = view.FindViewById <TextView>(Resource.Id.textView2); TextView textView3 = view.FindViewById <TextView>(Resource.Id.textView3); TextView textView4 = view.FindViewById <TextView>(Resource.Id.textView4); TextView textView5 = view.FindViewById <TextView>(Resource.Id.textView5); TextView textView6 = view.FindViewById <TextView>(Resource.Id.textView6); TextView textView7 = view.FindViewById <TextView>(Resource.Id.textView7); TextView textView8 = view.FindViewById <TextView>(Resource.Id.textView8); TextView textView9 = view.FindViewById <TextView>(Resource.Id.textView9); TextView textView10 = view.FindViewById <TextView>(Resource.Id.textView10); TextView textView11 = view.FindViewById <TextView>(Resource.Id.textView11); TextView textView12 = view.FindViewById <TextView>(Resource.Id.textView12); TextView textView13 = view.FindViewById <TextView>(Resource.Id.textView13); TextView textView14 = view.FindViewById <TextView>(Resource.Id.textView14); TextView textView15 = view.FindViewById <TextView>(Resource.Id.textView15); TextView textView16 = view.FindViewById <TextView>(Resource.Id.textView16); TextView textView17 = view.FindViewById <TextView>(Resource.Id.textView17); TextView textView18 = view.FindViewById <TextView>(Resource.Id.textView18); textViews = new List <TextView> { textView1, textView2, textView3, textView4, textView5, textView6, textView7, textView8, textView9, textView10, textView11, textView12, textView13, textView14, textView15, textView16, textView17, textView18 }; if (SendData.isJapanese) { leftTitle.Text = Convert.LanguageDic[leftTitle.Text]; middleTitle.Text = Convert.LanguageDic[middleTitle.Text]; rightTitle.Text = Convert.LanguageDic[rightTitle.Text]; owner.Title = "防衛"; } else { owner.Title = "Defense"; } types = allTypes.defenseTypes; for (int i = 0; i < types.Count; i++) { textViews[i].Tag = i; textViews[i].Text = types[i].type; textViews[i].Gravity = GravityFlags.Center; textViews[i].SetPadding(0, 0, 0, 10); int h = Resources.DisplayMetrics.HeightPixels / 100; if (h > 18) { h = 18; } textViews[i].SetTextSize(Android.Util.ComplexUnitType.Dip, h + 11); gradient = (GradientDrawable)textViews[i].Background; gradient.SetColor(Color.ParseColor(Colors.TypeToColor[types[i].type])); textViews[i].Click += Handle_Click; textViews[i].LongClick += Handle_LongClick; } var adLayout = view.FindViewById <LinearLayout>(Resource.Id.googleAds); //if (SendData.isConnected) //{ // var ad = new AdView(this); // ad.AdSize = AdSize.SmartBanner; // ad.AdUnitId = "ca-app-pub-2288808768882490/2788554960"; // var requestBuilder = new AdRequest.Builder(); // ad.LoadAd(requestBuilder.Build()); // adLayout.AddView(ad); //} //else mainLayout.RemoveView(adLayout); return(view); }
public override View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { // Set view, remember ImageView for icon and setup onclick listener. View v = inflater.inflate(R.layout.device_picker, container, false); mIcon = (ImageView) v.findViewById(R.id.devicePickerIcon); mIcon.OnClickListener = this; return v; }
public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { base.OnCreateView(inflater, container, savedInstanceState); return(this.BindingInflate(FragmentId, null)); }
public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { CreateViewCalled.Raise(this, new MvxCreateViewParameters(inflater, container, savedInstanceState)); return(base.OnCreateView(inflater, container, savedInstanceState)); }
public MessageAdapter(Activity activity) { mInflater = activity.LayoutInflater; mMessages = new List<Pair<Message, int?>>(); mFormatter = new SimpleDateFormat("HH:mm"); }
public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { if (container == null) { // Currently in a layout without a container, so no reason to create our view. return null; } View view = inflater.Inflate(Resource.Layout.News_Primary, container, false); view.SetOnTouchListener( this ); view.SetBackgroundColor( Rock.Mobile.UI.Util.GetUIColor( ControlStylingConfig.BackgroundColor ) ); return view; }
public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { container.RemoveAllViews(); this.container = (ViewGroup)container.Parent.Parent; LinearLayout layout = new LinearLayout(container.Context); layout.Orientation = Android.Widget.Orientation.Vertical; variationsList = new BorderedList(container.Context); variationsList.Id = 3; variationsList.ItemClick += VariationsList_ItemClick; variationsList.Adapter = listAdapter; Resources res = container.Context.Resources; #pragma warning disable CS0618 // Type or member is obsolete Drawable shape = res.GetDrawable(Resource.Drawable.VariationsListBorder); #pragma warning restore CS0618 // Type or member is obsolete //layout.AddView(variationsList); if (this.container is CurrentOrderLayout) { LinearLayout inOutLayout = new LinearLayout(container.Context); inOutLayout.SetPadding(0, 10, 0, 0); Button inOutButton = new Button(container.Context); inOutButton.Click += InOutButton_Click; inOutButton.Text = "Eat In / Out"; inOutButton.SetTextSize(ComplexUnitType.Sp, 23); inOutText = new TextView(container.Context); inOutText.SetTextSize(ComplexUnitType.Sp, 23); inOutText.SetTextColor(Color.Black); inOutText.SetPadding(10, 0, 0, 0); inOutText.Text = "Eat In"; inOutLayout.AddView(inOutButton); inOutLayout.AddView(inOutText); layout.AddView(inOutLayout); inOutButton.LayoutParameters.Width = 390; inOutButton.LayoutParameters.Height = 120; LinearLayout discountLayout = new LinearLayout(container.Context); discountButton = new Button(container.Context); discountButton.Click += DiscountButton_Click; discountButton.Text = "Set Discount"; discountButton.SetTextSize(ComplexUnitType.Sp, 23); discountText = new TextView(container.Context); discountText.SetTextSize(ComplexUnitType.Sp, 23); discountText.SetTextColor(Color.Black); discountText.SetPadding(10, 0, 0, 0); discountText.Text = "No Discount"; discountLayout.AddView(discountButton); discountLayout.AddView(discountText); discountText.LayoutParameters.Width = 470; layout.AddView(discountLayout); discountButton.LayoutParameters.Width = 390; discountButton.LayoutParameters.Height = 120; LinearLayout quantityLayout = new LinearLayout(container.Context); quantityButton = new Button(container.Context); quantityButton.Click += QuantityButton_Click; quantityButton.Text = "Set Quantity"; quantityButton.SetTextSize(ComplexUnitType.Sp, 23); quantityText = new TextView(container.Context); quantityText.SetTextSize(ComplexUnitType.Sp, 23); quantityText.SetTextColor(Color.Black); quantityText.SetPadding(10, 0, 0, 0); quantityText.Text = "1"; quantityLayout.AddView(quantityButton); quantityLayout.AddView(quantityText); layout.AddView(quantityLayout); quantityButton.LayoutParameters.Width = 390; quantityButton.LayoutParameters.Height = 120; } else { //variationsList.LayoutParameters.Height = 750; } layout.AddView(variationsList); variationsList.LayoutParameters.Height = 550; variationsList.LayoutParameters.Width = 750; LinearLayout buttonLayout = new LinearLayout(container.Context); buttonLayout.Orientation = Android.Widget.Orientation.Horizontal; buttonLayout.SetBackgroundColor(Color.White); backButton = new ImageView(container.Context); #pragma warning disable CS0618 // Type or member is obsolete backButton.SetImageDrawable(res.GetDrawable(Resource.Drawable.Back)); #pragma warning restore CS0618 // Type or member is obsolete backButton.Click += BackButton_Click; backButton.Visibility = ViewStates.Invisible; forwardButton = new ImageView(container.Context); #pragma warning disable CS0618 // Type or member is obsolete forwardButton.SetImageDrawable(res.GetDrawable(Resource.Drawable.Forward)); #pragma warning restore CS0618 // Type or member is obsolete forwardButton.Click += ForwardButton_Click; forwardButton.Visibility = ViewStates.Invisible; confirmButton = new ImageView(container.Context); #pragma warning disable CS0618 // Type or member is obsolete confirmButton.SetImageDrawable(res.GetDrawable(Resource.Drawable.Confirm)); #pragma warning restore CS0618 // Type or member is obsolete confirmButton.Click += ConfirmButton_Click; confirmButton.Visibility = ViewStates.Invisible; buttonLayout.AddView(backButton); buttonLayout.AddView(forwardButton); buttonLayout.AddView(confirmButton); buttonLayout.SetPadding(40, 0, 0, 0); layout.AddView(buttonLayout); container.AddView(layout); newOrderItemId = svc.GetNewOrderItemId(); return(base.OnCreateView(inflater, container, savedInstanceState)); }
protected override void OnCreate(Bundle savedInstanceState) { viewModel = new ViewModel(); assets = this.Assets; LayoutInflater layoutInflater = LayoutInflater.From(this); view = layoutInflater.Inflate(Resource.Layout.EditorBannerMain, null); SetContentView(view); LinearLayout mainLayout = FindViewById <LinearLayout> (Resource.Id.editor_layout); visibilityLayout = FindViewById <LinearLayout> (Resource.Id.visibility_layout); visibilityLayout.Visibility = ViewStates.Gone; Button ok = FindViewById <Button> (Resource.Id.button); Button cancel = FindViewById <Button> (Resource.Id.button2); ok.Click += Ok_Click; cancel.Click += Cancel_Click; editor = new SfImageEditor(this); var bitmap = BitmapFactory.DecodeResource(Resources, BannerCreator.Image); editor.Bitmap = bitmap; mainLayout.AddView(editor); editor.ToolbarSettings.ToolbarItems.Clear(); FooterToolbarItem banner = new FooterToolbarItem() { Text = "Banner Types", SubItems = new List <ToolbarItem>() { new ToolbarItem() { Text = "Facebook Post" }, new ToolbarItem() { Text = "Facebook Cover" }, new ToolbarItem() { Text = "Twitter Cover" }, new ToolbarItem() { Text = "Twitter Post" }, new ToolbarItem() { Text = "YouTubeChannel Cover" }, }, }; HeaderToolbarItem item2 = new HeaderToolbarItem(); item2.Text = "Share"; item2.Icon = BitmapFactory.DecodeResource(Resources, Resource.Drawable.share); HeaderToolbarItem crop = new HeaderToolbarItem(); crop.Text = "Banner Types"; editor.ToolbarSettings.ToolbarItems.Add(item2); editor.ToolbarSettings.ToolbarItems.Add(banner); editor.ToolbarSettings.ToolbarItemSelected += (sender, e) => { if (e.ToolbarItem is HeaderToolbarItem) { if ((e.ToolbarItem as HeaderToolbarItem).Text == "Share") { ShareImage(); } } if (e.ToolbarItem is ToolbarItem) { var toolitem = e.ToolbarItem as ToolbarItem; if (toolitem.Text != "Banner Types" && toolitem.Text != "Share") { visibilityLayout.Visibility = ViewStates.Visible; } if (toolitem.Text == "Facebook Post") { editor.ToggleCropping(1200, 900); } else if (toolitem.Text == "Facebook Cover") { editor.ToggleCropping(851, 315); } else if (toolitem.Text == "Twitter Cover") { editor.ToggleCropping(1500, 500); } else if (toolitem.Text == "Twitter Post") { editor.ToggleCropping(1024, 512); } else if (toolitem.Text == "YouTubeChannel Cover") { editor.ToggleCropping(2560, 1440); } } }; base.OnCreate(savedInstanceState); }
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes: //ORIGINAL LINE: @Override public android.view.View onCreateView(android.view.LayoutInflater inflater, @Nullable android.view.ViewGroup container, @Nullable android.os.Bundle savedInstanceState) public override View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { View view = inflater.inflate(R.layout.fragment_pos_printer_page_mode, container, false); pageModeAreaTextView = (TextView) view.findViewById(R.id.textViewPageModeArea); try { pageModeAreaTextView.Text = posPrinter.PageModeArea; } catch (JposException e) { // TODO Auto-generated catch block Console.WriteLine(e.ToString()); Console.Write(e.StackTrace); } pageModeHorizontalPositionEditText = (EditText) view.findViewById(R.id.editTextPageModeHorizontalPosition); try { pageModeHorizontalPositionEditText.Text = Convert.ToString(posPrinter.PageModeHorizontalPosition); } catch (JposException e) { // TODO Auto-generated catch block Console.WriteLine(e.ToString()); Console.Write(e.StackTrace); } pageModeVerticalPositionEditText = (EditText) view.findViewById(R.id.editTextPageModeVerticalPosition); try { pageModeVerticalPositionEditText.Text = Convert.ToString(posPrinter.PageModeVerticalPosition); } catch (JposException e) { // TODO Auto-generated catch block Console.WriteLine(e.ToString()); Console.Write(e.StackTrace); } pageModePrintAreaEditText1 = (EditText) view.findViewById(R.id.editTextPageModePrintArea1); pageModePrintAreaEditText2 = (EditText) view.findViewById(R.id.editTextPageModePrintArea2); pageModePrintAreaEditText3 = (EditText) view.findViewById(R.id.editTextPageModePrintArea3); pageModePrintAreaEditText4 = (EditText) view.findViewById(R.id.editTextPageModePrintArea4); try { string[] pageModePrintArea = posPrinter.PageModePrintArea.split(","); pageModePrintAreaEditText1.Text = pageModePrintArea[0]; pageModePrintAreaEditText2.Text = pageModePrintArea[1]; pageModePrintAreaEditText3.Text = pageModePrintArea[2]; pageModePrintAreaEditText4.Text = pageModePrintArea[3]; } catch (JposException e1) { // TODO Auto-generated catch block Console.WriteLine(e1.ToString()); Console.Write(e1.StackTrace); } pageModePrintDirectionSpinner = (Spinner) view.findViewById(R.id.spinnerPageModePrintDirection); try { switch (posPrinter.PageModePrintDirection) { case POSPrinterConst.PTR_PD_LEFT_TO_RIGHT: pageModePrintDirectionSpinner.Selection = 0; break; case POSPrinterConst.PTR_PD_BOTTOM_TO_TOP: pageModePrintDirectionSpinner.Selection = 1; break; case POSPrinterConst.PTR_PD_RIGHT_TO_LEFT: pageModePrintDirectionSpinner.Selection = 2; break; case POSPrinterConst.PTR_PD_TOP_TO_BOTTOM: pageModePrintDirectionSpinner.Selection = 3; break; } } catch (JposException e) { // TODO Auto-generated catch block Console.WriteLine(e.ToString()); Console.Write(e.StackTrace); } pageModeCommandSpinner = (Spinner) view.findViewById(R.id.spinnerPageModeCommand); view.findViewById(R.id.buttonClearPrintArea).OnClickListener = this; view.findViewById(R.id.buttonUpdateProperties).OnClickListener = this; view.findViewById(R.id.buttonSendPageModeCommand).OnClickListener = this; deviceMessagesTextView = (TextView) view.findViewById(R.id.textViewDeviceMessages); deviceMessagesTextView.MovementMethod = new ScrollingMovementMethod(); deviceMessagesTextView.VerticalScrollBarEnabled = true; return view; }