예제 #1
0
		public void OnTabSelected (ActionBar.Tab tab, FragmentTransaction ft) 
		{
			TitlesFragment titleFrag = (TitlesFragment) FragmentManager.FindFragmentById (Resource.Id.frag_title);
			titleFrag.PopulateTitles (tab.Position);
		
			titleFrag.SelectPosition (0);
		}
예제 #2
0
파일: MainActivity.cs 프로젝트: cirk0r/PW
 public void OnTabUnselected(ActionBar.Tab tab, FragmentTransaction ft)
 {
     this.RunOnUiThread(() =>
     {
         Toast.MakeText(this, "OnTabUnselected " + tab.Text, ToastLength.Long).Show();
     });
 }
예제 #3
0
 public void OnTabSelected(ActionBar.Tab tab, FragmentTransaction ft)
 {
     PilotListCounterFragment fragment = tab.Tag as PilotListCounterFragment;
     if (fragment != null)
     {
         ft.Replace(R.Ids.pilotsOnlineFragmentContainer, fragment);
     }
 }
 public void OnTabSelected(ActionBar.Tab tab, FragmentTransaction ft)
 {
     StationInventoryListFragment fragment = tab.Tag as StationInventoryListFragment;
     if (fragment != null)
     {
         ft.Replace(R.Ids.stationInventoryFragmentContainer, fragment);
     }
 }
예제 #5
0
		public void OnTabSelected (ActionBar.Tab tab, FragmentTransaction ft)
		{
			FragmentManager.PopBackStack (null, FragmentManager.PopBackStackInclusive);

			Log.Debug (Tag, "The tab {0} has been selected.", tab.Text);
			Fragment frag = _fragments [tab.Position];
			ft.Replace (Resource.Id.content_frame, frag);
		}
예제 #6
0
 public void OnTabSelected(ActionBar.Tab tab, FragmentTransaction ft)
 {
     Fragment fragment = tab.Tag as Fragment;
     if (fragment != null)
     {
         ft.Replace(R.Ids.itemDetailFragmentContainer, fragment);
     }
 }
        public override void FinishUpdate(ViewGroup container)
        {
            if (_curTransaction == null)
                return;

            _curTransaction.CommitAllowingStateLoss();
            _curTransaction = null;
            _fragmentManager.ExecutePendingTransactions();
        }
예제 #8
0
        public void OnTabSelected(ActionBar.Tab tab, FragmentTransaction ft)
        {
            switch (tab.Position)
            {
                case 0:
                    //Show content of tab1
                    break;

                case 1:
                    //Show content of tab2
                    break;

                default:
                    break;
            }
        }
        public override void DestroyItem(ViewGroup container, int position, Object objectValue)
        {
            var fragment = (Fragment)objectValue;

            if (_curTransaction == null)
                _curTransaction = _fragmentManager.BeginTransaction();

            #if DEBUG
            Mvx.Trace("Removing item #" + position + ": f=" + objectValue + " v=" + ((Fragment) objectValue).View +
                      " t=" + fragment.Tag);
            #endif

            while (_savedState.Count <= position)
            {
                _savedState.Add(null);
                _savedFragmentTags.Add(null);
            }

            _savedState[position] = _fragmentManager.SaveFragmentInstanceState(fragment);
            _savedFragmentTags[position] = fragment.Tag;
            _fragments[position] = null;

            _curTransaction.Remove(fragment);
        }
예제 #10
0
 public void OnTabReselected(ActionBar.Tab tab, FragmentTransaction ft)
 {
     // nothing
 }
 protected virtual void OnFragmentPopped(FragmentTransaction ft, Fragment fragment,
                                         MvxFragmentPresentationAttribute attribute)
 {
 }
예제 #12
0
        protected override void SetupPageTransition(FragmentTransaction transaction, bool isPush)
        {
            switch (_transitionType)
            {
            case TransitionType.None:
                return;

            case TransitionType.Default:
                return;

            case TransitionType.Fade:
                transaction.SetCustomAnimations(Resource.Animation.fade_in, Resource.Animation.fade_out,
                                                Resource.Animation.fade_out, Resource.Animation.fade_in);
                break;

            case TransitionType.Flip:
                transaction.SetCustomAnimations(Resource.Animation.flip_in, Resource.Animation.flip_out,
                                                Resource.Animation.flip_out, Resource.Animation.flip_in);
                break;

            case TransitionType.Scale:
                transaction.SetCustomAnimations(Resource.Animation.scale_in, Resource.Animation.scale_out,
                                                Resource.Animation.scale_out, Resource.Animation.scale_in);
                break;

            case TransitionType.SlideFromLeft:
                if (isPush)
                {
                    transaction.SetCustomAnimations(Resource.Animation.enter_left, Resource.Animation.exit_right,
                                                    Resource.Animation.enter_right, Resource.Animation.exit_left);
                }
                else
                {
                    transaction.SetCustomAnimations(Resource.Animation.enter_right, Resource.Animation.exit_left,
                                                    Resource.Animation.enter_left, Resource.Animation.exit_right);
                }
                break;

            case TransitionType.SlideFromRight:
                if (isPush)
                {
                    transaction.SetCustomAnimations(Resource.Animation.enter_right, Resource.Animation.exit_left,
                                                    Resource.Animation.enter_left, Resource.Animation.exit_right);
                }
                else
                {
                    transaction.SetCustomAnimations(Resource.Animation.enter_left, Resource.Animation.exit_right,
                                                    Resource.Animation.enter_right, Resource.Animation.exit_left);
                }
                break;

            case TransitionType.SlideFromTop:
                if (isPush)
                {
                    transaction.SetCustomAnimations(Resource.Animation.enter_top, Resource.Animation.exit_bottom,
                                                    Resource.Animation.enter_bottom, Resource.Animation.exit_top);
                }
                else
                {
                    transaction.SetCustomAnimations(Resource.Animation.enter_bottom, Resource.Animation.exit_top,
                                                    Resource.Animation.enter_top, Resource.Animation.exit_bottom);
                }
                break;

            case TransitionType.SlideFromBottom:
                if (isPush)
                {
                    transaction.SetCustomAnimations(Resource.Animation.enter_bottom, Resource.Animation.exit_top,
                                                    Resource.Animation.enter_top, Resource.Animation.exit_bottom);
                }
                else
                {
                    transaction.SetCustomAnimations(Resource.Animation.enter_top, Resource.Animation.exit_bottom,
                                                    Resource.Animation.enter_bottom, Resource.Animation.exit_top);
                }
                break;

            default:
                return;
            }
        }
예제 #13
0
 public void OnTabUnselected(ActionBar.Tab tab, FragmentTransaction ft)
 {
 }
예제 #14
0
 public void OnTabSelected(ActionBar.Tab tab, FragmentTransaction ft)
 {
     //Console.WriteLine("ViewPagerAdapter - OnTabSelected tab: {0}", tab.Text);
     _viewPager.SetCurrentItem(tab.Position, true);
 }
