protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);
            SetContentView(Resource.Layout.Main);
            var toolbar = FindViewById<Android.Support.V7.Widget.Toolbar>(Resource.Id.toolbar);
            SetSupportActionBar(FindViewById<Android.Support.V7.Widget.Toolbar>(Resource.Id.toolbar));

            // Create list with demo content
            var list = new List<string> { "Lorem ipsum dolor", "Sit amet, consetetur", "Sadipscing elitr", 
                "Lorem ipsum dolor", "Sit amet, consetetur", "Sadipscing elitr", "Lorem ipsum dolor", "Sit amet, consetetur", "Sadipscing elitr",
                "Lorem ipsum dolor", "Sit amet, consetetur", "Sadipscing elitr", "Lorem ipsum dolor", "Sit amet, consetetur", "Sadipscing elitr"
            };
                    
            FindViewById<ListView>(Resource.Id.listView).Adapter = new ArrayAdapter(this, Android.Resource.Layout.SimpleListItem1, list);

            // Set colors for swipe container and attach a refresh listener
            swipeContainer = FindViewById<SwipeRefreshLayout>(Resource.Id.slSwipeContainer);
            swipeContainer.SetColorSchemeResources(Android.Resource.Color.HoloBlueLight, Android.Resource.Color.HoloGreenLight, Android.Resource.Color.HoloOrangeLight, Android.Resource.Color.HoloRedLight);
            swipeContainer.Refresh += SwipeContainer_Refresh;

            // Uncomment to following line if you want to show the loading indicator from the beginning
            // It has to be delayed until the swipeContainer has been completely loaded to take effect
            // swipeContainer.Post(() => { swipeContainer.Refreshing = true; });

            // Manually show refreshing indicator on button press
            FindViewById<Button>(Resource.Id.button).Click += async delegate(object sender, EventArgs e)
            {
                swipeContainer.Refreshing = true;
                await Task.Delay(5000);
                swipeContainer.Refreshing = false;
            };
        }
		public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
		{
			var view = inflater.Inflate(Resource.Layout.ListViewWithSwipe, container, false);


			SwipeRefreshLayout = (SwipeRefreshLayout)view.FindViewById(Resource.Id.swipe_refresh_layout);
			SwipeRefreshLayout.SetColorSchemeColors(Resource.Color.tenBlue,
				Resource.Color.colorPrimary,
				Resource.Color.colorAccent,
				Resource.Color.colorPrimaryDark);
			SwipeRefreshLayout.Refresh += async delegate
			{
				await FetchTableData();
			};


			ListView = view.FindViewById<ListView>(Resource.Id.list);
			ListView.SetOnScrollListener(new TailFetchListViewListener(this));
			ListView.AddFooterView(FooterView, null, false);
			ListView.ItemClick += (object sender, AdapterView.ItemClickEventArgs e) =>
			{
				TenServiceHelper.GoToGuestProfile(FragmentManager, Master.Id, TableItems[e.Position]);
			};


			BackgroundTextView = (TextView)view.FindViewById<TextView>(Resource.Id.backgroundTextView);
			BackgroundTextView.Text = EmptyTableString;
			return view;
		}
    protected override void OnCreate (Bundle bundle)
		{
			base.OnCreate (bundle);
			SetContentView (Resource.Layout.MainScreenActivityView);
			//this.Window.AddFlags(WindowManagerFlags.Fullscreen);
			PopulateTabs ();
            _tabHost = FindViewById<TabHost>(Resource.Id.tabHost1);
            //set selected tab if there is a topic (coming from a notification)
            try
            {
			string topic = Intent.GetStringExtra("topic");
			if (topic != null) {

                    _tabHost.SetCurrentTabByTag (topic);
			}
			}
			catch(Exception e) {
				
			}
            
            _refresher = FindViewById<SwipeRefreshLayout>(Resource.Id.refresher1);
            _refresher.Refresh += delegate {
                PopulateSermons();
                PopulatePrayerRequests();
                PopulateElders();
                _refresher.Refreshing = false;
            };

            _gestureListener = new GestureListener();
            _gestureListener.LeftEvent += GestureRight;
            _gestureListener.RightEvent += GestureLeft;
            _gestureDetector = new GestureDetector(this, _gestureListener);
        }
        public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
        {
			var root = inflater.Inflate(Resource.Layout.fragment_conversations, container, false);
            var list = root.FindViewById<ListView>(Resource.Id.conversations_list);
            list.ItemClick += OnConversationClick;
			list.Adapter = new ConverstationAdapter(Activity, viewModel);

			var friendGrid = root.FindViewById<GridView> (Resource.Id.grid);
			friendGrid.ItemClick += FriendClicked;
			friendGrid.Adapter = new FriendAdapter (Activity, viewModel);

			selectFriend = root.FindViewById<LinearLayout> (Resource.Id.new_conversation);

			var cancelFriends = root.FindViewById<Button> (Resource.Id.cancel);
			cancelFriends.Click += (sender, e) => {
				fab.Show ();
				selectFriend.Visibility = ViewStates.Gone;
			};

            fab = root.FindViewById<FloatingActionButton>(Resource.Id.fab);
            fab.Click += OnStartNewConversationClick;
            fab.AttachToListView(list);

			refresher = root.FindViewById<SwipeRefreshLayout> (Resource.Id.refresher);
			refresher.Refresh += (sender, e) => viewModel.ExecuteLoadConversationsCommand ();


            return root;
        }
		protected override void OnElementChanged (ElementChangedEventArgs<PullToRefreshContentView> e)
		{
			base.OnElementChanged (e);

			if (refresher != null)
				return;

			refresher = new SwipeRefreshLayout (Xamarin.Forms.Forms.Context);
			refresher.LayoutParameters = new LayoutParams (LayoutParams.MatchParent, LayoutParams.MatchParent);
			refresher.SetColorSchemeResources (Resource.Color.xam_purple);

			refresher.SetOnRefreshListener (this);
			//This gets called when we pull down to refresh to trigger command
			refresher.Refresh += (object sender2, EventArgs e2) => {
				var command = this.Element.RefreshCommand;
				if (command == null)
					return;

				command.Execute (null);
			};

			//HACK as I need to add the sub group to the content group...
			//var text = new Android.Widget.ListView (Xamarin.Forms.Forms.Context);
			//text.LayoutParameters = new LayoutParams (LayoutParams.MatchParent, LayoutParams.MatchParent);
			//text.Text = "Hello world";

			//refresher.AddView (text);

			refresher.SetBackgroundColor (Android.Graphics.Color.Red);
			SetNativeControl (refresher);
		}
    public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
    {
      var root = inflater.Inflate(Resource.Layout.fragment_contacts, container, false);

      refresher = root.FindViewById<SwipeRefreshLayout>(Resource.Id.refresher);
      refresher.SetColorScheme(Resource.Color.blue);

      refresher.Refresh += async delegate
      {
        if (viewModel.IsBusy)
          return;

        await viewModel.GetContactsAsync();
        Activity.RunOnUiThread(() => { ((BaseAdapter)listView.Adapter).NotifyDataSetChanged(); });

      };

      viewModel.PropertyChanged += PropertyChanged;

      listView = root.FindViewById<ListView>(Resource.Id.list);

      listView.Adapter = new ContactAdapter(Activity, viewModel);

      listView.ItemLongClick += ListViewItemLongClick;
      listView.ItemClick += ListViewItemClick;
      var fab = root.FindViewById<FloatingActionButton>(Resource.Id.fab);
      fab.AttachToListView(listView);
      fab.Click += (sender, args) =>
      {
        ContactDetailsActivity.ViewModel = null;
        var intent = new Intent(Activity, typeof(ContactDetailsActivity));
        StartActivity(intent);
      };
      return root;
    }
