Exemplo n.º 1
0
        private void ApplySort(View view)
        {
            try
            {
                sortType = (SortType)view.FindViewById <Spinner>(Resource.Id.CommonSortSpinner).SelectedItemPosition;

                if (view.FindViewById <RadioButton>(Resource.Id.CommonSortOrderAscending).Checked)
                {
                    sortOrder = SortOrder.Ascending;
                }
                else if (view.FindViewById <RadioButton>(Resource.Id.CommonSortOrderDescending).Checked)
                {
                    sortOrder = SortOrder.Descending;
                }
                else
                {
                    sortOrder = SortOrder.Ascending;
                }

                _ = ListDoll();
            }
            catch (Exception ex)
            {
                ETC.LogError(ex, this);
                ETC.ShowSnackbar(snackbarLayout, Resource.String.DBList_FilterBoxApplyFail, Snackbar.LengthLong);
            }
        }
Exemplo n.º 2
0
        private async Task FairyImageStageChange(int id)
        {
            try
            {
                switch (id)
                {
                case Resource.Id.FairyDBImageViewerNextButton when imageNum is 3:
                    imageNum = 1;
                    break;

                case Resource.Id.FairyDBImageViewerNextButton:
                    imageNum += 1;
                    break;

                case Resource.Id.FairyDBImageViewerPreviousButton when imageNum is 1:
                    imageNum = 3;
                    break;

                case Resource.Id.FairyDBImageViewerPreviousButton:
                    imageNum -= 1;
                    break;
                }

                await LoadImage();
            }
            catch (Exception ex)
            {
                ETC.LogError(ex, this);
                ETC.ShowSnackbar(snackbarLayout, Resource.String.ImageViewer_ChangeImageError, Snackbar.LengthLong, Android.Graphics.Color.DarkRed);
            }
        }
Exemplo n.º 3
0
        private void ResetFilter()
        {
            try
            {
                for (int i = 0; i < gradeFilters.Length; ++i)
                {
                    filterGrade[i] = false;
                }
                for (int i = 0; i < typeFilters.Length; ++i)
                {
                    filterType[i] = false;
                }
                for (int i = 0; i < productTimeFilters.Length; ++i)
                {
                    filterProductTime[i] = 0;
                }
                filterMod = false;

                for (int i = 0; i < hasApplyFilter.Length; ++i)
                {
                    hasApplyFilter[i] = false;
                }

                _ = ListDoll();
            }
            catch (Exception ex)
            {
                ETC.LogError(ex, this);
                ETC.ShowSnackbar(snackbarLayout, Resource.String.DBList_FilterBoxResetFail, Snackbar.LengthLong);
            }
        }
Exemplo n.º 4
0
        private void ApplyFilter(View view)
        {
            try
            {
                for (int i = 0; i < gradeFilters.Length; ++i)
                {
                    filterGrade[i] = view.FindViewById <CheckBox>(gradeFilters[i]).Checked;
                }
                for (int i = 0; i < typeFilters.Length; ++i)
                {
                    filterType[i] = view.FindViewById <CheckBox>(typeFilters[i]).Checked;
                }
                for (int i = 0; i < productTimeFilters.Length; ++i)
                {
                    filterProductTime[i] = view.FindViewById <NumberPicker>(productTimeFilters[i]).Value;
                }
                filterMod = view.FindViewById <CheckBox>(modFilter).Checked;

                CheckApplyFilter();

                _ = ListDoll();
            }
            catch (Exception ex)
            {
                ETC.LogError(ex, this);
                ETC.ShowSnackbar(snackbarLayout, Resource.String.DBList_FilterBoxApplyFail, Snackbar.LengthLong);
            }
        }
