Exemplo n.º 1
0
        public void selectScene(View view)
        {
            switch (view.Id)
            {
            case Resource.Id.scene1:
                mTransitionManager.TransitionTo(mScene1);
                break;

            case Resource.Id.scene2:
                mTransitionManager.TransitionTo(mScene2);
                break;

            case Resource.Id.scene3:
                mTransitionManager.TransitionTo(mScene3);
                break;

            case Resource.Id.scene4:
                // scene4 is not an actual 'Scene', but rather a dynamic change in the UI,
                // transitioned to using beginDelayedTransition() to tell the TransitionManager
                // to get ready to run a transition at the next frame
                TransitionManager.BeginDelayedTransition(mSceneRoot);
                SetNewSize(Resource.Id.view1, 150, 25);
                SetNewSize(Resource.Id.view2, 150, 25);
                SetNewSize(Resource.Id.view3, 150, 25);
                SetNewSize(Resource.Id.view4, 150, 25);
                break;
            }
        }
Exemplo n.º 2
0
        private void QuickStartNavigation()
        {
            // Transition to navigation state
            mapState = MapState.NAVIGATION;

            cancelNavigationFab.Show();

            // Show the InstructionView
            TransitionManager.BeginDelayedTransition(navigationLayout);
            instructionView.Visibility = ViewStates.Visible;

            AdjustMapPaddingForNavigation();
            // Updates camera with last location before starting navigating,
            // making sure the route information is updated
            // by the time the initial camera tracking animation is fired off
            // Alternatively, NavigationMapboxMap#startCamera could be used here,
            // centering the map camera to the beginning of the provided route
            navigationMap.ResumeCamera(lastLocation);
            navigation.StartNavigation(route);
            AddEventToHistoryFile("start_navigation");

            // Location updates will be received from ProgressChangeListener
            RemoveLocationEngineListener();

            // TODO remove example usage
            navigationMap.ResetCameraPositionWith(NavigationCamera.NavigationTrackingModeGps);
            ICameraUpdate cameraUpdate = CameraOverheadUpdate();

            if (cameraUpdate != null)
            {
                NavigationCameraUpdate navUpdate = new NavigationCameraUpdate(cameraUpdate);
                navigationMap.RetrieveCamera().Update(navUpdate);
            }
        }
Exemplo n.º 3
0
 private void AnimateTagsLayout(bool openTags)
 {
     TransitionManager.BeginDelayedTransition(_rootLayout);
     _localTagsList.Visibility            = _tagsListContainer.Visibility = openTags ? ViewStates.Visible : ViewStates.Gone;
     _photosContainer.Visibility          = _titleContainer.Visibility =
         _descriptionContainer.Visibility = _tagsFlow.Visibility = _postBtnContainer.Visibility = openTags ? ViewStates.Gone : ViewStates.Visible;
 }
Exemplo n.º 4
0
        private void OnTransitioning(object sender, bool transitioning)
        {
            var container = Container;

            if (container == null)
            {
                return;
            }

            if (!transitioning)
            {
                return;
            }

#pragma warning disable CA2000 // Dispose objects before losing scope
            var trans = new TransitionSet();
            trans.SetOrdering(TransitionOrdering.Together);
            trans.AddListener(new TransitionCompletion(this, container));
#pragma warning restore CA2000 // Dispose objects before losing scope

            foreach (var t in BuildTransitions(_transition?.Element))
            {
                trans.AddTransition(t);
            }

            TransitionManager.BeginDelayedTransition(container, trans);
        }
Exemplo n.º 5
0
        private void OnTransitioning(object sender, bool transitioning)
        {
            var container = Container;

            if (container == null)
            {
                return;
            }

            if (!transitioning)
            {
                return;
            }

            var trans = new TransitionSet();

            trans.SetOrdering(TransitionOrdering.Together);
            trans.AddListener(new TransitionCompletion(this, container));

            foreach (var t in BuildTransitions(_transition?.Element))
            {
                trans.AddTransition(t);
            }

            TransitionManager.BeginDelayedTransition(container, trans);
        }
