public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { view = base.OnCreateView(inflater, container, savedInstanceState); transactionsList = view.FindViewById <MvxListView>(Resource.Id.transactions_list); scoreImage = view.FindViewById <ImageView>(Resource.Id.score_image); collectionBackgroundView = view.FindViewById <View>(Resource.Id.collection_background_view); view.FindViewById <Button>(Resource.Id.see_em_button).Click += (s, e) => { (Activity as MainActivity).SetRequiredCurrentTab(2); }; view.FindViewById <Button>(Resource.Id.do_more_button).Click += (s, e) => { (Activity as MainActivity).SetRequiredCurrentTab(3); }; var bottomBackgroundLayout = view.FindViewById <LinearLayout>(Resource.Id.bottom_white_background); transactionsList.Adapter = new TransactionsAdapter(this.Activity, (IMvxAndroidBindingContext)BindingContext, transactionsList, bottomBackgroundLayout); scrollView = view.FindViewById <LockableScrollView>(Resource.Id.scrollView); scrollHelper = new PointsScrollHelper(scrollView, false, GetType()); UpdateControls(); scrollView.ScrollChange += async(s, e) => { OnScrollViewChanged(s, e); if (scrollView.GetChildAt(0).Height - scrollView.Height <= scrollView.ScrollY) { if (!ViewModel.IsLoadingMore && !ViewModel.IsBusy) { await ViewModel.LoadMoreTransactions(); } } }; return(view); }
protected override void OnCreate(Bundle bundle) { base.OnCreate(bundle); App.CurrentActivity = this; SetContentView(Resource.Layout.welcome); // Create your application here viewModel = new WelcomeViewModel(); viewModel.PropertyChanged += HandlePropertyChanged; progressBar = FindViewById<ProgressBar>(Resource.Id.progressBar); buttonPlay = FindViewById<Button>(Resource.Id.button_play); buttonAbout = FindViewById<ImageButton>(Resource.Id.button_about); background = FindViewById<ImageView>(Resource.Id.background); map = FindViewById<QuestMapView>(Resource.Id.map); scrollView = FindViewById<LockableScrollView>(Resource.Id.map_scroll); //scrollView.IsScrollable = true; scrollView.SmoothScrollingEnabled = true; map.SetPins(new [] { MapPinPosition.Center, MapPinPosition.Right, MapPinPosition.Left, MapPinPosition.Center, MapPinPosition.Left, MapPinPosition.Center, MapPinPosition.Right, MapPinPosition.Left, MapPinPosition.Right, MapPinPosition.Center, MapPinPosition.Left, MapPinPosition.Center }); buttonPlay.Click += (sender, args) => { if (viewModel.GameLoaded && viewModel.Game != null && viewModel.Game.Started) { GoToGame(); return; } viewModel.LoadGameCommand.Execute(null); }; buttonAbout.Click += (sender, args) => { StartActivity(new Intent(this, typeof(AboutActivity))); OverridePendingTransition(Resource.Animation.slide_in_left, Resource.Animation.slide_out_left); }; }
protected override void OnCreate(Bundle bundle) { base.OnCreate(bundle); App.CurrentActivity = this; SetContentView(Resource.Layout.welcome); // Create your application here viewModel = new WelcomeViewModel(); viewModel.PropertyChanged += HandlePropertyChanged; progressBar = FindViewById <ProgressBar>(Resource.Id.progressBar); buttonPlay = FindViewById <Button>(Resource.Id.button_play); buttonAbout = FindViewById <ImageButton>(Resource.Id.button_about); background = FindViewById <ImageView>(Resource.Id.background); map = FindViewById <QuestMapView>(Resource.Id.map); scrollView = FindViewById <LockableScrollView>(Resource.Id.map_scroll); //scrollView.IsScrollable = true; scrollView.SmoothScrollingEnabled = true; map.SetPins(new [] { MapPinPosition.Center, MapPinPosition.Right, MapPinPosition.Left, MapPinPosition.Center, MapPinPosition.Left, MapPinPosition.Center, MapPinPosition.Right, MapPinPosition.Left, MapPinPosition.Right, MapPinPosition.Center, MapPinPosition.Left, MapPinPosition.Center }); buttonPlay.Click += (sender, args) => { if (viewModel.GameLoaded && viewModel.Game != null && viewModel.Game.Started) { GoToGame(); return; } viewModel.LoadGameCommand.Execute(null); }; buttonAbout.Click += (sender, args) => { StartActivity(new Intent(this, typeof(AboutActivity))); OverridePendingTransition(Resource.Animation.slide_in_left, Resource.Animation.slide_out_left); }; }
public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { view = base.OnCreateView(inflater, container, savedInstanceState); scoreImage = view.FindViewById <ImageView>(Resource.Id.score_image); var pointsList = view.FindViewById <MvxListView>(Resource.Id.points_list); collectionBackgroundView = view.FindViewById <View>(Resource.Id.collection_background_view); pointsAdapter = new PointsAdapter(this.Activity, (IMvxAndroidBindingContext)BindingContext, pointsList); pointsList.Adapter = pointsAdapter; GetScoreFill(); UpdateControls(); scrollView = view.FindViewById <LockableScrollView>(Resource.Id.scrollView); scrollHelper = new PointsScrollHelper(scrollView, false, GetType()); scrollView.ScrollChange += (s, e) => { OnScrollViewChanged(s, e); }; return(view); }
protected override void OnCreate(Bundle bundle) { base.OnCreate(bundle); // Set our view from the "main" layout resource SetContentView(Resource.Layout.Main); EditText e = new EditText(this); e.InputType = InputTypes.TextFlagNoSuggestions; viewModel = new HomeViewModel(); buttonPlay = FindViewById <Button>(Resource.Id.button_play); buttonPlay.Click += ButtonPlayOnClick; background = FindViewById <ImageView>(Resource.Id.background); map = FindViewById <HareAndHoundsMapView>(Resource.Id.map); scrollView = FindViewById <LockableScrollView>(Resource.Id.map_scroll); scrollView.SmoothScrollingEnabled = true; map.SetPins(new[] { MapPinPosition.Center, MapPinPosition.Right, MapPinPosition.Left, MapPinPosition.Center, MapPinPosition.Left, MapPinPosition.Center, MapPinPosition.Right, MapPinPosition.Left, MapPinPosition.Right, MapPinPosition.Center, MapPinPosition.Left, MapPinPosition.Center }); // Get our button from the layout resource, // and attach an event to it }
public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { view = base.OnCreateView(inflater, container, savedInstanceState); leaderboardList = view.FindViewById <MvxListView>(Resource.Id.leaderboard_list); tvOverall = view.FindViewById <TextView>(Resource.Id.tv_overall); tvRanked = view.FindViewById <TextView>(Resource.Id.tv_ranked); userPhoto = view.FindViewById <MvxAppCompatImageView>(Resource.Id.user_photo); collectionBackgroundView = view.FindViewById <View>(Resource.Id.collection_background_view); view.FindViewById <Button>(Resource.Id.earn_button).Click += (s, e) => { (Activity as MainActivity).SetRequiredCurrentTab(3); }; adapter = new LeaderboardAdapter(this.Activity, (IMvxAndroidBindingContext)BindingContext, leaderboardList); leaderboardList.Adapter = adapter; UpdateControls(); scrollView = view.FindViewById <LockableScrollView>(Resource.Id.scrollView); scrollHelper = new PointsScrollHelper(scrollView, false, GetType()); scrollView.ScrollChange += (s, e) => { OnScrollViewChanged(s, e); }; return(view); }
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.DeveloperModeEnabled == 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.GetCurrentContainerDisplayWidth( ), this.Resources.DisplayMetrics.HeightPixels ), OnResultViewDone ); ResultView.Hide( ); // setup the tutorial overlay TutorialBacker = new View( Rock.Mobile.PlatformSpecific.Android.Core.Context ); TutorialBacker.LayoutParameters = new RelativeLayout.LayoutParams( ViewGroup.LayoutParams.MatchParent, ViewGroup.LayoutParams.MatchParent ); TutorialBacker.Alpha = 0; TutorialBacker.SetBackgroundColor( Android.Graphics.Color.Black ); layout.AddView( TutorialBacker ); AnimatingTutorial = false; TutorialOverlay = new ImageView( Rock.Mobile.PlatformSpecific.Android.Core.Context ); TutorialOverlay.LayoutParameters = new RelativeLayout.LayoutParams( ViewGroup.LayoutParams.WrapContent, ViewGroup.LayoutParams.WrapContent ); ((RelativeLayout.LayoutParams)TutorialOverlay.LayoutParameters ).AddRule( LayoutRules.CenterInParent ); TutorialOverlay.Alpha = 0; TutorialOverlay.SetBackgroundColor( Android.Graphics.Color.Transparent ); layout.AddView( TutorialOverlay ); NavBarRevealTracker = new NavBarReveal( ); return layout; }
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.OnTouchIntercept = OnInterceptTouchEvent; ScrollView.OnChangedScroll = OnScrollChanged; ((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 (MobileApp.Shared.Network.RockLaunchData.Instance.Data.DeveloperModeEnabled == 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.GetCurrentContainerDisplayWidth( ), this.Resources.DisplayMetrics.HeightPixels), OnResultViewDone); ResultView.Hide( ); // setup the tutorial overlay TutorialBacker = new View(Rock.Mobile.PlatformSpecific.Android.Core.Context); TutorialBacker.LayoutParameters = new RelativeLayout.LayoutParams(ViewGroup.LayoutParams.MatchParent, ViewGroup.LayoutParams.MatchParent); TutorialBacker.Alpha = 0; TutorialBacker.SetBackgroundColor(Android.Graphics.Color.Black); layout.AddView(TutorialBacker); AnimatingTutorial = false; TutorialOverlay = new ImageView(Rock.Mobile.PlatformSpecific.Android.Core.Context); TutorialOverlay.LayoutParameters = new RelativeLayout.LayoutParams(ViewGroup.LayoutParams.WrapContent, ViewGroup.LayoutParams.WrapContent); ((RelativeLayout.LayoutParams)TutorialOverlay.LayoutParameters).AddRule(LayoutRules.CenterInParent); TutorialOverlay.Alpha = 0; TutorialOverlay.SetBackgroundColor(Android.Graphics.Color.Transparent); layout.AddView(TutorialOverlay); NavBarRevealTracker = new NavBarReveal( ); return(layout); }