Exemplo n.º 5
0
        private async void LoadImage(bool IsRefresh)
        {
            try
            {
                LoadProgressBar.Visibility = ViewStates.Visible;

                await Task.Delay(100);

                string ImagePath = Path.Combine(ETC.cachePath, "Enemy", "Normal", $"{EnemyCodeName}.gfdcache");

                if ((File.Exists(ImagePath) == false) || (IsRefresh == true))
                {
                    using (WebClient wc = new WebClient())
                    {
                        await Task.Run(async() => { await wc.DownloadFileTaskAsync(Path.Combine(ETC.server, "Data", "Images", "Enemy", "Normal", $"{EnemyCodeName}.png"), ImagePath); });
                    }
                }

                await Task.Delay(500);

                EnemyImageView.SetImageDrawable(Android.Graphics.Drawables.Drawable.CreateFromPath(ImagePath));

                ImageStatus.Text = $"{EnemyCodeName} - {EnemyName}";
            }
            catch (Exception ex)
            {
                ETC.LogError(ex, this);
                ETC.ShowSnackbar(SnackbarLayout, Resource.String.ImageLoad_Fail, Snackbar.LengthLong, Android.Graphics.Color.DarkRed);
            }
            finally
            {
                LoadProgressBar.Visibility = ViewStates.Invisible;
                IsRefresh = false;
            }
        }
Exemplo n.º 6
0
        private void InitFilterBox()
        {
            var inflater = LayoutInflater;

            try
            {
                View v = inflater.Inflate(Resource.Layout.FSTFilterLayout, null);

                for (int i = 0; i < typeFilters.Length; ++i)
                {
                    v.FindViewById <CheckBox>(typeFilters[i]).Checked = filterType[i];
                }

                var filterBox = new AndroidX.AppCompat.App.AlertDialog.Builder(this, ETC.dialogBGVertical);
                filterBox.SetTitle(Resource.String.DBList_FilterBoxTitle);
                filterBox.SetView(v);
                filterBox.SetPositiveButton(Resource.String.AlertDialog_Set, delegate { ApplyFilter(v); });
                filterBox.SetNegativeButton(Resource.String.AlertDialog_Cancel, delegate { });
                filterBox.SetNeutralButton(Resource.String.AlertDialog_Reset, delegate { ResetFilter(); });

                filterBox.Show();
            }
            catch (Exception ex)
            {
                ETC.LogError(ex, this);
                ETC.ShowSnackbar(snackbarLayout, Resource.String.FilterBox_InitError, Snackbar.LengthLong);
            }
        }
Exemplo n.º 7
0
        private void LoadCostumeList()
        {
            try
            {
                costumes = new List <string>()
                {
                    Resources.GetString(Resource.String.DollDBImageViewer_DefaultCostume)
                };

                if (doll.Costumes != null)
                {
                    costumes.AddRange(doll.Costumes);
                }

                costumes.TrimExcess();

                var CostumeListAdapter = new ArrayAdapter(this, Resource.Layout.SpinnerListLayout_ImageViewer, costumes);
                CostumeListAdapter.SetDropDownViewResource(Resource.Layout.SpinnerListLayout_ImageViewer);

                costumeList.Adapter = CostumeListAdapter;
            }
            catch (Exception ex)
            {
                ETC.LogError(ex, this);
                ETC.ShowSnackbar(snackbarLayout, Resource.String.Initialize_List_Fail, Snackbar.LengthLong, Android.Graphics.Color.DarkRed);
            }
        }
Exemplo n.º 8
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            try
            {
                base.OnCreate(savedInstanceState);

                ListItem = new ListProcess(ListDoll);

                adapter = new DollListAdapter(subList, this);
                (adapter as DollListAdapter).ItemClick += Adapter_ItemClick;

                recyclerView.SetAdapter(adapter);

                SupportActionBar.SetTitle(Resource.String.DollDBMainActivity_Title);
                SupportActionBar.SetDisplayHomeAsUpEnabled(true);

                InitProcess();

                _ = ListDoll();

                /*if ((ETC.locale.Language == "ko") && (ETC.sharedPreferences.GetBoolean("Help_DBList", true)))
                 * {
                 *  ETC.RunHelpActivity(this, "DBList");
                 * }*/
            }
            catch (Exception ex)
            {
                ETC.LogError(ex, this);
                ETC.ShowSnackbar(snackbarLayout, Resource.String.Activity_OnCreateError, Snackbar.LengthShort, Android.Graphics.Color.DeepPink);
            }
        }