예제 #15
0
        private async void SetupMapIfNeeded()
        {
            if (_map == null && !_gettingMap)
            {
                // TODO À quoi sert cette variable ? On peut supprimer je pense.
                // a priori SetupMapIfNeeded peut-être appelé pluiseurs fois d'affilé, c'est pour prévenir ça
                _gettingMap = true;
                GoogleMapOptions mapOptions = new GoogleMapOptions()
                    .InvokeMapType(GoogleMap.MapTypeNormal)
                    //.InvokeZoomControlsEnabled(true)
                    //.InvokeMapToolbarEnabled(true)
                    .InvokeCompassEnabled(true)
                    .InvokeCamera(await GetStartingCameraPosition());

                _fragTx = FragmentManager.BeginTransaction();
                _mapFragment = MapFragmentExtended.NewInstance(mapOptions);
                _fragTx.Add(Resource.Id.map, _mapFragment, "map");
                _fragTx.Commit();
                _mapFragment.GetMapAsync(this);
            }

        }
예제 #16
0
 public static FragmentTransaction ReplaceEx(this FragmentTransaction fragmentTransaction, int containerViewId, Fragment fragment)
 {
     return(fragmentTransaction.Replace(containerViewId, fragment));
 }
예제 #17
0
			public void OnTabSelected(ActionBar.Tab tab, FragmentTransaction ft)
			{
				ft.Replace (Resource.Id.container, fragment);
			}
예제 #18
0
        private void SLDcjms_SaveDataSetCompleted(object sender, SaveDataSetCompletedEventArgs e)
        {
            try
            {
                if (e.Error == null)
                {
                    //check result status
                    if (SLDcjms.CurrentTable.Rows.Count <= 0)
                    {
                        //nothing happen or just delete rows
                    }
                    else
                    {
                        string RowStatus    = SLDcjms.GetCurrentPropertyValueOfString("Stat");
                        string ErrorMessage = SLDcjms.GetCurrentPropertyValueOfString("ErrorMessage");

                        if ((RowStatus != "E") || string.IsNullOrEmpty(ErrorMessage))
                        {
                            if (CSISystemContext.ForceAutoPost)
                            {
                                //Ready to Post -- calling DcjrPSp
                                ShowProgressBar(true);
                                string strParmeters = "";
                                strParmeters = CSIBaseInvoker.BuildXMLParameters(strParmeters, SLDcjms.GetCurrentPropertyValueOfString("TransNum"));
                                strParmeters = CSIBaseInvoker.BuildXMLParameters(strParmeters, "", true);
                                SLDcjms.InvokeMethod("DcjmPSp", strParmeters);
                            }
                            else
                            {
                                if (CSISystemContext.ShowSuccessMessage)
                                {
                                    ShowProcessedMessage();
                                }
                                //Clear Result if no error.
                                Initialize();
                            }
                        }
                        else
                        {
                            //delete first before prompt message.
                            SLDcjms.CurrentTable.Rows[0].Delete();
                            ShowProgressBar(true);
                            SLDcjms.DeleteIDO();

                            //Populate Error
                            FragmentTransaction ft           = FragmentManager.BeginTransaction();
                            CSIMessageDialog    DeleteDialog = (CSIMessageDialog)FragmentManager.FindFragmentByTag("DeleteDialog");

                            if (DeleteDialog != null)
                            {
                                ft.Show(DeleteDialog);
                            }
                            else
                            {
                                DeleteDialog = new CSIMessageDialog(GetString(Resource.String.app_name), ErrorMessage, DialogTypes.OK);
                                DeleteDialog.Show(ft, "DeleteDialog");
                            }
                        }
                    }
                }
                else
                {
                    WriteErrorLog(e.Error);
                }
            }catch (Exception Ex)
            {
                WriteErrorLog(Ex);
            }
            ShowProgressBar(false);
        }
예제 #19
0
 public static FragmentTransaction AddEx(this FragmentTransaction fragmentTransaction, int containerViewId, Fragment fragment)
 {
     return(fragmentTransaction.Add(containerViewId, fragment));
 }
예제 #20
0
        protected async void Login()
        {
            FragmentTransaction transaction  = FragmentManager.BeginTransaction();
            ProgressDialog      progressDiag = new ProgressDialog();

            progressDiag.Show(transaction, "dialog fragment");

            string email    = _emailInput.Text == string.Empty ? "-" : _emailInput.Text;
            string password = _passwordInput.Text == string.Empty ? "-" : _passwordInput.Text;
            //check the input
            string json = string.Format("{{ \"user\": {{ \"email\":\"{0}\", \"password\":\"{1}\"}} }}", email, password);

            try
            {
                string response = await Http.Request("https://thawing-ocean-8598.herokuapp.com/login", json, null);

                if (response != string.Empty && response.Contains("auth_token"))
                {
                    //string temp = response.Split(':')[1].Trim();
                    //string token = temp.Substring(1, temp.Length - 3);
                    JObject dict  = JObject.Parse(response);                    //NuGet packet: Newtonsoft.Json
                    string  token = dict["auth_token"].ToString();
                    string  group = dict["type"].ToString();
                    Log.Warn(_tag, "tocken: " + token);
                    User user = new User(email, password, token);
                    user.group = group;

                    Intent userActivity;
                    if (group == "seller")
                    {
                        string sellerInfo = Http.GetRequest("https://thawing-ocean-8598.herokuapp.com/register-nfc", token);
                        userActivity = new Intent(this, typeof(SellerMainActivity));
                        if (NFCSettings.GetSettings(ApplicationContext, "nfc_id") == "no-id")
                        {
                            Log.Warn(_tag, "not yet registered");
                            JObject seller = JObject.Parse(sellerInfo);
                            string  nfc_id = seller["device_id"].ToString();
                            NFCSettings.SaveSettings(ApplicationContext, "nfc_id", nfc_id);
                            Log.Warn(_tag, "nfc id: " + nfc_id);
                        }
                    }
                    else
                    {
                        userActivity = new Intent(this, typeof(UserMainActivity));
                    }



                    userActivity.PutExtra("User", Json.Serialize(user));
                    StartActivity(userActivity);
                }
                else
                {
                    new Exception("Nepavyko prisijungti");
                }
            }
            catch (Exception ex)
            {
                Log.Warn(_tag, ex.Message);
                OpenDialog(null, ex.Message);
            }
            finally
            {
                progressDiag.Dismiss();
            }
        }
예제 #21
0
 public TabEventArgs(FragmentTransaction fragmentTransaction)
 {
     FragmentTransaction = fragmentTransaction;
 }