Example #7
0
        protected async override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);
            SetContentView(Resource.Layout.dashboard);
            _lvlist = FindViewById<ListView>(Resource.Id.lvList);
            _tvCount = FindViewById<TextView>(Resource.Id.tvCount);
            _refresher = FindViewById<SwipeRefreshLayout>(Resource.Id.refresher);
            _tvNew = FindViewById<TextView>(Resource.Id.tvNew);
            _tvHot = FindViewById<TextView>(Resource.Id.tvHot);
            _ivNewSipp = FindViewById<ImageView>(Resource.Id.ivsendsipper);
            _customAdapter = new SippsAdapter(this);
            _lvlist.Adapter = _customAdapter;


            _tvNew.Click += TvNew_Click;
            _tvHot.Click += TvHot_Click;
            _ivNewSipp.Click += ivsendsipper_Click;
            _lvlist.ItemClick += Lvlist_ItemClick;
            _lvlist.SetOnScrollListener(this);

            _refresher.Refresh += async delegate
            {
                await LoadSipps(true);
                _refresher.Refreshing = false;
            };
            
            await LoadSipps();
        }
		public override View OnCreateView (LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
		{
			var root = inflater.Inflate (Resource.Layout.fragment_friends, container, false);
           

			var friendGrid = root.FindViewById<GridView> (Resource.Id.grid);
			friendGrid.ItemClick += FriendClicked;
			friendGrid.Adapter = new FriendAdapter (Activity, viewModel);

			friendGrid.LongClickable = true;
			friendGrid.ItemLongClick += (sender, e) => 
			{

				var friend = viewModel.Friends[e.Position];
				viewModel.ExecuteFlagFriendCommand(friend.FriendId, friend.Name);
			};

			var fab = root.FindViewById<FloatingActionButton> (Resource.Id.fab);
			fab.AttachToListView (friendGrid);
			fab.Click += (sender, e) => {
				var builder = new Android.Support.V7.App.AlertDialog.Builder (Activity);
				builder.SetTitle (Resource.String.add_friend)
					.SetItems (new [] {
					Resources.GetString (Resource.String.add_by_email),
					Resources.GetString (Resource.String.pick_contact)
				}, this);
				builder.Create ().Show ();
			};

			refresher = root.FindViewById<SwipeRefreshLayout> (Resource.Id.refresher);
			refresher.Refresh += (sender, e) => viewModel.ExecuteLoadFriendsCommand ();


			return root;
		}
Example #9
0
 public void FindAndBindViews()
 {
     mRecycler = FindViewById<RecyclerView>(Resource.Id.rvList);
     mRecycler.SetLayoutManager(new LinearLayoutManager(this));
     refresher = FindViewById<SwipeRefreshLayout>(Resource.Id.refresher);
     refresher.Refresh += (sender, e) => OnRefresh(sAccount);
     refresher.SetColorSchemeResources(Android.Resource.Color.HoloRedLight, Android.Resource.Color.HoloGreenLight, Android.Resource.Color.HoloOrangeLight, Android.Resource.Color.HoloGreenLight);
     mAdapter = new BaseRecyclerViewAdapter<UserModel, UserViewHolder>(BaseContext, new List<UserModel>(), Resource.Layout.Item_UserView);
     mRecycler.SetAdapter(mAdapter);
 }
Example #10
0
        public override View OnCreateView (LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
        {
            base.OnCreateView (inflater, container, savedInstanceState);

            _view = inflater.Inflate (Resource.Layout.fragment_videos, null);

            _refreshLayout = _view.FindViewById<SwipeRefreshLayout> (Resource.Id.swipeRefreshLayout);
            _refreshLayout.Refresh += (o, e) => { LoadDataToGridAsync (); };

            LoadDataToGridAsync ();

            return _view;
        }
        public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
        {
			var root = inflater.Inflate(Resource.Layout.fragment_conversations, container, false);
            var list = root.FindViewById<ListView>(Resource.Id.conversations_list);
            list.ItemClick += OnConversationClick;
			list.Adapter = new ConverstationAdapter(Activity, viewModel);

            viewModel.ExecuteLoadConversationsCommand();

            refresher = root.FindViewById<SwipeRefreshLayout> (Resource.Id.refresher);
			refresher.Refresh += (sender, e) => viewModel.ExecuteLoadConversationsCommand ();


            return root;
        }
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);
            SetContentView(Resource.Layout.activity_list);
            mContext = this;
            users = GetUsers();
            swipeRefreshLayout = FindViewById<SwipeRefreshLayout>(Resource.Id.swipeRefreshLayout);
            swipeRefreshLayout.SetOnRefreshListener(this);

            mRecyclerView = FindViewById<SwipeMenuRecyclerViews>(Resource.Id.listView);
            mRecyclerView.SetLayoutManager(new LinearLayoutManager(this));
            mRecyclerView.SetOpenInterpolator(new BounceInterpolator());
            mRecyclerView.SetCloseInterpolator(new BounceInterpolator());
            mAdapter = new AppAdapter(this, users);
            mRecyclerView.SetAdapter(mAdapter);
        }
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);
            SetContentView(Resource.Layout.activity_list);
            mContext = this;
            users = GetUsers();
            swipeRefreshLayout = FindViewById<SwipeRefreshLayout>(Resource.Id.swipeRefreshLayout);
            swipeRefreshLayout.SetOnRefreshListener(this);

            mRecyclerView = FindViewById<SwipeMenuRecyclerViews>(Resource.Id.listView);
            mRecyclerView.SetLayoutManager(new StaggeredGridLayoutManager(2, StaggeredGridLayoutManager.Vertical));
            mRecyclerView.AddItemDecoration(new StaggeredSpaceItemDecoration(15, 0, 15, 45));
            mRecyclerView.SetOpenInterpolator(new BounceInterpolator());
            mRecyclerView.SetCloseInterpolator(new BounceInterpolator());
            mAdapter = new AppAdapter(this, users);
            mRecyclerView.SetAdapter(mAdapter);
        }
		protected async override void OnCreate (Bundle savedInstanceState)
		{
			base.OnCreate (savedInstanceState);

			SetContentView (Resource.Layout.Main);

			_listView = FindViewById<ListView>(Resource.Id.listView);

			_swipeRefreshLayout = FindViewById<SwipeRefreshLayout>(Resource.Id.swipeRefreshLayout);
			_swipeRefreshLayout.Refresh += async delegate
			{
				await BindPhotos();
				_swipeRefreshLayout.Refreshing = false;
			};

			await BindPhotos();
		}
        public override View OnCreateView (LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
        {
            var view = inflater.Inflate (Resource.Layout.LogTimeEntriesListFragment, container, false);
            view.FindViewById<TextView> (Resource.Id.EmptyTextTextView).SetFont (Font.RobotoLight);

            emptyMessageView = view.FindViewById<View> (Resource.Id.EmptyMessageView);
            emptyMessageView.Visibility = ViewStates.Gone;
            recyclerView = view.FindViewById<RecyclerView> (Resource.Id.LogRecyclerView);
            recyclerView.SetLayoutManager (new LinearLayoutManager (Activity));
            swipeLayout = view.FindViewById<SwipeRefreshLayout> (Resource.Id.LogSwipeContainer);
            swipeLayout.SetOnRefreshListener (this);
            coordinatorLayout = view.FindViewById<CoordinatorLayout> (Resource.Id.logCoordinatorLayout);
            StartStopBtn = view.FindViewById<StartStopFab> (Resource.Id.StartStopBtn);
            timerComponent = ((MainDrawerActivity)Activity).Timer; // TODO: a better way to do this?
            HasOptionsMenu = true;

            return view;
        }
Example #16
0
		protected override void OnCreate (Bundle bundle)
		{
			base.OnCreate (bundle);

			SetContentView (Resource.Layout.Main);

			forum = PostListFragment.Instantiate ("android", "Android");
			SupportFragmentManager.BeginTransaction ()
				.Add (Resource.Id.container, forum, "post-list")
				.Commit ();

			refresher = FindViewById<SwipeRefreshLayout> (Resource.Id.refresher);
			refresher.SetColorScheme (Resource.Color.xam_dark_blue,
			                          Resource.Color.xam_purple,
			                          Resource.Color.xam_gray,
			                          Resource.Color.xam_green);
			refresher.Refresh += HandleRefresh;
		}
        public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
        {
            base.OnCreateView(inflater, container, savedInstanceState);

            var view = inflater.Inflate(Resource.Layout.MainTaskListFragment, container, false);

            View header = Activity.LayoutInflater.Inflate(Resource.Layout.MainTaskListHeader, null);
            mainList = view.FindViewById<ExpandableListView>(Resource.Id.mainActivitiesList);
            mainList.AddHeaderView(header, null, false);
            mainList.SetAdapter(new ScenarioListAdapter(Activity,
                AppData.Session.Categories.ToArray()));
            mainList.ChildClick += mainList_ChildClick;

            // When the pull to refresh is activated, pull new data from the server and refresh the list with the new data
            refresher = view.FindViewById<SwipeRefreshLayout>(Resource.Id.refresher);
            refresher.Refresh += async delegate
            {
                if (!AndroidUtils.IsConnected())
                {
                    AndroidUtils.OfflineAlert(Activity);
                    refresher.Refreshing = false;
                    return;
                }

                await ServerData.FetchCategories();
                refresher.Refreshing = false;

                ((ScenarioListAdapter) mainList.ExpandableListAdapter).Categories = AppData.Session.Categories.ToArray();
                Activity.RunOnUiThread(
                    () => ((ScenarioListAdapter) mainList.ExpandableListAdapter).NotifyDataSetChanged());
            };

            // If there's only one category, it makes sense to expand it by default
            if (AppData.Session.Categories.Count == 1)
            {
                mainList.ExpandGroup(0, true);
            }

            practiceBtn = header.FindViewById<Button>(Resource.Id.practiceAreaBtn);
            practiceBtn.Click += practiceButton_Click;
            return view;
        }
Example #18
0
		public override View OnCreateView(LayoutInflater inflater ,ViewGroup container ,Bundle savedInstanceState) 
		{
			View v = inflater.Inflate(Resource.Layout.MyHealth_tab_1 ,container ,false);
			//TextView tvText = v.FindViewById<TextView> (Resource.Id.textView);
			recyclerView = v.FindViewById <RecyclerView> (Resource.Id.recyclerView);

			progressDialog = ProgressDialog.Show (Activity, "Sila Tunggu", "Sedang Memuatkan...");

			llMHeT1ErrorLayout = (LinearLayout)v.FindViewById (Resource.Id.llMHeT1ErrorLayout);
			tvMHeT1ErrorStatus = (TextView)v.FindViewById (Resource.Id.tvMHeT1ErrorStatus);

			tvMHeT1ErrorStatus.Text = "Sedang memeriksa data...";

			mSlideRefreshLayout = v.FindViewById<SwipeRefreshLayout> (Resource.Id.swipelayout);
			mSlideRefreshLayout.SetColorScheme (Android.Resource.Color.HoloBlueBright, Android.Resource.Color.HoloBlueDark, Android.Resource.Color.HoloGreenLight, Android.Resource.Color.HoloRedLight);
			mSlideRefreshLayout.Refresh += mSlideRefreshLayout_Refresh;

			if (recyclerView != null) {
				recyclerView.HasFixedSize = true;

				var layoutManager = new LinearLayoutManager (Activity);
				var onScrollListener = new MyHealthRecyclerViewOnScrollListener (layoutManager);

				onScrollListener.LoadMoreEvent += (object sender, EventArgs e) => {
					Console.Error.WriteLine ("isRefeshing" + isRefreshing);
					page++;
					if (page <= lastPage && isRefreshing == false) {
						Console.Error.WriteLine ("masuk");

						ThreadPool.QueueUserWorkItem (o => {
							setupMyHealthData (page);
						});
					}
				};
				recyclerView.AddOnScrollListener (onScrollListener);
				recyclerView.SetLayoutManager (layoutManager);
			}


			return v;
		}
Example #19
0
        //Called on onCreate, init everything here!
        public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
        {
            View view = inflater.Inflate(Resource.Layout.ManageEvents, container, false);

            recyclerView = view.FindViewById<RecyclerView>(Resource.Id.manageEventsList);
            progressBar = view.FindViewById<ProgressBar>(Resource.Id.loadingProgressBar);
            swipeRefreshLayout = view.FindViewById<SwipeRefreshLayout>(Resource.Id.swipeRefreshLayout);
            floatingAddEventBtn = view.FindViewById<FloatingActionButton>(Resource.Id.floatingAddEventBtn);

            topLeftToolbarButton = Activity.FindViewById<Button>(Resource.Id.topToolbarButtonLeft);
            topRightToolbarButton = Activity.FindViewById<Button>(Resource.Id.topToolbarButtonRight);
            topLeftToolbarImageButton = Activity.FindViewById<ImageButton>(Resource.Id.topToolbarImageButtonLeft);
            topRightToolbarImageButton = Activity.FindViewById<ImageButton>(Resource.Id.topToolbarImageButtonRight);

            topLeftToolbarButton.Text = "All";
            topRightToolbarButton.Text = "Mine";
            topLeftToolbarButton.Visibility = ViewStates.Visible;
            topLeftToolbarImageButton.Visibility = ViewStates.Gone;
            topRightToolbarButton.Visibility = ViewStates.Visible;
            topRightToolbarImageButton.Visibility = ViewStates.Gone;

            swipeRefreshLayout.Refresh += SwipeRefreshLayout_Refresh;

            floatingAddEventBtn.Click += FloatingAddEventBtn_Click;

            string facebookUserId = Profile.CurrentProfile.Id;

            webClient = new WebClient();
            ownEventsUrl = new Uri("https://howlout.gear.host/api/EventsAPI/Owner/"+facebookUserId);

            // Call chosen url to retrieve events matching Facebook User Id
            webClient.DownloadDataAsync(ownEventsUrl);
            webClient.DownloadDataCompleted += WebClient_DownloadDataCompleted;

            // Creating the layout manager
            layoutManager = new LinearLayoutManager(this.Activity);
            recyclerView.SetLayoutManager(layoutManager);

            return view;
        }
Example #20
0
        private void InitComponent(View view)
        {
            try
            {
                MainRecyclerView = (WRecyclerView)view.FindViewById(Resource.Id.newsfeedRecyler);
                PopupBubbleView  = (FloatingActionButton)view.FindViewById(Resource.Id.popup_bubble);

                SwipeRefreshLayout = view.FindViewById <SwipeRefreshLayout>(Resource.Id.swipeRefreshLayout);
                if (SwipeRefreshLayout != null)
                {
                    SwipeRefreshLayout.SetColorSchemeResources(Android.Resource.Color.HoloBlueLight, Android.Resource.Color.HoloGreenLight, Android.Resource.Color.HoloOrangeLight, Android.Resource.Color.HoloRedLight);
                    SwipeRefreshLayout.Refreshing = true;
                    SwipeRefreshLayout.Enabled    = true;
                    SwipeRefreshLayout.SetProgressBackgroundColorSchemeColor(AppSettings.SetTabDarkTheme ? Color.ParseColor("#424242") : Color.ParseColor("#f7f7f7"));
                    SwipeRefreshLayout.Refresh += SwipeRefreshLayoutOnRefresh;
                }
            }
            catch (Exception e)
            {
                Methods.DisplayReportResultTrack(e);
            }
        }
Example #21
0
        private void SetRecyclerViewAdapters()
        {
            try
            {
                MainRecyclerView = FindViewById <WRecyclerView>(Resource.Id.Recyler);
                EmptyStateLayout = FindViewById <ViewStub>(Resource.Id.viewStub);

                SwipeRefreshLayout = FindViewById <SwipeRefreshLayout>(Resource.Id.swipeRefreshLayout);
                SwipeRefreshLayout.SetColorSchemeResources(Android.Resource.Color.HoloBlueLight, Android.Resource.Color.HoloGreenLight, Android.Resource.Color.HoloOrangeLight, Android.Resource.Color.HoloRedLight);
                SwipeRefreshLayout.Refreshing = true;
                SwipeRefreshLayout.Enabled    = true;
                SwipeRefreshLayout.SetProgressBackgroundColorSchemeColor(AppSettings.SetTabDarkTheme ? Color.ParseColor("#424242") : Color.ParseColor("#f7f7f7"));

                PostFeedAdapter = new NativePostAdapter(this, "", MainRecyclerView, NativeFeedType.Memories, SupportFragmentManager);

                MainRecyclerView.SetXAdapter(PostFeedAdapter, SwipeRefreshLayout);
            }
            catch (Exception e)
            {
                Methods.DisplayReportResultTrack(e);
            }
        }
Example #22
0
        /// <summary>
        /// Handles the actions to do when this activity is created
        /// </summary>
        /// <param name="savedInstanceState">Saved instance state.</param>
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);
            toastAlert = true;
            editRecipe = null;
            editMode   = false;

            IngViewModel     = BrowseIngredientFragment.ViewModel;
            RecViewModel     = BrowseRecipeFragment.ViewModel;
            ingredientNames  = IngViewModel.Ingredients.Select(ingredient => ingredient.Name).ToArray();
            addedIngredients = new ObservableCollection <Ingredient>();

            SetContentView(Resource.Layout.activity_add_recipe);
            saveButton             = FindViewById <FloatingActionButton>(Resource.Id.save_button_addRecipe);
            nameField              = FindViewById <EditText>(Resource.Id.nameField_addRecipe);
            instructionsField      = FindViewById <EditText>(Resource.Id.instructionsField_addRecipe);
            addIngredientButton    = FindViewById <Button>(Resource.Id.addIngredientToRecipe_addRecipe);
            ingredientRecyclerView = FindViewById <RecyclerView>(Resource.Id.recyclerviewAddIngredients_addRecipe);
            ingredientSpinner      = FindViewById <Spinner>(Resource.Id.ingredientSpinner_addRecipe);
            swipeRefreshLayout     = FindViewById <SwipeRefreshLayout>(Resource.Id.swipeRefreshLayout_addRecipe);

            ingredientRecyclerView.SetAdapter(adapter = new RecipeIngredientsAdapter(this, addedIngredients, quantityStore));
            ingredientSpinner.Adapter = new ArrayAdapter(this.ApplicationContext, Android.Resource.Layout.SimpleListItem1, ingredientNames);

            quantityStore = new List <float>();

            var data = Intent.GetStringExtra("recipe") ?? null;

            if (data != null)
            {
                editMode   = true;
                editRecipe = Newtonsoft.Json.JsonConvert.DeserializeObject <Recipe>(data);
                fillForm();
            }
            addIngredientButton.Click  += AddIngredientButton_Click;
            saveButton.Click           += SaveButton_Click;
            adapter.ItemLongClick      += IngredientRecyclerView_ItemLongClick;
            swipeRefreshLayout.Refresh += SwipeRefreshLayout_Refresh;
        }