Exemplo n.º 9
0
        private void SetChipsetBonusList()
        {
            try
            {
                int gradeSetting = Convert.ToInt32(gradeControl.Rating);

                var list = new List <string>
                {
                    Resources.GetString(Resource.String.FSTDBDetail_Chipset_Default)
                };

                foreach (int i in fst.ChipsetBonusCount)
                {
                    list.Add(i.ToString());
                }

                list.TrimExcess();

                var adapter = new ArrayAdapter(this, Resource.Layout.SpinnerListLayout, list);
                adapter.SetDropDownViewResource(Resource.Layout.SpinnerListLayout);
                chipsetBonusSelector.Adapter = adapter;

                chipsetBonusSelector.SetSelection(0);
            }
            catch (Exception ex)
            {
                ETC.LogError(ex, this);
                ETC.ShowSnackbar(snackbarLayout, Resource.String.List_InitError, Snackbar.LengthShort, Android.Graphics.Color.DarkRed);
            }
        }
Exemplo n.º 10
0
        private void ResetFilter()
        {
            try
            {
                for (int i = 0; i < enemyTypeFilters.Length; ++i)
                {
                    filterEnemyType[i] = false;
                }
                for (int i = 0; i < enemyAffiliationFilters.Length; ++i)
                {
                    filterEnemyAffiliation[i] = false;
                }

                for (int i = 0; i < hasApplyFilter.Length; ++i)
                {
                    hasApplyFilter[i] = false;
                }

                _ = ListEnemy();
            }
            catch (Exception ex)
            {
                ETC.LogError(ex, this);
                ETC.ShowSnackbar(snackbarLayout, Resource.String.DBList_FilterBoxResetFail, Snackbar.LengthLong);
            }
        }
Exemplo n.º 11
0
        private void CreateListObject()
        {
            try
            {
                foreach (DataRow dr in ETC.enemyList.Rows)
                {
                    bool isCreate = false;

                    foreach (Enemy enemy in rootList)
                    {
                        if (enemy.CodeName == (string)dr["CodeName"])
                        {
                            isCreate = true;
                            break;
                        }
                    }

                    if (!isCreate)
                    {
                        rootList.Add(new Enemy(dr));
                    }
                }

                rootList.TrimExcess();
            }
            catch (Exception ex)
            {
                ETC.LogError(ex, this);
                ETC.ShowSnackbar(snackbarLayout, Resource.String.Initialize_List_Fail, Snackbar.LengthShort);
            }
        }
Exemplo n.º 12
0
        private async Task CheckUpdate()
        {
            await Task.Delay(100);

            bool isMissing = false;

            try
            {
                isMissing = CheckImage();

                if (!isMissing)
                {
                    using (WebClient wc = new WebClient())
                    {
                        string LocalVerPath = Path.Combine(ETC.systemPath, "ShortGuideVer.txt");

                        if (!File.Exists(LocalVerPath))
                        {
                            hasUpdate = true;
                        }
                        else
                        {
                            int serverVer = int.Parse(await wc.DownloadStringTaskAsync(Path.Combine(ETC.server, "ShortGuideVer.txt")));
                            int localVer  = 0;

                            using (StreamReader sr = new StreamReader(new FileStream(LocalVerPath, FileMode.Open, FileAccess.Read)))
                            {
                                localVer = int.Parse(sr.ReadToEnd());
                            }

                            hasUpdate = localVer < serverVer;
                        }
                    }
                }

                if (hasUpdate || isMissing)
                {
                    var builder = new AndroidX.AppCompat.App.AlertDialog.Builder(Activity);
                    builder.SetTitle(Resource.String.UpdateDialog_Title);
                    builder.SetMessage(Resource.String.UpdateDialog_Message);
                    builder.SetCancelable(true);
                    builder.SetPositiveButton(Resource.String.AlertDialog_Confirm, async delegate { await DownloadShortGuideImage(); });
                    builder.SetNegativeButton(Resource.String.AlertDialog_Cancel, delegate { });

                    var dialog = builder.Create();
                    dialog.Show();
                }
            }
            catch (Exception ex)
            {
                ETC.LogError(ex, Activity);
                ETC.ShowSnackbar(snackbarLayoutF, Resource.String.UpdateCheck_Fail, Snackbar.LengthLong, Android.Graphics.Color.DarkRed);
            }
        }
        private void ShowResultScreen(int[] resultDicnumbers)
        {
            try
            {
                if (resultDicnumbers.Length == 0)
                {
                    ETC.ShowSnackbar(snackbarLayout, "Result Empty", Snackbar.LengthShort);

                    return;
                }

                string[] type        = new string[resultDicnumbers.Length];
                string[] resultNames = new string[resultDicnumbers.Length];

                for (int i = 0; i < resultDicnumbers.Length; ++i)
                {
                    DataRow dr = null;

                    switch (category)
                    {
                    case ProductCategory.Doll:
                        type[i] = "Doll";
                        dr      = ETC.FindDataRow(ETC.dollList, "DicNumber", resultDicnumbers[i]);
                        break;

                    case ProductCategory.Equip:
                        if ((int)dr["ProductTime"] <= 60)
                        {
                            type[i] = "Equip";
                            dr      = ETC.FindDataRow(ETC.equipmentList, "DicNumber", resultDicnumbers[i]);
                        }
                        else
                        {
                            type[i] = "Fairy";
                            dr      = ETC.FindDataRow(ETC.fairyList, "DicNumber", resultDicnumbers[i]);
                        }
                        break;
                    }

                    resultNames[i] = (string)dr["Name"];
                }

                Intent resultInfo = new Intent(this, typeof(ProductResultActivity));
                resultInfo.PutExtra("ResultType", type);
                resultInfo.PutExtra("ResultInfo", resultNames);
                StartActivity(resultInfo);
                OverridePendingTransition(Android.Resource.Animation.FadeIn, Android.Resource.Animation.FadeOut);
            }
            catch (Exception ex)
            {
                ETC.LogError(ex, this);
                ETC.ShowSnackbar(snackbarLayout, Resource.String.ProductSimulatorActivity_StartResultError, Snackbar.LengthShort);
            }
        }
