示例#1
0
                public TheRecyclerViewAdapter(FragmentActivity activity)
                {
                    this.activity = activity;
                    var model = ApplicationModel.Instance;

                    data = model.Settings.SearchPaths;
                }
示例#2
0
 public btnFollowingClickListner(FragmentActivity activity, UserProfile userProfile, Button btnFollowing, TextView followerCount)
 {
     this.followerCount = followerCount;
     this.activity      = activity;
     this.userProfile   = userProfile;
     this.btnFollowing  = btnFollowing;
 }
示例#3
0
 public GetProfileDetails(FragmentActivity activity, View view, long userID, TextView toolbar_title)
 {
     this.activity      = activity;
     this.view          = view;
     this.userID        = userID;
     this.toolbar_title = toolbar_title;
 }
示例#4
0
 public postFriendRequest(FragmentActivity activity, UserProfile userProfile, Button btnFollowing, TextView followerCount)
 {
     this.followerCount = followerCount;
     this.btnFollowing  = btnFollowing;
     this.activity      = activity;
     this.userProfile   = userProfile;
 }
        public static void ProgressDialogDismiss(this FragmentActivity fragmentActivity, Android.App.ProgressDialog dialog)
        {
            Log.Debug(TAG, nameof(ProgressDialogDismiss));

            fragmentActivity.RunOnUiThread(() =>
            {
                Log.Debug(TAG, "[3] Closing dialog.");
                if (dialog != null)
                {
                    if (dialog.IsShowing)
                    {
                        Log.Debug(TAG, string.Format($"--{nameof(ProgressDialogDismiss)}: dialog - IsShowing"));
                        dialog.Dismiss();
                    }
                    else
                    {
                        Log.Debug(TAG, string.Format($"--{nameof(ProgressDialogDismiss)}: dialog - NOT IsShowing"));
                    }
                }
                else
                {
                    Log.Debug(TAG, string.Format($"--{nameof(ProgressDialogDismiss)}: dialog is NULL"));
                }
                Log.Debug(TAG, "[4] Dialog closed.");
            });
        }
示例#6
0
 public RecyclerViewCuisineAdapter(List <IdcategoriesNavigation> cuisines, Context context, RecyclerView recycler, FragmentActivity activity)
 {
     this.cuisines = cuisines;
     this.context  = context;
     this.recycler = recycler;
     this.activity = activity;
 }
示例#7
0
        public static void Construct(FragmentActivity activity, Toolbar toolbar)
        {
            TopMovieFragment topMovieFragment = new TopMovieFragment();
            var fragments = new Fragment[]
            {
                new MovieSearchFragment(),
                topMovieFragment
            };

            var titles = CharSequence.ArrayFromStringArray(new[]
            {
                "Search",
                "Top Rated"
            });

            var viewPager = activity.FindViewById <ViewPager>(Resource.Id.viewpager);

            viewPager.Adapter = new TabsFragmentPageAdapter(activity.SupportFragmentManager, fragments, titles);

            var tabLayout = activity.FindViewById <TabLayout>(Resource.Id.sliding_tabs);

            tabLayout.SetupWithViewPager(viewPager);
            viewPager.PageSelected += (sender, args) =>
            {
                if (args.Position == 1)
                {
                    topMovieFragment.GetTopMovies(activity);
                }
            };
            SetToolbar(activity, toolbar);
        }
        void SetupUserInterface()
        {
            var activity = this.Context as Activity;

            view = activity.LayoutInflater.Inflate(Resource.Layout.ViewerLayout, this, false);

            // init UI
            mPdfViewCtrl      = view.FindViewById <pdftron.PDF.PDFViewCtrl>(Resource.Id.pdfviewctrl);
            mToolbarContainer = view.FindViewById <FrameLayout>(Resource.Id.annotation_toolbar_container);
            mPresetContainer  = view.FindViewById <FrameLayout>(Resource.Id.preset_container);

            // setup PDFViewCtrl and ToolManager
            AppUtils.SetupPDFViewCtrl(mPdfViewCtrl, PDFViewCtrlConfig.GetDefaultConfig(this.Context));

            if (activity is FragmentActivity)
            {
                mFragmentActivity = activity as FragmentActivity;
            }
            mToolManager = ToolManagerBuilder.From().Build(mFragmentActivity, mPdfViewCtrl);

            // setup toolbars
            SetupAnnotationToolbar();

            var file = Utils.CopyResourceToLocal(this.Context, Resource.Raw.sample, "sample", ".pdf");

            mPdfDoc = mPdfViewCtrl.OpenPDFUri(Android.Net.Uri.FromFile(file), "");
        }
 public btnUploadEventProfilepic(ImageView btnUploadPhotos, FragmentActivity activity, long eventID, long creatorId)
 {
     this.creatorId       = creatorId;
     this.btnUploadPhotos = btnUploadPhotos;
     this.activity        = activity;
     this.eventID         = eventID;
 }