Example #23
0
        public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
        {
            ViewModel = new ItemsViewModel();

            ServiceLocator.Instance.Register <MockDataStore, MockDataStore>();

            View view         = inflater.Inflate(Resource.Layout.fragment_browse, container, false);
            var  recyclerView =
                view.FindViewById <RecyclerView>(Resource.Id.recyclerView);

            recyclerView.HasFixedSize       = true;
            recyclerView.SetAdapter(adapter = new BrowseItemsAdapter(Activity, ViewModel));

            refresher = view.FindViewById <SwipeRefreshLayout>(Resource.Id.refresher);

            refresher.SetColorSchemeColors(Resource.Color.accent);

            progress            = view.FindViewById <ProgressBar>(Resource.Id.progressbar_loading);
            progress.Visibility = ViewStates.Gone;

            return(view);
        }
        private void DestroyBasic()
        {
            try
            {
                MAdView?.Destroy();

                MAdapter           = null !;
                SwipeRefreshLayout = null !;
                MRecycler          = null !;
                EmptyStateLayout   = null !;
                Inflated           = null !;
                MainScrollEvent    = null !;
                SearchView         = null !;
                SearchKey          = null !;
                ToolBar            = null !;
                MAdView            = null !;
            }
            catch (Exception e)
            {
                Methods.DisplayReportResultTrack(e);
            }
        }