예제 #22
0
        private async void HandleBtnCheckSimilarityAnalysis(object sender, EventArgs e)
        {
            var progressDialog = new ProgressDialog(view.Context);

            progressDialog.SetCancelable(true);
            progressDialog.SetMessage("Please wait!");
            progressDialog.SetProgressStyle(ProgressDialogStyle.Spinner);
            progressDialog.Show();
            try
            {
                var httpClient = new HttpClient();
                connection = new SQLiteConnection(dbPath);
                var    userData       = connection.Get <UserSession>(1);
                string fatherToBase64 = await convertImageToBase64(imgvFather);

                string motherToBase64 = await convertImageToBase64(imgvMother);

                string childrenToBase64 = await convertImageToBase64(imgvChildren);

                var compareFaces = new CompareFaces
                {
                    userId        = userData.userId,
                    fatherPhoto   = fatherToBase64,
                    motherPhoto   = motherToBase64,
                    childrenPhoto = childrenToBase64
                };
                var content = new StringContent(JsonConvert.SerializeObject(compareFaces), Encoding.UTF8, "application/json");
                httpClient.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", userData.Token);

                var responseApi = await httpClient.PostAsync("UrlApi" + "api/FaceRecognition/CheckSimilarityResults", content);

                var result = await responseApi.Content.ReadAsStringAsync();

                var checkSimilarity     = JsonConvert.DeserializeObject <CheckSimilarity>(result);
                var displayResultsModel = new DisplayResultsModel {
                    checkSimilarity = checkSimilarity, father = fatherToBase64, mother = motherToBase64, children = childrenToBase64
                };
                List <string> attributes = new List <string> {
                    "Contempt", "Disgust", "Anger", "Fear", "Happiness", "Neutral", "Sadness", "Smile", "Surprise", "Similarity", "Glasses"
                };

                List <string> fatherResults = new List <string> {
                    displayResultsModel.checkSimilarity.cognitiveMicrosoft[0].faceAttributes.emotion.contempt.ToString(),
                    displayResultsModel.checkSimilarity.cognitiveMicrosoft[0].faceAttributes.emotion.disgust.ToString(),
                    displayResultsModel.checkSimilarity.cognitiveMicrosoft[0].faceAttributes.emotion.anger.ToString(),
                    displayResultsModel.checkSimilarity.cognitiveMicrosoft[0].faceAttributes.emotion.fear.ToString(),
                    displayResultsModel.checkSimilarity.cognitiveMicrosoft[0].faceAttributes.emotion.happiness.ToString(),
                    displayResultsModel.checkSimilarity.cognitiveMicrosoft[0].faceAttributes.emotion.neutral.ToString(),
                    displayResultsModel.checkSimilarity.cognitiveMicrosoft[0].faceAttributes.emotion.sadness.ToString(),
                    displayResultsModel.checkSimilarity.cognitiveMicrosoft[0].faceAttributes.smile.ToString(),
                    displayResultsModel.checkSimilarity.cognitiveMicrosoft[0].faceAttributes.emotion.surprise.ToString(),
                    displayResultsModel.checkSimilarity.similarityTest[0].Confidence.ToString(),
                    displayResultsModel.checkSimilarity.cognitiveMicrosoft[0].faceAttributes.glasses.ToString()
                };

                List <string> motherResults = new List <string> {
                    displayResultsModel.checkSimilarity.cognitiveMicrosoft[1].faceAttributes.emotion.contempt.ToString(),
                    displayResultsModel.checkSimilarity.cognitiveMicrosoft[1].faceAttributes.emotion.disgust.ToString(),
                    displayResultsModel.checkSimilarity.cognitiveMicrosoft[1].faceAttributes.emotion.anger.ToString(),
                    displayResultsModel.checkSimilarity.cognitiveMicrosoft[1].faceAttributes.emotion.fear.ToString(),
                    displayResultsModel.checkSimilarity.cognitiveMicrosoft[1].faceAttributes.emotion.happiness.ToString(),
                    displayResultsModel.checkSimilarity.cognitiveMicrosoft[1].faceAttributes.emotion.neutral.ToString(),
                    displayResultsModel.checkSimilarity.cognitiveMicrosoft[1].faceAttributes.emotion.sadness.ToString(),
                    displayResultsModel.checkSimilarity.cognitiveMicrosoft[1].faceAttributes.smile.ToString(),
                    displayResultsModel.checkSimilarity.cognitiveMicrosoft[1].faceAttributes.emotion.surprise.ToString(),
                    displayResultsModel.checkSimilarity.similarityTest[1].Confidence.ToString(),
                    displayResultsModel.checkSimilarity.cognitiveMicrosoft[1].faceAttributes.glasses.ToString()
                };
                List <string> childrenResults = new List <string> {
                    displayResultsModel.checkSimilarity.cognitiveMicrosoft[2].faceAttributes.emotion.contempt.ToString(),
                    displayResultsModel.checkSimilarity.cognitiveMicrosoft[2].faceAttributes.emotion.disgust.ToString(),
                    displayResultsModel.checkSimilarity.cognitiveMicrosoft[2].faceAttributes.emotion.anger.ToString(),
                    displayResultsModel.checkSimilarity.cognitiveMicrosoft[2].faceAttributes.emotion.fear.ToString(),
                    displayResultsModel.checkSimilarity.cognitiveMicrosoft[2].faceAttributes.emotion.happiness.ToString(),
                    displayResultsModel.checkSimilarity.cognitiveMicrosoft[2].faceAttributes.emotion.neutral.ToString(),
                    displayResultsModel.checkSimilarity.cognitiveMicrosoft[2].faceAttributes.emotion.sadness.ToString(),
                    displayResultsModel.checkSimilarity.cognitiveMicrosoft[2].faceAttributes.smile.ToString(),
                    displayResultsModel.checkSimilarity.cognitiveMicrosoft[2].faceAttributes.emotion.surprise.ToString(),
                    "-",
                    displayResultsModel.checkSimilarity.cognitiveMicrosoft[2].faceAttributes.glasses.ToString()
                };

                FragmentTransaction fragmentManager           = this.FragmentManager.BeginTransaction();
                DisplayResults3PersonsSimilarity diplaResults = new DisplayResults3PersonsSimilarity(attributes, fatherResults, motherResults, childrenResults);
                fragmentManager.Replace(Resource.Id.parent_fragment, diplaResults);
                fragmentManager.SetTransition(FragmentTransit.FragmentOpen);
                fragmentManager.AddToBackStack(null);
                fragmentManager.Commit();
                progressDialog.Hide();
            }
            catch (HttpRequestException httpExec)
            {
                progressDialog.Hide();
                displaySnackBar("Check your internet connection.");
            }
            catch (Exception ex)
            {
                progressDialog.Hide();
                displaySnackBar(ex.ToString());
            }
        }
        public override Java.Lang.Object InstantiateItem(ViewGroup container, int position)
        {
            // If we already have this item instantiated, there is nothing
            // to do.  This can happen when we are restoring the entire pager
            // from its saved state, where the fragment manager has already
            // taken care of restoring the fragments we previously had instantiated.
            if (_fragments.Count > position)
            {
                var existingFragment = _fragments.ElementAtOrDefault(position);
                if (existingFragment != null)
                {
                    return(existingFragment);
                }
            }

            if (_curTransaction == null)
            {
                _curTransaction = _fragmentManager.BeginTransaction();
            }

            var fragmentTag = GetTag(position);

            Fragment.SavedState fss = null;
            if (_savedState.Count > position)
            {
                var savedTag = _savedFragmentTags.ElementAtOrDefault(position);
                if (string.Equals(fragmentTag, savedTag))
                {
                    fss = _savedState.ElementAtOrDefault(position);
                }
            }

            var fragment = GetItem(position, fss);

            if (fss != null)
            {
                fragment.SetInitialSavedState(fss);
            }

            //if fragment tag is null let's set it to something meaning full;
            if (string.IsNullOrEmpty(fragmentTag))
            {
                fragmentTag = fragment.GetType().FragmentJavaName();
            }

#if DEBUG
            MvxLog.Instance.Trace("Adding item #{0}: f={1} t={2}", position, fragment, fragmentTag);
#endif

            while (_fragments.Count <= position)
            {
                _fragments.Add(null);
            }

            fragment.SetMenuVisibility(false);
            fragment.UserVisibleHint = false;
            _fragments[position]     = fragment;
            _curTransaction.Add(container.Id, fragment, fragmentTag);

            return(fragment);
        }