示例#10
0
        public static void InitPopupMenu(FragmentActivity ctx, int idBelow)
        {
            int layoutWidth  = (ctx.Resources.DisplayMetrics.WidthPixels * 31) / 100;
            int layoutHeight = 4 * ((int)ctx.Resources.GetDimension(Resource.Dimension.main_menu_icon_size) + 2);

            RelativeLayout.LayoutParams lp = new RelativeLayout.LayoutParams(layoutWidth, layoutHeight);
            lp.AddRule(LayoutRules.Below, idBelow);
            lp.TopMargin = (int)ctx.Resources.GetDimension(Resource.Dimension.action_bar_height);

            Log.Debug("InitPopupMenu", " before popupMenu=");
            RelativeLayout popupMenu = ctx.FindViewById <RelativeLayout>(Resource.Id.popup_mainmenu_inner);

            Log.Debug("InitPopupMenu", "popupMenu=" + popupMenu);
            popupMenu.LayoutParameters = lp;
            popupMenu.SetBackgroundResource(Resource.Drawable.actionbar_background);

//            MainMenuFragment mainmenupopup_fragment = (MainMenuFragment)ctx.SupportFragmentManager.FindFragmentById(Resource.Id.mainmenupopup_fragment);
//            mainmenupopup_fragment.IsPopupMenu = true;

            Button btnSettings = ctx.FindViewById <Button>(Resource.Id.btnSettingsMain);

            btnSettings.Touch += (object sender, View.TouchEventArgs e) => {
                switch (e.Event.Action & MotionEventActions.Mask)
                {
                case MotionEventActions.Up:
                    popupMenu.Visibility = ViewStates.Gone;
                    SettingsClicked(ctx);
                    break;
                }
            };
        }
示例#11
0
 public GetAllEventDetails(View view, FragmentActivity activity, long userID, ListView lvEvent)
 {
     this.view     = view;
     this.activity = activity;
     this.userID   = userID;
     this.lvEvent  = lvEvent;
 }
示例#12
0
        public static void Construct(FragmentActivity activity, Toolbar toolbar)
        {
            _topRatedFragment = new OtherFragment();

            var fragments = new Fragment[]
            {
                new MovieInputFragment(),
                _topRatedFragment
            };
            var titles = CharSequence.ArrayFromStringArray(new[]
            {
                "Search",
                "Top Rated"
            });

            var viewPager = activity.FindViewById <ViewPager>(Resource.Id.viewpager);

            viewPager.Adapter = new TabsFragmentPagerAdapter(activity.SupportFragmentManager, fragments, titles);

            // Give the TabLayout the ViewPager
            var tabLayout = activity.FindViewById <TabLayout>(Resource.Id.sliding_tabs);

            tabLayout.SetupWithViewPager(viewPager);
            tabLayout.TabSelected += async(sender, args) =>
            {
                var tab = args.Tab;
                if (tab.Position == 1)
                {
                    await _topRatedFragment.FetchTopRatedMovies();
                }
            };
            SetToolbar(activity, toolbar);
        }