Example #25
0
        private void InitComponent()
        {
            try
            {
                MRecycler        = (RecyclerView)FindViewById(Resource.Id.recyler);
                EmptyStateLayout = FindViewById <ViewStub>(Resource.Id.viewStub);

                SwipeRefreshLayout = (SwipeRefreshLayout)FindViewById(Resource.Id.swipeRefreshLayout);
                SwipeRefreshLayout.SetColorSchemeResources(Android.Resource.Color.HoloBlueLight, Android.Resource.Color.HoloGreenLight, Android.Resource.Color.HoloOrangeLight, Android.Resource.Color.HoloRedLight);
                SwipeRefreshLayout.Refreshing = true;
                SwipeRefreshLayout.Enabled    = true;
                SwipeRefreshLayout.SetProgressBackgroundColorSchemeColor(AppSettings.SetTabDarkTheme ? Color.ParseColor("#424242") : Color.ParseColor("#f7f7f7"));


                MAdView = FindViewById <AdView>(Resource.Id.adView);
                AdsGoogle.InitAdView(MAdView, MRecycler);
            }
            catch (Exception e)
            {
                Methods.DisplayReportResultTrack(e);
            }
        }
        private void DestroyBasic()
        {
            try
            {
                MAdView?.Destroy();

                MAdapter            = null !;
                SwipeRefreshLayout  = null !;
                MRecycler           = null !;
                EmptyStateLayout    = null !;
                Inflated            = null !;
                ItemUser            = null !;
                InviteFriendsButton = null !;
                PageId        = null !;
                MAdView       = null !;
                PageDataClass = null !;
            }
            catch (Exception e)
            {
                Methods.DisplayReportResultTrack(e);
            }
        }
Example #27
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);

            OverridePendingTransition(Resource.Animation.SlideInLeft, Resource.Animation.SlideOutLeft);

            SetContentView(Resource.Layout.NewsEvents);

            list  = FindViewById <ListView>(Resource.Id.listNotices);
            swipe = FindViewById <SwipeRefreshLayout>(Resource.Id.swipeRefresh);

            list.LayoutAnimation = AnimationUtils.LoadLayoutAnimation(this, Resource.Animation.LayoutAnimatorFade);
            list.ItemClick      += new EventHandler <AdapterView.ItemClickEventArgs>(List_ItemClick);

            swipe.Refresh += ((sender, args) =>
            {
                newsList = null;
                StartProcess();
            });

            StartProcess();
        }
        protected override void OnCreate(Bundle savedInstanceState)
        {
            int idUser = Intent.GetIntExtra("IdUser", 0);

            usr = localStorage.GetUser(idUser);
            base.OnCreate(savedInstanceState);
            SetContentView(Resource.Layout.activity_project);
            lstTask = FindViewById <ListView>(Resource.Id.proj_list);
            ImageView decobutton = FindViewById <ImageView>(Resource.Id.proj_img);

            add = FindViewById <Button>(Resource.Id.proj_add);
            LoadTaskList();

            add.Click += delegate
            {
                var activity = new Intent(this, typeof(TaskActivity));
                activity.PutExtra("IdUser", usr.Id);
                activity.PutExtra("Edit", false);
                StartActivity(activity);
                Finish();
                LoadTaskList();
            };

            SwipeRefreshLayout refresher = FindViewById <SwipeRefreshLayout>(Resource.Id.refresher);

            refresher.Refresh += delegate {
                LoadTaskCloudList();
                refresher.Refreshing = false;
            };

            decobutton.Click += delegate
            {
                var activity = new Intent(this, typeof(MainActivity));
                StartActivity(activity);
                Finish();
                LoadTaskList();
            };
        }
Example #29
0
        private void InitComponent(View view)
        {
            try
            {
                ImageUser        = (ImageView)view.FindViewById(Resource.Id.ImageUser);
                ImageAct         = (ImageView)view.FindViewById(Resource.Id.ImageAct);
                NameUser         = view.FindViewById <TextView>(Resource.Id.NameUser);
                TimeUser         = view.FindViewById <TextView>(Resource.Id.TimeUser);
                ContentAct       = view.FindViewById <TextView>(Resource.Id.ContentAct);
                LikeActLayout    = view.FindViewById <LinearLayout>(Resource.Id.LikeActLayout);
                IconLikeAct      = view.FindViewById <TextView>(Resource.Id.IconLikeAct);
                CountLikeAct     = view.FindViewById <TextView>(Resource.Id.CountLikeAct);
                DislikeActLayout = view.FindViewById <LinearLayout>(Resource.Id.DislikeActLayout);
                IconDislikeAct   = view.FindViewById <TextView>(Resource.Id.IconDislikeAct);
                CountDislikeAct  = view.FindViewById <TextView>(Resource.Id.CountDislikeAct);
                CommentActLayout = view.FindViewById <LinearLayout>(Resource.Id.CommentActLayout);
                IconCommentAct   = view.FindViewById <TextView>(Resource.Id.IconCommentAct);
                CountCommentAct  = view.FindViewById <TextView>(Resource.Id.CountCommentAct);

                EmptyStateLayout = view.FindViewById <ViewStub>(Resource.Id.viewStub);
                MRecycler        = view.FindViewById <RecyclerView>(Resource.Id.recycler_view);
                TxtComment       = view.FindViewById <EditText>(Resource.Id.commenttext);
                ImgSent          = view.FindViewById <ImageView>(Resource.Id.send);

                SwipeRefreshLayout = view.FindViewById <SwipeRefreshLayout>(Resource.Id.swipeRefreshLayout);
                SwipeRefreshLayout.SetColorSchemeResources(Android.Resource.Color.HoloBlueLight, Android.Resource.Color.HoloGreenLight, Android.Resource.Color.HoloOrangeLight, Android.Resource.Color.HoloRedLight);
                SwipeRefreshLayout.Refreshing = false;
                SwipeRefreshLayout.Enabled    = false;
                SwipeRefreshLayout.SetProgressBackgroundColorSchemeColor(AppSettings.SetTabDarkTheme ? Color.ParseColor("#424242") : Color.ParseColor("#f7f7f7"));

                TxtComment.Text = "";
                Methods.SetColorEditText(TxtComment, AppSettings.SetTabDarkTheme ? Color.White : Color.Black);
            }
            catch (Exception e)
            {
                Console.WriteLine(e);
            }
        }
Example #30
0
        protected override async void OnCreate(Bundle savedInstanceState)
        {
            rssReaderService = new RssReaderService(Constants.ConnectionString);

            base.OnCreate(savedInstanceState);

            SetContentView(Resource.Layout.activity_rssitems);

            var toolbar = FindViewById <Android.Support.V7.Widget.Toolbar>(Resource.Id.toolbar);

            SetSupportActionBar(toolbar);

            SupportActionBar.SetHomeButtonEnabled(true);
            SupportActionBar.SetDisplayHomeAsUpEnabled(true);

            itemsSwipeRefreshLayout = FindViewById <SwipeRefreshLayout>(Resource.Id.rssitems_swiperefreshlayout);
            itemsRecyclerview       = FindViewById <RecyclerView>(Resource.Id.rssitems_itemsRecyclerview);


            itemsRecyclerview.SetLayoutManager(new LinearLayoutManager(this));
            //itemsRecyclerview.SetLayoutManager(new GridLayoutManager(this, 2));

            // https://www.lemonde.fr/rss/une.xml

            // Recuperer l'element depuis l'id
            var id = Intent.GetIntExtra("ID", -1);

            if (id != -1)
            {
                item = rssReaderService.GetRssSourceById(id);

                SupportActionBar.Title = item.Title;

                itemsSwipeRefreshLayout.Refresh += ItemsSwipeRefreshLayout_Refresh;

                var _ = Load();
            }
        }
Example #31
0
        public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
        {
            if (savedInstanceState?.ContainsKey("Line") == true && savedInstanceState?.ContainsKey("Route") == true)
            {
                int  lineId = savedInstanceState.GetInt("Line");
                Line line   = TramUrWayApplication.GetLine(lineId);

                int routeId = savedInstanceState.GetInt("Route");
                route = line.Routes.FirstOrDefault(r => r.Id == routeId);
            }
            if (savedInstanceState?.ContainsKey("Color") == true)
            {
                int argb = savedInstanceState.GetInt("Color");
                color = new Color(argb);
            }

            View view = inflater.Inflate(Resource.Layout.RouteFragment, container, false);

            // Refresh widget
            swipeRefresh          = view.FindViewById <SwipeRefreshLayout>(Resource.Id.RouteFragment_SwipeRefresh);
            swipeRefresh.Refresh += (s, e) => QueryRefresh?.Invoke(s, e);
            swipeRefresh.SetColorSchemeColors(color.ToArgb());

            // Steps list
            recyclerView              = view.FindViewById <RecyclerView>(Resource.Id.RouteFragment_StopList);
            recyclerView.Focusable    = false;
            recyclerView.HasFixedSize = true;
            recyclerView.SetLayoutManager(new LinearLayoutManager(recyclerView.Context));
            recyclerView.AddItemDecoration(new DividerItemDecoration(recyclerView.Context, LinearLayoutManager.Vertical));
            recyclerView.SetAdapter(routeAdapter = new RouteAdapter(route));

            if (lastTimeSteps != null)
            {
                routeAdapter.Update(lastTimeSteps, lastTransports);
            }

            return(view);
        }