Exemplo n.º 14
0
        private async Task ListEquip()
        {
            subList.Clear();

            string searchText = searchViewText.ToUpper();

            int[] pTime  = { filterProductTime[0], filterProductTime[1] };
            int   pRange = filterProductTime[2];

            try
            {
                for (int i = 0; i < rootList.Count; ++i)
                {
                    Equip equip = rootList[i];

                    if ((pTime[0] + pTime[1]) != 0)
                    {
                        if (!CheckEquipByProductTime(pTime, pRange, equip.ProductTime))
                        {
                            continue;
                        }
                    }

                    if (CheckFilter(equip))
                    {
                        continue;
                    }

                    if (!string.IsNullOrWhiteSpace(searchText))
                    {
                        string name = equip.Name.ToUpper();

                        if (!name.Contains(searchText))
                        {
                            continue;
                        }
                    }

                    subList.Add(equip);
                }

                subList.Sort(SortEquip);

                await Task.Delay(100);

                RefreshAdapter();
            }
            catch (Exception ex)
            {
                ETC.LogError(ex, this);
                ETC.ShowSnackbar(snackbarLayout, Resource.String.DBList_ListingFail, Snackbar.LengthLong);
            }
        }
        private int CalcResource(string resourceType)
        {
            try
            {
                int[] values = (type == ProductType.Normal) ? new int[3] : new int[4];
                int   result = 0;

                switch (resourceType)
                {
                case "ManPower":
                    for (int i = 0; i < values.Length; ++i)
                    {
                        values[i] = manPowerNPs[i].Value;
                    }
                    break;

                case "Ammo":
                    for (int i = 0; i < values.Length; ++i)
                    {
                        values[i] = ammoNPs[i].Value;
                    }
                    break;

                case "Food":
                    for (int i = 0; i < values.Length; ++i)
                    {
                        values[i] = foodNPs[i].Value;
                    }
                    break;

                case "Parts":
                    for (int i = 0; i < values.Length; ++i)
                    {
                        values[i] = partsNPs[i].Value;
                    }
                    break;
                }

                for (int i = 0; i < values.Length; ++i)
                {
                    result += (values[i] * Convert.ToInt32(Math.Pow(10, (values.Length - (i + 1)))));
                }

                return(result);
            }
            catch (Exception ex)
            {
                ETC.LogError(ex, this);
                ETC.ShowSnackbar(snackbarLayout, Resource.String.ProductSimulatorActivity_CalcResourceError, Snackbar.LengthShort);

                return(0);
            }
        }