示例#13
0
        public HolderFragment <T> HolderFragmentFor(FragmentActivity activity)
        {
            var fm     = activity.SupportFragmentManager;
            var holder = FindHolderFragment(fm);

            if (holder != null)
            {
                return(holder);
            }

            if (_mNotCommittedActivityHolders.ContainsKey(activity))
            {
                return(_mNotCommittedActivityHolders[activity]);
            }

            if (!_mActivityCallbacksIsAdded)
            {
                _mActivityCallbacksIsAdded = true;
                activity.Application.RegisterActivityLifecycleCallbacks(_mActivityCallbacks);
            }

            holder = CreateHolderFragment(fm);
            _mNotCommittedActivityHolders.Add(activity, holder);
            return(holder);
        }
 public TabManager(FragmentActivity activity, TabHost tabHost, int containerId)
 {
     _activity = activity;
     _tabHost = tabHost;
     _containerId = containerId;
     _tabHost.SetOnTabChangedListener(this);
 }
示例#15
0
        public static void SwitchFragment(string Fragment_Tag, FragmentActivity activity)
        {
            var sfm = activity.SupportFragmentManager;

            sfm.BeginTransaction().Show(sfm.FindFragmentByTag(Fragment_Tag));
            sfm.BeginTransaction().Commit();

            NavigationView nav  = mContext.FindViewById <NavigationView>(Resource.Id.nav_view);
            var            item = nav.Menu.FindItem(Resource.Id.nav_manage);

            switch (Fragment_Tag)
            {
            case "Fragment_gpx":
                Fragment_map.mapControl.Visibility = ViewStates.Invisible;
                mContext.FindViewById <FloatingActionButton>(Resource.Id.fab).Visibility = ViewStates.Invisible;

                item.SetTitle("Map");
                break;

            case "Fragment_map":
                Fragment_map.mapControl.Visibility = ViewStates.Visible;
                mContext.FindViewById <FloatingActionButton>(Resource.Id.fab).Visibility = ViewStates.Visible;

                item.SetTitle("Routes / Tracks");
                break;
            }
        }
 public ExpandableStockListAdapter(FragmentActivity activity, List <StockAdapterListItem> items, List <Stock> dbItems, List <StockItemGoogle> googleItems)
 {
     this.activity    = activity;
     this.items       = items;
     this.dbItems     = dbItems;
     this.googleItems = googleItems;
 }
示例#17
0
 public TabManager(FragmentActivity activity, TabHost tabHost, int containerId)
 {
     _activity    = activity;
     _tabHost     = tabHost;
     _containerId = containerId;
     _tabHost.SetOnTabChangedListener(this);
 }
        private void HandleShowFilters(object sender, EventArgs e)
        {
            FragmentActivity      activity = Context as FragmentActivity;
            ExploreBottomFragment bottomSheetDialogFragment = new ExploreBottomFragment(gridLayout);

            bottomSheetDialogFragment.Show(activity.SupportFragmentManager, bottomSheetDialogFragment.Tag);
        }