Example #32
0
        public async void SetupScheduleData(SwipeRefreshLayout swipeRefresh = default)
        {
            if (viewPager.Adapter != null)
            {
                tabLayout.Visibility = viewPager.Visibility = ViewStates.Gone;
            }
            var emptyView   = FindViewById <AppCompatTextView>(Resource.Id.tv_schedule_base_emptytext);
            var tabsAdapter = new PageTabsAdapter(SupportFragmentManager);

            emptyView.Visibility = ViewStates.Visible;
            emptyView.Text       = "Loading...";
            if (swipeRefresh != null)
            {
                swipeRefresh.Refreshing = true;
            }

            var data = await WebData.GetTVSchedule().ConfigureAwait(true);

            if (data != null && data.Count > 0)
            {
                emptyView.Visibility = ViewStates.Gone;
                tabLayout.Visibility = ViewStates.Visible;
                viewPager.Visibility = ViewStates.Visible;
                viewPager.Adapter    = tabsAdapter;
                foreach (var item in data)
                {
                    tabsAdapter.AddTab(new TitleFragment()
                    {
                        Title = item.Key, Fragmnet = new MainTabs(DataEnum.DataType.TVSchedule, new List <object>(item.Value))
                    });
                }
            }
            emptyView.Text = Resources.GetString(Resource.String.empty_data_view);
            if (swipeRefresh != null)
            {
                swipeRefresh.Refreshing = false;
            }
        }
        public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
        {
            var root = inflater.Inflate(Resource.Layout.fragment_contacts, container, false);

            refresher = root.FindViewById <SwipeRefreshLayout>(Resource.Id.refresher);
            refresher.SetColorScheme(Resource.Color.blue);

            refresher.Refresh += async delegate
            {
                if (viewModel.IsBusy)
                {
                    return;
                }

                await viewModel.GetContactsAsync();

                Activity.RunOnUiThread(() => { ((BaseAdapter)listView.Adapter).NotifyDataSetChanged(); });
            };

            viewModel.PropertyChanged += PropertyChanged;

            listView = root.FindViewById <ListView>(Resource.Id.list);

            listView.Adapter = new ContactAdapter(Activity, viewModel);

            listView.ItemLongClick += ListViewItemLongClick;
            listView.ItemClick     += ListViewItemClick;
            var fab = root.FindViewById <FloatingActionButton>(Resource.Id.fab);

            fab.AttachToListView(listView);
            fab.Click += (sender, args) =>
            {
                ContactDetailsActivity.ViewModel = null;
                var intent = new Intent(Activity, typeof(ContactDetailsActivity));
                StartActivity(intent);
            };
            return(root);
        }
Example #34
0
		public override View OnCreateView(LayoutInflater inflater ,ViewGroup container ,Bundle savedInstanceState) 
		{
			View v = inflater.Inflate(Resource.Layout.MySoal_tab_1 ,container ,false);
			//TextView tvText = v.FindViewById<TextView> (Resource.Id.textView);
			recyclerView = v.FindViewById <RecyclerView> (Resource.Id.recyclerView);

			llMST1ErrorLayout = (LinearLayout)v.FindViewById (Resource.Id.llMST1ErrorLayout);
			tvMST1ErrorStatus = (TextView)v.FindViewById (Resource.Id.tvMST1ErrorStatus);

			footerViewUL = ((LayoutInflater)Activity.GetSystemService (Context.LayoutInflaterService)).Inflate (Resource.Layout.MySoal_ReadMoreLayout, null, false);

			mSlideRefreshLayout = v.FindViewById<SwipeRefreshLayout> (Resource.Id.swipelayout);
			mSlideRefreshLayout.SetColorScheme (Android.Resource.Color.HoloBlueBright, Android.Resource.Color.HoloBlueDark, Android.Resource.Color.HoloGreenLight, Android.Resource.Color.HoloRedLight);
			mSlideRefreshLayout.Refresh += mSlideRefreshLayout_Refresh;

			if (recyclerView != null) {
				recyclerView.HasFixedSize = true;

				var layoutManager = new LinearLayoutManager (Activity);
				var onScrollListener = new MySoalRecyclerViewOnScrollListener (layoutManager);

				onScrollListener.LoadMoreEvent += (object sender, EventArgs e) => {
					Console.Error.WriteLine ("isRefeshing" + isRefreshing);
					page++;
					if (page <= lastPage && isRefreshing == false) {
						Console.Error.WriteLine ("masuk");

						ThreadPool.QueueUserWorkItem (o => {
							InitialProgress (page);
						});
					}
				};
				recyclerView.AddOnScrollListener (onScrollListener);
				recyclerView.SetLayoutManager (layoutManager);
			}

			return v;
		}
Example #35
0
		public override View OnCreateView(LayoutInflater inflater ,ViewGroup container ,Bundle savedInstanceState) 
		{
			tokenData = Activity.Intent.GetStringExtra ("Token");
			
			View v = inflater.Inflate(Resource.Layout.MyKomuniti_tab_1 ,container ,false);
			//TextView tvText = v.FindViewById<TextView> (Resource.Id.textView);
			recyclerView = v.FindViewById <RecyclerView> (Resource.Id.recyclerView);

			progressDialog = ProgressDialog.Show (Activity, "Sila Tunggu", "Sedang Memuatkan...");

			llMKkT1ErrorStatus = (LinearLayout)v.FindViewById (Resource.Id.llMKkT1ErrorStatus);
			tvMKkT1ErrorStatus = (TextView)v.FindViewById (Resource.Id.tvMKkT1ErrorStatus);

			mSlideRefreshLayout = v.FindViewById<SwipeRefreshLayout> (Resource.Id.swipelayout);
			mSlideRefreshLayout.SetColorScheme (Android.Resource.Color.HoloBlueBright, Android.Resource.Color.HoloBlueDark, Android.Resource.Color.HoloGreenLight, Android.Resource.Color.HoloRedLight);
			mSlideRefreshLayout.Refresh += mSlideRefreshLayout_Refresh;

			if (recyclerView != null) {
				recyclerView.HasFixedSize = true;

				var layoutManager = new LinearLayoutManager (Activity);
				var onScrollListener = new MyKomunitiRecyclerViewOnScrollListener (layoutManager);

				onScrollListener.LoadMoreEvent += (object sender, EventArgs e) => {
					page++;
					if (page <= lastPage && isRefreshing == false) {

						ThreadPool.QueueUserWorkItem (o => {
							InitialSetup (tokenData, page);
						});
					}
				};
				recyclerView.AddOnScrollListener (onScrollListener);
				recyclerView.SetLayoutManager (layoutManager);
			}
				
			return v;
		}
        public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
        {
            if (EngineService.EngineInstance.ChatListViewModel == null)
            {
                EngineService.EngineInstance.ChatListViewModel = new ChatListViewModel();
            }
            ChatListViewModel = EngineService.EngineInstance.ChatListViewModel;

            var rootView = inflater.Inflate(Resource.Layout.fragment_chat, container, false);

            recycler     = rootView.FindViewById <RecyclerView>(Resource.Id.recycleChatHistory);
            fabAdd       = rootView.FindViewById <FloatingActionButton>(Resource.Id.fabAddChat);
            swipeRefresh = rootView.FindViewById <SwipeRefreshLayout>(Resource.Id.swipeRefresh);
            InitSwipeRefreshLayout(swipeRefresh);

            recycler.HasFixedSize = true;
            recycler.SetLayoutManager(new LinearLayoutManager(this.Context, LinearLayoutManager.Vertical, false));
            recycler.SetItemAnimator(new DefaultItemAnimator());

            Adapter = new ChatListAdapter(Activity, ChatListViewModel);
            recycler.SetAdapter(Adapter);

            InitRecyclerScrollListener(recycler, (e) => {
                if (e && fabAdd.IsShown)
                {
                    fabAdd.Hide();
                }
                else if (!e && !fabAdd.IsShown)
                {
                    fabAdd.Show();
                }
            });

            fabAdd.Click += (sender, e) => {
                ParentActivity.SetTabAndFragment(MainActivity.FRAGMENT_TYPE.FRAGMENT_CONTACT);
            };
            return(rootView);
        }
Example #37
0
        private void InitView()
        {
            fab           = FindViewById <FloatingActionButton>(Resource.Id.fab_recycler_view);
            mRecyclerView = FindViewById <RecyclerView>(Resource.Id.recycler_view_recycler_view);

            if (GetScreenWidthDp() >= 1200)
            {
                GridLayoutManager gridLayoutManager = new GridLayoutManager(this, 3);
                mRecyclerView.SetLayoutManager(gridLayoutManager);
            }
            else if (GetScreenWidthDp() >= 800)
            {
                GridLayoutManager gridLayoutManager = new GridLayoutManager(this, 2);
                mRecyclerView.SetLayoutManager(gridLayoutManager);
            }
            else
            {
                LinearLayoutManager linearLayoutManager = new LinearLayoutManager(this);
                mRecyclerView.SetLayoutManager(linearLayoutManager);
            }

            adapter = new RecyclerViewAdapter(this);
            mRecyclerView.SetAdapter(adapter);
            adapter.SetItems(data);
            adapter.AddFooter();

            fab.SetOnClickListener(this);
            ItemTouchHelper.Callback callback         = new Views.ItemTouchHelperCallback(adapter);
            ItemTouchHelper          mItemTouchHelper = new ItemTouchHelper(callback);

            mItemTouchHelper.AttachToRecyclerView(mRecyclerView);

            swipeRefreshLayout = FindViewById <SwipeRefreshLayout>(Resource.Id.swipe_refresh_layout_recycler_view);
            swipeRefreshLayout.SetColorSchemeResources(Resource.Color.google_blue, Resource.Color.google_green, Resource.Color.google_red, Resource.Color.google_yellow);
            swipeRefreshLayout.SetOnRefreshListener(this);

            mRecyclerView.AddOnScrollListener(new OnScrollListener(this));
        }