Exemplo n.º 16
0
        private async Task ListDoll()
        {
            var tempList = new List <Doll>();

            string searchText = searchViewText.ToUpper();

            int[] pTime  = { filterProductTime[0], filterProductTime[1] };
            int   pRange = filterProductTime[2];

            try
            {
                for (int i = 0; i < rootList.Count; ++i)
                {
                    var doll = rootList[i];

                    if ((pTime[0] + pTime[1]) != 0)
                    {
                        if (!CheckDollByProductTime(pTime, pRange, doll.ProductTime))
                        {
                            continue;
                        }
                    }

                    if (CheckFilter(doll))
                    {
                        continue;
                    }

                    if (!string.IsNullOrWhiteSpace(searchText))
                    {
                        if (!doll.Name.ToUpper().Contains(searchText))
                        {
                            continue;
                        }
                    }

                    tempList.Add(doll);
                }

                subList.Clear();
                subList.AddRange(tempList);
                subList.Sort(SortDoll);

                await Task.Delay(100);

                RefreshAdapter();
            }
            catch (Exception ex)
            {
                ETC.LogError(ex, this);
                ETC.ShowSnackbar(snackbarLayout, Resource.String.DBList_ListingFail, Snackbar.LengthLong);
            }
        }
Exemplo n.º 17
0
        private void InitSortBox()
        {
            string[] sortTypeList =
            {
                Resources.GetString(Resource.String.Sort_SortMethod_Name),
                Resources.GetString(Resource.String.Sort_SortMethod_Number),
                Resources.GetString(Resource.String.Sort_SortMethod_ProductTime),
                Resources.GetString(Resource.String.Sort_SortMethod_HP),
                Resources.GetString(Resource.String.Sort_SortMethod_FR),
                Resources.GetString(Resource.String.Sort_SortMethod_EV),
                Resources.GetString(Resource.String.Sort_SortMethod_AC),
                Resources.GetString(Resource.String.Sort_SortMethod_AS),
            };

            try
            {
                View v = LayoutInflater.Inflate(Resource.Layout.CommonSorterLayout, null);

                var adapter = new ArrayAdapter(this, Resource.Layout.SpinnerListLayout, sortTypeList);
                adapter.SetDropDownViewResource(Resource.Layout.SpinnerListLayout);

                var sortSpinner = v.FindViewById <Spinner>(Resource.Id.CommonSortSpinner);

                sortSpinner.Adapter = adapter;
                sortSpinner.SetSelection((int)sortType);

                switch (sortOrder)
                {
                default:
                case SortOrder.Ascending:
                    v.FindViewById <RadioButton>(Resource.Id.CommonSortOrderAscending).Checked = true;
                    break;

                case SortOrder.Descending:
                    v.FindViewById <RadioButton>(Resource.Id.CommonSortOrderDescending).Checked = true;
                    break;
                }

                var filterBox = new AndroidX.AppCompat.App.AlertDialog.Builder(this, ETC.dialogBGVertical);
                filterBox.SetTitle(Resource.String.DBList_SortBoxTitle);
                filterBox.SetView(v);
                filterBox.SetPositiveButton(Resource.String.AlertDialog_Set, delegate { ApplySort(v); });
                filterBox.SetNegativeButton(Resource.String.AlertDialog_Cancel, delegate { });
                filterBox.SetNeutralButton(Resource.String.AlertDialog_Reset, delegate { ResetSort(); });

                filterBox.Show();
            }
            catch (Exception ex)
            {
                ETC.LogError(ex, this);
                ETC.ShowSnackbar(snackbarLayout, Resource.String.SortBox_InitError, Snackbar.LengthLong);
            }
        }