Exemplo n.º 6
0
 public static void SetupAutoSceneTransition(ViewGroup root)
 {
     if (Android.OS.Build.VERSION.SdkInt >= Android.OS.BuildVersionCodes.Kitkat)
     {
         TransitionManager.BeginDelayedTransition(root);
     }
 }
        public void SetValues()
        {
            switch (operacija)
            {
            case Operacije.Plus:
            {
                number1 = rand.Next(maxValue);
                number2 = rand.Next(maxValue - number1);

                correctAnswer = number1 + number2;
                break;
            }

            case Operacije.Minus:
            {
                number1 = rand.Next(maxValue);
                number2 = rand.Next(number1);

                correctAnswer = number1 - number2;
                break;
            }

            case Operacije.Mnozenje:
            {
                number1 = rand.Next(maxValue);
                number2 = rand.Next(maxValue);

                while (number1 * number2 > App.preferences.mnozenje)
                {
                    number2 = rand.Next(maxValue);
                }

                correctAnswer = number1 * number2;
                break;
            }

            case Operacije.Deljenje:
            {
                number1 = rand.Next(maxValue);
                number2 = rand.Next(1, maxValue);

                while (number1 * number2 > App.preferences.deljenje)
                {
                    number2 = rand.Next(maxValue);
                }

                correctAnswer = number1;
                number1       = number1 * number2;
                break;
            }
            }

            TransitionManager.BeginDelayedTransition((ViewGroup)rootView,
                                                     new ChangeText().SetChangeBehavior(ChangeText.ChangeBehaviorOutIn));
            number1TW.Text = number1.ToString();
            number2TW.Text = number2.ToString();
        }
        public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
        {
            rootView = (FrameLayout)inflater.Inflate(Resource.Layout.math_fragment, container, false);
            TransitionManager.BeginDelayedTransition((ViewGroup)rootView,
                                                     new ChangeText().SetChangeBehavior(ChangeText.ChangeBehaviorOutIn));

            igrajPonovo = rootView.FindViewById <FButton>(Resource.Id.igrajPonovo);

            izlaz       = rootView.FindViewById <FButton>(Resource.Id.izlaz);
            number1Btn  = rootView.FindViewById <FButton>(Resource.Id.number1);
            number2Btn  = rootView.FindViewById <FButton>(Resource.Id.number2);
            number3Btn  = rootView.FindViewById <FButton>(Resource.Id.number3);
            number4Btn  = rootView.FindViewById <FButton>(Resource.Id.number4);
            number5Btn  = rootView.FindViewById <FButton>(Resource.Id.number5);
            number6Btn  = rootView.FindViewById <FButton>(Resource.Id.number6);
            number7Btn  = rootView.FindViewById <FButton>(Resource.Id.number7);
            number8Btn  = rootView.FindViewById <FButton>(Resource.Id.number8);
            number9Btn  = rootView.FindViewById <FButton>(Resource.Id.number9);
            number0Btn  = rootView.FindViewById <FButton>(Resource.Id.number0);
            delete      = rootView.FindViewById <FButton>(Resource.Id.delete);
            start       = rootView.FindViewById <FButton>(Resource.Id.start);
            startLayout = rootView.FindViewById <LinearLayout>(Resource.Id.startLayout);

            number1TW         = rootView.FindViewById <TextView>(Resource.Id.number1TW);
            number2TW         = rootView.FindViewById <TextView>(Resource.Id.number2TW);
            solutionTW        = rootView.FindViewById <TextView>(Resource.Id.solutionTW);
            vreme             = rootView.FindViewById <TextView>(Resource.Id.vreme);
            redniBrojZadatka  = rootView.FindViewById <TextView>(Resource.Id.redniBrojZadatka);
            operacijaTW       = rootView.FindViewById <TextView>(Resource.Id.operacija);
            tacnihOdgovoraTW  = rootView.FindViewById <TextView>(Resource.Id.tacnihOdgovora);
            brojTacnihNaKraju = rootView.FindViewById <TextView>(Resource.Id.brojTacnihNaKraju);
            vremeNaKraju      = rootView.FindViewById <TextView>(Resource.Id.vremeNaKraju);
            igrajPonovoLayout = rootView.FindViewById <LinearLayout>(Resource.Id.igrajPonovoLayout);
            questionLayout    = rootView.FindViewById <LinearLayout>(Resource.Id.questionLayout);

            Init();

            start.Click += delegate
            {
                Start();
            };

            izlaz.Click += delegate
            {
                //Activity.FragmentManager.PopBackStack();
                PlayFragment pf = new PlayFragment();
                Activity.FragmentManager.BeginTransaction().Replace(App.fragmentContainer.Id, pf, "play").Commit();
                App.CurrentFragment = pf;
            };

            igrajPonovo.Click += delegate
            {
                Start();
            };

            return(rootView);
        }
        private void Answer_Click(object sender, EventArgs e)
        {
            TransitionManager.BeginDelayedTransition((ViewGroup)rootView,
                                                     new ChangeText().SetChangeBehavior(ChangeText.ChangeBehaviorOutIn));

            FButton btn = sender as FButton;

            if (btn.Text.Equals(correctAnswer.ToString()))
            {
                numberOfCorrectAnswers++;

                int colorFrom = Resources.GetColor(Resource.Color.transparent);
                int colorTo   = Resources.GetColor(Resource.Color.fbutton_color_green_sea);

                ValueAnimator colorAnim = ObjectAnimator.OfInt(questionLayout, "backgroundColor", (int)colorFrom, (int)colorTo);
                colorAnim.SetDuration(500);
                colorAnim.SetEvaluator(new ArgbEvaluator());
                colorAnim.RepeatCount = 1;
                colorAnim.RepeatMode  = ValueAnimatorRepeatMode.Reverse;
                colorAnim.Start();
            }
            else
            {
                int colorFrom = Resources.GetColor(Resource.Color.transparent);
                int colorTo   = Resources.GetColor(Android.Resource.Color.HoloRedDark);

                ValueAnimator colorAnim = ObjectAnimator.OfInt(questionLayout, "backgroundColor", (int)colorFrom, (int)colorTo);
                colorAnim.SetDuration(500);
                colorAnim.SetEvaluator(new ArgbEvaluator());
                colorAnim.RepeatCount = 1;
                colorAnim.RepeatMode  = ValueAnimatorRepeatMode.Reverse;
                colorAnim.Start();
            }

            if (question == 10)
            {
                timer.Stop();

                startLayout.Visibility       = ViewStates.Visible;
                igrajPonovoLayout.Visibility = ViewStates.Visible;
                brojTacnihNaKraju.Text       = numberOfCorrectAnswers.ToString();
                vremeNaKraju.Text            = vremeResavanja.ToString();

                CRecord record = new CRecord();
                record.GameId = App.MathWithAnswersCode + (int)operacija;
                record.Result = numberOfCorrectAnswers;
                record.Time   = vremeResavanja;
                App.db.InsertRecord(record);
                return;
            }

            SetValues();
            question++;

            redniBrojZadatka.Text = question.ToString();
            tacnihOdgovoraTW.Text = numberOfCorrectAnswers.ToString();
        }
        private void RemoveButtonClick(object sender, EventArgs e)
        {
            var index = _viewGroup.ChildCount - 1;

            if (index > -1)
            {
                TransitionManager.BeginDelayedTransition(_viewGroup, new Slide((int)GravityFlags.Top));
                _viewGroup.RemoveViewAt(index);
            }
        }
Exemplo n.º 11
0
 private void ChangeLanguage()
 {
     TransitionManager.BeginDelayedTransition((ViewGroup)rootView,
                                              new ChangeText().SetChangeBehavior(ChangeText.ChangeBehaviorOutIn));
     play.Text           = GetString(Resource.String.igraj);
     this.Activity.Title = GetString(Resource.String.app_name);
     settings.Text       = GetString(Resource.String.podesavanja);
     records.Text        = GetString(Resource.String.rekordi);
     quit.Text           = GetString(Resource.String.quit);
 }
        private void AddButtonClick(object sender, EventArgs e)
        {
            var button = new Button(this)
            {
                Text = "Button"
            };

            button.SetBackgroundColor(new Color(_random.Next(0, 255), _random.Next(0, 255), _random.Next(0, 255)));

            TransitionManager.BeginDelayedTransition(_viewGroup, new Slide((int)GravityFlags.Bottom));

            _viewGroup.AddView(button);
        }