Example #38
0
        public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
        {
            View view = null;

            try
            {
                view = inflater.Inflate(Resource.Layout.fragmentListTrajets, null);

                m_refresher         = view.FindViewById <SwipeRefreshLayout>(Resource.Id.fragmentParameters_refresher);
                m_recyclerView      = view.FindViewById <RecyclerView>(Resource.Id.fragmentParameters_recyclerView);
                m_textviewEmptyList = view.FindViewById <TextView>(Resource.Id.fragmentParameters_textview_emptyList);

                //trajets list
                m_recyclerView.SetLayoutManager(new LinearLayoutManager(Activity));
                m_adapter = new RecyclerviewAdapter_Display_trajets(Activity, this);
                m_recyclerView.SetAdapter(m_adapter);

                m_refresher.Refresh += M_refresher_Refresh;

                m_refresher.Post(async() =>
                {
                    m_refresher.Refreshing = true;

                    await RefreshtrajetList();
                });
            }
            catch (System.Exception e)
            {
                MobileCenter_Helper.ReportError(new FileAccessManager(), e, GetType().Name, MethodBase.GetCurrentMethod().Name);

                if (view != null)
                {
                    DynamicUIBuild_Utils.ShowSnackBar(Activity, view, Resource.String.snackbar_errorHappened, Snackbar.LengthLong);
                }
            }

            return(view);
        }
Example #39
0
 protected override void OnCreate(Bundle savedInstanceState)
 {
     base.OnCreate(savedInstanceState);
     Xamarin.Essentials.Platform.Init(this, savedInstanceState);
     // Set our view from the "main" layout resource
     SetContentView(Resource.Layout.activity_main);
     //Reference swiperefresh layout, set color scheme
     classSwipeRefresh = FindViewById <SwipeRefreshLayout>(Resource.Id.swipeLayout);
     classSwipeRefresh.SetColorScheme(Android.Resource.Color.HoloBlueBright, Android.Resource.Color.HoloOrangeLight, Android.Resource.Color.HoloRedLight, Android.Resource.Color.HoloGreenLight);
     //Initilize UI Components
     myListView        = FindViewById <ListView>(Resource.Id.myListView);
     editSearch        = FindViewById <EditText>(Resource.Id.editSearch);
     headerAddressLine = FindViewById <TextView>(Resource.Id.headerAddressLine);
     headerCity        = FindViewById <TextView>(Resource.Id.headerCity);
     headerState       = FindViewById <TextView>(Resource.Id.headerState);
     headerZipCode     = FindViewById <TextView>(Resource.Id.headerZipCode);
     //Adjust Search bar to be invisable and viewstates to gone
     editSearch.Alpha      = 0;
     editSearch.Visibility = ViewStates.Gone;
     //Activate customer toolbar
     toolBar = FindViewById <Toolbar>(Resource.Id.toolbar);
     SetSupportActionBar(toolBar);
     SupportActionBar.Title = "";
     //Download data from MYSQL Using PHP
     mProgressBar = FindViewById <ProgressBar>(Resource.Id.progressBar);
     mClient      = new WebClient();
     mUrl         = new Uri("http://192.168.1.22:80/christmaslightsPHP/getAddresses.php");
     mClient.DownloadDataAsync(mUrl);
     //Events
     myListView.ItemClick          += MyListView_ItemClick;
     classSwipeRefresh.Refresh     += ClassSwipeRefresh_Refresh;
     editSearch.TextChanged        += EditSearch_TextChanged;
     headerAddressLine.Click       += HeaderAddressLine_Click;
     headerCity.Click              += HeaderCity_Click;
     headerState.Click             += HeaderState_Click;
     headerZipCode.Click           += HeaderZipCode_Click;
     mClient.DownloadDataCompleted += MClient_DownloadDataCompleted;
 }
Example #40
0
        private void InitComponent(View view)
        {
            try
            {
                MRecycler        = (RecyclerView)view.FindViewById(Resource.Id.recyler);
                EmptyStateLayout = view.FindViewById <ViewStub>(Resource.Id.viewStub);

                SwipeRefreshLayout = (SwipeRefreshLayout)view.FindViewById(Resource.Id.swipeRefreshLayout);
                SwipeRefreshLayout.SetDefaultStyle();

                FilterButton = (TextView)view.FindViewById(Resource.Id.toolbar_title);
                FontUtils.SetTextViewIcon(FontsIconFrameWork.IonIcons, FilterButton, IonIconsFonts.AndroidOptions);
                FilterButton.SetTextColor(Color.White);
                FilterButton.SetTextSize(ComplexUnitType.Sp, 20f);
                FilterButton.Visibility = ViewStates.Visible;

                ShowGoogleAds(view, MRecycler);
            }
            catch (Exception e)
            {
                Console.WriteLine(e);
            }
        }
Example #41
0
        private void InitComponent()
        {
            try
            {
                MRecycler        = (RecyclerView)FindViewById(Resource.Id.recyler);
                EmptyStateLayout = FindViewById <ViewStub>(Resource.Id.viewStub);

                SwipeRefreshLayout = (SwipeRefreshLayout)FindViewById(Resource.Id.swipeRefreshLayout);
                SwipeRefreshLayout.SetColorSchemeResources(Android.Resource.Color.HoloBlueLight, Android.Resource.Color.HoloGreenLight, Android.Resource.Color.HoloOrangeLight, Android.Resource.Color.HoloRedLight);
                SwipeRefreshLayout.Refreshing = false;
                SwipeRefreshLayout.Enabled    = false;
                SwipeRefreshLayout.SetProgressBackgroundColorSchemeColor(AppSettings.SetTabDarkTheme ? Color.ParseColor("#424242") : Color.ParseColor("#f7f7f7"));

                ProgressBarLoader            = (ProgressBar)FindViewById(Resource.Id.sectionProgress);
                ProgressBarLoader.Visibility = ViewStates.Gone;

                FloatingActionButtonView = FindViewById <FloatingActionButton>(Resource.Id.floatingActionButtonView);
            }
            catch (Exception e)
            {
                Console.WriteLine(e);
            }
        }
Example #42
0
        private void DestroyBasic()
        {
            try
            {
                MAdView?.Destroy();

                MAdapter            = null;
                SwipeRefreshLayout  = null;
                MRecycler           = null;
                EmptyStateLayout    = null;
                Inflated            = null;
                MainScrollEvent     = null;
                MAdView             = null;
                ItemUser            = null;
                InviteFriendsButton = null;
                GroupId             = null;
                GroupDataClass      = null;
            }
            catch (Exception e)
            {
                Console.WriteLine(e);
            }
        }
Example #43
0
        private void DestroyBasic()
        {
            try
            {
                MAdView?.Destroy();
                RewardedVideoAd?.OnDestroy(this);

                MAdapter           = null !;
                SwipeRefreshLayout = null !;
                MRecycler          = null !;
                EmptyStateLayout   = null !;
                Inflated           = null !;
                MainScrollEvent    = null !;
                BtnFilter          = null !;
                CategoryId         = null !;
                MAdView            = null !;
                RewardedVideoAd    = null !;
            }
            catch (Exception e)
            {
                Methods.DisplayReportResultTrack(e);
            }
        }
Example #44
0
        /// <summary>
        /// 页面控件
        /// </summary>
        protected void InitViews(View view)
        {
            tvTitle1   = view.FindViewById <TextView>(Resource.Id.tv_title_1);
            tvTitle2   = view.FindViewById <TextView>(Resource.Id.tv_title_2);
            tvRate1    = view.FindViewById <TextView>(Resource.Id.tv_rate_1);
            tvRate2    = view.FindViewById <TextView>(Resource.Id.tv_rate_2);
            llAscWrap  = view.FindViewById <LinearLayout>(Resource.Id.ll_asc_wrap);
            llDescWrap = view.FindViewById <LinearLayout>(Resource.Id.ll_desc_wrap);

            //区域模块
            tvBudgetTitle  = view.FindViewById <TextView>(Resource.Id.tv_area_title);
            tvBudget       = view.FindViewById <TextView>(Resource.Id.tv_area_budget);
            tvBudgetRate   = view.FindViewById <TextView>(Resource.Id.tv_area_rate);
            llBudgetBefore = view.FindViewById <LinearLayout>(Resource.Id.ll_area_before);
            llBudgetAfter  = view.FindViewById <LinearLayout>(Resource.Id.ll_area_after);

            // 财年
            tv_year = view.FindViewById <TextView>(Resource.Id.tv_year);

            mSwipeRefreshLayout = (SwipeRefreshLayout)view.FindViewById(Resource.Id.refresher);
            mSwipeRefreshLayout.SetColorSchemeColors(Color.ParseColor("#db0000"));
            mSwipeRefreshLayout.SetOnRefreshListener(this);
        }
Example #45
0
        public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
        {
            ((MainActivity)Activity).SetAsDrawerToolbar();
            var ignored = base.OnCreateView(inflater, container, savedInstanceState);

            view = inflater.Inflate(Resource.Layout.booking_index, null);

            swipeRefresh = view.FindViewById <SwipeRefreshLayout>(Resource.Id.booking_index_swipe);

            swipeRefresh.Refresh += delegate
            {
                backgroundWorker.RunWorkerAsync();
            };

            swipeRefresh.Refreshing = true;

            backgroundWorker                     = new BackgroundWorker();
            backgroundWorker.DoWork             += Bworker_DoWork;
            backgroundWorker.RunWorkerCompleted += Bworker_RunWorkerCompleted;
            backgroundWorker.RunWorkerAsync();

            return(view);
        }