Exemplo n.º 18
0
        private async Task LoadImage(bool isRefresh = false)
        {
            await Task.Delay(100);

            try
            {
                fairyImageView.SetImageDrawable(null);
                imageDrawable?.Dispose();
                loadingLayout.Visibility = ViewStates.Visible;
                loadingIndicator.SmoothToShow();
                loadingText.SetText(Resource.String.Common_Load);

                string imageName = $"{fairy.DicNumber}_{imageNum}";
                string imagePath = Path.Combine(ETC.cachePath, "Fairy", "Normal", $"{imageName}.gfdcache");
                string url       = Path.Combine(ETC.server, "Data", "Images", "Fairy", "Normal", $"{imageName}.png");

                if (!File.Exists(imagePath) || isRefresh)
                {
                    string dTemp = Resources.GetString(Resource.String.Common_Downloading);

                    loadingText.Text = dTemp;

                    using (var wc = new WebClient())
                    {
                        wc.DownloadProgressChanged += (sender, e) => { loadingText.Text = $"{dTemp}{e.ProgressPercentage}%"; };

                        await wc.DownloadFileTaskAsync(url, imagePath);
                    }
                }

                await Task.Delay(500);

                loadingText.SetText(Resource.String.Common_Load);

                imageDrawable = await Drawable.CreateFromPathAsync(imagePath);

                fairyImageView.SetImageDrawable(imageDrawable);

                fairyNumTitle.Text = $"{imageNum} 단계";
                imageStatus.Text   = $"{fairy.Name} - {imageNum}단계";
            }
            catch (Exception ex)
            {
                ETC.LogError(ex, this);
                ETC.ShowSnackbar(snackbarLayout, Resource.String.ImageLoad_Fail, Snackbar.LengthLong, Android.Graphics.Color.DarkRed);
            }
            finally
            {
                loadingText.Text = "";
                loadingIndicator.SmoothToHide();
                loadingLayout.Visibility = ViewStates.Gone;
            }
        }
Exemplo n.º 19
0
        internal void ShowImage(int index)
        {
            int      height   = 0;
            Drawable drawable = null;

            try
            {
                imageContainer.RemoveAllViews();

                drawable = Drawable.CreateFromPath(Path.Combine(ETC.cachePath, "OldGFD", "Images", $"{lang}_{imageName[index]}.gfdcache"));
                Android.Graphics.Bitmap bitmap = ((BitmapDrawable)drawable).Bitmap;

                while (height < bitmap.Height)
                {
                    int remainHeight = bitmap.Height - height;

                    Android.Graphics.Bitmap bitmapFix;

                    if (remainHeight >= 1000)
                    {
                        bitmapFix = Android.Graphics.Bitmap.CreateBitmap(bitmap, 0, height, bitmap.Width, 1000);
                        height   += 1000;
                    }
                    else
                    {
                        bitmapFix = Android.Graphics.Bitmap.CreateBitmap(bitmap, 0, height, bitmap.Width, remainHeight);
                        height   += remainHeight;
                    }

                    ImageView iv = new ImageView(Activity)
                    {
                        LayoutParameters = new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MatchParent, ViewGroup.LayoutParams.WrapContent)
                    };
                    iv.SetImageBitmap(bitmapFix);
                    iv.SetScaleType(ImageView.ScaleType.FitXy);
                    iv.SetAdjustViewBounds(true);

                    imageContainer.AddView(iv);
                }
            }
            catch (Exception ex)
            {
                ETC.LogError(ex, Activity);
                ETC.ShowSnackbar(snackbarLayout_F, Resource.String.ImageLoad_Fail, Snackbar.LengthLong, Android.Graphics.Color.DarkRed);
            }
            finally
            {
                GC.Collect();
                drawable?.Dispose();
            }
        }
Exemplo n.º 20
0
        /*private void MainSubFAB_Click(object sender, EventArgs e)
         * {
         *  try
         *  {
         *      FloatingActionButton fab = sender as FloatingActionButton;
         *
         *      switch (fab.Id)
         *      {
         *          case Resource.Id.SideLinkFAB1:
         *              string uri = string.Format("https://namu.wiki/w/{0}(소녀전선)", fst.Name);
         *              var intent = new Intent(this, typeof(WebBrowserActivity));
         *              intent.PutExtra("url", uri);
         *              StartActivity(intent);
         *              OverridePendingTransition(Android.Resource.Animation.FadeIn, Android.Resource.Animation.FadeOut);
         *              break;
         *          case Resource.Id.SideLinkFAB2:
         *              string uri2 = string.Format("http://gf.inven.co.kr/dataninfo/dolls/detail.php?d=126&c={0}", FSTDicNum);
         *              var intent2 = new Intent(this, typeof(WebBrowserActivity));
         *              intent2.PutExtra("url", uri2);
         *              StartActivity(intent2);
         *              OverridePendingTransition(Android.Resource.Animation.FadeIn, Android.Resource.Animation.FadeOut);
         *              break;
         *          case Resource.Id.SideLinkFAB3:
         *              string uri3 = string.Format("https://girlsfrontline.kr/doll/{0}", FSTDicNum);
         *              var intent3 = new Intent(this, typeof(WebBrowserActivity));
         *              intent3.PutExtra("url", uri3);
         *              StartActivity(intent3);
         *              OverridePendingTransition(Android.Resource.Animation.FadeIn, Android.Resource.Animation.FadeOut);
         *              break;
         *      }
         *  }
         *  catch (Exception ex)
         *  {
         *      ETC.LogError(ex, this);
         *      ETC.ShowSnackbar(snackbarLayout, Resource.String.SideLinkOpen_Fail, Snackbar.LengthShort, Android.Graphics.Color.DarkRed);
         *  }
         * }*/

        // Not Use Now
        private void FSTDBDetailSmallImage_Click(object sender, EventArgs e)
        {
            try
            {
                var fstImageViewer = new Intent(this, typeof(DollDBImageViewer));
                fstImageViewer.PutExtra("Data", fst.Name);
                StartActivity(fstImageViewer);
                OverridePendingTransition(Android.Resource.Animation.FadeIn, Android.Resource.Animation.FadeOut);
            }
            catch (Exception ex)
            {
                ETC.LogError(ex, this);
                ETC.ShowSnackbar(snackbarLayout, Resource.String.ImageViewer_ActivityOpenError, Snackbar.LengthShort, Android.Graphics.Color.DarkRed);
            }
        }