示例#19
0
 public AndroidNavigator([NonNull] FragmentActivity activity, [NonNull] FragmentManager fragmentManager,
                         [IdRes] int containerId)
 {
     _activity        = activity;
     _fragmentManager = fragmentManager;
     _containerId     = containerId;
 }
            public void onAttach(Activity activity)
            {
                base.OnAttach(activity);

                //  if (activity instanceof FragmentActivity) {
                mContext = (FragmentActivity)activity;
            }
        public static TFragment GetNavigationFragment <TFragment>(
            this FragmentActivity activity)
            where TFragment : Fragment
        {
            var fragments = activity.SupportFragmentManager.Fragments;

            if (fragments != null)
            {
                foreach (var fragment in fragments)
                {
                    if (fragment is NavHostFragment navHostFragment)
                    {
                        var fragments2 = navHostFragment
                                         .ChildFragmentManager.Fragments;
                        foreach (var fragment1 in fragments2)
                        {
                            if (fragment1 is TFragment t)
                            {
                                return(t);
                            }
                        }
                    }
                }
            }
            return(null);
        }
        void SetupUserInterface()
        {
            activity = this.Context as Activity;
            view     = activity.LayoutInflater.Inflate(Resource.Layout.ViewerLayout, this, false);

            mPdfViewCtrl = view.FindViewById <pdftron.PDF.PDFViewCtrl>(Resource.Id.pdfviewctrl);
            AppUtils.SetupPDFViewCtrl(mPdfViewCtrl, PDFViewCtrlConfig.GetDefaultConfig(this.Context));

            var file = Utils.CopyResourceToLocal(this.Context, Resource.Raw.sample, "sample", ".pdf");

            mPdfDoc = mPdfViewCtrl.OpenPDFUri(Android.Net.Uri.FromFile(file), "");

            FragmentActivity fragmentActivity = null;

            if (activity is FragmentActivity)
            {
                fragmentActivity = activity as FragmentActivity;
            }
            mToolManager = ToolManagerBuilder.From().Build(fragmentActivity, mPdfViewCtrl);
            mToolManager.SetCanOpenEditToolbarFromPan(true);
            mToolManager.OpenEditToolbar += (sender, e) =>
            {
                mAnnotationToolbar.Show(AnnotationToolbar.StartModeEditToolbar, null, 0, e.Mode, !mAnnotationToolbar.IsShowing);
            };

            mAnnotationToolbar = view.FindViewById <AnnotationToolbar>(Resource.Id.annotationtoolbar);
            mAnnotationToolbar.Setup(mToolManager);
            mAnnotationToolbar.SetButtonStayDown(true);
            mAnnotationToolbar.HideButton(AnnotationToolbarButtonId.Close);
            mAnnotationToolbar.Show();

            mSeekBar = view.FindViewById <ThumbnailSlider>(Resource.Id.thumbseekbar);
        }
        public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
        {
            view = inflater.Inflate(Resource.Layout.TasksListMaster, container, false);

            //get framelayout
            //tContainer = view.FindViewById<FrameLayout>(Resource.Id.taskFragementContainer);

            MyActivity = Activity;

            //passed goal id
            selGoalId = Convert.ToInt32(Activity.Intent.Extras.Get("GoalId").ToString());

            mListTasks = view.FindViewById <ListView>(Resource.Id.listTrackTasks);

            //transaction
            //var trans = MyActivity.SupportFragmentManager.BeginTransaction();
            //trans.Add(tContainer.Id, new GoalTaskFragment(), "TaskDetails");
            //trans.Commit();

            //tContainer.SetOnTouchListener(this);

            //click
            mListTasks.ItemClick += MListTasks_ItemClick;

            //context menu
            mListTasks.ContextMenuCreated += MListTasks_ContextMenuCreated;

            //populate list
            populateItemsList(view, selGoalId);


            return(view);
        }
 public postInviteContact(FragmentActivity activity, SPGetSearchUserList_Result userData, Button btnSendInvite, PeopleDataAdapter peopleDataAdapter)
 {
     this.activity          = activity;
     this.userData          = userData;
     this.btnSendInvite     = btnSendInvite;
     this.peopleDataAdapter = peopleDataAdapter;
 }
 public onRefereshPrivateLayout(HomeAdapterPrivateEvent privateEventAdapter, FragmentActivity context, SwipeRefreshLayout mSwipeRefreshLayout, RecyclerView rvPrivateEvent)
 {
     this.rvPrivateEvent      = rvPrivateEvent;
     this.mSwipeRefreshLayout = mSwipeRefreshLayout;
     this.privateEventAdapter = privateEventAdapter;
     this.context             = context;
 }