예제 #24
0
 public static FragmentTransaction HideEx(this FragmentTransaction fragmentTransaction, Fragment fragment)
 {
     return(fragmentTransaction.Hide(fragment));
 }
 public virtual void OnBeforeFragmentChanging(IMvxCachedFragmentInfo fragmentInfo, FragmentTransaction transaction)
 {
 }
예제 #26
0
 public static FragmentTransaction ShowEx(this FragmentTransaction fragmentTransaction, Fragment fragment)
 {
     return(fragmentTransaction.Show(fragment));
 }
예제 #27
0
		protected internal override void onCreate(Bundle savedInstanceState)
		{
			base.onCreate(savedInstanceState);

			// Remove title bar
			requestWindowFeature(Window.FEATURE_NO_TITLE);

			loadInterface();

			if (savedInstanceState == null)
			{
				mFragmentTransaction = FragmentManager.beginTransaction();
				initSubscriberFragment();
				initPublisherFragment();
				initPublisherStatusFragment();
				initSubscriberQualityFragment();
				mFragmentTransaction.commitAllowingStateLoss();
			}

			mNotificationManager = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);

			sessionConnect();
		}
예제 #28
0
 public static FragmentTransaction SetTransitionEx(this FragmentTransaction fragmentTransaction, int transit)
 {
     return(fragmentTransaction.SetTransition(transit));
 }
 protected virtual void ReplaceFragment(FragmentTransaction ft, IMvxCachedFragmentInfo fragInfo)
 {
     ft.Replace(fragInfo.ContentId, fragInfo.CachedFragment, fragInfo.Tag);
 }
예제 #30
0
 public static int CommitAllowingStateLossEx(this FragmentTransaction fragmentTransaction)
 {
     return(fragmentTransaction.CommitAllowingStateLoss());
 }
예제 #31
0
		public void OnTabUnselected (ActionBar.Tab tab, FragmentTransaction ft)
		{
			Log.Debug (Tag, "The tab {0} as been unselected.", tab.Text);
		}
예제 #32
0
 public static FragmentTransaction RemoveEx(this FragmentTransaction fragmentTransaction, Fragment fragment)
 {
     return(fragmentTransaction.Remove(fragment));
 }
예제 #33
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);
            SetContentView(Resource.Layout.Main);

            var toolbar = FindViewById <SupportToolbar>(Resource.Id.toolbar);

            SetSupportActionBar(toolbar);

            mainLayout = FindViewById <LinearLayout>(Resource.Id.mainLayout);
            layout1    = FindViewById <LinearLayout>(Resource.Id.layout1);
            layout2    = FindViewById <LinearLayout>(Resource.Id.layout2);
            layout3    = FindViewById <LinearLayout>(Resource.Id.layout3);
            layouts    = new List <LinearLayout> {
                layout1, layout2, layout3, mainLayout
            };
            left  = FindViewById <TextView>(Resource.Id.leftTop);
            right = FindViewById <TextView>(Resource.Id.rightTop);
            TextView textView1  = FindViewById <TextView>(Resource.Id.textView1);
            TextView textView2  = FindViewById <TextView>(Resource.Id.textView2);
            TextView textView3  = FindViewById <TextView>(Resource.Id.textView3);
            TextView textView4  = FindViewById <TextView>(Resource.Id.textView4);
            TextView textView5  = FindViewById <TextView>(Resource.Id.textView5);
            TextView textView6  = FindViewById <TextView>(Resource.Id.textView6);
            TextView textView7  = FindViewById <TextView>(Resource.Id.textView7);
            TextView textView8  = FindViewById <TextView>(Resource.Id.textView8);
            TextView textView9  = FindViewById <TextView>(Resource.Id.textView9);
            TextView textView10 = FindViewById <TextView>(Resource.Id.textView10);
            TextView textView11 = FindViewById <TextView>(Resource.Id.textView11);
            TextView textView12 = FindViewById <TextView>(Resource.Id.textView12);
            TextView textView13 = FindViewById <TextView>(Resource.Id.textView13);
            TextView textView14 = FindViewById <TextView>(Resource.Id.textView14);
            TextView textView15 = FindViewById <TextView>(Resource.Id.textView15);
            TextView textView16 = FindViewById <TextView>(Resource.Id.textView16);
            TextView textView17 = FindViewById <TextView>(Resource.Id.textView17);
            TextView textView18 = FindViewById <TextView>(Resource.Id.textView18);

            textViews = new List <TextView>
            {
                textView1, textView2, textView3, textView4, textView5, textView6, textView7, textView8, textView9, textView10,
                textView11, textView12, textView13, textView14, textView15, textView16, textView17, textView18
            };

            if (SendData.isJapanese)
            {
                Convert.ConvertTextViews(layouts);
                SupportActionBar.Title = "防衛";
            }
            else
            {
                SupportActionBar.Title = "Defense";
            }

            types = allTypes.defenseTypes;

            for (int i = 0; i < types.Count; i++)
            {
                textViews[i].Tag     = i;
                textViews[i].Text    = types[i].type;
                textViews[i].Gravity = GravityFlags.Center;
                textViews[i].SetPadding(0, 0, 0, 10);

                int h = Resources.DisplayMetrics.HeightPixels / 100;
                if (h > 18)
                {
                    h = 18;
                }

                textViews[i].SetTextSize(Android.Util.ComplexUnitType.Dip, h + 11);

                gradient = (GradientDrawable)textViews[i].Background;
                gradient.SetColor(Color.ParseColor(Colors.TypeToColor[types[i].type]));

                textViews[i].Click     += Handle_Click;
                textViews[i].LongClick += Handle_LongClick;
                //textViews[i].Touch += Handle_Touch;
            }

            if (SendData.showHelp)
            {
                FragmentTransaction transaction = FragmentManager.BeginTransaction();
                DialogHelp          dialog      = new DialogHelp();
                dialog.Show(transaction, "Help");
            }

            var adLayout = FindViewById <LinearLayout>(Resource.Id.googleAds);

            if (SendData.isConnected)
            {
                var ad = new AdView(this);
                ad.AdSize   = AdSize.SmartBanner;
                ad.AdUnitId = "ca-app-pub-2288808768882490/2788554960";
                var requestBuilder = new AdRequest.Builder();
                ad.LoadAd(requestBuilder.Build());
                adLayout.AddView(ad);
            }
            else
            {
                mainLayout.RemoveView(adLayout);
            }
        }