Exemplo n.º 13
0
        private void ClearAllClick(object sender, EventArgs e)
        {
            TransitionManager.BeginDelayedTransition((ViewGroup)rootView,
                                                     new ChangeText().SetChangeBehavior(ChangeText.ChangeBehaviorOutIn));

            subSolution   = "";
            solution.Text = subSolution;

            for (int i = solution.Text.Length; i < correctSolutionLenght; i++)
            {
                solution.Text += " _";
            }
        }
        private void OnTimerElapsed(object sender, ElapsedEventArgs e)
        {
            RunOnUiThread(() =>
            {
                for (int i = 0; i < _viewGroup.ChildCount; i++)
                {
                    var child           = _viewGroup.GetChildAt(i);
                    var layoutParams    = child.LayoutParameters;
                    layoutParams.Height = (int)(_random.Next(50, 100) * Resources.DisplayMetrics.Density + 0.5f);

                    TransitionManager.BeginDelayedTransition(_viewGroup, new ChangeBounds());
                    child.LayoutParameters = layoutParams;
                }
            });
        }
        private void ExpandCollapse()
        {
            TransitionManager.BeginDelayedTransition(dualNavigationMap);
            ConstraintSet constraint;

            if (constraintChanged[0])
            {
                constraint = navigationMapConstraint;
            }
            else
            {
                constraint = navigationMapExpandedConstraint;
            }
            constraint.ApplyTo(dualNavigationMap);
            constraintChanged[0] = !constraintChanged[0];
        }
Exemplo n.º 16
0
        private void DeleteClick(object sender, EventArgs e)
        {
            if (subSolution.Length == 0)
            {
                return;
            }
            TransitionManager.BeginDelayedTransition((ViewGroup)rootView,
                                                     new ChangeText().SetChangeBehavior(ChangeText.ChangeBehaviorOutIn));

            subSolution   = subSolution.Substring(0, subSolution.Length - 1);
            solution.Text = subSolution;

            for (int i = solution.Text.Length; i < correctSolutionLenght; i++)
            {
                solution.Text += " _";
            }
        }
Exemplo n.º 17
0
        private void AnimateTagsLayout(int subject)
        {
            TransitionManager.BeginDelayedTransition(_rootLayout);
            _tagsListLayout.Visibility = Resource.Id.toolbar == subject ? ViewStates.Visible : ViewStates.Gone;

            var topPadding = (int)TypedValue.ApplyDimension(ComplexUnitType.Dip, Resource.Id.toolbar == subject ? 5 : 45, Resources.DisplayMetrics);

            _topMarginTagsLayout.SetPadding(0, topPadding, 0, 0);

            var currentButtonLayoutParameters = _tagsLayout.LayoutParameters as RelativeLayout.LayoutParams;

            if (currentButtonLayoutParameters != null)
            {
                currentButtonLayoutParameters.AddRule(LayoutRules.Below, subject);
                _tagsLayout.LayoutParameters = currentButtonLayoutParameters;
            }
        }
Exemplo n.º 18
0
        private void ResetFields()
        {
            correctSolution = (App.preferences.language == LangEnum.Latinica) ? image.SolutionLatin : image.SolutionCyrilic;

            correctSolutionLenght = correctSolution.Length;
            subSolution           = "";

            solution.Text = "";

            ImageViewAnimatedChange(Activity, slika, image.Name);

            TransitionManager.BeginDelayedTransition((ViewGroup)rootView,
                                                     new ChangeText().SetChangeBehavior(ChangeText.ChangeBehaviorOutIn));

            for (int i = solution.Text.Length; i < correctSolutionLenght; i++)
            {
                solution.Text += " _";
            }
        }
Exemplo n.º 19
0
        public void InitFields()
        {
            correctSolution = (App.preferences.language == LangEnum.Latinica) ? image.SolutionLatin : image.SolutionCyrilic;

            correctSolutionLenght = correctSolution.Length;
            subSolution           = "";

            solution.Text = "";

            slika.SetImageResource(Activity.Resources.GetIdentifier(image.Name, "drawable", Activity.PackageName));

            TransitionManager.BeginDelayedTransition((ViewGroup)rootView,
                                                     new ChangeText().SetChangeBehavior(ChangeText.ChangeBehaviorOutIn));

            for (int i = solution.Text.Length; i < correctSolutionLenght; i++)
            {
                solution.Text += " _";
            }
        }
Exemplo n.º 20
0
        public void OnCancelNavigationClick(object sender, EventArgs args)
        {
            var floatingActionButton = sender as FloatingActionButton;

            navigationMap.UpdateCameraTrackingMode(NavigationCamera.NavigationTrackingModeNone);
            // Transition to info state
            mapState = MapState.INFO;

            floatingActionButton.Hide();

            // Hide the InstructionView
            TransitionManager.BeginDelayedTransition(navigationLayout);
            instructionView.Visibility = ViewStates.Invisible;

            // Reset map camera and pitch
            ResetMapAfterNavigation();

            // Add back regular location listener
            AddLocationEngineListener();
        }
Exemplo n.º 21
0
        private void ChangeFragment(int id)
        {
            var fragment = id switch
            {
                Resource.Id.MainNavigation_Home => mainHomeF,
                Resource.Id.MainNavigation_DB => mainDBF,
                Resource.Id.MainNavigation_GFDv1 => mainGFDv1F,
                Resource.Id.MainNavigation_GFUtil => mainGFUtilF,
                Resource.Id.MainNavigation_Other => mainOtherF,
                _ => null,
            };

            if (fragment == null)
            {
                return;
            }

            TransitionManager.BeginDelayedTransition(fContainer);

            SupportFragmentManager.BeginTransaction().Replace(Resource.Id.MainFragmentContainer, fragment).Commit();

            GC.Collect();
        }