示例#26
0
        public FingerprintService(
            FragmentActivity fragmentActivity,
            Context applicationContext,
            IObservable <Unit> applicationActivated,
            CoreDispatcher dispatcher,
            IScheduler backgroundScheduler,
            FuncAsync <BiometricPrompt.PromptInfo> promptInfoBuilder)
        {
            fragmentActivity.Validation().NotNull(nameof(fragmentActivity));
            applicationActivated.Validation().NotNull(nameof(applicationActivated));
            backgroundScheduler.Validation().NotNull(nameof(backgroundScheduler));
            _dispatcher        = dispatcher ?? throw new ArgumentNullException(nameof(dispatcher));
            _promptInfoBuilder = promptInfoBuilder ?? throw new ArgumentNullException(nameof(promptInfoBuilder));

            var executor = ContextCompat.GetMainExecutor(applicationContext);
            var callback = new AuthenticationCallback(OnAuthenticationSucceeded, OnAuthenticationFailed, OnAuthenticationError);

            _BiometricPrompt  = new BiometricPrompt(fragmentActivity, executor, callback);
            _BiometricManager = BiometricManager.From(Application.Context);

            _keyStore = KeyStore.GetInstance(ANDROID_KEYSTORE);
            _keyStore.Load(null);

            _canAuthenticate =
                applicationActivated
                .ObserveOn(backgroundScheduler)
                .StartWith(backgroundScheduler, Unit.Default)
                .Select(_ => _BiometricManager.CanAuthenticate())
                .Replay(1, backgroundScheduler)
                .RefCount();
        }
 public getAllEventDetails(FragmentActivity activity, ListView lvEvent, EditText etTextEventSearch, TextView tvNodata)
 {
     this.tvNodata          = tvNodata;
     this.activity          = activity;
     this.lvEvent           = lvEvent;
     this.etTextEventSearch = etTextEventSearch;
 }
        protected override IMvvmDialog ShowDialog(string dialogKey)
        {
            if (!_dialogs.ContainsKey(dialogKey))
            {
                throw new ArgumentException("DialogKey does not exists");
            }
            Type fragmentType = _dialogs[dialogKey];
            AbstractDialogFragmentBase fragment = Activator.CreateInstance(fragmentType) as AbstractDialogFragmentBase;

            if (fragment == null)
            {
                throw new Exception("Fragment does not inherit AbstractDialogFragmentBase");
            }
#if SUPPORT
            FragmentActivity fragmentActivity = ActivityService.CurrentActivity as FragmentActivity;
            if (fragmentActivity == null)
            {
                throw new Exception("Activity does not inherit ActivityBase");
            }
            fragment.DialogFragmentManager = fragmentActivity.SupportFragmentManager;
#else
            fragment.DialogFragmentManager = ActivityService.CurrentActivity.FragmentManager;
#endif
            return(fragment);
        }
示例#29
0
 public WeClipFragmentLoadData(FragmentActivity activity, GridView gvWeClip, View view, long eventId)
 {
     this.activity = activity;
     this.gvWeClip = gvWeClip;
     this.view     = view;
     this.eventId  = eventId;
     weclipFile    = new List <WeClipVideo>();
 }
示例#30
0
 /// <summary>
 /// Закрыть клавиатуру
 /// </summary>
 /// <param name="activity"></param>
 /// <param name="view"></param>
 public static void HideKeyboard(FragmentActivity activity, View view)
 {
     if (activity != null && view != null)
     {
         var inputMethodManager = (InputMethodManager)activity.GetSystemService(Context.InputMethodService);
         inputMethodManager.HideSoftInputFromWindow(view.WindowToken, 0);
     }
 }
        public override void OnAttach(Context context)
        {
            base.OnAttach(context);

            FragmentActivity activity = (FragmentActivity)context;

            arFragment = (ArFragment)activity.SupportFragmentManager.FindFragmentById(Resource.Id.ar_fragment);
        }
 private bool Changing;                                              // a flag to know if the user is able to change something or just read 
 public TransactionDialog(FragmentActivity activity,BusinessLayer.Person person, BusinessLayer.Transaction transaction, bool ChangePermission): base(activity)
 {
     _context = activity;
     _transaction = transaction;
     _person = person;
     _person.FillAddressen(Utilities.GetCurrentLanguage(MainActivity._mainActivity), MainActivity.User);
     Changing = ChangePermission;
 }
示例#33
0
            public SamplePagerAdapter(FragmentActivity activity)
                : base()
            {
                items.Add("Ofertas publicadas(10)");
                items.Add("Mis Ofertas(05)");
                items.Add("Mis Ventas Hoy(04)");

                this.Activity=activity;
            }
