protected override void OnCreate(Bundle savedInstanceState) { base.OnCreate(savedInstanceState); MobileBarcodeScanner.Initialize(Application); Window.SetFlags(WindowManagerFlags.Secure, WindowManagerFlags.Secure); SetContentView(Resource.Layout.activityMain); if (savedInstanceState != null) { _isAuthenticated = savedInstanceState.GetBoolean("isAuthenticated"); _pauseTime = new DateTime(savedInstanceState.GetLong("pauseTime")); } else { _isAuthenticated = false; _pauseTime = DateTime.MinValue; } _toolbar = FindViewById <MaterialToolbar>(Resource.Id.toolbar); SetSupportActionBar(_toolbar); SupportActionBar.SetTitle(Resource.String.categoryAll); var appBarLayout = FindViewById <AppBarLayout>(Resource.Id.appBarLayout); _bottomAppBar = FindViewById <BottomAppBar>(Resource.Id.bottomAppBar); _bottomAppBar.NavigationClick += OnBottomAppBarNavigationClick; _bottomAppBar.MenuItemClick += delegate { _toolbar.Menu.FindItem(Resource.Id.actionSearch).ExpandActionView(); appBarLayout.SetExpanded(true); _authList.SmoothScrollToPosition(0); }; _coordinatorLayout = FindViewById <CoordinatorLayout>(Resource.Id.coordinatorLayout); _progressBar = FindViewById <ProgressBar>(Resource.Id.appBarProgressBar); _addButton = FindViewById <FloatingActionButton>(Resource.Id.buttonAdd); _addButton.Click += OnAddButtonClick; _authList = FindViewById <RecyclerView>(Resource.Id.list); _emptyStateLayout = FindViewById <LinearLayout>(Resource.Id.layoutEmptyState); _emptyMessageText = FindViewById <TextView>(Resource.Id.textEmptyMessage); _viewGuideButton = FindViewById <MaterialButton>(Resource.Id.buttonViewGuide); _viewGuideButton.Click += delegate { StartActivity(typeof(GuideActivity)); }; _refreshOnActivityResume = false; DetectGoogleAPIsAvailability(); var prefs = PreferenceManager.GetDefaultSharedPreferences(this); var firstLaunch = prefs.GetBoolean("firstLaunch", true); if (firstLaunch) { StartActivity(typeof(IntroActivity)); } }
protected override void OnCreate(Bundle savedInstanceState) { base.OnCreate(savedInstanceState); Window.SetFlags(WindowManagerFlags.Secure, WindowManagerFlags.Secure); SetContentView(Resource.Layout.activityMain); var toolbar = FindViewById <Toolbar>(Resource.Id.toolbar); SetSupportActionBar(toolbar); SupportActionBar.SetTitle(Resource.String.categoryAll); _bottomAppBar = FindViewById <BottomAppBar>(Resource.Id.bottomAppBar); _bottomAppBar.NavigationClick += OnBottomAppBarNavigationClick; _bottomAppBar.MenuItemClick += (sender, args) => { toolbar.Menu.FindItem(Resource.Id.actionSearch).ExpandActionView(); _authList.SmoothScrollToPosition(0); }; _coordinatorLayout = FindViewById <CoordinatorLayout>(Resource.Id.coordinatorLayout); _progressBar = FindViewById <ProgressBar>(Resource.Id.appBarProgressBar); _addButton = FindViewById <FloatingActionButton>(Resource.Id.buttonAdd); _addButton.Click += OnAddButtonClick; _authList = FindViewById <RecyclerView>(Resource.Id.list); _emptyStateLayout = FindViewById <LinearLayout>(Resource.Id.layoutEmptyState); _emptyMessageText = FindViewById <TextView>(Resource.Id.textEmptyMessage); _viewGuideButton = FindViewById <MaterialButton>(Resource.Id.buttonViewGuide); _viewGuideButton.Click += (sender, args) => { StartChildActivity(typeof(GuideActivity)); }; _isChildActivityOpen = false; _keyguardManager = (KeyguardManager)GetSystemService(KeyguardService); MobileBarcodeScanner.Initialize(Application); _barcodeScanner = new MobileBarcodeScanner(); DetectGoogleAPIsAvailability(); var prefs = PreferenceManager.GetDefaultSharedPreferences(this); var firstLaunch = prefs.GetBoolean("firstLaunch", true); if (firstLaunch) { StartChildActivity(typeof(IntroActivity)); } }
protected override void OnCreate(Bundle savedInstanceState) { base.OnCreate(savedInstanceState); Xamarin.Essentials.Platform.Init(this, savedInstanceState); SetContentView(Resource.Layout.Main); drawerLayout = FindViewById <DrawerLayout>(Resource.Layout.Main); FloatingActionButton fab = FindViewById <FloatingActionButton>(Resource.Id.fab); bottomAppBar = FindViewById <BottomAppBar>(Resource.Id.bottom_app_bar); bottomAppBar.NavigationClick += BottomAppBar_NavigationClick; bottomAppBar.MenuItemClick += BottomAppBar_MenuItemClick; if (fab != null) { fab.Click += FabOnClick; } SetSupportActionBar(bottomAppBar); }
//protected override void OnElementPropertyChanged(object sender, PropertyChangedEventArgs e) //{ // base.OnElementPropertyChanged(sender, e); //} CoordinatorLayout GetLayout() { coordinatorLayout = new CoordinatorLayout(this.Context); coordinatorLayout.LayoutParameters = new CoordinatorLayout.LayoutParams(LayoutParams.MatchParent, LayoutParams.MatchParent); //Width, Height; var bottombar = new BottomAppBar(this.Context); bottombar.LayoutParameters = new BottomAppBar.LayoutParams(LayoutParams.MatchParent, LayoutParams.WrapContent); //Width, Height; bottombar.SetForegroundGravity(GravityFlags.Bottom); bottombar.Id = 666; bottombar.BackgroundTint = ContextCompat.GetColorStateList(this.Context, Resource.Color.colorPrimary); bottombar.FabAlignmentMode = BottomAppBar.FabAlignmentModeCenter; bottombar.NavigationIcon = Context.GetDrawable(Resource.Drawable.homeIcon); floatingActionButton = new FloatingActionButton(this.Context); //var layoutParams = fab.LayoutParameters; CoordinatorLayout.LayoutParams layoutParams = (CoordinatorLayout.LayoutParams)floatingActionButton.LayoutParameters; layoutParams.Width = LayoutParams.WrapContent; layoutParams.Height = LayoutParams.WrapContent; layoutParams.AnchorId = bottombar.Id; floatingActionButton.LayoutParameters = layoutParams; floatingActionButton.SetImageResource(Resource.Drawable.plus); return(null); }
protected override void OnCreate(Bundle savedInstanceState) { base.OnCreate(savedInstanceState); Xamarin.Essentials.Platform.Init(this, savedInstanceState); SetContentView(Resource.Layout.activity_main); CurrentUserUid = Intent.GetStringExtra("CurrentUserUid"); CurrentUserDisplayName = Intent.GetStringExtra("CurrentUserDisplayName"); //CurrentUserEmail = Intent.GetStringExtra("CurrentUserEmail"); CurrentUserPhoto = Intent.GetStringExtra("CurrentUserPhoto"); // var ButtonClickStatus = Intent.GetStringExtra("ButtonClickStatus"); database = AppDataHelper.GetDatabase(); firebaseAuth = AppDataHelper.GetFirebaseAuth(); this.Window.AddFlags(WindowManagerFlags.DrawsSystemBarBackgrounds); this.Window.ClearFlags(WindowManagerFlags.TranslucentStatus); this.Window.SetStatusBarColor(Color.ParseColor("#204060")); var toolbar = FindViewById <Toolbar>(Resource.Id.toolbar); SetSupportActionBar(toolbar); toolbar.SetNavigationOnClickListener(this); SupportActionBar.SetDisplayHomeAsUpEnabled(true); SupportActionBar.SetDisplayShowTitleEnabled(true); // SupportActionBar.SetHomeButtonEnabled(true); SupportActionBar.SetHomeAsUpIndicator(Resource.Drawable.baseline_notes_24); nodataicon = FindViewById <ImageView>(Resource.Id.nodataicon); homeText = FindViewById <TextView>(Resource.Id.homeText); statsText = FindViewById <TextView>(Resource.Id.statsText); calendarpickericon = FindViewById <ImageView>(Resource.Id.calendarpickericon); calendarpickericon.SetColorFilter(Color.ParseColor("#04040C")); drawerLayout = FindViewById <DrawerLayout>(Resource.Id.drawer_layout); drawerLayout.AddDrawerListener(this); navigationView = FindViewById <NavigationView>(Resource.Id.nav_view); navigationView.SetNavigationItemSelectedListener(this); View headerView = navigationView.GetHeaderView(0); navheader_username = headerView.FindViewById <TextView>(Resource.Id.navheader_username); navheader_username.Text = CurrentUserDisplayName; ProfilePic = headerView.FindViewById <ImageView>(Resource.Id.ProfilePic); versionno = FindViewById <TextView>(Resource.Id.versionno); versionno.Text = "v " + Application.Context.ApplicationContext.PackageManager.GetPackageInfo(Application.Context.ApplicationContext.PackageName, 0).VersionName; //Android.Net.Uri myUri = Android.Net.Uri.Parse(CurrentUserPhoto); //if (CrossConnectivity.Current.IsConnected) //{ // var imageBitmap = GetImageBitmapFromUrl(CurrentUserPhoto); // ProfilePic.SetImageBitmap(imageBitmap); //} Picasso.Get().Load(CurrentUserPhoto).Placeholder(Resource.Drawable.icon).Into(ProfilePic); // ProfilePic.SetImageURI(myUri); //ProfilePic.SetImageURI(CurrentUserPhoto); recyclerView = FindViewById <RecyclerView>(Resource.Id.recyclerView); nestedscroolview = FindViewById <NestedScrollView>(Resource.Id.nestedscroolview); MarginItemDecoration_Hor marginItemDecoration_Hor = new MarginItemDecoration_Hor(15, true, true); recyclerView.AddItemDecoration(marginItemDecoration_Hor); prefs = PreferenceManager.GetDefaultSharedPreferences(this); AppDataHelper.editor = prefs.Edit(); var mString = prefs.GetString("CurrencySymbolSelected", ""); if (mString == "") { AppDataHelper.editor.PutString("CurrencySymbolSelected", GetString(Resource.String.Rs)); AppDataHelper.editor.PutString("CurrencyTextSelected", GetString(Resource.String.RsCurrency)); AppDataHelper.editor.Apply(); } var mStringOrderBySelected = prefs.GetString("OrderBySelected", ""); if (mStringOrderBySelected == "") { AppDataHelper.editor.PutString("OrderBySelected", "DateDay"); AppDataHelper.editor.Apply(); } //else //{ //} totalexpenseVALUE = FindViewById <TextView>(Resource.Id.totalexpenseVALUE); totalexpenseVALUE.Text = prefs.GetString("CurrencySymbolSelected", "") + "0"; Datetxt = FindViewById <TextView>(Resource.Id.Datetxt); Datetxt.Text = DateTime.Now.DayOfWeek + ", " + DateTime.Today.Day + " " + DateTime.Now.ToString("MMMM", CultureInfo.InvariantCulture) + " " + DateTime.Today.Year; YearSelected = DateTime.Today.Year.ToString(); MonthSelected = DateTime.Now.ToString("MMMM", CultureInfo.InvariantCulture); homeText.SetCompoundDrawablesWithIntrinsicBounds(null, GetDrawable(Resource.Drawable.baseline_home_24), null, null); statsText.SetCompoundDrawablesWithIntrinsicBounds(null, GetDrawable(Resource.Drawable.outline_insert_chart_24), null, null); homeText.Click += HomeText_Click; statsText.Click += StatsText_Click; fab = FindViewById <FloatingActionButton>(Resource.Id.fab); fab.Click += Fab_Click; if (VersionTracking.IsFirstLaunchEver) { currencyModal_Fragment = new CurrencyModal_Fragment(); var trans = SupportFragmentManager.BeginTransaction(); currencyModal_Fragment.Show(trans, "Currency"); } calendarpickericon.Click += Calendartxt_Click; TotalExpenseValue = new List <string>(); parentObjects = new List <IParentObject>(); SetupVerticalRecyclerView(); DisplayAndBindMonthRecyclerView(); int day = DateTime.Now.Day; int month = DateTime.Now.Month - 1; int year = DateTime.Now.Year; picker = new DatePickerDialog(this); picker.UpdateDate(year, month, day); bottomAppBar = FindViewById <BottomAppBar>(Resource.Id.bar); childListsearch = new List <ExpenseItemChild>(); //FetchAndListenExpensesTable(); recyclerView.SetOnClickListener(this); }
//private void HardwareButtons_BackPressed(object sender, Windows.Phone.UI.Input.BackPressedEventArgs e) //{ // e.Handled = true; // if(Frame.CanGoBack) // { // Frame.GoBack(); // } //} public About() { //if ("Windows.Mobile" == Windows.System.Profile.AnalyticsInfo.VersionInfo.DeviceFamily) // Windows.Phone.UI.Input.HardwareButtons.BackPressed += HardwareButtons_BackPressed; this.InitializeComponent(); storyBoard.Begin(); Task.Run(async() => { await this.Dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Normal, () => { BottomAppBar.Focus(FocusState.Programmatic); }); }); }