Exemplo n.º 22
0
        private async Task InitLoadProcess(bool isRefresh)
        {
            await Task.Delay(100);

            try
            {
                refreshMainLayout.Refreshing = true;
                TransitionManager.BeginDelayedTransition(refreshMainLayout);

                // 중화기 타이틀 바 초기화

                /*if (ETC.sharedPreferences.GetBoolean("DBDetailBackgroundImage", false) == true)
                 * {
                 *  try
                 *  {
                 *      if ((File.Exists(Path.Combine(ETC.CachePath, "Doll", "Normal", FSTDicNum + ".gfdcache")) == false) || (IsRefresh == true))
                 *      {
                 *          using (TimeOutWebClient wc = new TimeOutWebClient())
                 *          {
                 *              await wc.DownloadFileTaskAsync(Path.Combine(ETC.Server, "Data", "Images", "Guns", "Normal", FSTDicNum + ".png"), Path.Combine(ETC.CachePath, "Doll", "Normal", FSTDicNum + ".gfdcache"));
                 *          }
                 *      }
                 *
                 *      Drawable drawable = Drawable.CreateFromPath(Path.Combine(ETC.CachePath, "Doll", "Normal", FSTDicNum + ".gfdcache"));
                 *      drawable.SetAlpha(40);
                 *      FindViewById<RelativeLayout>(Resource.Id.DollDBDetailMainLayout).Background = drawable;
                 *  }
                 *  catch (Exception ex)
                 *  {
                 *      ETC.LogError(ex, this);
                 *  }
                 * }*/

                try
                {
                    var    smallImage    = FindViewById <ImageView>(Resource.Id.FSTDBDetailSmallImage);
                    string cropimagePath = Path.Combine(ETC.cachePath, "FST", "Normal_Crop", $"{fst.CodeName}.gfdcache");

                    if (!File.Exists(cropimagePath) || isRefresh)
                    {
                        using (var wc = new WebClient())
                        {
                            await wc.DownloadFileTaskAsync(Path.Combine(ETC.server, "Data", "Images", "FST", "Normal_Crop", $"{fst.CodeName}.png"), cropimagePath);
                        }
                    }

                    var dm = ApplicationContext.Resources.DisplayMetrics;

                    int width  = dm.WidthPixels;
                    int height = dm.HeightPixels;

                    var drawable = Drawable.CreateFromPath(cropimagePath);
                    smallImage.SetImageDrawable(drawable);
                    var param = new FrameLayout.LayoutParams(ViewGroup.LayoutParams.MatchParent, drawable.IntrinsicHeight * (width / drawable.IntrinsicWidth));
                    smallImage.LayoutParameters = param;
                }
                catch (Exception ex)
                {
                    ETC.LogError(ex, this);
                }

                /*FindViewById<TextView>(Resource.Id.FSTDBDetailFSTName).Text = FSTName;
                 * FindViewById<TextView>(Resource.Id.FSTDBDetailFSTDicNumber).Text = "No. " + 1;
                 * FindViewById<TextView>(Resource.Id.FSTDBDetailFSTProductTime).Text = "제조 불가";*/

                // 중화기 기본 정보 초기화

                FindViewById <TextView>(Resource.Id.FSTDBDetailInfoType).Text        = fst.Type;
                FindViewById <TextView>(Resource.Id.FSTDBDetailInfoName).Text        = fst.Name;
                FindViewById <TextView>(Resource.Id.FSTDBDetailInfoNickName).Text    = fst.NickName;
                FindViewById <TextView>(Resource.Id.FSTDBDetailInfoIllustrator).Text = fst.Illustrator;
                FindViewById <TextView>(Resource.Id.FSTDBDetailInfoVoiceActor).Text  = fst.VoiceActor;
                FindViewById <TextView>(Resource.Id.FSTDBDetailInfoRealModel).Text   = fst.RealModel;
                FindViewById <TextView>(Resource.Id.FSTDBDetailInfoCountry).Text     = fst.Country;
                FindViewById <TextView>(Resource.Id.FSTDBDetailInfoHowToGain).Text   = "정보 없음"; //(string)FSTInfoDR["DropEvent"];


                // 중화기 회로 정보 초기화

                SetCircuit();


                // 중화기 스킬 정보 초기화

                int[] skillIconIds             = { Resource.Id.FSTDBDetailSkillIcon1, Resource.Id.FSTDBDetailSkillIcon2, Resource.Id.FSTDBDetailSkillIcon3 };
                int[] skillNameIds             = { Resource.Id.FSTDBDetailSkillName1, Resource.Id.FSTDBDetailSkillName2, Resource.Id.FSTDBDetailSkillName3 };
                int[] skillInitCoolTimeIconIds = { Resource.Id.FSTDBDetailSkillInitCoolTimeIcon1, Resource.Id.FSTDBDetailSkillInitCoolTimeIcon2, Resource.Id.FSTDBDetailSkillInitCoolTimeIcon3 };
                int[] skillInitCoolTimeIds     = { Resource.Id.FSTDBDetailSkillInitCoolTime1, Resource.Id.FSTDBDetailSkillInitCoolTime2, Resource.Id.FSTDBDetailSkillInitCoolTime3 };
                int[] skillCoolTimeIconIds     = { Resource.Id.FSTDBDetailSkillCoolTimeIcon1, Resource.Id.FSTDBDetailSkillCoolTimeIcon2, Resource.Id.FSTDBDetailSkillCoolTimeIcon3 };
                int[] skillCoolTimeIds         = { Resource.Id.FSTDBDetailSkillCoolTime1, Resource.Id.FSTDBDetailSkillCoolTime2, Resource.Id.FSTDBDetailSkillCoolTime3 };
                int[] skillExplainIds          = { Resource.Id.FSTDBDetailSkillExplain1, Resource.Id.FSTDBDetailSkillExplain2, Resource.Id.FSTDBDetailSkillExplain3 };
                int[] skillTableSubLayoutIds   = { Resource.Id.FSTDBDetailSkillAbilitySubLayout1, Resource.Id.FSTDBDetailSkillAbilitySubLayout2, Resource.Id.FSTDBDetailSkillAbilitySubLayout3 };
                int[] skillAbilityTopLayoutIds = { Resource.Id.FSTDBDetailSkillAbilityTopLayout1, Resource.Id.FSTDBDetailSkillAbilityTopLayout2, Resource.Id.FSTDBDetailSkillAbilityTopLayout3 };
                int[] skillAbilityTopTextIds1  = { Resource.Id.FSTDBDetailSkillAbilityTopText11, Resource.Id.FSTDBDetailSkillAbilityTopText21, Resource.Id.FSTDBDetailSkillAbilityTopText31 };
                int[] skillAbilityTopTextIds2  = { Resource.Id.FSTDBDetailSkillAbilityTopText12, Resource.Id.FSTDBDetailSkillAbilityTopText22, Resource.Id.FSTDBDetailSkillAbilityTopText32 };


                for (int i = 0; i < 3; ++i)
                {
                    string skillName = fst.SkillName[i];

                    try
                    {
                        string skillIconPath = Path.Combine(ETC.cachePath, "Skill", $"{skillName}.gfdcache");

                        if (!File.Exists(skillIconPath) || isRefresh)
                        {
                            using (var wc = new WebClient())
                            {
                                wc.DownloadFile(Path.Combine(ETC.server, "Data", "Images", "SkillIcons", "FST", skillName + ".png"), skillIconPath);
                            }
                        }

                        FindViewById <ImageView>(skillIconIds[i]).SetImageDrawable(Drawable.CreateFromPath(skillIconPath));
                    }
                    catch (Exception ex)
                    {
                        ETC.LogError(ex, this);
                    }

                    FindViewById <TextView>(skillNameIds[i]).Text = skillName;

                    if (ETC.useLightTheme)
                    {
                        FindViewById <ImageView>(skillInitCoolTimeIconIds[i]).SetImageResource(Resource.Drawable.FirstCoolTime_Icon_WhiteTheme);
                        FindViewById <ImageView>(skillCoolTimeIconIds[i]).SetImageResource(Resource.Drawable.CoolTime_Icon_WhiteTheme);
                    }

                    string[] skillEffects = fst.SkillEffect[i];
                    string[] skillMags    = fst.SkillMag[i];

                    TextView skillInitCoolTime = FindViewById <TextView>(skillInitCoolTimeIds[i]);
                    skillInitCoolTime.SetTextColor(Android.Graphics.Color.Orange);
                    skillInitCoolTime.Text = "0"; //SkillMags[0];

                    TextView skillCoolTime = FindViewById <TextView>(skillCoolTimeIds[i]);
                    skillCoolTime.SetTextColor(Android.Graphics.Color.DarkOrange);
                    skillCoolTime.Text = "0"; //SkillMags[1];

                    FindViewById <TextView>(skillExplainIds[i]).Text = fst.SkillExplain[i];

                    LinearLayout skillTableSubLayout = FindViewById <LinearLayout>(skillTableSubLayoutIds[i]);
                    skillTableSubLayout.RemoveAllViews();

                    for (int k = 0; k < skillEffects.Length; ++k)
                    {
                        LinearLayout layout = new LinearLayout(this);
                        layout.Orientation      = Orientation.Horizontal;
                        layout.LayoutParameters = FindViewById <LinearLayout>(skillAbilityTopLayoutIds[i]).LayoutParameters;

                        TextView ability = new TextView(this);
                        TextView mag     = new TextView(this);

                        ability.LayoutParameters = FindViewById <TextView>(skillAbilityTopTextIds1[i]).LayoutParameters;
                        mag.LayoutParameters     = FindViewById <TextView>(skillAbilityTopTextIds2[i]).LayoutParameters;

                        ability.Text    = skillEffects[k];
                        ability.Gravity = GravityFlags.Center;
                        mag.Text        = skillMags[k];
                        mag.Gravity     = GravityFlags.Center;

                        layout.AddView(ability);
                        layout.AddView(mag);

                        skillTableSubLayout.AddView(layout);
                    }
                }


                // 인형 능력치 초기화

                CalcAbility();

                if (ETC.useLightTheme)
                {
                    SetCardTheme();
                }

                ShowCardViewVisibility();
            }
            catch (WebException ex)
            {
                ETC.LogError(ex, this);
                ETC.ShowSnackbar(snackbarLayout, Resource.String.RetryLoad_CauseNetwork, Snackbar.LengthShort, Android.Graphics.Color.DarkMagenta);

                _ = InitLoadProcess(false);

                return;
            }
            catch (Exception ex)
            {
                ETC.LogError(ex, this);
                ETC.ShowSnackbar(snackbarLayout, Resource.String.DBDetail_LoadDetailFail, Snackbar.LengthLong, Android.Graphics.Color.DarkRed);
            }
            finally
            {
                refreshMainLayout.Refreshing = false;
            }
        }