示例#34
0
        public TabsAdapter(FragmentActivity activity, TabHost tabHost, ViewPager pager)
            : base(activity.SupportFragmentManager)
        {
            _context = activity;
            _tabHost = tabHost;
            _viewPager = pager;
            _tabHost.SetOnTabChangedListener(this);
            _viewPager.Adapter = this;
            _viewPager.SetOnPageChangeListener(this);

        }
        private OnRgsExtraCheckedChangedListener onRgsExtraCheckedChangedListener; // 用于让调用者在切换tab时候增加新的功能
        public FragmentTabAdapter(FragmentActivity fragmentActivity, List<Fragment> fragments, int fragmentContentId, RadioGroup rgs)
        {
            this.fragments = fragments;
            this.rgs = rgs;
            this.fragmentactivity = fragmentActivity;
            this.fragmentcontentid = fragmentContentId;

            // 默认显示第一页
            FragmentTransaction ft = fragmentActivity.SupportFragmentManager.BeginTransaction();
            ft.Add(fragmentContentId, fragments[0]);
            ft.Commit();
            rgs.SetOnCheckedChangeListener(this);
          
        }
示例#36
0
        public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
		{
			fa = base.Activity;
			ll = (RelativeLayout) inflater.Inflate(Resource.Layout.FightIt, container, false);
		

			_gpsTracker = ((AfaApplication)fa.ApplicationContext).GetGpsTracker(fa);
		
			//_loadingDialog = LoadingDialogManager.ShowLoadingDialog (fa);

			_crueltySpotsList = ll.FindViewById<ListView>(Resource.Id.CrueltySpots);

			_crueltySpotsList.ItemClick += (sender, e) =>
			{
				var crueltySpot = _crueltySpots[e.Position];
				NavigateToCrueltySpotDetails(crueltySpot.ObjectId);
			};

            _loadingDialog = DialogManager.ShowLoadingDialog(this.Activity, "Retrieving Cruelty Spots");
            LoadCrueltySpots();
			return ll;
		}
 public TabsAdapter(FragmentActivity activity, TabHost tabHost, ViewPager pager) : base(activity.GetSupportFragmentManager())
 {
     mContext = activity;
     mTabHost = tabHost;
     mViewPager = pager;
     mTabHost.SetOnTabChangedListener(this);
     mViewPager.SetAdapter(this);
     mViewPager.SetOnPageChangeListener(this);
 }
 public TheRecyclerViewAdapter(FragmentActivity activity)
 {
     this.activity = activity;
     var model = ApplicationModel.Instance;
     data = model.Settings.SearchPaths;
 }