Exemplo n.º 21
0
        private void ResetSort()
        {
            try
            {
                sortType  = SortType.Name;
                sortOrder = SortOrder.Ascending;

                _ = ListDoll();
            }
            catch (Exception ex)
            {
                ETC.LogError(ex, this);
                ETC.ShowSnackbar(snackbarLayout, Resource.String.DBList_FilterBoxResetFail, Snackbar.LengthLong);
            }
        }
Exemplo n.º 22
0
        internal void ShowImage(int index)
        {
            string imagePath = Path.Combine(ETC.cachePath, "GuideBook", "Images", $"{lang}_{imageName[index]}.gfdcache");

            try
            {
                guideBookImageView.SetImageDrawable(Android.Graphics.Drawables.Drawable.CreateFromPath(imagePath));
                GC.Collect();
            }
            catch (Exception ex)
            {
                ETC.LogError(ex, Activity);
                ETC.ShowSnackbar(snackbarLayoutF, Resource.String.ImageLoad_Fail, Snackbar.LengthLong, Android.Graphics.Color.DarkRed);
            }
        }
Exemplo n.º 23
0
        private void EventButton_Click(object sender, EventArgs e)
        {
            try
            {
                Button bt = sender as Button;

                var intent = new Intent(this, typeof(WebBrowserActivity));
                intent.PutExtra("url", eventURLs[Convert.ToInt32(bt.Tag)]);
                StartActivity(intent);
                OverridePendingTransition(Android.Resource.Animation.FadeIn, Android.Resource.Animation.FadeOut);
            }
            catch (Exception ex)
            {
                ETC.LogError(ex, this);
                ETC.ShowSnackbar(snackbarLayout, Resource.String.MenuAccess_Fail, Snackbar.LengthLong, Android.Graphics.Color.DarkRed);
            }
        }
Exemplo n.º 24
0
        private void CreateListObject()
        {
            try
            {
                foreach (DataRow dr in ETC.dollList.Rows)
                {
                    rootList.Add(new Doll(dr));
                }

                rootList.TrimExcess();
            }
            catch (Exception ex)
            {
                ETC.LogError(ex, this);
                ETC.ShowSnackbar(snackbarLayout, Resource.String.Initialize_List_Fail, Snackbar.LengthShort);
            }
        }
Exemplo n.º 25
0
        private async Task InitProcess()
        {
            try
            {
                if (CheckImage())
                {
                    await DownloadShortGuideImage();
                }

                ShowImage(0);
                _ = CheckUpdate();
            }
            catch (Exception ex)
            {
                ETC.LogError(ex, Activity);
                ETC.ShowSnackbar(snackbarLayoutF, "Error InitProcess", Snackbar.LengthShort);
            }
        }