Exemplo n.º 23
0
		protected override void OnCreate (Bundle bundle)
		{
			base.OnCreate (bundle);

			SetContentView (Resource.Layout.Transition);

			#region property animation

			button = FindViewById<Button> (Resource.Id.button);
			text = FindViewById<TextView> (Resource.Id.textView);
			linear = FindViewById<LinearLayout> (Resource.Id.linear);

			if(bundle != null) {
				if(bundle.GetBoolean("visible")) {
					text.Visibility = ViewStates.Visible;
				}
				visible = bundle.GetBoolean("visible");
			}

			// This button demonstrates a simple property animation
			button.Click += (o, e) => {

				// OS version check since transition manager is only available in KitKat+
				var version = BuildVersionCodes.Kitkat;
				if(Build.VERSION.SdkInt >= version) {
					TransitionManager.BeginDelayedTransition (linear);
				}

				// show and hide the text, so we can see the smooth transition
				if(text.Visibility != ViewStates.Visible)
				{
					text.Visibility = ViewStates.Visible;
					visible = true;
				}
				else
				{
					text.Visibility = ViewStates.Invisible;
					visible = false;
				}
			};

			#endregion

			#region scenes

			// the container holds the dynamic content what will be changing when we 
			// change Scenes
			container = FindViewById<RelativeLayout> (Resource.Id.container);
			sceneButton = FindViewById<Button> (Resource.Id.sceneButton);

			// Define the transition and inflate it from the xml
			transition = TransitionInflater.From(this).InflateTransition(Resource.Transition.transition);

			// Define scenes that we're going to use

			// NOTE: There is a known Java bug in GetSceneForLayout (https://code.google.com/p/android/issues/detail?id=62450)
			// It may not work as intended the second time an activity is launched (relaunch or configuration change)
			scene1 = Scene.GetSceneForLayout(container, Resource.Layout.Scene1, this);
			scene2 = Scene.GetSceneForLayout(container, Resource.Layout.Scene2, this);

			scene1.Enter();

			sceneButton.Click += (o, e) => {
				// reserve variables. This keeps the animation going both ways.
				Scene temp = scene2;
				scene2 = scene1;
				scene1 = temp;

				TransitionManager.Go (scene1, transition);
			};

			#endregion

		}