示例#39
0
 public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
 {
     fa = base.Activity;
     ll = (TextView)inflater.Inflate (Resource.Layout.HomeFragment, container, false);
     return ll;
 }
 public ChangeOfflinePasswordDialog(FragmentActivity activity): base(activity)
 {
     _context = activity;
 }
        public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
        {
            fa = base.Activity;
            ll = (RelativeLayout)inflater.Inflate(Resource.Layout.ReportCruelty, container, false);

            //CrueltyNavMenuHelper.InitCrueltyNavMenu (this, CrueltyNavMenuItem.ReportIt);

            _crueltyReport = ((AfaApplication)fa.ApplicationContext).CrueltyReport;
            if (_crueltyReport == null)
            {
                _crueltyReport = new CrueltyReport();
                ((AfaApplication)fa.ApplicationContext).CrueltyReport = _crueltyReport;
            }

            _locationInput = ll.FindViewById<EditText>(Resource.Id.LocationInput);
            _crueltyTypeInput = ll.FindViewById<EditText>(Resource.Id.TypeOfCrueltyInput);

            if (_crueltyReport.PlaceSpecified)
            {
                var locationText = new StringBuilder();
                locationText.Append("<font color='#D34C96'><b>");
                locationText.Append(_crueltyReport.PlaceName);
                locationText.Append("</b></font>");
                locationText.Append("<br />");
                locationText.Append("<font color='#B5B5B5'><small>");
                locationText.Append(_crueltyReport.PlaceFormattedShortAddress);
                locationText.Append("</small></font>");
                var htmlText = locationText.ToString();
                _locationInput.SetText(Html.FromHtml(htmlText), TextView.BufferType.Spannable);
            }

            _crueltyTypeInput.Text = _crueltyReport.CrueltyType != null ? _crueltyReport.CrueltyType.Name : null;

            //_locationInput.FocusChange += (sender, args) =>
            //{
            //    if (args.HasFocus) {
            //        var intent = new Intent (fa, typeof(NearbyPlacesActivity));
            //        StartActivity (intent);
            //    }
            //};

            _locationInput.Click += (sender, args) =>
            {
                var intent = new Intent(fa, typeof(NearbyPlacesActivity));
                StartActivity(intent);
            };

            //_crueltyTypeInput.FocusChange += (sender, args) =>
            //{
            //    if (args.HasFocus) {
            //        var intent = new Intent (fa, typeof(CrueltyTypesActivity));
            //        StartActivity (intent);
            //    }
            //};

            _crueltyTypeInput.Click += (sender, args) =>
            {
                var intent = new Intent(fa, typeof(CrueltyTypesActivity));
                StartActivity(intent);
            };

            //// ToDo: This line hides the soft keyboard, but doing so makes the EditText only have 1 line.
            //// Look into alternative
            ////_locationInput.InputType = InputTypes.Null;
            //_crueltyTypeInput.InputType = InputTypes.Null;

            _submitButton = ll.FindViewById<Button>(Resource.Id.SubmitButton);
            _submitButton.Enabled = _crueltyReport.PlaceSpecified && _crueltyReport.CrueltyTypeSpecified;

            _submitButton.Click +=
                (sender, args) =>
                {
                    // Create a new Cruelty Spot
                    _loadingDialog = DialogManager.ShowSubmittingDialog(fa);
                    //CrueltySpotDto newCrueltySpot;
                    CrueltySpot newCrueltySpot;

                    if (_crueltyReport.IsGooglePlace())
                    {
                        // Fetch details from google
                        var googlePlaces = new GooglePlacesApi.GooglePlaces(AfaConfig.GoogleApiKey);
                        googlePlaces.GetDetails(_crueltyReport.GooglePlace.Reference, response =>
                        {
                            // ToDo: Check Status and handle non-OK
                            var placeDetails = response.result;

                            var latitude = placeDetails.geometry.location.lat;
                            var longitude = placeDetails.geometry.location.lng;
                            newCrueltySpot = new CrueltySpot
                            {
                                Name = placeDetails.name,
                                //Description = _descriptionInput.Text,
                                Address = placeDetails.Address,
                                City = placeDetails.City,
                                StateProvinceAbbreviation = placeDetails.StateOrProvince,
                                Zipcode = placeDetails.PostalCode,
                                PhoneNumber = placeDetails.formatted_phone_number,
                                WebpageUrl = placeDetails.website,
                                //Latitude = placeDetails.geometry.location.lat,
                                //Longitude = placeDetails.geometry.location.lng,
                                Location = new ParseGeoPoint(latitude, longitude),
                                //CrueltySpotCategoryId = _crueltyReport.CrueltyType.Id,
                                CrueltySpotCategory = ParseObject.CreateWithoutData<CrueltySpotCategory>(_crueltyReport.CrueltyType.Id),
                                GooglePlaceId = placeDetails.id
                            };

                            SubmitNewCrueltySpot(newCrueltySpot);

                        });
                    }
                    else
                    {
                        // Submit with user lat/lng
                        var gpsTracker = ((AfaApplication)fa.ApplicationContext).GetGpsTracker(fa);

                        var latitude = gpsTracker.Latitude;
                        var longitude = gpsTracker.Longitude;

                        newCrueltySpot = new CrueltySpot
                        {
                            Name = _crueltyReport.PlaceName,
                            //Description = _descriptionInput.Text,
                            Address = _crueltyReport.UserGeneratedPlace.Address,
                            City = _crueltyReport.UserGeneratedPlace.City,
                            StateProvinceAbbreviation = _crueltyReport.UserGeneratedPlace.StateProvinceAbbreviation,
                            Zipcode = _crueltyReport.UserGeneratedPlace.Zipcode,
                            //PhoneNumber = placeDetails.formatted_phone_number,
                            //WebpageUrl = placeDetails.website,
                            Email = _crueltyReport.UserGeneratedPlace.Email,
                            //Latitude = gpsTracker.Latitude,
                            //Longitude = gpsTracker.Longitude,
                            Location = new ParseGeoPoint(latitude, longitude),
                            //CrueltySpotCategoryId = _crueltyReport.CrueltyType.Id
                            CrueltySpotCategory = ParseObject.CreateWithoutData<CrueltySpotCategory>(_crueltyReport.CrueltyType.Id)
                        };

                        SubmitNewCrueltySpot(newCrueltySpot);
                    }


                };

            return ll;

        }
        public int WindowHeight  = 0;                    // We need this height to recognize when keyboard is shown or hide

        public PositionEditDialog(FragmentActivity activity): base(activity)
        {
            _context = activity;
        }
 public AuthenticationDialog(FragmentActivity context):base()
 {
     _context = context;
 }
 public InOutDialog(int position, FragmentActivity parentActivity)
 {
     this.position = position;
     this.ParentActivity = parentActivity;
 }