예제 #34
0
        //Creates the main attributes of the page when it is loaded
        public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
        {
            View v = inflater.Inflate(Resource.Layout.myProperties, container, false);

            mainLayout = v.FindViewById <LinearLayout>(Resource.Id.mainLayout);
            Button displayProperties = v.FindViewById <Button>(Resource.Id.showProperty);

            id = int.Parse(ap.getAccessKey());

            displayProperties.Click += async delegate
            {
                string    url  = "http://housechecker.co.uk/api/export_property.php";
                JsonValue json = await FetchUserAsync(url);

                string jsonString = json.ToString();
                //Getting the properties from the database and putting it into the list
                propertyList = JsonConvert.DeserializeObject <List <Address> >(jsonString);
                //Getting each property for the current landlord
                foreach (var accomodation in propertyList.Where(a => a.user_id.Equals(id)))
                {
                    //Creating the layout for the properties
                    LinearLayout newLayout = new LinearLayout(this.Context);
                    newLayout.Orientation = Orientation.Vertical;
                    TextView displayAddress = new TextView(this.Context);
                    displayAddress.Text = "Address: " + accomodation.address1 + ", " + accomodation.address2 + "\nCity: " +
                                          accomodation.city + "\nPostcode " + accomodation.postcode;
                    displayAddress.Typeface = Typeface.DefaultBold;
                    displayAddress.TextSize = 16;
                    displayAddress.Gravity  = GravityFlags.Center;

                    //Button to allow for more informaiton

                    ImageView imageView = new ImageView(this.Context);

                    try
                    {
                        string imageURL = accomodation.image.Remove(0, 2);
                        imageURL = "http://housechecker.co.uk" + imageURL;
                        WebRequest request = WebRequest.Create(imageURL);
                        // Creates the image URL based from what is stored in the database
                        WebResponse resp       = request.GetResponse();
                        Stream      respStream = resp.GetResponseStream();
                        Bitmap      bmp        = BitmapFactory.DecodeStream(respStream);
                        Bitmap      image      = Bitmap.CreateScaledBitmap(bmp, 500, 500, false);
                        // Resizes the image to fit
                        respStream.Dispose();
                        imageView.SetImageBitmap(image);
                        imageView.RefreshDrawableState();
                        // Creates it and sets it to the view
                    }
                    catch (Exception e)
                    {
                        imageView.SetImageDrawable(Resources.GetDrawable(Resource.Drawable.propertyStock));
                    }

                    imageView.Click += (senderNew, eNew) =>
                    {
                        FragmentTransaction fragmentTx     = FragmentManager.BeginTransaction();
                        PropertyDetail      propertyDetail = new PropertyDetail();
                        Bundle bundle = new Bundle();
                        bundle.PutString("accomID", accomodation.id.ToString());
                        propertyDetail.Arguments = bundle;
                        fragmentTx.Replace(Resource.Id.content_frame, propertyDetail);
                        fragmentTx.Commit();
                        // Creates a click event function for the image so it will go to the selected property
                    };

                    newLayout.AddView(imageView);
                    newLayout.AddView(displayAddress);
                    mainLayout.AddView(newLayout);
                }
            };
            displayProperties.CallOnClick();
            return(v);
        }
 public virtual void OnTabFragmentChanging(string tag, FragmentTransaction transaction)
 {
 }
 public static void ShowLobby(FragmentTransaction transaction)
 {
     transaction.Replace(Resource.Id.main_activity_fragment_placeholder, lobbyFrag);
     transaction.Commit();
 }
 protected virtual void OnFragmentChanging(FragmentTransaction ft, Fragment fragment,
                                           MvxFragmentPresentationAttribute attribute, MvxViewModelRequest request)
 {
 }
예제 #38
0
		public void OnTabReselected (ActionBar.Tab tab, FragmentTransaction ft)
		{
			Log.Debug (Tag, "The tab {0} was re-selected.", tab.Text);
		}
 public virtual void OnFragmentCreated(IMvxCachedFragmentInfo fragmentInfo, FragmentTransaction transaction)
 {
 }
예제 #40
0
 public void OnTabUnselected(ActionBar.Tab tab, FragmentTransaction ft)
 {
     var h = TabUnselected;
     if (h != null)
         h (tab, new ActionBar.TabEventArgs (ft));
 }
 protected virtual void ReplaceFragment(FragmentTransaction ft, IMvxCachedFragmentInfo fragInfo)
 {
     ft.Replace(fragInfo.ContentId, fragInfo.CachedFragment as Fragment, fragInfo.Tag);
 }
 public override int Show(FragmentTransaction p0, string p1)
 {
     try
     {
         return base.Show(p0, p1);
     }
     catch (Exception ex)
     {
         return 0;
     }
 }
예제 #43
0
		public void OnTabSelected (ActionBar.Tab tab, FragmentTransaction ft)
		{
			SupportFragmentManager.PopBackStack (null, FragmentManager.PopBackStackInclusive);
			content.SetCurrentItem (tab.Position, true);
			Log.Debug (Tag, "The tab {0} as been selected.", tab.Text);
		}
		private void initalizeFragment(string activeFragmentTag, Fragment frag) {
			activeFragment = activeFragmentTag;
			trans = FragmentManager.BeginTransaction();
			trans.Add(Resource.Id.teamDetailsFragmentContainer, frag, activeFragmentTag);
			trans.CommitAllowingStateLoss();
		}
예제 #45
0
			public void OnTabUnselected(ActionBar.Tab tab, FragmentTransaction ft) 
			{
				ft.Remove (fragment);
			}
 // Called before the transaction is commited
 public virtual void OnFragmentChanging(IMvxCachedFragmentInfo fragmentInfo, FragmentTransaction transaction)
 {
 }
 public static void ShowRegAuth(FragmentTransaction transaction)
 {
     transaction.Replace(Resource.Id.main_activity_fragment_placeholder, regFrag);
     transaction.Commit();
 }
			public void OnTabReselected (ActionBar.Tab tab, FragmentTransaction ft){
				fragment.OnResume ();
			}
예제 #49
0
		public void OnTabUnselected (ActionBar.Tab tab, FragmentTransaction ft)
		{
			// perform any extra work associated with saving fragment state here.
			Log.Debug (Tag, "The tab {0} as been unselected.", tab.Text);
		}
예제 #50
0
        public void OnTabUnselected(ActionBar.Tab tab, FragmentTransaction ft)
        {
            var fragment = GetFragmentForPosition(tab.Position);

            ft.Detach(fragment);
        }
