private void SetRecyclerViewAdapters() { try { MAdapter = new FeelingsAdapter(this); LayoutManager = new GridLayoutManager(this, 3); MRecycler.SetLayoutManager(LayoutManager); MRecycler.AddItemDecoration(new GridSpacingItemDecoration(3, 3, true)); MRecycler.SetAdapter(MAdapter); MRecycler.HasFixedSize = true; MRecycler.SetItemViewCacheSize(8); MRecycler.GetLayoutManager().ItemPrefetchEnabled = true; } catch (Exception e) { Console.WriteLine(e); } }
private void SetRecyclerViewAdapters() { try { MAdapter = new FeelingsAdapter(this); LayoutManager = new GridLayoutManager(this, 3); MRecycler.SetLayoutManager(LayoutManager); MRecycler.AddItemDecoration(new GridSpacingItemDecoration(3, 3, true)); MRecycler.SetAdapter(MAdapter); MRecycler.HasFixedSize = true; MRecycler.SetItemViewCacheSize(10); MRecycler.GetLayoutManager().ItemPrefetchEnabled = true; } catch (Exception e) { Methods.DisplayReportResultTrack(e); } }
private void DestroyBasic() { try { MAdView?.Destroy(); InterstitialAd?.Destroy(); MAdapter = null; SwipeRefreshLayout = null; MRecycler = null; EmptyStateLayout = null; MAdView = null; InterstitialAd = null; } catch (Exception e) { Console.WriteLine(e); } }
private void DestroyBasic() { try { MAdView?.Destroy(); InterstitialAd?.Destroy(); MAdapter = null !; SwipeRefreshLayout = null !; MRecycler = null !; EmptyStateLayout = null !; MAdView = null !; InterstitialAd = null !; } catch (Exception e) { Methods.DisplayReportResultTrack(e); } }
protected override void OnCreate(Bundle savedInstanceState) { try { base.OnCreate(savedInstanceState); IMethods.IApp.FullScreenApp(this); var view = MyContextWrapper.GetContentView(this, Settings.Lang, Resource.Layout.Feelings_Layout); if (view != null) { SetContentView(view); } else { SetContentView(Resource.Layout.Feelings_Layout); } var ToolBar = FindViewById <Toolbar>(Resource.Id.toolbar); if (ToolBar != null) { ToolBar.Title = GetText(Resource.String.Lbl_Feeling); SetSupportActionBar(ToolBar); SupportActionBar.SetDisplayShowCustomEnabled(true); SupportActionBar.SetDisplayHomeAsUpEnabled(true); SupportActionBar.SetHomeButtonEnabled(true); SupportActionBar.SetDisplayShowHomeEnabled(true); } FeelingsRecylerView = FindViewById <RecyclerView>(Resource.Id.Recyler); FeelingsAdapter = new FeelingsAdapter(this); FeelingsRecylerView.SetLayoutManager(new GridLayoutManager(this, 3)); FeelingsRecylerView.AddItemDecoration(new GridSpacingItemDecoration(3, 3, true)); FeelingsRecylerView.SetAdapter(FeelingsAdapter); } catch (Exception e) { Crashes.TrackError(e); } }
private void FeelingsAdapter_ItemClick(object sender, FeelingsAdapterClickEventArgs adapterClickEvents) { try { var position = adapterClickEvents.Position; if (position >= 0) { var item = FeelingsAdapter.GetItem(position); if (item != null) { var resultIntent = new Intent(); resultIntent.PutExtra("Feelings", item.FeelingText); SetResult(Result.Ok, resultIntent); Finish(); } } } catch (Exception e) { Crashes.TrackError(e); } }