Exemplo n.º 26
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            try
            {
                base.OnCreate(savedInstanceState);

                if (ETC.useLightTheme)
                {
                    SetTheme(Resource.Style.GFS_Toolbar_Light);
                }

                // Create your application here
                SetContentView(Resource.Layout.DBMainLayout);

                canRefresh = Preferences.Get("DBListImageShow", false);

                toolbar    = FindViewById <AndroidX.AppCompat.Widget.Toolbar>(Resource.Id.DBMainToolbar);
                searchView = FindViewById <AndroidX.AppCompat.Widget.SearchView>(Resource.Id.DBSearchView);
                searchView.QueryTextChange += (sender, e) =>
                {
                    searchViewText = e.NewText;

                    _ = ListItem();
                };
                recyclerView = FindViewById <RecyclerView>(Resource.Id.DBRecyclerView);
                recyclerView.SetLayoutManager(new LinearLayoutManager(this));
                snackbarLayout = FindViewById <CoordinatorLayout>(Resource.Id.DBSnackbarLayout);

                SetSupportActionBar(toolbar);
                SupportActionBar.SetTitle(Resource.String.DollDBMainActivity_Title);
                SupportActionBar.SetDisplayHomeAsUpEnabled(true);

                /*if ((ETC.locale.Language == "ko") && (ETC.sharedPreferences.GetBoolean("Help_DBList", true)))
                 * {
                 *  ETC.RunHelpActivity(this, "DBList");
                 * }*/
            }
            catch (Exception ex)
            {
                ETC.LogError(ex, this);
                ETC.ShowSnackbar(snackbarLayout, Resource.String.Activity_OnCreateError, Snackbar.LengthShort, Android.Graphics.Color.DeepPink);
            }
        }
Exemplo n.º 27
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            try
            {
                base.OnCreate(savedInstanceState);

                // Create your application here
                SetContentView(Resource.Layout.SettingMainLayout);

                SnackbarLayout = FindViewById <CoordinatorLayout>(Resource.Id.SettingSnackbarLayout);

                FragmentManager.BeginTransaction().Replace(Resource.Id.SettingFragmentContainer, new HiddenSettingFragment(), null).Commit();
            }
            catch (Exception ex)
            {
                ETC.LogError(ex, this);
                ETC.ShowSnackbar(SnackbarLayout, Resource.String.Activity_OnCreateError, Snackbar.LengthLong, Android.Graphics.Color.DarkRed);
            }
        }
Exemplo n.º 28
0
        private void ApplyFilter(View view)
        {
            try
            {
                for (int i = 0; i < typeFilters.Length; ++i)
                {
                    filterType[i] = view.FindViewById <CheckBox>(typeFilters[i]).Checked;
                }

                CheckApplyFilter();

                _ = ListFST();
            }
            catch (Exception ex)
            {
                ETC.LogError(ex, this);
                ETC.ShowSnackbar(snackbarLayout, Resource.String.DBList_FilterBoxApplyFail, Snackbar.LengthLong);
            }
        }
Exemplo n.º 29
0
        private void HelpFAB_Click(object sender, EventArgs e)
        {
            try
            {
                string url = (sender as FloatingActionButton).Id switch
                {
                    Resource.Id.DiscordFAB => "https://discord.gg/sWRw4MN",
                    _ => "",
                };

                var intent = new Intent(Intent.ActionView, Android.Net.Uri.Parse(url));
                StartActivity(intent);
            }
            catch (Exception ex)
            {
                ETC.LogError(ex, this);
                ETC.ShowSnackbar(snackbarLayout, Resource.String.SideLinkOpen_Fail, Snackbar.LengthShort, Android.Graphics.Color.DarkRed);
            }
        }
Exemplo n.º 30
0
        private async Task ListFST()
        {
            subList.Clear();

            string searchText = searchViewText.ToUpper();

            try
            {
                for (int i = 0; i < rootList.Count; ++i)
                {
                    FST fst = rootList[i];

                    if (CheckFilter(fst))
                    {
                        continue;
                    }

                    if (!string.IsNullOrWhiteSpace(searchText))
                    {
                        string name = fst.Name.ToUpper();

                        if (!name.Contains(searchText))
                        {
                            continue;
                        }
                    }

                    subList.Add(fst);
                }

                subList.Sort(SortFST);

                await Task.Delay(100);

                RefreshAdapter();
            }
            catch (Exception ex)
            {
                ETC.LogError(ex, this);
                ETC.ShowSnackbar(snackbarLayout, Resource.String.DBList_ListingFail, Snackbar.LengthLong);
            }
        }