Exemplo n.º 24
0
        private void KeyboardClick(object sender, EventArgs e)
        {
            TransitionManager.BeginDelayedTransition((ViewGroup)rootView,
                                                     new ChangeText().SetChangeBehavior(ChangeText.ChangeBehaviorOutIn));

            if (subSolution.Length == correctSolutionLenght)
            {
                return;
            }

            subSolution  += (sender as FButton).Text.ToUpper();;
            solution.Text = subSolution;


            var solutionLower = subSolution.ToLower();

            if (subSolution.Length == correctSolutionLenght)
            {
                bool correct = true;
                for (int i = 0; i < correctSolutionLenght; i++)
                {
                    var ch1 = solutionLower[i];
                    var ch2 = correctSolution[i];
                    if (solutionLower[i] != correctSolution[i])
                    {
                        correct = false;
                    }
                    if (correctSolution[i] == 'а')
                    {
                        if (solutionLower[i] == 'а')
                        {
                            correct = true;
                        }
                    }
                }

                if (correct)
                {
                    if (App.preferences.language == LangEnum.Latinica)
                    {
                        image.SolvedLatin = true;
                    }
                    else
                    {
                        image.SolvedCyrilic = true;
                    }

                    App.db.UpdateImage(image);

                    int newID = image.Id + 1;

                    image = App.db.GetImageByID(newID);
                    if (image != null)
                    {
                        ResetFields();
                    }
                }
            }

            for (int i = solution.Text.Length; i < correctSolutionLenght; i++)
            {
                solution.Text += " _";
            }
        }
        /// <summary>
        /// Loads the new constraint layout and adds the animation operation.
        /// </summary>
        private void PageTransition()
        {
            // Disable the See More / Hide button so we can't trigger another animation while this one is happening
            // It will get re-enabled in OnTransitionEnd
            seeMoreHideButton.Enabled = false;

            seeMoreModeEnabled = !seeMoreModeEnabled;

            if (seeMoreModeEnabled)
            {
                // Current: Results
                // Transition To: See More

                // The original x-ray view (that only appears in See More) is hidden to begin with so that
                // TalkBack doesn't narrate its elements
                xRayDisplayViewOriginal.Visibility = ViewStates.Visible;

                Transition transition = new AutoTransition();
                transition.AddListener(this); // This listener will hide the conditionListSecondary when the transition is done (and re-enable the See More / Hide button)

                TransitionManager.BeginDelayedTransition(root, transition);

                seeMoreConstraints.ApplyTo(root);
                seeMoreHideButton.SetText(Resource.String.see_all_btn_hide);
                layoutManagerPrimary.ScrollEnabled = true;

                xRayDisplayView.TextDisplayMode = XRayDisplayView.DisplayMode.Small;
                xRayDisplayView.FilenameLabel   = GetString(Resource.String.see_all_image_label_analyzed);
            }
            else
            {
                // Current: See More
                // Transition To: Results

                // We need a little bit of a custom transition here:
                // We want to fade in the conditionListSecondary and move it at the same time
                // We also want to keep the origin x-ray view visible during the transition then hide it afterwards

                // This transition takes care of the fade in + move for all elements
                TransitionSet mainTransitions = new TransitionSet();
                mainTransitions.SetOrdering(TransitionSet.OrderingTogether);
                mainTransitions.AddTransition(new ChangeBounds());
                mainTransitions.AddTransition(new Fade(Fade.In));

                // This transition takes care of fading out the original x-ray view
                Transition fadeOut = new Fade(Fade.Out);
                fadeOut.AddTarget(Resource.Id.img_xray_original);

                // We can then run the two transition sequentially to make sure the fade out happens after everything else
                TransitionSet transitions = new TransitionSet();
                transitions.SetOrdering(TransitionSet.OrderingSequential);
                transitions.AddTransition(mainTransitions);
                transitions.AddTransition(fadeOut);
                transitions.AddListener(this); // This listener will re-enable the See More / Hide button when the transition is done

                TransitionManager.BeginDelayedTransition(root, transitions);

                resultsConstraints.ApplyTo(root);
                seeMoreHideButton.SetText(Resource.String.results_btn_see_more);

                // Need to reset the scroll of conditionListPrimary to the top
                layoutManagerPrimary.ScrollToPositionWithOffset(0, 0);
                layoutManagerPrimary.ScrollEnabled = false;

                xRayDisplayView.TextDisplayMode = XRayDisplayView.DisplayMode.Large;
                xRayDisplayView.FilenameLabel   = GetString(Resource.String.results_image_label);
            }
        }