예제 #51
0
		protected virtual void ReplaceFragment(FragmentTransaction ft, IMvxCachedFragmentInfo fragInfo)
		{
			ft.Replace(fragInfo.ContentId, fragInfo.CachedFragment as Android.Support.V4.App.Fragment, fragInfo.Tag);
		}
예제 #52
0
        public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
        {
            GetOrderParameters();
            var view = inflater.Inflate(Resource.Layout.activity_order_management, container, false);

            #region Иннициализация переменных
            Id           = view.FindViewById <TextView>(Resource.Id.OrderManagementTextIdValue);
            Weight       = view.FindViewById <TextView>(Resource.Id.OrderManagementTexWeight);
            Temperature  = view.FindViewById <TextView>(Resource.Id.OrderManagementTextTemperature);
            Battery      = view.FindViewById <TextView>(Resource.Id.OrderManagementTexBattery);
            Illumination = view.FindViewById <TextView>(Resource.Id.OrderManagementTextIllumination);
            Humidity     = view.FindViewById <TextView>(Resource.Id.OrderManagementTextHumidity);
            //Gate = view.FindViewById<TextView>(Resource.Id.OrderManagementTextGate);
            Lock = view.FindViewById <TextView>(Resource.Id.OrderManagementTextLock);
            //Fold = view.FindViewById<TextView>(Resource.Id.OrderManagementTextFold);
            Events      = view.FindViewById <TextView>(Resource.Id.OrderManagementTextEvents);
            progressBar = view.FindViewById <ProgressBar>(Resource.Id.OrderManagementProgressBar);
            Status      = view.FindViewById <TextView>(Resource.Id.OrderManagementTextStatus);
            Cost        = view.FindViewById <TextView>(Resource.Id.OrderManagementTextCost);
            Payment     = view.FindViewById <TextView>(Resource.Id.OrderManagementTextPayment);
            btn_Pay     = view.FindViewById <Button>(Resource.Id.OrderManagementButtonPay);
            btn_Photo   = view.FindViewById <Button>(Resource.Id.OrderManagementButtonPhoto);
            btn_Video   = view.FindViewById <Button>(Resource.Id.OrderManagementButtonVideo);
            btn_Lock    = view.FindViewById <Button>(Resource.Id.OrderManagementButtonLock);
            #endregion

            Id.Click     += Id_Click;
            Events.Click += Events_Click;

            sweep = view.FindViewById <SwipeRefreshLayout>(Resource.Id.SwipeRefreshLayout);
            sweep.SetColorSchemeColors(Color.Red, Color.Green, Color.Blue, Color.Yellow);
            sweep.Refresh += RefreshLayout_Refresh;

            btn_Lock.Click += delegate
            {
                AlertDialog.Builder alert = new AlertDialog.Builder(Activity);
                if (btn_Lock.Text == "Поднять")
                {
                    alert.SetTitle("Подтверждение действия");
                    alert.SetMessage("Вы действительно хотите поднять роллету контейнера?");
                    alert.SetPositiveButton("Поднять", (senderAlert, args) =>
                    {
                        MakeUnLock();
                    });
                    alert.SetNegativeButton("Отмена", (senderAlert, args) =>
                    {
                    });
                }
                else if (btn_Lock.Text == "Опустить")
                {
                    alert.SetTitle("Подтверждение действия");
                    if (StaticOrder.Order_Stage_Id == "3")
                    {
                        LayoutInflater layoutInflater = LayoutInflater.From(Activity);
                        View           dialogView     = layoutInflater.Inflate(Resource.Layout.modal_transmit_order, null);
                        alert.SetView(dialogView);

                        checkBox = dialogView.FindViewById <CheckBox>(Resource.Id.ManageOrderCheckBox);

                        Date = dialogView.FindViewById <Spinner>(Resource.Id.ManageOrderSpinnerTime);
                        CreateTimeArray();
                        ArrayAdapter <string> adapter = new ArrayAdapter <string>(Activity, Android.Resource.Layout.SimpleSpinnerItem, Time);
                        adapter.SetDropDownViewResource(Android.Resource.Layout.SimpleSpinnerDropDownItem);
                        Date.Adapter       = adapter;
                        Date.ItemSelected += new EventHandler <AdapterView.ItemSelectedEventArgs>(SpinnerClass_ItemSelected);
                        Date.Visibility    = ViewStates.Invisible;

                        checkBox.Text   = "Погрузка завершена. Контейнер готов к отправке.";
                        checkBox.Click += delegate
                        {
                            check           = checkBox.Checked;
                            Date.Visibility = ViewStates.Visible;
                            Date.Focusable  = false;
                            Date.Clickable  = false;
                        };
                    }
                    else if (StaticOrder.Order_Stage_Id == "6")
                    {
                        LayoutInflater layoutInflater = LayoutInflater.From(Activity);
                        View           dialogView     = layoutInflater.Inflate(Resource.Layout.modal_transmit_order, null);
                        alert.SetView(dialogView);

                        checkBox = dialogView.FindViewById <CheckBox>(Resource.Id.ManageOrderCheckBox);
                        Date     = dialogView.FindViewById <Spinner>(Resource.Id.ManageOrderSpinnerTime);
                        CreateTimeArray();
                        ArrayAdapter <string> adapter = new ArrayAdapter <string>(Activity, Android.Resource.Layout.SimpleSpinnerItem, Time);
                        adapter.SetDropDownViewResource(Android.Resource.Layout.SimpleSpinnerDropDownItem);
                        Date.Adapter       = adapter;
                        Date.ItemSelected += new EventHandler <AdapterView.ItemSelectedEventArgs>(SpinnerClass_ItemSelected);
                        Date.Visibility    = ViewStates.Invisible;

                        checkBox.Text   = "Разгрузка завершена. Контейнер готов к отправке.";
                        checkBox.Click += delegate
                        {
                            check           = checkBox.Checked;
                            Date.Visibility = ViewStates.Visible;
                            Date.Focusable  = false;
                            Date.Clickable  = false;
                        };
                    }
                    alert.SetMessage("Вы действительно хотите опустить роллету контейнера?");
                    alert.SetPositiveButton("Опустить", (senderAlert, args) =>
                    {
                        MakeLock(check);
                        if (check == true)
                        {
                            Transmitt();
                        }

                        FragmentTransaction transaction1 = this.FragmentManager.BeginTransaction();
                        ManageOrderActivity content2     = new ManageOrderActivity();
                        transaction1.Replace(Resource.Id.framelayout, content2).AddToBackStack(null).Commit();
                    });
                }
                Dialog dialog = alert.Create();
                dialog.Show();


                // }
            };

            btn_Pay.Click += delegate
            {
                if (Payment.Text == "неизвестно")
                {
                    Toast.MakeText(Activity, "В настоящий момент невозможно использовать эту кнопку!\nПричина: Неизвестно состояние об оплате.", ToastLength.Long).Show();
                }
                else
                {
                    AlertDialogCreation("Внесение оплаты", "Вы действительно хотите оплатить заказ?");
                }
            };
            btn_Photo.Click += delegate
            {
                AlertDialogCreation("Сделать фотографию", "Вы действительно хотите сделать фотографию с камеры контейнера?");
            };
            btn_Video.Click += delegate
            {
                AlertDialogCreation("Сделать видео", "Вы действительно хотите сделать видео с камеры контейнера?");
            };

            return(view);
        }
        public override Object InstantiateItem(ViewGroup container, int position)
        {
            // If we already have this item instantiated, there is nothing
            // to do.  This can happen when we are restoring the entire pager
            // from its saved state, where the fragment manager has already
            // taken care of restoring the fragments we previously had instantiated.

            if (_fragments.Count > position)
            {
                var existingFragment = _fragments.ElementAtOrDefault(position);
                if (existingFragment != null)
                    return existingFragment;
            }

            if (_curTransaction == null)
                _curTransaction = _fragmentManager.BeginTransaction();

            var fragmentTag = GetTag(position);

            Fragment.SavedState fss = null;
            if (_savedState.Count > position)
            {
                var savedTag = _savedFragmentTags.ElementAtOrDefault(position);
                if (string.Equals(fragmentTag, savedTag))
                    fss = _savedState.ElementAtOrDefault(position);
            }

            var fragment = GetItem(position, fss);
            if (fss != null)
                fragment.SetInitialSavedState(fss);

            #if DEBUG
            Mvx.Trace("Adding item #" + position + ": f=" + fragment + " t=" + fragmentTag);
            #endif

            while (_fragments.Count <= position)
                _fragments.Add(null);

            fragment.SetMenuVisibility(false);
            fragment.UserVisibleHint = false;
            _fragments[position] = fragment;
            _curTransaction.Add(container.Id, fragment, fragmentTag);

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

            imageView   = view.FindViewById <ImageView>(Resource.Id.imageslider);
            footerImage = view.FindViewById <ImageView>(Resource.Id.imagefooterslider);
            headerIndex = 0;


            sharedPreferences = this.Activity.GetSharedPreferences(BaseURL.MyPrefreance, FileCreationMode.Private);

            rv_items = (RecyclerView)view.FindViewById(Resource.Id.rv_home);

            GridLayoutManager gridLayoutManager = new GridLayoutManager(this.Activity, 3);

            rv_items.SetLayoutManager(gridLayoutManager);
            rv_items.SetItemAnimator(new DefaultItemAnimator());
            rv_items.NestedScrollingEnabled = false;

            Search_layout = (LinearLayout)view.FindViewById(Resource.Id.search_layout);
            scrollView    = (ScrollView)view.FindViewById(Resource.Id.scroll_view);
            scrollView.SmoothScrollingEnabled = true;
            if (isOnline())
            {
                HeaderLoadImages();
                FooterLoadImages();
                setHeaderSlideShow();
                makeGetCategoryRequest();
            }

            Search_layout.Click += delegate
            {
                SearchFragment      trending_fragment = new SearchFragment();
                FragmentManager     m = FragmentManager;
                FragmentTransaction fragmentTransaction = m.BeginTransaction();
                fragmentTransaction.Replace(Resource.Id.contentPanel, trending_fragment);
                fragmentTransaction.Commit();
            };

            fabMain  = (FloatingActionButton)view.FindViewById(Resource.Id.fabMain);
            fabOne   = (FloatingActionButton)view.FindViewById(Resource.Id.fabOne);
            fabTwo   = (FloatingActionButton)view.FindViewById(Resource.Id.fabTwo);
            fabThree = (FloatingActionButton)view.FindViewById(Resource.Id.fabThree);
            fabfour  = (FloatingActionButton)view.FindViewById(Resource.Id.fabfour);



            fabOne.SetAlpha(0);
            fabTwo.SetAlpha(0);
            fabThree.SetAlpha(0);
            fabfour.SetAlpha(0);

            fabOne.TranslationY   = translationY;
            fabTwo.TranslationY   = translationY;
            fabThree.TranslationY = translationY;
            fabfour.TranslationY  = translationY;

            fabMain.Click  += FabMain_Click;
            fabOne.Click   += FabOne_Click;
            fabTwo.Click   += FabTwo_Click;
            fabThree.Click += FabThree_Click;
            fabfour.Click  += Fabfour_Click;

            tab1 = (TabItem)view.FindViewById(Resource.Id.top_selling_item);
            tab2 = (TabItem)view.FindViewById(Resource.Id.recent_item);
            tab3 = (TabItem)view.FindViewById(Resource.Id.deals_item);
            tab4 = (TabItem)view.FindViewById(Resource.Id.whtsnewitem);

            tabLayout = (TabLayout)view.FindViewById(Resource.Id.tablayout);
            viewPager = (ViewPager)view.FindViewById(Resource.Id.pager_product);

            pageAdapter            = new PageAdapter(ChildFragmentManager, 1);
            viewPager.Adapter      = pageAdapter;
            tabLayout.TabSelected += TabLayout_TabSelected;

            viewPager.AddOnPageChangeListener(new TabLayoutOnPageChangeListener(tabLayout));
            return(view);
        }
