internal async void Adapter_ItemClick(object sender, int e) { await Task.Delay(10); try { switch (e) { case 0: if (ETC.dbVersion != 0) { Activity.StartActivity(typeof(ProductSimulatorCategoryActivity)); Activity.OverridePendingTransition(Android.Resource.Animation.FadeIn, Android.Resource.Animation.FadeOut); } else { //ETC.ShowSnackbar(snackbarLayout, Resource.String.NoDBFiles, Snackbar.LengthShort, Android.Graphics.Color.DarkRed); Toast.MakeText(Activity, Resource.String.NoDBFiles, ToastLength.Short).Show(); } break; case 1: Activity.StartActivity(typeof(CartoonActivity)); Activity.OverridePendingTransition(Android.Resource.Animation.FadeIn, Android.Resource.Animation.FadeOut); break; case 2: //ETC.ShowSnackbar(snackbarLayout, Resource.String.DevMode, Snackbar.LengthShort); Activity.StartActivity(typeof(GFOSTPlayerActivity)); Activity.OverridePendingTransition(Android.Resource.Animation.FadeIn, Android.Resource.Animation.FadeOut); break; case 3: Activity.StartActivity(typeof(GFPVListActivity)); Activity.OverridePendingTransition(Android.Resource.Animation.FadeIn, Android.Resource.Animation.FadeOut); break; case 4: Activity.StartActivity(typeof(GFAnimationActivity)); Activity.OverridePendingTransition(Android.Resource.Animation.FadeIn, Android.Resource.Animation.FadeOut); break; default: //ETC.ShowSnackbar(snackbarLayout, Resource.String.AbnormalAccess, Snackbar.LengthShort, Android.Graphics.Color.DarkRed); Toast.MakeText(Activity, Resource.String.AbnormalAccess, ToastLength.Short).Show(); break; } } catch (Exception ex) { ETC.LogError(ex, Activity); //ETC.ShowSnackbar(snackbarLayout, Resource.String.MenuAccess_Fail, Snackbar.LengthLong, Android.Graphics.Color.DarkRed); Toast.MakeText(Activity, "Menu access fail", ToastLength.Short).Show(); } }
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); } }
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 Initialize() { try { InitDeveloperInfo(); _ = CheckAppVersion(); } catch (Exception ex) { ETC.LogError(ex, this); } }
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); } }
private void AreaList_ItemSelected(object sender, AdapterView.ItemSelectedEventArgs e) { try { AreaDR = ETC.freeOPList.Rows[e.Position]; CalcCount(nowLevel.Value, targetLevel.Value, dollDummy.Value, warCount.Value); } catch (Exception ex) { ETC.LogError(ex, Activity); } }
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); } }
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); } }
private void DrawerListView_ItemClick(object sender, AdapterView.ItemClickEventArgs e) { try { ((OldGFDViewerScreen)oldGFDViewerF).ShowImage(e.Position); mainDrawerLayout.CloseDrawer(GravityCompat.Start); } catch (Exception ex) { ETC.LogError(ex, this); } }
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; } }
protected override async void OnCreate(Bundle savedInstanceState) { try { base.OnCreate(savedInstanceState); if (ETC.useLightTheme) { SetTheme(Resource.Style.GFS_Toolbar_Light); } // Create your application here SetContentView(Resource.Layout.DollDBImageViewer); string[] temp = Intent.GetStringExtra("Data").Split(';'); modIndex = int.Parse(temp[1]); doll = new Doll(ETC.FindDataRow(ETC.dollList, "DicNumber", int.Parse(temp[0]))); censorType = doll.HasCensored ? doll.CensorType : null; toolbar = FindViewById <AndroidX.AppCompat.Widget.Toolbar>(Resource.Id.DollDBImageViewerMainToolbar); loadingLayout = FindViewById <RelativeLayout>(Resource.Id.DollDBImageViewerLoadingLayout); loadingIndicator = FindViewById <AVLoadingIndicatorView>(Resource.Id.DollDBImageViewerLoadingIndicatorView); loadingText = FindViewById <TextView>(Resource.Id.DollDBImageViewerLoadingIndicatorExplainText); dollImageView = FindViewById <PhotoView>(Resource.Id.DollDBImageViewerImageView); snackbarLayout = FindViewById <CoordinatorLayout>(Resource.Id.DollDBImageViewerSnackbarLayout); costumeList = FindViewById <Spinner>(Resource.Id.DollDBImageViewerCostumeList); costumeList.ItemSelected += (sender, e) => { isDamage = false; costumeIndex = e.Position; censorMenuItem.SetVisible(CheckCensorType()); _ = LoadImage(costumeIndex, false); }; imageStatus = FindViewById <TextView>(Resource.Id.DollDBImageViewerImageStatus); SetSupportActionBar(toolbar); SupportActionBar.SetDisplayShowTitleEnabled(false); SupportActionBar.SetDisplayHomeAsUpEnabled(true); await InitializeProcess(); LoadCostumeList(); _ = LoadImage(0, false); } catch (Exception ex) { ETC.LogError(ex, this); Toast.MakeText(this, Resource.String.Activity_OnCreateError, ToastLength.Short).Show(); } }
private void MainNavigationView_NavigationItemSelected(object sender, NavigationView.NavigationItemSelectedEventArgs e) { try { string title = ""; ft = SupportFragmentManager.BeginTransaction(); switch (e.MenuItem.ItemId) { case Resource.Id.CalcNavigation_ExpItem: ft.Replace(Resource.Id.CalcFragmentContainer, expItemCalcF, "ExpItemCalc"); title = Resources.GetString(Resource.String.TitleName_ExpItemCalc); break; case Resource.Id.CalcNavigation_Core: ft.Replace(Resource.Id.CalcFragmentContainer, coreCalcF, "CoreCalc"); title = Resources.GetString(Resource.String.TitleName_CoreCalc); break; case Resource.Id.CalcNavigation_CoalitionGrade: ft.Replace(Resource.Id.CalcFragmentContainer, coalitionGradeF, "CoalitionGradeCalc"); title = Resources.GetString(Resource.String.TitleName_CoalitionGrade); break; case Resource.Id.CalcNavigation_SkillTraining: ft.Replace(Resource.Id.CalcFragmentContainer, skillTrainingCalcF, "SkillTraining"); title = Resources.GetString(Resource.String.TitleName_SkillTrainingCalc); break; case Resource.Id.CalcNavigation_FSTGradeUp: ft.Replace(Resource.Id.CalcFragmentContainer, fstGradeUpF, "FSTGradeUp"); title = Resources.GetString(Resource.String.TitleName_FSTGradeUpCalc); break; case Resource.Id.CalcNavigation_AreaExp: ft.Replace(Resource.Id.CalcFragmentContainer, areaExpCalcF, "AreaExpCalc"); title = Resources.GetString(Resource.String.TitleName_AreaExpCalc); break; } ft.Commit(); mainDrawerLayout.CloseDrawer(GravityCompat.Start); SupportActionBar.Title = title; } catch (Exception ex) { ETC.LogError(ex, this); Toast.MakeText(this, Resource.String.ChangeMode_Error, ToastLength.Short).Show(); } }
private void InitList() { try { imageAdapter = new ArrayAdapter(this, Android.Resource.Layout.SimpleListItem1, shortGuideImageList); drawerListView.Adapter = imageAdapter; } catch (Exception ex) { ETC.LogError(ex, this); Toast.MakeText(this, "Fail List Process", ToastLength.Short).Show(); } }
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(); } }
public override void OnBindViewHolder(RecyclerView.ViewHolder holder, int position) { var vh = holder as MainRecyclerViewHolder; try { vh.Title.Text = title[position]; } catch (Exception ex) { ETC.LogError(ex, context); Toast.MakeText(context, "Error Create View", ToastLength.Short).Show(); } }
/// <summary> /// Calculate require fragment /// </summary> /// <param name="start">Set FST now grade</param> /// <param name="target">Set FST target grade</param> private void CalcFragment(int start, int target) { try { int requireFragment = fragmentCount[target] - fragmentCount[start]; resultFragment.Text = $"{requireFragment} {Resources.GetString(Resource.String.Calc_FSTGradeUp_DefaultFragmentResultText)}"; } catch (Exception ex) { ETC.LogError(ex, Activity); Toast.MakeText(Activity, Resource.String.InternalCalc_Error, ToastLength.Long).Show(); } }
protected override void AttachBaseContext(Context @base) { try { ETC.BasicInitializeApp(@base); base.AttachBaseContext(ETC.baseContext); } catch (Exception ex) { ETC.LogError(ex); Toast.MakeText(this, "Fail Basic Initialize", ToastLength.Long).Show(); } }
public override bool OnCreateOptionsMenu(IMenu menu) { try { MenuInflater.Inflate(Resource.Menu.OldGFDMenu, menu); } catch (Exception ex) { ETC.LogError(ex, this); Toast.MakeText(this, "Cannot create option menu", ToastLength.Short).Show(); } return(base.OnCreateOptionsMenu(menu)); }
/// <summary> /// Calculate require data patch /// </summary> /// <param name="start">Set FST now version</param> /// <param name="target">Set FST target version</param> private void CalcDataPatch(int start, int target) { try { int requireDataPatch = dataPatchCount[target] - dataPatchCount[start]; resultDataPatch.Text = $"{requireDataPatch} {Resources.GetString(Resource.String.Calc_FSTGradeUp_DefaultDataPatchText)}"; } catch (Exception ex) { ETC.LogError(ex, Activity); Toast.MakeText(Activity, Resource.String.InternalCalc_Error, ToastLength.Long).Show(); } }
private bool CheckDeviceNetwork() { try { var network = Connectivity.NetworkAccess; return(network == NetworkAccess.Internet); } catch (Exception ex) { ETC.LogError(ex, this); return(false); } }
private void FairyDBDetailSmallImage_Click(object sender, EventArgs e) { try { var fairyImageViewer = new Intent(this, typeof(FairyDBImageViewer)); fairyImageViewer.PutExtra("Keyword", fairy.Name); StartActivity(fairyImageViewer); OverridePendingTransition(Android.Resource.Animation.FadeIn, Android.Resource.Animation.FadeOut); } catch (Exception ex) { ETC.LogError(ex, this); Toast.MakeText(this, Resource.String.ImageViewer_ActivityOpenError, ToastLength.Long).Show(); } }
/*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); } }
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); } }
private void CheckPermission(string permission) { try { if (CheckSelfPermission(permission) == Permission.Denied) { RequestPermissions(new string[] { permission }, 0); } } catch (Exception ex) { ETC.LogError(ex); Toast.MakeText(this, Resource.String.Permission_Error, ToastLength.Short).Show(); } }
private void Adapter_ItemClick(object sender, int e) { try { ListLink(e, linkDic); dialogListView.Adapter = new ArrayAdapter <string>(this, Android.Resource.Layout.SimpleListItem1, linkDic.Keys.ToArray()); sheetDialog.Show(); } catch (Exception ex) { ETC.LogError(ex, this); } }
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); } }
private void LevelSelector_ValueChanged(object sender, NumberPicker.ValueChangeEventArgs e) { NumberPicker np = sender as NumberPicker; try { switch (np.Id) { case Resource.Id.CalcReportStartLevel when expTypeList.SelectedItemPosition == 0: targetLevel.MinValue = e.NewVal; nowExpEditText.Text = levelExp[np.Value - 1].ToString(); break; case Resource.Id.CalcReportStartLevel when expTypeList.SelectedItemPosition == 1: targetLevel.MinValue = e.NewVal; nowExpEditText.Text = levelExpFairy[np.Value - 1].ToString(); break; case Resource.Id.CalcReportStartLevel when expTypeList.SelectedItemPosition == 2: targetLevel.MinValue = e.NewVal; nowExpEditText.Text = levelExpFST[np.Value - 1].ToString(); break; case Resource.Id.CalcReportEndLevel: startLevel.MaxValue = e.NewVal; break; } switch (expTypeList.SelectedItemPosition) { case 0: CalcReport(targetLevel.Value); break; case 1: CalcReportFairy(targetLevel.Value); break; case 2: CalcReportFST(targetLevel.Value, trainerLevel.Value); break; } } catch (Exception ex) { ETC.LogError(ex, Activity); } }
protected override void OnCreate(Bundle savedInstanceState) { base.OnCreate(savedInstanceState); if (ETC.useLightTheme) { SetTheme(Resource.Style.GFS_NoActionBar_Light); } // Create your application here SetContentView(Resource.Layout.CalcMainLayout); ETC.LoadDBSync(ETC.skillTrainingList, "SkillTraining.gfs", true); ETC.LoadDBSync(ETC.freeOPList, "FreeOP.gfs", true); // Set Main Drawer mainDrawerLayout = FindViewById <DrawerLayout>(Resource.Id.Calc_MainDrawerLayout); mainDrawerLayout.DrawerOpened += delegate { SupportActionBar.SetHomeAsUpIndicator(Resource.Drawable.MenuOpen); }; mainDrawerLayout.DrawerClosed += delegate { SupportActionBar.SetHomeAsUpIndicator(Resource.Drawable.Menu); }; mainNavigationView = FindViewById <NavigationView>(Resource.Id.Calc_NavigationView); mainNavigationView.NavigationItemSelected += MainNavigationView_NavigationItemSelected; // Set ActionBar SetSupportActionBar(FindViewById <AndroidX.AppCompat.Widget.Toolbar>(Resource.Id.Calc_Toolbar)); SupportActionBar.SetDisplayHomeAsUpEnabled(true); SupportActionBar.SetDisplayShowTitleEnabled(true); SupportActionBar.SetHomeButtonEnabled(true); SupportActionBar.Title = Resources.GetString(Resource.String.TitleName_ExpItemCalc); SupportActionBar.SetHomeAsUpIndicator(Resource.Drawable.Menu); // Set Fragment ft = SupportFragmentManager.BeginTransaction(); expItemCalcF = new ExpItemCalc(); coreCalcF = new DummyCore(); coalitionGradeF = new CoalitionGrade(); skillTrainingCalcF = new SkillTraining(); fstGradeUpF = new FSTGradeUp(); areaExpCalcF = new AreaExpCalc(); ft.Add(Resource.Id.CalcFragmentContainer, expItemCalcF, "ExpItemCalc"); ft.Commit(); }
public override void OnBindViewHolder(RecyclerView.ViewHolder holder, int position) { FairyListViewHolder vh = holder as FairyListViewHolder; var item = items[position]; try { int TypeIconId = 0; switch (item.Type) { case string s when s == ETC.Resources.GetString(Resource.String.Common_FairyType_Combat): TypeIconId = Resource.Drawable.Fairy_Combat; break; case string s when s == ETC.Resources.GetString(Resource.String.Common_FairyType_Strategy): TypeIconId = Resource.Drawable.Fairy_Strategy; break; default: TypeIconId = Resource.Drawable.Fairy_Combat; break; } vh.TypeIcon.SetImageResource(TypeIconId); if (Preferences.Get("DBListImageShow", false)) { vh.SmallImage.Visibility = ViewStates.Visible; string FilePath = System.IO.Path.Combine(ETC.cachePath, "Fairy", "Normal_Crop", $"{item.DicNumber}.gfdcache"); if (System.IO.File.Exists(FilePath) == true) { vh.SmallImage.SetImageDrawable(Android.Graphics.Drawables.Drawable.CreateFromPath(FilePath)); } } else { vh.SmallImage.Visibility = ViewStates.Gone; } vh.Name.Text = item.Name; vh.ProductTime.Text = ETC.CalcTime(item.ProductTime); } catch (Exception ex) { ETC.LogError(ex, context); Toast.MakeText(context, "Error Create View", ToastLength.Short).Show(); } }