示例#45
0
 public ListviewDialog(FragmentActivity activity, List<BusinessLayer.Log> logs, string title): base(activity)
 {
     _activity = activity;  
     _title = title;
     _logs = logs;
 }
示例#46
0
 public ListviewDialog(FragmentActivity activity, List< BusinessLayer.Anschrift> anschriften, string title):base(activity)
 {
     _activity = activity;
     _title = title;
     _anschriften = anschriften;
 }
示例#47
0
 public ListviewDialog(FragmentActivity activity, List<BusinessLayer.Position> positionen, string title): base(activity)
 {
     _activity = activity;  
     _title = title;
     _positionen = positionen;
 }
      // Attach a PlusClient managing fragment to you activity.
      public static PlusClientFragment GetPlusClientFragment(
              FragmentActivity activity, String[] visibleActivities)
      {
         if (!(activity is OnSignedInListener))
         {
            throw new ArgumentException(
                    "The activity must implement OnSignedInListener to receive callbacks.");
         }

         // Check if the fragment is already attached.
         FragmentManager fragmentManager = activity.GetSupportFragmentManager();
         Fragment fragment = fragmentManager.FindFragmentByTag(TAG_PLUS_CLIENT);
         if (fragment is PlusClientFragment)
         {
            // The fragment is attached.  If it has the right visible activities, return it.
            if (Arrays.Equals(visibleActivities,
                    fragment.GetArguments().GetStringArray(ARG_VISIBLE_ACTIVITIES)))
            {
               return (PlusClientFragment)fragment;
            }
         }

         FragmentTransaction fragmentTransaction = fragmentManager.BeginTransaction();
         // If a fragment was already attached, remove it to clean up.
         if (fragment != null)
         {
            fragmentTransaction.Remove(fragment);
         }

         // Create a new fragment and attach it to the fragment manager.
         Bundle arguments = new Bundle();
         arguments.PutStringArray(ARG_VISIBLE_ACTIVITIES, visibleActivities);
         PlusClientFragment signInFragment = new PlusClientFragment();
         signInFragment.SetArguments(arguments);
         fragmentTransaction.Add(signInFragment, TAG_PLUS_CLIENT);
         fragmentTransaction.Commit();
         return signInFragment;
      }
 public TransactionMenuFragment(int position, FragmentActivity parentActivity)
 {
     this.position = position;
     this.ParentActivity = parentActivity;
 }
示例#50
0
 public ListviewDialog(FragmentActivity activity, List<BusinessLayer.Task> tasks, string title): base(activity)
 {
     _activity = activity;  
     _title = title;
     _tasks = tasks;
 }