Exemplo n.º 26
0
        private void ChangeAdapter(bool isPrevious)
        {
            (int topTitleId, int titleId, int captionId)menuStringIds = (0, 0, 0);

            TransitionManager.BeginDelayedTransition(mainRecyclerView);

            if (!(!isPrevious && (categoryType == Category.Item)))
            {
                titleList.Clear();
                captionList.Clear();
                topTitleList.Clear();
            }

            if (isPrevious)
            {
                switch (categoryType)
                {
                // SubMain -> Main
                case Category.SubMain:
                    menuStringIds = (Resource.Array.Story_Main_TopTitle, Resource.Array.Story_Main, Resource.Array.Story_Main_Caption);
                    categoryType  = Category.Main;
                    break;

                // Item -> SubMain
                case Category.Item when topType is Top.Main:
                    menuStringIds = (Resource.Array.Story_Main_Main_TopTitle, Resource.Array.Story_Main_Main, Resource.Array.Story_Main_Main_Caption);
                    categoryType  = Category.SubMain;
                    break;

                case Category.Item when topType is Top.Sub:
                    menuStringIds = (Resource.Array.Story_Main_Sub_TopTitle, Resource.Array.Story_Main_Sub, Resource.Array.Story_Main_Sub_Caption);
                    categoryType  = Category.SubMain;
                    break;

                case Category.Item when topType is Top.Memory:
                    menuStringIds = (Resource.Array.Story_Main_Memory_TopTitle, Resource.Array.Story_Main_Memory, Resource.Array.Story_Main_Memory_Caption);
                    categoryType  = Category.SubMain;
                    break;
                }
            }
            else
            {
                switch (categoryType)
                {
                // Main -> SubMain
                case Category.Main when topType is Top.Main:
                    menuStringIds = (Resource.Array.Story_Main_Main_TopTitle, Resource.Array.Story_Main_Main, Resource.Array.Story_Main_Main_Caption);
                    categoryType  = Category.SubMain;
                    break;

                case Category.Main when topType is Top.Sub:
                    menuStringIds = (Resource.Array.Story_Main_Sub_TopTitle, Resource.Array.Story_Main_Sub, Resource.Array.Story_Main_Sub_Caption);
                    categoryType  = Category.SubMain;
                    break;

                case Category.Main when topType is Top.Memory:
                    menuStringIds = (Resource.Array.Story_Main_Memory_TopTitle, Resource.Array.Story_Main_Memory, Resource.Array.Story_Main_Memory_Caption);
                    categoryType  = Category.SubMain;
                    break;

                // SubMain -> Item
                case Category.SubMain when topType is Top.Main:
                    ListMainStoryItem(out menuStringIds);
                    categoryType = Category.Item;
                    break;

                case Category.SubMain when topType is Top.Sub:
                    ListSubStoryItem(out menuStringIds);
                    categoryType = Category.Item;
                    break;

                case Category.SubMain when topType is Top.Memory:
                    ListMemoryStoryItem(out menuStringIds);
                    categoryType = Category.Item;
                    break;

                // Item -> Resder
                case Category.Item:
                    RunReader();
                    return;
                }
            }

            topTitleList.AddRange(Resources.GetStringArray(menuStringIds.topTitleId));
            titleList.AddRange(Resources.GetStringArray(menuStringIds.titleId));
            captionList.AddRange(Resources.GetStringArray(menuStringIds.captionId));

            adapter.NotifyDataSetChanged();
        }
Exemplo n.º 27
0
 private void Render(bool loading)
 {
     TransitionManager.BeginDelayedTransition(_container);
     _loading.Visibility = loading ? ViewStates.Visible : ViewStates.Gone;
     _posts.Visibility   = !loading ? ViewStates.Visible : ViewStates.Gone;
 }