Example #46
0
        private void SetRecyclerViewAdapters()
        {
            try
            {
                MainRecyclerView = FindViewById <WRecyclerView>(Resource.Id.Recyler);
                PostFeedAdapter  = new NativePostAdapter(this, "", MainRecyclerView, NativeFeedType.Saved);

                SwipeRefreshLayout = FindViewById <SwipeRefreshLayout>(Resource.Id.swipeRefreshLayout);
                SwipeRefreshLayout.SetColorSchemeResources(Android.Resource.Color.HoloBlueLight, Android.Resource.Color.HoloGreenLight, Android.Resource.Color.HoloOrangeLight, Android.Resource.Color.HoloRedLight);
                SwipeRefreshLayout.Refreshing = true;
                SwipeRefreshLayout.Enabled    = true;
                SwipeRefreshLayout.SetProgressBackgroundColorSchemeColor(AppSettings.SetTabDarkTheme ? Color.ParseColor("#424242") : Color.ParseColor("#f7f7f7"));

                MainRecyclerView.SetXAdapter(PostFeedAdapter, SwipeRefreshLayout);

                LinearLayout adContainer = FindViewById <LinearLayout>(Resource.Id.bannerContainer);
                BannerAd = AdsFacebook.InitAdView(this, adContainer);
            }
            catch (Exception e)
            {
                Methods.DisplayReportResultTrack(e);
            }
        }
Example #47
0
        private void DestroyBasic()
        {
            try
            {
                MAdView?.Destroy();

                MAdapter           = null;
                SwipeRefreshLayout = null;
                MRecycler          = null;
                EmptyStateLayout   = null;
                Inflated           = null;
                MainScrollEvent    = null;
                MAdView            = null;
                SearchText         = null;
                SearchView         = null;
                BtnFilter          = null;
                ToolBar            = null;
            }
            catch (Exception e)
            {
                Console.WriteLine(e);
            }
        }
        public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
        {
            // Use this to return your custom view for this Fragment
            View view = inflater.Inflate(Resource.Layout.en_caso_list_fragment, container, false);

            tvNoInternet = view.FindViewById <TextView>(Resource.Id.encaso_list_nointernet);

            swipeRefreshLayout          = view.FindViewById <SwipeRefreshLayout>(Resource.Id.encaso_list_swipe);
            swipeRefreshLayout.Refresh += SwipeRefreshLayout_Refresh;

            recyclerView = view.FindViewById <RecyclerView>(Resource.Id.encaso_list_recyclerview);

            LinearLayoutManager linearLayoutManager = new LinearLayoutManager(Context);

            recyclerView.SetLayoutManager(linearLayoutManager);
            rssEnCaso = LocalDatabase <RssEnCaso> .GetRssEnCasoDb().GetAll();

            manualRecyclerAdapter = new ManualRecyclerAdapter(rssEnCaso);
            recyclerView.SetAdapter(manualRecyclerAdapter);
            recyclerView.AddOnScrollListener(new CustomScrollListener());
            recyclerView.HasFixedSize = true;
            return(view);
        }
Example #49
0
        private void InitComponent(View view)
        {
            try
            {
                MRecycler        = (RecyclerView)view.FindViewById(Resource.Id.recyler);
                EmptyStateLayout = view.FindViewById <ViewStub>(Resource.Id.viewStub);

                SwipeRefreshLayout = (SwipeRefreshLayout)view.FindViewById(Resource.Id.swipeRefreshLayout);
                SwipeRefreshLayout.SetColorSchemeResources(Android.Resource.Color.HoloBlueLight, Android.Resource.Color.HoloGreenLight, Android.Resource.Color.HoloOrangeLight, Android.Resource.Color.HoloRedLight);
                SwipeRefreshLayout.Refreshing = true;
                SwipeRefreshLayout.Enabled    = true;
                SwipeRefreshLayout.SetProgressBackgroundColorSchemeColor(AppSettings.SetTabDarkTheme ? Color.ParseColor("#424242") : Color.ParseColor("#f7f7f7"));

                SwipeRefreshLayout.Refresh += SwipeRefreshLayoutOnRefresh;

                LinearLayout adContainer = view.FindViewById <LinearLayout>(Resource.Id.bannerContainer);
                BannerAd = AdsFacebook.InitAdView(Activity, adContainer);
            }
            catch (Exception e)
            {
                Console.WriteLine(e);
            }
        }
Example #50
0
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);

            createDatabase();

            SetContentView(Resource.Layout.Main);

            ListView listView = FindViewById <ListView>(Resource.Id.listview);

            swipeToRefreshLayout = FindViewById <SwipeRefreshLayout>(Resource.Id.swipe_refresh_layout);

            bindedList = new List <ElementModel>()
            {
                newElementModel(), newElementModel(), newElementModel(),
            };

            adapter          = new SwipeListAdapter(this, bindedList);
            listView.Adapter = adapter;

            swipeToRefreshLayout.SetOnRefreshListener(this);
            swipeToRefreshLayout.Post(refreshFromDatabase);
        }
Example #51
0
        private void DestroyBasic()
        {
            try
            {
                MAdView?.Destroy();
                RewardedVideoAd?.OnDestroy(this);

                MAdapter           = null;
                SwipeRefreshLayout = null;
                MRecycler          = null;
                EmptyStateLayout   = null;
                Inflated           = null;
                MainScrollEvent    = null;
                BtnFilter          = null;
                CategoryId         = null;
                MAdView            = null;
                RewardedVideoAd    = null;
            }
            catch (Exception e)
            {
                Console.WriteLine(e);
            }
        }
		public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
		{
			var view = inflater.Inflate(Resource.Layout.ListViewWithSwipe, container, false);


			SwipeRefreshLayout = (SwipeRefreshLayout)view.FindViewById(Resource.Id.swipe_refresh_layout);
			SwipeRefreshLayout.SetColorScheme(Resource.Color.tenBlue,
				Resource.Color.colorPrimary,
				Resource.Color.colorAccent,
				Resource.Color.colorPrimaryDark);
			SwipeRefreshLayout.Refresh += async delegate
			{
				await FetchTableData();
			};

			ListView = view.FindViewById<ListView>(Resource.Id.list);
			ListView.SetOnScrollListener(new TailFetchListViewListener(this));

			BackgroundTextView = (TextView)view.FindViewById<TextView>(Resource.Id.backgroundTextView);
			BackgroundTextView.Text = EmptyTableString;

			return view;
		}
Example #53
0
        protected override void OnCreate(Bundle bundle)
        {
            handler = new Handler();

            base.OnCreate(bundle);

            // Set our view from the "main" layout resource
            SetContentView(Resource.Layout.Main);

            swipe_refresh_layout = FindViewById<SwipeRefreshLayout>(Resource.Id.swipe_refresh_layout);
            // Setup the actionbar indicator

            // To use the default layout:
            // Set the background color
            swipe_refresh_layout.SetActionBarSwipeIndicatorBackgroundColor(Resources.GetColor(Resource.Color.swipe_to_refresh_background));
            // Set the text colors. Failing to do so will cause the text to not be displayed.
            swipe_refresh_layout.SetActionBarSwipeIndicatorTextColor(Resources.GetColor(Resource.Color.swipe_to_refresh_text));
            swipe_refresh_layout.SetActionBarSwipeIndicatorRefreshingTextColor(Resources.GetColor(Resource.Color.swipe_to_refresh_text));

            // Or you can use a custom layout...
            // This is recommended if you want more control over the text styling.
            //swipe_refresh_layout.SetActionBarSwipeIndicatorLayout(Resource.Layout.swipe_indicator, Resource.Id.text);

            // Set the text to be displayed.
            swipe_refresh_layout.SetActionBarSwipeIndicatorRefreshingText(Resource.String.loading);
            swipe_refresh_layout.SetActionBarSwipeIndicatorText(Resource.String.swipe_to_refresh);

            // Setup colors
            swipe_refresh_layout.SetColorScheme(
                Resource.Color.refreshing_color1,
                Resource.Color.refreshing_color2,
                Resource.Color.refreshing_color3,
                Resource.Color.refreshing_color4);
            // Set the listener
            swipe_refresh_layout.Refresh += OnRefresh;
        }
        public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
        {
            base.OnCreateView(inflater, container, savedInstanceState);
            var view = inflater.Inflate(Resource.Layout.fragment_past_trips, null);

            viewModel = new PastTripsViewModel();

            recyclerView = view.FindViewById<RecyclerView>(Resource.Id.recyclerView);
            refresher = view.FindViewById<SwipeRefreshLayout>(Resource.Id.refresher);

            refresher.Refresh += (sender, e) => viewModel.LoadPastTripsCommand.Execute(null);


            adapter = new TripAdapter(Activity, viewModel);
            adapter.ItemClick += OnItemClick;
            adapter.ItemLongClick += OnItemLongClick;
            layoutManager = new LinearLayoutManager(Activity) {Orientation = LinearLayoutManager.Vertical};
            recyclerView.SetLayoutManager(layoutManager);
            recyclerView.SetAdapter(adapter);
            recyclerView.ClearOnScrollListeners();
            recyclerView.AddOnScrollListener(new TripsOnScrollListenerListener(viewModel, layoutManager));

            return view;
        }