예제 #55
0
        private void SetView(int fragmentResource, Fragment view, bool retainView)
        {
            _DrawerToggle.SetClosedResource(_CurrentViewTitle);

            _FragmentManager = FragmentManager.BeginTransaction();
            _FragmentManager.Replace(fragmentResource, view);

            // If true, allows the user to return to that fragment.
            // Otherwise it is destroyed.
            if(retainView)
            {
                _FragmentManager.AddToBackStack(null);
        }

            _FragmentManager.Commit();

            _DrawerLayout.CloseDrawers();
        }
예제 #56
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);

            RequestWindowFeature(WindowFeatures.NoTitle);

            // Create your application here

            SetContentView(Resource.Layout.Finance);

            FindViewById <Button>(Resource.Id.faCloseB).Click += (sender, e) => {
                Finish();
            };

            var pharmacyUUID = Intent.GetStringExtra("UUID");

            if (string.IsNullOrEmpty(pharmacyUUID))
            {
                return;
            }


            Pharmacy = MainDatabase.GetPharmacy(pharmacyUUID);
            FindViewById <TextView>(Resource.Id.faInfoTV).Text = string.Format("ПРОДАЖИ: {0}", Pharmacy.GetName());

            //				var date1 = FindViewById<TextView>(Resource.Id.htiDate1);
            //				date1.Text = DateTimeOffset.Now.Date.ToString("dd.MM.yy");
            //
            //				var date2 = FindViewById<TextView>(Resource.Id.htiDate2);
            //				date2.Text = DateTimeOffset.Now.Date.AddDays(7).Date.ToString("dd.MM.yy");
            //
            Content    = FindViewById <LinearLayout>(Resource.Id.faContentLL);
            Table      = FindViewById <LinearLayout>(Resource.Id.faTable);
            TableBySKU = FindViewById <LinearLayout>(Resource.Id.faTableBySKU);

            var add      = FindViewById <ImageView>(Resource.Id.faAdd);
            var isCanAdd = Intent.GetBooleanExtra(C_IS_CAN_ADD, true);

            if (isCanAdd)
            {
                add.Click += (sender, e) => {
                    //Toast.MakeText(this, "ADD BUTTON CLICKED", ToastLength.Short).Show();
                    Console.WriteLine("Event {0} was called", "faAdd_Click");
                    FragmentTransaction fragmentTransaction = FragmentManager.BeginTransaction();

                    var prev = FragmentManager.FindFragmentByTag(FinanceDialog.TAG);
                    if (prev != null)
                    {
                        fragmentTransaction.Remove(prev);
                    }
                    fragmentTransaction.AddToBackStack(null);

                    var financeDialog = new FinanceDialog(Pharmacy);
                    financeDialog.Show(fragmentTransaction, FinanceDialog.TAG);
                    financeDialog.AfterSaved += (caller, arguments) => {
                        Console.WriteLine("Event {0} was called. FinanceDatas count {1}", "AfterSaved", arguments.FinanceDatas.Count);

                        //Table.RemoveAllViews();

                        RefreshView();
                        //MainDatabase.SaveItems(arguments.FinanceDatas);
                        //SetValues(arguments.FinanceDatas);
                    };
                };
            }
            else
            {
                add.Visibility = ViewStates.Gone;
            }

            var switcher = FindViewById <ViewSwitcher>(Resource.Id.faSwitchViewTypeVS);
            var sw       = FindViewById <ImageView>(Resource.Id.faSwitchIV);

            sw.Click += (sender, e) => {
                switcher.ShowNext();
            };
        }
 public virtual void OnFragmentCreated(IMvxCachedFragmentInfo fragmentInfo, FragmentTransaction transaction)
 {
 }
