protected override void OnCreate(Bundle savedInstanceState) { base.OnCreate(savedInstanceState); // Set our view from the "main" layout resource SetContentView(Resource.Layout.activity_main); var parentThatHasBottomSheetBehavior = FindViewById <FrameLayout>(Resource.Id.bottomsheetview); mBottomSheetBehavior = BottomSheetBehavior.From(parentThatHasBottomSheetBehavior); if (mBottomSheetBehavior != null) { mBottomSheetBehavior.SetBottomSheetCallback(new PlayerBehavior(Window.DecorView.RootView)); } var miniPlayer = FindViewById <RelativeLayout>(Resource.Id.miniplayerview); miniPlayer.Click += (sender, e) => { mBottomSheetBehavior.State = BottomSheetBehavior.StateExpanded; }; var closeButton = FindViewById <ImageView>(Resource.Id.closebutton); closeButton.Click += (sender, e) => { mBottomSheetBehavior.State = BottomSheetBehavior.StateCollapsed; }; }
public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { var view = inflater.Inflate(Resource.Layout.payments_layout, container, false); //add payment bottomsheet mBottomsheetRoot = (RelativeLayout)view.FindViewById(Resource.Id.payment_sheet_root); mBehavior = BottomSheetBehavior.From(mBottomsheetRoot); mBehavior.State = BottomSheetBehavior.StateHidden; var cancelTxt = (TextView)view.FindViewById(Resource.Id.cancel_txt); cancelTxt.Click += CancelTxt_Click; var addPaymentBtn = (Button)view.FindViewById(Resource.Id.add_new_payment_btn); addPaymentBtn.Click += AddPaymentBtn_Click; var momoBtn = (RelativeLayout)view.FindViewById(Resource.Id.momo_relative); momoBtn.Click += MomoBtn_Click; var ccBtn = (RelativeLayout)view.FindViewById(Resource.Id.cc_relative); ccBtn.Click += CcBtn_Click; return(view); }
private void CloseFabMenu() { if (BottomSheetBehavior.From(bottomSheet).State != BottomSheetBehavior.StateExpanded) { ReloadMapEventMarkers(); bottomSheet.Animate().TranslationY(0); isFabOpen = false; fabMain.Animate().Rotation(0f); bgFabMenu.Animate().Alpha(0f); fabEvents.Animate() .TranslationY(0) .Rotation(90f); fabAccount.Animate() .TranslationY(0) .Rotation(90f); fabSettings.Animate() .TranslationY(0) .Rotation(90f); fabLogin.Animate() .TranslationY(0) .Rotation(90f).SetListener(new FabAnimatorListener(bgFabMenu, fabEvents, fabAccount, fabSettings, fabLogin)); } }
protected override void SetValueImpl(object target, object value) { var view = target as BottomSheetView; var nested = view.FindViewById <NestedScrollView>(Resource.Id.bottomSheet); if (nested == null) { return; } var beh = BottomSheetBehavior.From(nested); beh.State = int.Parse((string)value); if (!subscribed) { callback = new BottomSheetCback(); callback.StateSwaped += OnStateSwaped; beh.SetBottomSheetCallback(callback); subscribed = true; } view.State = (string)value; }
private void InitBottomSheets() { var notifRoot = (ConstraintLayout)FindViewById(Resource.Id.notifs_root); var qrRoot = (ConstraintLayout)FindViewById(Resource.Id.qr_root); var closeBottomBtn = FindViewById <TextView>(Resource.Id.notifs_hdr); var qrImageView = FindViewById <ImageView>(Resource.Id.qr_iv); qrImageView.PostDelayed(async() => { qrImageView.SetImageBitmap(await Task.Run(() => new QrGenUtil().TextToImageEncode(AppDataHelper.GetCurrentUser().Uid))); }, 1000); NotifBehavior = BottomSheetBehavior.From(notifRoot); NotifBehavior.Hideable = true; NotifBehavior.State = BottomSheetBehavior.StateHidden; NotifBehavior.AddBottomSheetCallback(new BottomSheetCallback()); closeBottomBtn.Click += delegate { NotifBehavior.State = BottomSheetBehavior.StateHidden; }; QrBehavior = BottomSheetBehavior.From(qrRoot); QrBehavior.Hideable = true; QrBehavior.State = BottomSheetBehavior.StateHidden; QrBehavior.AddBottomSheetCallback(new BottomSheetCallback()); }
public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { var view = inflater.Inflate(Resource.Layout.finding_driver_nearby, container, false); var mlinear_ = (LinearLayout)view.FindViewById(Resource.Id.mLinear_finder); mlinear_.Click += Mlinear__Click; from_tv = (TextView)view.FindViewById(Resource.Id.mypos_tv); to_tv = (TextView)view.FindViewById(Resource.Id.dest_tv); eta_tv = (TextView)view.FindViewById(Resource.Id.eta_tv); price_tv = (TextView)view.FindViewById(Resource.Id.price_tv); from_tv.Text = _from; to_tv.Text = _to; eta_tv.Text = _eta; price_tv.Text = $"Gh¢ {_fares.ToString()}"; var btnCancel = (Button)view.FindViewById(Resource.Id.canc_btn); btnCancel.Click += (s1, e1) => { MainActivity.Instance.ReverseTrip(); MainActivity.Instance.RideRequestEvent.CancelRequestAsync(); Dismiss(); }; rl_bottomSheet = (RelativeLayout)view.FindViewById(Resource.Id.finder_rl); behavior_finder = BottomSheetBehavior.From(rl_bottomSheet); return(view); }
void ConnectControl() { //DrawerLayout drawerLayout = (Android.Support.V4.Widget.DrawerLayout)FindViewById(Resource.Id.drawerLayout); //ToolBar mainToolbar = (Android.Support.V7.Widget.Toolbar)FindViewById(Resource.Id.mainToolbar); SetSupportActionBar(mainToolbar); SupportActionBar.Title = ""; Android.Support.V7.App.ActionBar actionBar = SupportActionBar; actionBar.SetHomeAsUpIndicator(Resource.Mipmap.ic_menu_action); actionBar.SetDisplayHomeAsUpEnabled(true); //TextView pickupLocationText = (TextView)FindViewById(Resource.Id.pickupLocationText); destinationText = (TextView)FindViewById(Resource.Id.destinationText); tripStatusText = (TextView)FindViewById(Resource.Id.tripStatusText); driverNameText = (TextView)FindViewById(Resource.Id.driverNameText); //Buttons favouritePlacesButton = (Button)FindViewById(Resource.Id.favouritePlacesButton); locationSetButton = (Button)FindViewById(Resource.Id.locationSetButton); requestDriverButton = (Button)FindViewById(Resource.Id.requestDriverButton); pickupRadio = (RadioButton)FindViewById(Resource.Id.pickupRadio); destinationRadio = (RadioButton)FindViewById(Resource.Id.DestinationRadio); callDriverButton = (ImageButton)FindViewById(Resource.Id.callDriverButton); cancelTripButton = (ImageButton)FindViewById(Resource.Id.cancelTripButton); favouritePlacesButton.Click += FavouritePlacesButton_Click; locationSetButton.Click += LocationSetButton_Click; requestDriverButton.Click += RequestDriverButton_Click; pickupRadio.Click += PickupRadio_Click; destinationRadio.Click += DestinationRadio_Click; //Layouts layoutPickUp = (RelativeLayout)FindViewById(Resource.Id.layoutPickUp); layoutDestination = (RelativeLayout)FindViewById(Resource.Id.layoutDestination); layoutPickUp.Click += LayoutPickUp_Click; layoutDestination.Click += LayoutDestination_Click; //imageview centerMarker = (ImageView)FindViewById(Resource.Id.centerMarker); //Bottomsheet FrameLayout tripDetailsView = (FrameLayout)FindViewById(Resource.Id.tripdetails_bottomsheet); FrameLayout rideInfoSheet = (FrameLayout)FindViewById(Resource.Id.bottom_sheet_trip); tripDetailsBottonsheetBehaviour = BottomSheetBehavior.From(tripDetailsView); driverAssignedBottomSheetBehaviour = BottomSheetBehavior.From(rideInfoSheet); lv = FindViewById <ListView>(Resource.Id.lv); //BIND ADAPTER adapter = new CustomAdapter(this, GetSpacecrafts()); lv.Adapter = adapter; lv.ItemClick += lv_ItemClick; }
public override void OnStateChanged(View bottomSheet, int newState) { if (newState == BottomSheetBehavior.StateDragging) { var behavior = BottomSheetBehavior.From(bottomSheet); behavior.State = BottomSheetBehavior.StateExpanded; } }
private void Button_Click2(object sender, EventArgs e) { FrameLayout bottomSheet = (FrameLayout)FindViewById(Resource.Id.bottom_sheet); BottomSheetBehavior behavior = BottomSheetBehavior.From(bottomSheet); behavior.PeekHeight = 300; }
/// <summary> /// Ons the create view. /// </summary> /// <returns>The create view.</returns> /// <param name="inflater">Inflater.</param> /// <param name="container">Container.</param> /// <param name="savedInstanceState">Saved instance state.</param> public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { scale = Context.Resources.DisplayMetrics.Density; int pixels = 0; if (v == null) { v = (ViewGroup)inflater.Inflate(Resource.Layout.sucursales_fragment, container, false); } cordinatorSucursales = v.FindViewById <CoordinatorLayout>(Resource.Id.cordinatorSucursales); btnLogout = v.FindViewById <ImageButton>(Resource.Id.btnLogout); btnVolver = v.FindViewById <ImageView>(Resource.Id.btnVolver); linearLayoutBtnIrAMapasDeTienda = v.FindViewById <LinearLayout>(Resource.Id.linearLayoutBtnIrAMapasDeTienda); lblNombreActivity = v.FindViewById <TextView>(Resource.Id.lblNombreActivity); btnVolver.Visibility = ViewStates.Invisible; btnLogout.Visibility = ViewStates.Invisible; linearLayoutBtnIrAMapasDeTienda.Visibility = ViewStates.Invisible; lblNombreActivity.Text = "¿En quĂ© tienda estĂ¡s?"; sheet_suc = v.FindViewById <LinearLayout>(Resource.Id.linear_sheet_sucursales); linear_mapa = v.FindViewById <LinearLayout>(Resource.Id.linear_mapa); listaVacia = v.FindViewById <LinearLayout>(Resource.Id.sucursal_lista_vacia); CoordinatorLayout.LayoutParams linearLayoutParams = new CoordinatorLayout.LayoutParams(LinearLayout.LayoutParams.WrapContent, LinearLayout.LayoutParams.WrapContent); if (isVertical) { pixels = (int)(360 * scale + 0.5f); bottomSheetBehavior_suc = BottomSheetBehavior.From(sheet_suc); bottomSheetBehavior_suc.PeekHeight = pixels; } else { ViewGroup.LayoutParams parameters = (ViewGroup.LayoutParams)sheet_suc.LayoutParameters; parameters.Width = 500; parameters.Height = 660; if (parameters is ViewGroup.MarginLayoutParams) { ((ViewGroup.MarginLayoutParams)parameters).LeftMargin = 780; } sheet_suc.LayoutParameters = parameters; pixels = (int)(0 * scale + 0.5f); } linearLayoutParams.SetMargins(0, 0, 0, pixels); linear_mapa.LayoutParameters = linearLayoutParams; recycler = v.FindViewById <RecyclerView>(Resource.Id.mi_recycler_view_sucursales); adapter = new AdapterSucursal(DataManager.Sucursales, this); adapter.itemClick += OnItemClick; recycler.SetAdapter(adapter); layoutManager = new LinearLayoutManager(Activity); recycler.SetLayoutManager(layoutManager); mf = (SupportMapFragment)ChildFragmentManager.FindFragmentById(Resource.Id.map_sucursales); mf.GetMapAsync(this); ThreadPool.QueueUserWorkItem(o => cargaServicios()); RetainInstance = true; return(v); }
protected override void OnCreate(Bundle savedInstanceState) { base.OnCreate(savedInstanceState); // Set our view from the "main" layout resource SetContentView(Resource.Layout.activity_bottom_sheet); var recyclerView = FindViewById <RecyclerView>(Resource.Id.recyclerview); mOffsetText = FindViewById <TextView>(Resource.Id.offsetText); mStateText = FindViewById <TextView>(Resource.Id.stateText); Toolbar toolbar = FindViewById <Toolbar>(Resource.Id.toolbar); //SetSupportActionBar(toolbar); var linearLayoutManager = new LinearLayoutManager(this) { AutoMeasureEnabled = true }; ApplicationAdapter adapter = new ApplicationAdapter(this, listApplications(this)); recyclerView.SetLayoutManager(linearLayoutManager); recyclerView.SetAdapter(adapter); FrameLayout parentThatHasBottomSheetBehavior = (FrameLayout)recyclerView.Parent.Parent; mBottomSheetBehavior = BottomSheetBehavior.From(parentThatHasBottomSheetBehavior); if (mBottomSheetBehavior != null) { SetStateText(this, new OnStateChangeEventArgs(mBottomSheetBehavior.State)); var bttomCallback = new BottomSheetBehaviorOverride(SetOffsetText, SetStateText); mBottomSheetBehavior.SetBottomSheetCallback(bttomCallback); } View peekButton = FindViewById <View>(Resource.Id.peek_me); peekButton.Click += delegate { //Let's peek it, programmatically View peakView = FindViewById <View>(Resource.Id.drag_me); mBottomSheetBehavior.PeekHeight = peakView.Height; peakView.RequestLayout(); }; View modal = FindViewById <View>(Resource.Id.as_modal); modal.Click += delegate { BottomSheetDialogFragment bottomSheetDialogFragment = new CustomBottomSheetDialogFragment(); bottomSheetDialogFragment.Show(SupportFragmentManager, bottomSheetDialogFragment.Tag); }; }
public override Android.App.Dialog OnCreateDialog(Bundle savedInstanceState) { var dialog = (BottomSheetDialog)base.OnCreateDialog(savedInstanceState); dialog.ShowEvent += (sender, e) => { var bottomSheet = dialog.FindViewById <FrameLayout>(Resource.Id.design_bottom_sheet); BottomSheetBehavior.From(bottomSheet).State = BottomSheetBehavior.StateExpanded; }; return(dialog); }
void ConnectControl() { //DrawerLayout drawerLayout = FindViewById <Android.Support.V4.Widget.DrawerLayout>(Resource.Id.drawerLayout); //ToolBar mainToolbar = FindViewById <Android.Support.V7.Widget.Toolbar>(Resource.Id.mainToolbar); SetSupportActionBar(mainToolbar); SupportActionBar.Title = ""; Android.Support.V7.App.ActionBar actionBar = SupportActionBar; actionBar.SetHomeAsUpIndicator(Resource.Mipmap.ic_menu_action); actionBar.SetDisplayHomeAsUpEnabled(true); //TextView pickupLocationText = FindViewById <TextView>(Resource.Id.pickupLocationText); destiantionLocationText = FindViewById <TextView>(Resource.Id.destinationLocationText); tripStatusText = FindViewById <TextView>(Resource.Id.tripStatusText); driverNameText = FindViewById <TextView>(Resource.Id.driverNameText); //Buttom favouritePlacesButton = FindViewById <Button>(Resource.Id.favouritePlaceButtom); locationSetButton = FindViewById <Button>(Resource.Id.locationSetButton); requestDriverButton = FindViewById <Button>(Resource.Id.requestDriverButton); pickupRadio = FindViewById <RadioButton>(Resource.Id.pickupRadio); destinationRadio = FindViewById <RadioButton>(Resource.Id.destinationpRadio); callDriverButton = FindViewById <ImageButton>(Resource.Id.callDriverButton); cancelTripButton = FindViewById <ImageButton>(Resource.Id.cancelTripButton); requestDriverButton.Click += RequestDriverButton_Click; favouritePlacesButton.Click += FavouritePlacesButton_Click; locationSetButton.Click += LocationSetButton_Click; pickupRadio.Click += PickupRadio_Click; destinationRadio.Click += DestinationRadio_Click; //ImageView centerMaker = FindViewById <ImageView>(Resource.Id.centerMarker); //LayoutPickup layoutPickUp = FindViewById <RelativeLayout>(Resource.Id.layoutPickUp); layoutDestination = FindViewById <RelativeLayout>(Resource.Id.layoutDestination); layoutPickUp.Click += LayoutPickUp_Click; layoutDestination.Click += LayoutDestination_Click; //BottomSheet FrameLayout tripDetailsView = FindViewById <FrameLayout>(Resource.Id.tripdetails_bottomsheet); FrameLayout rideInfoSheet = FindViewById <FrameLayout>(Resource.Id.bottom_sheet_trip); tripDetalBottomsheetBehavior = BottomSheetBehavior.From(tripDetailsView); driverAssignedBottomSheetBehaivor = BottomSheetBehavior.From(rideInfoSheet); }
public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { View view = inflater.Inflate(Resource.Layout.calendar, container, false); //TextViews testText = view.FindViewById <TextView>(Resource.Id.txttest); beginnerText = view.FindViewById <TextView>(Resource.Id.txtBeginnerSelector); intermediateText = view.FindViewById <TextView>(Resource.Id.txtIntermediateSelector); //TextBoxes calendarWorkoutTextBox = view.FindViewById <EditText>(Resource.Id.txtWorkoutInput); calendarRepTextBox = view.FindViewById <EditText>(Resource.Id.txtRepInput); //CalendarViews calendarCalendarView = view.FindViewById <CalendarView>(Resource.Id.viewCalendar); //Buttons selfStartButton = view.FindViewById <Button>(Resource.Id.btnSelfCalendarStart); //RadioButton beginnerCheckBox = view.FindViewById <CheckBox>(Resource.Id.cbBeginnerSelector); intermediateCheckBox = view.FindViewById <CheckBox>(Resource.Id.cbIntermediateSelector); //Spinner workoutSpinner = view.FindViewById <MaterialSpinner>(Resource.Id.workoutSpinner); //Layouts FrameLayout workoutLayout = view.FindViewById <FrameLayout>(Resource.Id.layoutWorkout); workoutLayoutBottomSheetBehaviour = BottomSheetBehavior.From(workoutLayout); FrameLayout recyclerViewLayout = view.FindViewById <FrameLayout>(Resource.Id.layoutWorkoutBottomSheet); workoutRecyclerViewBottomSheetBehaviour = BottomSheetBehavior.From(recyclerViewLayout); calendarCoordinatorLayout = view.FindViewById <CoordinatorLayout>(Resource.Id.calendarView); //RecyclerView myRecyclerView = view.FindViewById <RecyclerView>(Resource.Id.myRecyclerView); //Events calendarCalendarView.DateChange += CalendarCalendarView_DateChange; selfStartButton.Click += SelfStartButton_Click; calendarWorkoutTextBox.TextChanged += CalendarWorkoutTextBox_TextChanged; beginnerCheckBox.Click += BeginnerButton_Click; intermediateCheckBox.Click += IntermediateButton_Click; workoutSpinner.ItemSelected += WorkoutSpinner_ItemSelected; SetupWorkoutSpinner(); return(view); }
protected override void OnCreate(Bundle savedInstanceState) { base.OnCreate(savedInstanceState); SetContentView(Resource.Layout.vendor_detail); View bottomSheet = FindViewById <View>(Resource.Id.bottom_sheet); // Create your application here FindViewById <TextView>(Resource.Id.vendorName).Text = Common.selectedVendorName; FindViewById <TextView>(Resource.Id.vendorLocation).Text = Common.selectedVendorLocation; FindViewById <TextView>(Resource.Id.vendorPrice).Text = Common.selectedVendorRate; vendorDetailsSheet = BottomSheetBehavior.From(bottomSheet); vendorDetailsSheet.PeekHeight = 400; }
public override Dialog OnCreateDialog(Bundle savedInstanceState) { var dialog = (BottomSheetDialog)base.OnCreateDialog(savedInstanceState); dialog.ShowEvent += delegate { var bottomSheet = dialog.FindViewById <FrameLayout>(Resource.Id.design_bottom_sheet); BottomSheetBehavior.From(bottomSheet).State = BottomSheetBehavior.StateExpanded; }; if (Build.VERSION.SdkInt < BuildVersionCodes.OMr1) { dialog.Window.SetNavigationBarColor(Color.Black); } return(dialog); }
public override void Show() { var inflater = (LayoutInflater)Context.GetSystemService(Context.LayoutInflaterService); using (var dialogView = inflater.Inflate(Resource.Layout.lyt_custom_alert, null)) { dialogView.SetMinimumWidth((int)(Style.ScreenWidth * 0.8)); var alertTitle = dialogView.FindViewById <AutoLinkTextView>(Resource.Id.alert_title); alertTitle.AutoLinkText = _headerText; alertTitle.Typeface = string.IsNullOrEmpty(_messageText) ? Style.Regular : Style.Semibold; alertTitle.Visibility = string.IsNullOrEmpty(_headerText) ? ViewStates.Gone : ViewStates.Visible; alertTitle.LinkClick += LinkClick; var alertMessage = dialogView.FindViewById <TextView>(Resource.Id.alert_message); alertMessage.Text = _messageText; alertMessage.Typeface = Style.Light; alertMessage.Visibility = string.IsNullOrEmpty(_messageText) ? ViewStates.Gone : ViewStates.Visible; var isHorizontal = _orientation.Equals(Orientation.Horizontal); var layout = isHorizontal ? dialogView.FindViewById <LinearLayout>(Resource.Id.horizontal_lyt) : dialogView.FindViewById <LinearLayout>(Resource.Id.vertical_lyt); layout.Visibility = ViewStates.Visible; var alertCancel = isHorizontal ? dialogView.FindViewById <Button>(Resource.Id.cancel_h) : dialogView.FindViewById <Button>(Resource.Id.cancel_v); alertCancel.Text = _cancelText; alertCancel.Click += (sender, e) => { Cancel(); }; var actionBtn = isHorizontal ? dialogView.FindViewById <Button>(Resource.Id.alert_action_btn_h) : dialogView.FindViewById <Button>(Resource.Id.alert_action_btn_v); actionBtn.Text = _alertActText; actionBtn.Click += OnButtonAction; SetContentView(dialogView); Window.FindViewById(Resource.Id.design_bottom_sheet).SetBackgroundColor(Color.Transparent); var dialogPadding = (int)Android.Util.TypedValue.ApplyDimension(Android.Util.ComplexUnitType.Dip, 10, Context.Resources.DisplayMetrics); Window.DecorView.SetPadding(dialogPadding, dialogPadding, dialogPadding, dialogPadding); base.Show(); var bottomSheet = FindViewById <FrameLayout>(Resource.Id.design_bottom_sheet); BottomSheetBehavior.From(bottomSheet).State = BottomSheetBehavior.StateExpanded; } }
void ConnectControl() { //DrawerLayout drawerLayout = (Android.Support.V4.Widget.DrawerLayout)FindViewById(Resource.Id.drawerLayout); //Toolbar mainToolbar = (Android.Support.V7.Widget.Toolbar)FindViewById(Resource.Id.mainToolbar); SetSupportActionBar(mainToolbar); SupportActionBar.Title = ""; Android.Support.V7.App.ActionBar actionBar = SupportActionBar; actionBar.SetHomeAsUpIndicator(Resource.Mipmap.ic_menu_action); actionBar.SetDisplayHomeAsUpEnabled(true); //TextView pickupLocationText = (TextView)FindViewById(Resource.Id.pickupLocationText); destinationText = (TextView)FindViewById(Resource.Id.destinationText); //Buttons favouritePlacesButton = (Button)FindViewById(Resource.Id.favouritePlacesButton); locationSetButton = (Button)FindViewById(Resource.Id.locationSetButton); requestDriverButton = (Button)FindViewById(Resource.Id.requestDriverButton); pickupRadio = (RadioButton)FindViewById(Resource.Id.pickupRadio); destinationRadio = (RadioButton)FindViewById(Resource.Id.destinationRadio); favouritePlacesButton.Click += FavouritePlacesButton_Click; locationSetButton.Click += LocationSetButton_Click; requestDriverButton.Click += RequestDriverButton_Click; pickupRadio.Click += PickupRadio_Click; destinationRadio.Click += DestinationRadio_Click; //Layouts layoutPickup = (RelativeLayout)FindViewById(Resource.Id.layoutPickup); layoutDestination = (RelativeLayout)FindViewById(Resource.Id.layoutDestination); layoutPickup.Click += LayoutPickup_Click; layoutDestination.Click += LayoutDestination_Click; //ImageViews centerMarker = (ImageView)FindViewById(Resource.Id.centerMarker); //Bottomsheets FrameLayout tripDetailsView = (FrameLayout)FindViewById(Resource.Id.tripdetails_bottomsheet); tripDetailsBottomSheetBehavior = BottomSheetBehavior.From(tripDetailsView); }
public override void Show() { using (var dialogView = LayoutInflater.From(Context).Inflate(Resource.Layout.lyt_wallet_extra, null)) { dialogView.SetMinimumWidth((int)(Style.ScreenWidth * 0.8)); var dialogTitle = dialogView.FindViewById <TextView>(Resource.Id.title); dialogTitle.Typeface = Style.Semibold; dialogTitle.Text = AppSettings.LocalizationManager.GetText(LocalizationKeys.SelectAction); var porwerUp = dialogView.FindViewById <Button>(Resource.Id.power_up); porwerUp.Typeface = Style.Semibold; porwerUp.Text = AppSettings.LocalizationManager.GetText(LocalizationKeys.PowerUp); porwerUp.Click += PorwerUpOnClick; var porwerDown = dialogView.FindViewById <Button>(Resource.Id.power_down); porwerDown.Typeface = Style.Semibold; porwerDown.Text = AppSettings.LocalizationManager.GetText(LocalizationKeys.PowerDown); porwerDown.Click += PorwerDownOnClick; porwerDown.Visibility = _balance.EffectiveSp - _balance.DelegatedToMe - 5 > 0 ? ViewStates.Visible : ViewStates.Gone; var cancelPorwerDown = dialogView.FindViewById <Button>(Resource.Id.cancel_power_down); cancelPorwerDown.Typeface = Style.Semibold; cancelPorwerDown.Text = AppSettings.LocalizationManager.GetText(LocalizationKeys.CancelPowerDown); cancelPorwerDown.Click += CancelPorwerDownOnClick; cancelPorwerDown.Visibility = _balance.ToWithdraw > 0 ? ViewStates.Visible : ViewStates.Gone; var cancel = dialogView.FindViewById <Button>(Resource.Id.cancel); cancel.Typeface = Style.Semibold; cancel.Text = AppSettings.LocalizationManager.GetText(LocalizationKeys.Cancel); cancel.Click += CancelOnClick; SetContentView(dialogView); Window.FindViewById(Resource.Id.design_bottom_sheet).SetBackgroundColor(Color.Transparent); var dialogPadding = (int)TypedValue.ApplyDimension(ComplexUnitType.Dip, 10, Context.Resources.DisplayMetrics); Window.DecorView.SetPadding(dialogPadding, dialogPadding, dialogPadding, dialogPadding); base.Show(); var bottomSheet = FindViewById <FrameLayout>(Resource.Id.design_bottom_sheet); BottomSheetBehavior.From(bottomSheet).State = BottomSheetBehavior.StateExpanded; } }
public override void Show() { using (var dialogView = LayoutInflater.From(Context).Inflate(Resource.Layout.lyt_promote_popup, null)) { dialogView.SetMinimumWidth((int)(Context.Resources.DisplayMetrics.WidthPixels * 0.8)); _promoteTitle = dialogView.FindViewById <TextView>(Resource.Id.promote_title); _promoteTitle.Text = AppSettings.LocalizationManager.GetText(LocalizationKeys.PromotePost); _promoteTitle.Typeface = Style.Semibold; _pager = dialogView.FindViewById <ViewPager>(Resource.Id.promote_container); _adapter = new PromotePagerAdapter(Context); _pager.OffscreenPageLimit = 2; _pager.Adapter = _adapter; _pager.SetCurrentItem((int)Pages.Main, false); _pager.PageSelected += PageSelected; _actionBtn = dialogView.FindViewById <Button>(Resource.Id.findpromote_btn); _actionBtn.Text = _actionButtonTitle = AppSettings.LocalizationManager.GetText(LocalizationKeys.FindPromoter); _actionBtn.Typeface = Style.Semibold; _actionBtn.Click += ActionButtonClick; _actionSpinner = dialogView.FindViewById <ProgressBar>(Resource.Id.promote_spinner); _actionSpinner.Visibility = ViewStates.Gone; var close = dialogView.FindViewById <Button>(Resource.Id.close); close.Typeface = Style.Semibold; close.Text = AppSettings.LocalizationManager.GetText(LocalizationKeys.Close); close.Click += CloseOnClick; SetContentView(dialogView); Window.FindViewById(Resource.Id.design_bottom_sheet).SetBackgroundColor(Color.Transparent); var dialogPadding = (int)Android.Util.TypedValue.ApplyDimension(Android.Util.ComplexUnitType.Dip, 10, Context.Resources.DisplayMetrics); Window.DecorView.SetPadding(dialogPadding, dialogPadding, dialogPadding, dialogPadding); base.Show(); var bottomSheet = FindViewById <FrameLayout>(Resource.Id.design_bottom_sheet); var behavior = BottomSheetBehavior.From(bottomSheet); behavior.State = BottomSheetBehavior.StateExpanded; behavior.SetBottomSheetCallback(new CustomBottomSheetCallback()); } }
protected override void OnCreate(Bundle savedInstanceState) { base.OnCreate(savedInstanceState); SetContentView(Resource.Layout.Activity_BottomSheet); LinearLayout sheet = FindViewById <LinearLayout>(Resource.Id.bottom_sheet); BottomSheetBehavior bottomSheetBehavior = BottomSheetBehavior.From(sheet); bottomSheetBehavior.PeekHeight = 300; bottomSheetBehavior.Hideable = true; bottomSheetBehavior.SetBottomSheetCallback(new MyBottomSheetCallBack()); FloatingActionButton fab = FindViewById <FloatingActionButton>(Resource.Id.fab); fab.Click += (o, e) => { bottomSheetBehavior.State = BottomSheetBehavior.StateCollapsed; }; }
private void SetUpBottomSheet(int height) { // Set up bottom sheet BottomSheetBehavior bottomSheetBehavior = BottomSheetBehavior.From(bottomSheet); bottomSheetBehavior.PeekHeight = height; bottomSheetBehavior.SetBottomSheetCallback(new BSCallBack(bgFabMenu)); // Fill sports list List <string> sportList = new List <string>(); foreach (var sport in RequestSender.GetSports()) { sportList.Add(sport.Name); } // Sport spinner var adapter = new ArrayAdapter <string>(this, Android.Resource.Layout.SimpleSpinnerDropDownItem, sportList); sportSpinner.Adapter = adapter; // Date picker searchDates.Focusable = false; searchDates.Click += (sender, e) => { DateTime today = DateTime.Today; DatePickerDialog dialog = new DatePickerDialog(this, OnStartDateSet, today.Year, today.Month, today.Day); dialog.DatePicker.MinDate = today.Millisecond; dialog.Show(); }; // Load events List <WebApi.Classes.Event> events = RequestSender.GetBriefEvents(); eventList.HasFixedSize = true; eventListLayout = new LinearLayoutManager(this); eventList.SetLayoutManager(eventListLayout); eventListAdapter = new PulloutEventAdapter(events); eventList.SetAdapter(eventListAdapter); }
public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle b) { try { var layout = inflater.Inflate(Resource.Layout.layout_control, container, false); Inject(layout); swPower.Click += SwPowerOnCheckedChange; sbVol.OnProgressChanged += SbVolOnProgressChanged; sbCTL.OnProgressChanged += SbCtlOnProgressChanged; sbBass.OnProgressChanged += SbBassOnProgressChanged; sbTreble.OnProgressChanged += SbTrebleOnProgressChanged; bsb = BottomSheetBehavior.From(flSheet); var bc = new ViewHelper.BrinBottomSheetCallBack { OnSlideChanged = OnSlideChanged, OnStateStatusChanged = OnStateStatusChanged }; bsb.SetBottomSheetCallback(bc); llChildAudio.Visibility = ViewStates.Gone; llChildVideo.Visibility = ViewStates.Gone; llChildInp.Visibility = ViewStates.Gone; llChildSou.Visibility = ViewStates.Gone; llChildNet.Visibility = ViewStates.Gone; llChildSlp.Visibility = ViewStates.Gone; OpenBroadcast(); return(layout); } catch (Exception e) { Console.WriteLine(e); throw; } }
public override void Show() { using (var dialogView = LayoutInflater.From(Context).Inflate(Resource.Layout.lyt_successfull_transaction, null)) { dialogView.SetMinimumWidth((int)(Style.ScreenWidth * 0.8)); var title = dialogView.FindViewById <TextView>(Resource.Id.title); title.Typeface = Style.Light; title.Text = AppSettings.LocalizationManager.GetText(LocalizationKeys.TransferSuccess); var recipient = dialogView.FindViewById <TextView>(Resource.Id.recipient); recipient.Typeface = Style.Semibold; recipient.Text = AppSettings.LocalizationManager.GetText(LocalizationKeys.Recipient); var recipientName = dialogView.FindViewById <TextView>(Resource.Id.recipient_value); recipientName.Typeface = Style.Semibold; recipientName.Text = _recipient; var amount = dialogView.FindViewById <TextView>(Resource.Id.amount); amount.Typeface = Style.Semibold; amount.Text = AppSettings.LocalizationManager.GetText(LocalizationKeys.Amount); var amountValue = dialogView.FindViewById <TextView>(Resource.Id.amount_value); amountValue.Typeface = Style.Semibold; amountValue.Text = _amount; var closeBtn = dialogView.FindViewById <Button>(Resource.Id.close); closeBtn.Text = AppSettings.LocalizationManager.GetText(LocalizationKeys.Close); closeBtn.Click += CloseBtnOnClick; SetContentView(dialogView); Window.FindViewById(Resource.Id.design_bottom_sheet).SetBackgroundColor(Color.Transparent); var dialogPadding = (int)TypedValue.ApplyDimension(ComplexUnitType.Dip, 10, Context.Resources.DisplayMetrics); Window.DecorView.SetPadding(dialogPadding, dialogPadding, dialogPadding, dialogPadding); base.Show(); var bottomSheet = FindViewById <FrameLayout>(Resource.Id.design_bottom_sheet); BottomSheetBehavior.From(bottomSheet).State = BottomSheetBehavior.StateExpanded; } }
// ----------------------------------------------------------------------------- // Lifecycle protected override void OnCreate(Bundle savedInstanceState) { base.OnCreate(savedInstanceState); // Init SetContentView(Resource.Layout.Main); Title = "Layout Test"; // Toolbar SetSupportActionBar(FindViewById <Android.Support.V7.Widget.Toolbar>(Resource.Id.toolbar)); // Controls _bottomSheetHeaderLayout = FindViewById <LinearLayout>(Resource.Id.bottomSheetHeaderLayout); _bottomSheetBodyTextView = FindViewById <TextView>(Resource.Id.bottomSheetBodyTextView); _bottomNavigationView = FindViewById <BottomNavigationView>(Resource.Id.bottom_navigation); _bottomNavigationView.NavigationItemSelected += BottomNavigation_NavigationItemSelected; var coordinatorLayout = FindViewById <CoordinatorLayout>(Resource.Id.mainLayout); _bottomSheetScrollView = coordinatorLayout.FindViewById <NestedScrollView>(Resource.Id.bottomSheetScrollView); var bottomSheetBehavior = BottomSheetBehavior.From(_bottomSheetScrollView); //bottomSheetBehavior.PeekHeight = 0; bottomSheetBehavior.SetBottomSheetCallback(new CustomBottomSheetCallback(_bottomSheetHeaderLayout, _bottomSheetBodyTextView, _bottomSheetScrollView)); // Coordinator Layout //var coordinatorLayout = FindViewById<CoordinatorLayout>(Resource.Id.mainLayout); //var colorBottomSheet = coordinatorLayout.FindViewById<NestedScrollView>(Resource.Id.bottomSheetScrollView); //var bottomSheetBehavior = BottomSheetBehavior.From(colorBottomSheet); //var effects = FindViewById<Button>(Resource.Id.effects); //effects.Click += (sender, e) => //{ // bottomSheetBehavior.State = BottomSheetBehavior.StateExpanded; //}; // Load the first fragment on creation LoadFragment(new HomeFragment()); }
protected override void OnCreate(Bundle b) { try { base.OnCreate(b); SetContentView(Resource.Layout.layout_player); Inject(); SetSupportActionBar(tbMain); SupportActionBar.SetDisplayHomeAsUpEnabled(true); tbMain.NavigationClick += delegate { OnBackPressed(); }; bsbMain = BottomSheetBehavior.From(flSheet); bsbMain.Hideable = true; bsbMain.State = BottomSheetBehavior.StateHidden; OpenBroadcast(); } catch (Exception e) { Console.WriteLine(e); } }
public override void Show() { using (var dialogView = LayoutInflater.From(Context).Inflate(Resource.Layout.lyt_coin_pick, null)) { dialogView.SetMinimumWidth((int)(Style.ScreenWidth * 0.8)); var dialogTitle = dialogView.FindViewById <TextView>(Resource.Id.dialog_title); dialogTitle.Typeface = Style.Semibold; dialogTitle.Text = AppSettings.LocalizationManager.GetText(LocalizationKeys.SelectToken); _wheelPicker = dialogView.FindViewById <WheelPicker>(Resource.Id.coin_picker); _wheelPicker.Items = _displayCoins; _wheelPicker.ItemSelected += ItemSelected; _wheelPicker.Select(_selectedPosition); var selectBtn = dialogView.FindViewById <Button>(Resource.Id.select_btn); var cancelBtn = dialogView.FindViewById <Button>(Resource.Id.cacncel_btn); selectBtn.Text = AppSettings.LocalizationManager.GetText(LocalizationKeys.Select); cancelBtn.Text = AppSettings.LocalizationManager.GetText(LocalizationKeys.Cancel); selectBtn.Click += SelectBtnOnClick; cancelBtn.Click += CancelBtnOnClick; SetContentView(dialogView); Window.FindViewById(Resource.Id.design_bottom_sheet).SetBackgroundColor(Color.Transparent); var dialogPadding = (int)TypedValue.ApplyDimension(ComplexUnitType.Dip, 10, Context.Resources.DisplayMetrics); Window.DecorView.SetPadding(dialogPadding, dialogPadding, dialogPadding, dialogPadding); base.Show(); var bottomSheet = FindViewById <FrameLayout>(Resource.Id.design_bottom_sheet); var behavior = BottomSheetBehavior.From(bottomSheet); behavior.State = BottomSheetBehavior.StateExpanded; behavior.SetBottomSheetCallback(new CustomBottomSheetCallback()); } }
protected override void OnCreate(Bundle savedInstanceState) { base.OnCreate(savedInstanceState); //initialize media player mediaPlayerConnection = new CustomServiceConnection(this); DoBindService(); SetContentView(Resource.Layout.activity_exhibit_details); if (Android.OS.Build.VERSION.SdkInt >= Android.OS.BuildVersionCodes.Lollipop) { Window.AddFlags(WindowManagerFlags.DrawsSystemBarBackgrounds); } var toolbar = (Toolbar)FindViewById(Resource.Id.toolbar); toolbar.SetNavigationIcon(Resource.Drawable.ic_clear_white_24dp); SetSupportActionBar(toolbar); audioSeekbar = FindViewById <SeekBar> (Resource.Id.audio_progress_bar); audioSeekbar.ProgressChanged += (sender, args) => { if (mediaPlayerService != null && args.FromUser) { mediaPlayerService.SeekTo(args.Progress); } }; SupportActionBar.SetDisplayHomeAsUpEnabled(true); sharedPreferences = PreferenceManager.GetDefaultSharedPreferences(this); if (savedInstanceState != null) { // activity re-creation because of device rotation, instant run, ... exhibitId = savedInstanceState.GetString(KEY_EXHIBIT_ID); exhibit = ExhibitManager.GetExhibit(exhibitId); currentPageIndex = savedInstanceState.GetInt(KEY_CURRENT_PAGE_INDEX, 0); isAudioPlaying = savedInstanceState.GetBoolean(KEY_AUDIO_PLAYING, false); if (!isAudioPlaying) { pauseAudioPlaybackFlag = true; } isAudioToolbarHidden = savedInstanceState.GetBoolean(KEY_AUDIO_TOOLBAR_HIDDEN, true); if (!isAudioToolbarHidden) { showAudioToolbarFlag = true; } extras = savedInstanceState.GetBundle(KEY_EXTRAS); isCaptionShown = savedInstanceState.GetBoolean(KEY_CAPTION_SHOWN); var selectedTab = savedInstanceState.GetInt(KEY_CURRENT_CAPTION_TAB); var currentSource = savedInstanceState.GetInt(KEY_CURRENT_SOURCE); if (isCaptionShown) { ShowCaptions(selectedTab, currentSource); } isHelpDialogShown = savedInstanceState.GetBoolean(KEY__HELP_DIALOG_SHOWN, false); isSwitchToNextPageAutomatically = savedInstanceState.GetBoolean(KEY_PAGE_SWITCH_BASED_ON_SETTINGS, false); } else { // activity creation because of intent var intent = Intent; extras = intent.Extras; exhibitId = intent.GetStringExtra(INTENT_EXTRA_EXHIBIT_ID); exhibit = ExhibitManager.GetExhibit(exhibitId); } Title = exhibit.Name; if (exhibit.Pages.Count == 0) { throw new NullPointerException("Cannot display exhibit with no pages."); } // set up bottom sheet behavior bottomSheet = FindViewById(Resource.Id.bottom_sheet); bottomSheetBehavior = BottomSheetBehavior.From(bottomSheet); bottomSheetBehavior.SetBottomSheetCallback(new CustomBottomSheetCallback(this)); // audio toolbar revealView = (LinearLayout)FindViewById(Resource.Id.reveal_items); revealView.Visibility = ViewStates.Invisible; // Does not work with animations: // see also: http://stackoverflow.com/questions/7289827/how-to-start-animation-immediately-after-oncreate // set up play / pause toggle btnPlayPause = (ImageButton)FindViewById(Resource.Id.btnPlayPause); btnPlayPause.Click += (sender, args) => { if (isAudioPlaying) { PauseAudioPlayback(); isAudioPlaying = false; } else { StartAudioPlayback(); isAudioPlaying = true; btnPlayPause.SetImageResource(Android.Resource.Color.Transparent); } UpdatePlayPauseButtonIcon(); }; // set up CC button var btnCaptions = (ImageButton)FindViewById(Resource.Id.btnCaptions); btnCaptions.Click += (sender, args) => { ShowCaptions(); }; // set up previous / next button btnPreviousPage = (ImageButton)FindViewById(Resource.Id.buttonPrevious); btnPreviousPage.Click += (sender, args) => { DisplayPreviousExhibitPage(); }; btnNextPage = (ImageButton)FindViewById(Resource.Id.buttonNext); btnNextPage.Click += (sender, args) => { DisplayNextExhibitPage(); }; fab = (FloatingActionButton)FindViewById(Resource.Id.fab); fab.Click += (sender, args) => { switch (fabAction) { case BottomSheetConfig.FabAction.Next: DisplayNextExhibitPage(); break; case BottomSheetConfig.FabAction.Collapse: SetFabAction(BottomSheetConfig.FabAction.Expand); break; case BottomSheetConfig.FabAction.Expand: SetFabAction(BottomSheetConfig.FabAction.Collapse); break; default: throw new IllegalArgumentException("Unsupported FAB action!"); } }; }
protected override void OnCreate(Bundle savedInstanceState) { base.OnCreate(savedInstanceState); RequestedOrientation = ScreenOrientation.Portrait; SetContentView(Resource.Layout.Activity_BottomSheet); SetUpMap(); name_txt = FindViewById <TextView>(Resource.Id.name_txt); address_txt = FindViewById <TextView>(Resource.Id.address_txt); time_txt = FindViewById <TextView>(Resource.Id.time_txt); SupportToolbar toolBar = FindViewById <SupportToolbar>(Resource.Id.toolbar); SetSupportActionBar(toolBar); SupportActionBar ab = SupportActionBar; ab.SetHomeAsUpIndicator(Resource.Mipmap.menu_but); ab.SetDisplayHomeAsUpEnabled(true); mDrawerLayout = FindViewById <DrawerLayout>(Resource.Id.drawer_layout); NavigationView navigationView = FindViewById <NavigationView>(Resource.Id.nav_view); if (navigationView != null) { SetUpDrawerContent(navigationView); } //var menu = FindViewById<DrawerLayout>(Resource.Id.drawer_layout); //menu_but = FindViewById<Button>(Resource.Id.menu_but); //menu_but.Click += (sender, e) => //{ // mDrawerLayout.OpenDrawer((int)GravityFlags.Left); //}; cancel_ride_but = FindViewById <Button>(Resource.Id.cancel_ride_but); cancel_ride_but.Click += delegate { Toast.MakeText(this, "Votre course a bien ete annuler!", ToastLength.Long).Show(); Finish(); }; call_but = FindViewById <Button>(Resource.Id.call_but); call_but.Click += delegate { Toast.MakeText(this, "call button clicked!", ToastLength.Long).Show(); Finish(); }; message_but = FindViewById <Button>(Resource.Id.message_but); message_but.Click += delegate { Toast.MakeText(this, "message button clicked!", ToastLength.Long).Show(); Finish(); }; LinearLayout sheet = FindViewById <LinearLayout>(Resource.Id.bottom_sheet); BottomSheetBehavior bottomSheetBehavior = BottomSheetBehavior.From(sheet); bottomSheetBehavior.PeekHeight = 300; bottomSheetBehavior.Hideable = true; bottomSheetBehavior.SetBottomSheetCallback(new MyBottomSheetCallBack()); FloatingActionButton fab = FindViewById <FloatingActionButton>(Resource.Id.fab); fab.Click += (o, e) => { bottomSheetBehavior.State = BottomSheetBehavior.StateCollapsed; Finish(); }; // FIN MAIN____________________________________________________________________ }
protected override async void OnCreate(Bundle savedInstanceState) { base.OnCreate(savedInstanceState); SetContentView(Resource.Layout.activity_game); firstTime = true; // By default, enable auto camera autoCamera = true; preferences = new AppPreferences(this); // Get main view mainView = FindViewById <CoordinatorLayout>(Resource.Id.layout_game); mainView.Visibility = ViewStates.Invisible; // Get last known location locationHandler = new LocationHandler(this); userLocation = await locationHandler.GetLastKnownLocationAsync(); // Get map and listen when it's ready var mapFragment = (SupportMapFragment)SupportFragmentManager.FindFragmentById(Resource.Id.map); mapFragment.GetMapAsync(this); var textDebugLocation = FindViewById <TextView>(Resource.Id.text_debug_location); locationHandler.OnLocationUpdate += location => { // TODO: Check speed etc. here // TODO: Show a loading dialog until we get the first position Log.Info("POSITION", $"Long={location.Longitude} Lat={location.Latitude} Speed={location.Speed}"); textDebugLocation.Text = $"Accuracy: {location.Accuracy}%\nSpeed: {location.Speed} m/s"; // Update user location userLocation = location; if (location.Speed > 0 && battleView.Visibility != ViewStates.Visible) { AccountManager.CurrentUser.Health += 1; } // If map hasn't loaded yet, ignore player marker if (playerMarker == null) { return; } playerMarker.Position = location.ToLatLng(); if (autoCamera) { googleMap.AnimateCamera(CameraUpdateFactory.NewLatLng(location.ToLatLng())); } }; // Show profile when clicking on button fabUser = FindViewById <FloatingActionButton>(Resource.Id.fabUser); fabMap = FindViewById <FloatingActionButton>(Resource.Id.fabGame); fabUser.Click += (sender, args) => ToggleProfile(true); fabMap.Click += (sender, args) => ToggleProfile(false); // Set up profile view profileView = FindViewById <ViewStub>(Resource.Id.stub_profile).Inflate(); // Hide it in code to be able to see it when designing in xml profileView.Visibility = ViewStates.Invisible; // Set values on profile profileView.FindViewById <ImageButton>(Resource.Id.button_settings).Click += (sender, args) => StartActivity(new Intent(this, typeof(SettingsActivity))); equippedCubes = new ImageButton[3]; equippedCubeNames = new TextView[3]; equippedCubes[0] = profileView.FindViewById <ImageButton>(Resource.Id.inventory_companion_1); equippedCubes[1] = profileView.FindViewById <ImageButton>(Resource.Id.inventory_companion_2); equippedCubes[2] = profileView.FindViewById <ImageButton>(Resource.Id.inventory_companion_3); // Show companion info on click for (var i = 0; i < equippedCubes.Length; i++) { // Local copy of i var i2 = i; equippedCubes[i].Click += (sender, args) => Alert.ShowCompanionInfo(this, AccountManager.CurrentUser.EquippedCompanions[i2]); } equippedCubeNames[0] = profileView.FindViewById <TextView>(Resource.Id.text_companion_name_1); equippedCubeNames[1] = profileView.FindViewById <TextView>(Resource.Id.text_companion_name_2); equippedCubeNames[2] = profileView.FindViewById <TextView>(Resource.Id.text_companion_name_3); // Avoid clicking through profile view profileView.Touch += (sender, args) => args.Handled = true; // Inflate battle view battleView = FindViewById <ViewStub>(Resource.Id.stub_battle).Inflate(); battleView.Visibility = ViewStates.Invisible; // Avoid clicking through battle view battleView.Touch += (sender, args) => args.Handled = true; // Check if using fullscreen HUD if (preferences.Fullscreen) { void HudUpdate() { var batteryManager = (BatteryManager)GetSystemService(BatteryService); var hud = mainView.FindViewById <TextView>(Resource.Id.text_game_hud); hud.SetTextColor(IsMapDay ? Color.Black : Color.White); Task.Run(() => { while (preferences.Fullscreen) { var time = DateTime.Now.ToString("HH:mm"); var battery = batteryManager.GetIntProperty((int)BatteryProperty.Capacity); hud.Text = $"{time} | {battery}%"; Thread.Sleep(1000); } }); } // Wrap it in a function to avoid an async warning HudUpdate(); } // Setup debug mode FindViewById <Button>(Resource.Id.button_debug_focus_player).Click += (sender, args) => googleMap.AnimateCamera(CameraUpdateFactory.NewLatLng(userLocation.ToLatLng())); FindViewById <Button>(Resource.Id.button_debug_respawn).Click += (sender, args) => AccountManager.CurrentUser.HealthPercentage = 100; battleInfoView = FindViewById <LinearLayout>(Resource.Id.layout_battle_info); battleInfo = BottomSheetBehavior.From(battleInfoView); battleInfo.State = BottomSheetBehavior.StateHidden; // Avoid clicking through battle info view battleInfoView.Touch += (sender, args) => args.Handled = true; battleInfoView.FindViewById <Button>(Resource.Id.button_battle_info_fight).Click += (sender, args) => StartBattle(); // Add auto camera toggle FindViewById <Switch>(Resource.Id.switch_debug_auto_camera).CheckedChange += (sender, args) => autoCamera = args.IsChecked; if (!MainActivity.DebugMode) { FindViewById <LinearLayout>(Resource.Id.layout_debug_tools).Visibility = ViewStates.Gone; } // So we can manually set a battle range battleRange = preferences.DevBattleRange; SetUser(); }