Example #55
0
		public override View OnCreateView(LayoutInflater inflater ,ViewGroup container ,Bundle savedInstanceState) 
		{
			View v = inflater.Inflate(Resource.Layout.MyHealth_tab_2 ,container ,false);
			recyclerView = v.FindViewById <RecyclerView> (Resource.Id.recyclerViewTakwim);
			//mListView = v.FindViewById <ListView> (Resource.Id.listViewContainer);
			//mListView = v.FindViewById <ListView> (Android.Resource.Id.List);

			llMHeT2ErrorLayout = (LinearLayout)v.FindViewById (Resource.Id.llMHeT2ErrorLayout);
			tvMHeT2ErrorStatus = (TextView)v.FindViewById (Resource.Id.tvMHeT2ErrorStatus);

			mSlideRefreshLayout = v.FindViewById<SwipeRefreshLayout> (Resource.Id.swipelayout);
			mSlideRefreshLayout.SetColorScheme (Android.Resource.Color.HoloBlueBright, Android.Resource.Color.HoloBlueDark, Android.Resource.Color.HoloGreenLight, Android.Resource.Color.HoloRedLight);
			mSlideRefreshLayout.Refresh += mSlideRefreshLayout_Refresh;

			if (recyclerView != null) {
				recyclerView.HasFixedSize = true;

				var layoutManager = new LinearLayoutManager (Activity);
				var onScrollListener = new MyHealthBWRecyclerViewOnScrollListener (layoutManager);

				onScrollListener.LoadMoreEvent += (object sender, EventArgs e) => {
					page++;
					if (page <= lastPage && isRefreshing == false) {

						ThreadPool.QueueUserWorkItem (o => {
							setupMyHealthData (page);
						});
					}
				};
				recyclerView.AddOnScrollListener (onScrollListener);
				recyclerView.SetLayoutManager (layoutManager);
			}


			return v;
		}
        public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
        {
            View view = (View) inflater.Inflate(Resource.Layout.cardView_layout,container, false);

            //CardView
            mRecyclerView = view.FindViewById<RecyclerView>(Resource.Id.recyclerView);
            mCardViewHuoJing = new List<CardViewHuoJing>();

            FragmentManager fragmentManager1 = this.FragmentManager;

            string strURL=  this.Resources.GetString(Resource.String.HttpUri)+ String.Format("andriod/bjxx_intime_andriod.jsp?") + String.Format("userId={0}&userType={1}",LogInfoCardView.userId,LogInfoCardView.userType);

            Console.WriteLine (strURL);
            mHttpRequestCardView.HttpRequestFunc (strURL);

            doc.LoadXml(mHttpRequestCardView.HttpRecv);
            foreach (XmlNode node in doc.SelectNodes("FireIntime/Info/Fire"))
            {

                mCardViewHuoJing.Add (new CardViewHuoJing (){

                    bjxxbh=node.Attributes["bjxxbh"].Value,
                    dwmc=node.Attributes["dwmc"].Value,
                    lxdz=node.Attributes["lxdz"].Value,
                    lxr=node.Attributes["lxr"].Value,
                    khlb=node.Attributes["khlb"].Value,
                    gddh=node.Attributes["gddh"].Value,
                    bjdz=node.Attributes["bjdz"].Value,
                    asebh=node.Attributes["asebh"].Value,
                    ipphone=node.Attributes["ipphone"].Value,
                    quhao=node.Attributes["quhao"].Value,
                    bjsj=node.Attributes["bjsj"].Value,
                    bjjb=node.Attributes["bjjb"].Value,
                    flag=node.Attributes["flag"].Value,
                    bn=node.Attributes["bn"].Value

                });

            }

            //mCardViewHuoJing.Add(new Email() { Name = "tom", Subject = "Wanna hang out?", Message = "I'll be around tomorrow!!" });

            mLayoutManager = new LinearLayoutManager(Application.Context);
            mRecyclerView.SetLayoutManager(mLayoutManager);
            mAdapter = new RecyclerAdapter(mCardViewHuoJing, mRecyclerView,1,Application.Context,fragmentManager1);
            mRecyclerView.SetAdapter(mAdapter);

            //swipeRefresh
            mSwipeRefreshLayout = view.FindViewById<SwipeRefreshLayout> (Resource.Id.swipeLayout);
            mSwipeRefreshLayout.SetColorScheme (Android.Resource.Color.HoloBlueBright, Android.Resource.Color.HoloRedLight, Android.Resource.Color.HoloGreenLight, Android.Resource.Color.HoloPurple);
            mSwipeRefreshLayout.Refresh += mSwipeRefreshLayout_Refresh;

            //mRecyclerView.Click += mRecyclerView_Click;

            return view ;
        }
 private void SetUpSwipeView(View root)
 {
     _gridViewSwipeRefresh = root.FindViewById<SwipeRefreshLayout>(Resource.Id.swipeRefreshLayout_gridView);
     //OnCreateSwipeToRefresh(_gridViewSwipeRefresh);
     _gridViewSwipeRefresh.SetOnRefreshListener(this);
 }
        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.YourFragment, container, false);
            var root = inflater.Inflate(Resource.Layout.add_show_gridview_layout, container, false);

            mGridView = root.FindViewById<GridView>(Resource.Id.myGridview);
			mySwipeRefreshLayout = root.FindViewById<SwipeRefreshLayout> (Resource.Id.swiperefresh);
            SetUpAdapter();
            if (savedInstanceState == null)
            {
                var myTask = populateArrayOfShows();
            }
            else
            {
                string myJsonString = savedInstanceState.GetString("list");
                _myShowsList = JsonConvert.DeserializeObject<TVShowList>(myJsonString).tvShowList;
                PAGENUM = savedInstanceState.GetInt("pageNum", 1);

                UpdateAdapter();
            }
            
            mGridView.ItemClick += (object sender, AdapterView.ItemClickEventArgs e) =>
            {
                var intent = new Intent(this.Activity, typeof(OverviewShowActivity));
                //Change to show
                intent.PutExtra("TMDBID", "" + _myShowsList[e.Position].TMDBID);
                StartActivity(intent);


                //				Toast.MakeText (this.Activity, "I clicked on position " + e.Position + " with TVDBID of "
                //				+ showsJToken [e.Position] ["id"], ToastLength.Short).Show ();
            };

            mGridView.Scroll += (sender, args) =>
            {
                if (args.FirstVisibleItem + args.VisibleItemCount >= args.TotalItemCount && mAdapter.Count > 15 && !reachedBottomGridView)
                {
                    reachedBottomGridView = true;
                    getNextPage();
                    Console.WriteLine("I reached bottom of grid view");
                }
            };

			mySwipeRefreshLayout.Refresh += async delegate {

				//Updated list of trakked shows
				if(this.Activity is AddShowsTabActivity){
					await ((AddShowsTabActivity)this.Activity).UpdateTrakkedShowList();
				}

				mySwipeRefreshLayout.Refreshing = false;

			};

            return root;
        }
Example #59
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);
            this.RequestWindowFeature(WindowFeatures.NoTitle);
            SetContentView(Resource.Layout.gruppeRom);

            menuButton = FindViewById<ImageButton>(Resource.Id.menuButton);
            mainPage = FindViewById<ImageButton>(Resource.Id.westerdalsLogo);
            infoText = FindViewById<TextView>(Resource.Id.ingenInfo);
            hjelpButton = FindViewById<Button>(Resource.Id.HjelpButton);

            hjelpButton.Visibility = ViewStates.Gone;
            infoText.Visibility = ViewStates.Gone;

            swiperefresh = FindViewById<SwipeRefreshLayout>(Resource.Id.swiperefresh);
            swiperefresh.Refresh += Swiperefresh_Refresh;

            menuButton.Click += delegate
            {
                StartActivity(typeof(Menu));
            };
            mainPage.Click += delegate
            {
                StartActivity(typeof(Menu));
            };

            _beaconManager = new BeaconManager(this);
            _region = new Region("SomeBeaconIdentifier", "b9407f30-f5f8-466e-aff9-25556b57fe6d");

            romListView = FindViewById<ListView>(Resource.Id.romListe1);
            roomClient = new WebClient();
            servURL = new Uri("http://pj3100.somee.com/GetRooms.php");

            romListe = new List<RomBeacon>();

            romListeDB = new List<RomBeacon>();

            _beaconManager.SetBackgroundScanPeriod(2000, 0);
            _beaconManager.EnteredRegion += (sender, e) =>
            {
                int numberOfBeacons = e.Beacons.Count;

                    for (int i = 0; i < numberOfBeacons; i++)
                    {
                        romListe.Add(new RomBeacon
                        {
                            BeaconUUID = e.Beacons[i].ProximityUUID.ToString(),
                            BeaconMajor = e.Beacons[i].Major,
                            BeaconMinor = e.Beacons[i].Minor,
                            distance = calculateDistance(e.Beacons[i].MeasuredPower, e.Beacons[i].Rssi).ToString()
                        });
                    }
            };

            roomClient.DownloadDataAsync(servURL);
            roomClient.DownloadDataCompleted += roomClient_DownloadDataCompleted;

            if (romListeDB.Count == 0)
            {
                infoText.Visibility = ViewStates.Visible;
                infoText.Text = "Ingenting her, swipe ned for å fornye.";
            }
            else
            {
                infoText.Visibility = ViewStates.Gone;
            }
        }
Example #60
0
        private void InitRefreshers()
        {
            categoryRefresher = FindViewById<SwipeRefreshLayout>(Resource.Id.swipe1);
            categoryRefresher.Refresh += async (sender, e) =>
            {
                await Task.Factory.StartNew(() => LoadSets(false, true));
                NotifyListUpdate();
                categoryRefresher.Refreshing = false;
            };

            workshopRefresher = FindViewById<SwipeRefreshLayout>(Resource.Id.swipe2);
            workshopRefresher.Refreshing = true;
            workshopRefresher.Refresh +=  async (sender, e) =>
            {
                await Task.Factory.StartNew(() => LoadWorkshops(CurrentWorkshopSet, -1, false, true));
                NotifyListUpdate();
                workshopRefresher.Refreshing = false;
            };
        }