예제 #58
0
        //public void run()
        //{
        //    for (int i = 0; i < mThumbIds.Length; i++)
        //    {
        //        layout.SetBackgroundResource(mThumbIds[i]);

        //        try
        //        {
        //            Thread.Sleep(1000);
        //        }
        //        catch (System.Exception e)
        //        {

        //        }
        //
        //}
        //public void create()
        //{

        //    Thread th = new Thread();
        //    th.Start();
        //    try
        //    {
        //        Thread.Sleep(1000);
        //    }
        //    catch (System.Exception e)
        //    {
        //        //System.out.println(e);
        //    }
        //}

        public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
        {
            base.OnCreateView(inflater, container, savedInstanceState);
            var view = inflater.Inflate(Resource.Layout.fragment, container, false);

            login = view.FindViewById <TextView>(Resource.Id.Login);
            Product_cataloguee = view.FindViewById <LinearLayout>(Resource.Id.Product_cataloguee);
            promotion          = view.FindViewById <TextView>(Resource.Id.Promotions);
            contact            = view.FindViewById <TextView>(Resource.Id.Contact_us);
            bitcash            = view.FindViewById <TextView>(Resource.Id.Bit_cash);
            website            = view.FindViewById <TextView>(Resource.Id.Website);

            layout = view.FindViewById <LinearLayout>(Resource.Id.layout);
            // textView.Text = "Fragment1";
            TaskScheduler uiContext = TaskScheduler.FromCurrentSynchronizationContext();

            Console.WriteLine("timer started");
            Task.Delay(1000).ContinueWith((task) =>
            {
                //Do UI stuff
                for (int i = 0; i < mThumbIds.Length; i++)
                {
                    layout.SetBackgroundResource(mThumbIds[i]);
                    Task.Delay(1000);
                }
                Console.WriteLine("timer stopped");
            }, uiContext);

            //async Task Run()
            //{
            //    Console.WriteLine("timer started");
            //    await Task.Delay(1000);
            //    //Do UI stuff
            //    for (int i = 0; i < mThumbIds.Length; i++)
            //    {
            //        layout.SetBackgroundResource(mThumbIds[i]);

            //        try
            //        {
            //            Thread.Sleep(1000);
            //        }
            //        catch (System.Exception e)
            //        {

            //        }
            //        Console.WriteLine("timer stopped");
            //}
            //create();

            contact.Click += (o, e) =>
            {
                FragmentTransaction             transcation1      = FragmentManager.BeginTransaction();
                src.Fragments.ContactUsFragment contactUsFragment = new src.Fragments.ContactUsFragment();
                transcation1.Replace(Resource.Id.container, contactUsFragment, "Contact");
                transcation1.AddToBackStack("Contact");
                transcation1.Commit();
            };
            website.Click += (o, e) =>
            {
                FragmentManager.PopBackStackImmediate();
                var uri    = Android.Net.Uri.Parse("http://www.masafi.com/");
                var intent = new Intent(Intent.ActionView, uri);
                StartActivity(intent);
            };
            bitcash.Click += (o, e) =>
            {
                FragmentTransaction           transcation1    = FragmentManager.BeginTransaction();
                src.Fragments.BitCashFragment bitCashFragment = new src.Fragments.BitCashFragment();
                transcation1.Replace(Resource.Id.container, bitCashFragment, "Bit");
                transcation1.AddToBackStack("Bit");
                transcation1.Commit();
            };
            login.Click += (o, e) =>
            {
                FragmentTransaction         transcation1  = FragmentManager.BeginTransaction();
                src.Fragments.LoginFragment loginFragment = new src.Fragments.LoginFragment();
                transcation1.Replace(Resource.Id.container, loginFragment, "Login");
                transcation1.AddToBackStack("Login");
                transcation1.Commit();
            };
            Product_cataloguee.Click += (o, e) =>
            {
                FragmentTransaction transcation1 = FragmentManager.BeginTransaction();
                src.Fragments.ProductCatalogFragment loginFragment = new src.Fragments.ProductCatalogFragment();
                transcation1.Replace(Resource.Id.container, loginFragment, "Product");
                transcation1.AddToBackStack("Product");
                transcation1.Commit();
            };
            promotion.Click += (o, e) =>
            {
                FragmentTransaction             transcation1      = FragmentManager.BeginTransaction();
                src.Fragments.PromotionFragment promotionFragment = new src.Fragments.PromotionFragment();
                transcation1.Replace(Resource.Id.container, promotionFragment, "Promotion");
                transcation1.AddToBackStack("Promotion");
                transcation1.Commit();
            };
            return(view);
        }
		public void OnTabReselected (ActionBar.Tab tab, FragmentTransaction ft)
		{
		}
		/**
		 * Replaces the old fragment with the new one and adds the old to the backstack,
		 *if bool addToBackStack is set to true
		 **/
		public void switchFragment(string oldFragmentTag, string newFragmentTag, Fragment newFragment, bool addToBackStack) {
			menu.Opened = false;
			activeFragment = newFragmentTag;
			trans = FragmentManager.BeginTransaction();
			Fragment oldFragment = FragmentManager.FindFragmentByTag(oldFragmentTag);

			if(addToBackStack && oldFragment != null)
				trans.AddToBackStack(oldFragmentTag);

			if(oldFragment != null)
				trans.Remove(oldFragment);
			trans.Add(Resource.Id.fragmentContainer, newFragment, newFragmentTag);
			trans.Commit();
		}