Exemplo n.º 28
0
        private async Task InitLoadProcess(bool isRefresh)
        {
            await Task.Delay(100);

            try
            {
                refreshMainLayout.Refreshing = true;
                TransitionManager.BeginDelayedTransition(refreshMainLayout);


                // 철혈 타이틀 바 초기화

                if (Preferences.Get("DBDetailBackgroundImage", false))
                {
                    string imagePath = Path.Combine(ETC.cachePath, "Enemy", "Normal", $"{enemy.CodeName}.gfdcache");

                    if (!File.Exists(imagePath) || isRefresh)
                    {
                        using (var wc = new WebClient())
                        {
                            await wc.DownloadFileTaskAsync(Path.Combine(ETC.server, "Data", "Images", "Enemy", "Normal", $"{enemy.CodeName}.png"), imagePath);
                        }
                    }

                    var drawable = Drawable.CreateFromPath(imagePath);
                    drawable.SetAlpha(40);

                    FindViewById <ImageView>(Resource.Id.EnemyDBDetailBackgroundImageView).Background = drawable;
                }

                string cropImagePath = Path.Combine(ETC.cachePath, "Enemy", "Normal_Crop", $"{enemy.CodeName}.gfdcache");

                if (!File.Exists(cropImagePath) || isRefresh)
                {
                    using (WebClient wc = new WebClient())
                    {
                        await wc.DownloadFileTaskAsync(Path.Combine(ETC.server, "Data", "Images", "Enemy", "Normal_Crop", $"{enemy.CodeName}.png"), cropImagePath);
                    }
                }

                FindViewById <ImageView>(Resource.Id.EnemyDBDetailSmallImage).SetImageDrawable(Drawable.CreateFromPath(cropImagePath));

                TextView type = FindViewById <TextView>(Resource.Id.EnemyDBDetailType);

                if (enemy.IsBoss)
                {
                    FindViewById <TextView>(Resource.Id.EnemyDBDetailType).Text = Resources.GetString(Resource.String.EnemyDBDetail_Boss);
                }
                else
                {
                    FindViewById <TextView>(Resource.Id.EnemyDBDetailType).Text = Resources.GetString(Resource.String.EnemyDBDetail_Normal);
                }

                FindViewById <TextView>(Resource.Id.EnemyDBDetailEnemyName).Text     = enemy.Name;
                FindViewById <TextView>(Resource.Id.EnemyDBDetailEnemyCodeName).Text = enemy.CodeName;


                // 철혈 기본 정보 초기화

                int GradeIconId = 0;

                switch (enemy.IsBoss)
                {
                case true:
                    GradeIconId = Resource.Drawable.Type_Boss;
                    break;

                case false:
                    GradeIconId = Resource.Drawable.Type_Normal;
                    break;
                }

                FindViewById <ImageView>(Resource.Id.EnemyDBDetailInfoGrade).SetImageResource(GradeIconId);
                FindViewById <TextView>(Resource.Id.EnemyDBDetailInfoEnemyAffiliation).Text = enemy.Affiliation;
                FindViewById <TextView>(Resource.Id.EnemyDBDetailInfoName).Text             = enemy.Name;
                FindViewById <TextView>(Resource.Id.EnemyDBDetailInfoVoiceActor).Text       = "";
                FindViewById <TextView>(Resource.Id.EnemyDBDetailInfoETC).Text = enemy.Note;


                // 철혈 능력치 초기화

                string[] abilities        = { "HP", "FireRate", "Evasion", "Accuracy", "AttackSpeed", "Penetration", "Armor", "Range" };
                int[]    Progresses       = { Resource.Id.EnemyInfoHPProgress, Resource.Id.EnemyInfoFRProgress, Resource.Id.EnemyInfoEVProgress, Resource.Id.EnemyInfoACProgress, Resource.Id.EnemyInfoASProgress, Resource.Id.EnemyInfoPTProgress, Resource.Id.EnemyInfoAMProgress, Resource.Id.EnemyInfoRangeProgress };
                int[]    ProgressMaxTexts = { Resource.Id.EnemyInfoHPProgressMax, Resource.Id.EnemyInfoFRProgressMax, Resource.Id.EnemyInfoEVProgressMax, Resource.Id.EnemyInfoACProgressMax, Resource.Id.EnemyInfoASProgressMax, Resource.Id.EnemyInfoPTProgressMax, Resource.Id.EnemyInfoAMProgressMax, Resource.Id.EnemyInfoRangeProgressMax };
                int[]    StatusTexts      = { Resource.Id.EnemyInfoHPStatus, Resource.Id.EnemyInfoFRStatus, Resource.Id.EnemyInfoEVStatus, Resource.Id.EnemyInfoACStatus, Resource.Id.EnemyInfoASStatus, Resource.Id.EnemyInfoPTStatus, Resource.Id.EnemyInfoAMStatus, Resource.Id.EnemyInfoRangeStatus };

                for (int i = 0; i < Progresses.Length; ++i)
                {
                    FindViewById <TextView>(ProgressMaxTexts[i]).Text = FindViewById <ProgressBar>(Progresses[i]).Max.ToString();

                    int value = enemy.Abilities[enemyTypeIndex][abilities[i]];

                    FindViewById <ProgressBar>(Progresses[i]).Progress = value;
                    FindViewById <TextView>(StatusTexts[i]).Text       = value.ToString();
                }

                if (ETC.useLightTheme)
                {
                    SetCardTheme();
                }

                ShowCardViewVisibility();
            }
            catch (WebException ex)
            {
                ETC.LogError(ex, this);
                ETC.ShowSnackbar(snackbarLayout, Resource.String.RetryLoad_CauseNetwork, Snackbar.LengthShort, Android.Graphics.Color.DarkMagenta);

                _ = InitLoadProcess(false);

                return;
            }
            catch (Exception ex)
            {
                ETC.LogError(ex, this);
                ETC.ShowSnackbar(snackbarLayout, Resource.String.DBDetail_LoadDetailFail, Snackbar.LengthLong, Android.Graphics.Color.DarkRed);
            }
            finally
            {
                refreshMainLayout.Refreshing = false;
            }
        }
        private void NumericButtonClick(object sender, EventArgs e)
        {
            if (solutionTW.Text.Equals("_"))
            {
                solutionTW.Text = (sender as FButton).Text;
            }
            else
            {
                solutionTW.Text += (sender as FButton).Text;
            }

            string text = solutionTW.Text;

            try
            {
                int rez = Int32.Parse(text);
                if (rez == correctAnswer)
                {
                    numberOfCorrectAnswers++;

                    if (question == 10)
                    {
                        timer.Stop();
                        startLayout.Visibility       = ViewStates.Visible;
                        igrajPonovoLayout.Visibility = ViewStates.Visible;
                        brojTacnihNaKraju.Text       = numberOfCorrectAnswers.ToString();
                        vremeNaKraju.Text            = vremeResavanja.ToString();

                        CRecord record = new CRecord();
                        record.GameId = App.MathCode + (int)operacija;
                        record.Result = 10;
                        record.Time   = vremeResavanja;
                        App.db.InsertRecord(record);
                        return;
                    }

                    int colorFrom = Resources.GetColor(Resource.Color.transparent);
                    int colorTo   = Resources.GetColor(Resource.Color.fbutton_color_green_sea);

                    ValueAnimator colorAnim = ObjectAnimator.OfInt(questionLayout, "backgroundColor", (int)colorFrom, (int)colorTo);
                    colorAnim.SetDuration(500);
                    colorAnim.SetEvaluator(new ArgbEvaluator());
                    colorAnim.RepeatCount = 1;
                    colorAnim.RepeatMode  = ValueAnimatorRepeatMode.Reverse;
                    colorAnim.Start();

                    //ValueAnimator anim = (ObjectAnimator)AnimatorInflater.LoadAnimator(Activity, Resource.Animator.blinking_background);
                    //anim.SetTarget(objectToFlash);

                    question++;
                    TransitionManager.BeginDelayedTransition((ViewGroup)rootView,
                                                             new ChangeText().SetChangeBehavior(ChangeText.ChangeBehaviorOutIn));
                    solutionTW.Text       = "";
                    redniBrojZadatka.Text = question.ToString();
                    tacnihOdgovoraTW.Text = numberOfCorrectAnswers.ToString();
                    SetValues();
                }
            }
            catch (Exception exc)
            {
            }
        }
Exemplo n.º 30
0
 private void Render(ImmutableList <Post> list)
 {
     TransitionManager.BeginDelayedTransition(_container, new ChangeBounds());
     _adapter.UpdateItems(list);
 }