public MasonryAdapter(List <Product> products, Context context) { Mproducts = products; this.mContext = context; imageLoader = ImageLoader.Instance; imageLoader.Init(ImageLoaderConfiguration.CreateDefault(this.mContext)); }
public override void OnCreate() { base.OnCreate(); // Use default options var config = ImageLoaderConfiguration.CreateDefault(ApplicationContext); // Initialize ImageLoader with configuration. //ImageLoader.Instance.Init(config); }
public EventAdapter(List <EventList> list, Activity CurrentActivity) { mList = list; activity = CurrentActivity; imageLoader = ImageLoader.Instance; imageLoader.Init(ImageLoaderConfiguration.CreateDefault(activity)); options = new DisplayImageOptions.Builder() .CacheInMemory(true) .CacheOnDisk(true).Build(); }
public override void OnCreate() { base.OnCreate(); MobileCenter.Start("0ed255d2-40ed-4380-8ef4-daeae3f56632", typeof(Analytics), typeof(Crashes)); var config = ImageLoaderConfiguration.CreateDefault(ApplicationContext); // Initialize ImageLoader with configuration. ImageLoader.Instance.Init(config); RegisterActivityLifecycleCallbacks(this); }
public override void OnCreate() { base.OnCreate(); try { SetupDataFields(); ImageOptions = new DisplayImageOptions.Builder() .CacheInMemory(true) .CacheOnDisk(true) .ResetViewBeforeLoading() .ImageScaleType(UniversalImageLoader.Core.Assist.ImageScaleType.Exactly) .BitmapConfig(Android.Graphics.Bitmap.Config.Rgb565) .Build(); Log.Info(TAG, "OnCreate: Set up default options for Image Loader - cached in memory and cached on disk both true"); ImageLoaderConfig = new ImageLoaderConfiguration.Builder(Context) .DefaultDisplayImageOptions(ImageOptions) .Build(); ImageLoader.Instance.Init(ImageLoaderConfig); Log.Info(TAG, "OnCreate: Initialised Image Loader with default options set"); CurrentIsoLanguageCode = Locale.Default.ISO3Language; CurrentIsoCountryCode = Locale.Default.ISO3Country; Log.Info(TAG, "OnCreate: Determined Iso Language code - " + CurrentIsoLanguageCode); Log.Info(TAG, "OnCreate: Determined Iso Country code - " + CurrentIsoCountryCode); //grab current application permissions ApplicationPermissions = PermissionsHelper.SetupDefaultPermissionList(this); //******* thread task start Log.Info(TAG, "OnCreate: Initiating runnable thread..."); new Thread(new Runnable ( () => { Log.Info(TAG, "Runnable: Starting task ThreadTaskInitialisation"); ThreadTaskInitialisation(BaseContext); Log.Info(TAG, "Runnable: Finished runnable task"); } ) ).Start(); Log.Info(TAG, "OnCreate: In Main UI thread following initialisation of runnable task"); // thread task end } catch (System.Exception e) { Log.Error(TAG, "OnCreate: Error during GlobalData creation - " + e.Message); } }
protected override void OnCreate(Bundle savedInstanceState) { base.OnCreate(savedInstanceState); var config = ImageLoaderConfiguration.CreateDefault(ApplicationContext); // Initialize ImageLoader with configuration. ImageLoader.Instance.Init(config); drawerLayout = FindViewById <DrawerLayout>(Resource.Id.drawer_layout); SupportActionBar.SetHomeAsUpIndicator(Resource.Drawable.ic_menu); navigationView = FindViewById <NavigationView>(Resource.Id.nav_view); navigationView.NavigationItemSelected += (sender, e) => { if (previousItem != null) { previousItem.SetChecked(false); } navigationView.SetCheckedItem(e.MenuItem.ItemId); previousItem = e.MenuItem; switch (e.MenuItem.ItemId) { case Resource.Id.nav_home: ListItemClicked(0); break; case Resource.Id.nav_friends: ListItemClicked(1); break; case Resource.Id.nav_profile: ListItemClicked(2); break; } drawerLayout.CloseDrawers(); }; //if first time you will want to go ahead and click first item. if (savedInstanceState == null) { ListItemClicked(0); navigationView.SetCheckedItem(Resource.Id.nav_home); } }
protected override async void OnCreate(Bundle bundle) { try { base.OnCreate(bundle); ViewModel.Title = "Расписание"; Title = ViewModel.Title; _drawerLayout = FindViewById <DrawerLayout>(Resource.Id.drawer_layout); SupportActionBar.SetHomeAsUpIndicator(Resource.Drawable.ic_menu); var config = ImageLoaderConfiguration.CreateDefault(ApplicationContext); if (!ImageLoader.Instance.IsInited) { ImageLoader.Instance.Init(config); } } catch (Exception ex) { var m = ex.Message; } //// Initialize ImageLoader with configuration. var imageLoader = ImageLoader.Instance; var headerMenu = FindViewById <NavigationView>(Resource.Id.nav_view).GetHeaderView(0); var photoUser = headerMenu.FindViewById <ImageView>(Resource.Id.user_image); var nameUser = headerMenu.FindViewById <TextView>(Resource.Id.user_name); await ViewModel.Initialize() .ContinueWith( task => { RunOnUiThread( () => { imageLoader.DisplayImage(ViewModel?.CurrentUser?.photo_100, photoUser); }); }); IProfileService profileService; Mvx.TryResolve(out profileService); var user = await profileService.GetUser(); nameUser.Text = user.first_name + " " + user.last_name; imageLoader.DisplayImage(user.photo_100, photoUser); _navigationView = FindViewById <NavigationView>(Resource.Id.nav_view); _navigationView.NavigationItemSelected += NavigationViewOnNavigationItemSelected; }
protected override void OnCreate(Bundle savedInstanceState) { base.OnCreate(savedInstanceState); SetContentView(Resource.Layout.HomeActivity); LocationResultPermissionCallback = GetDrops; LocationChangedCallback = OnLocationChangedCallback; var config = ImageLoaderConfiguration.CreateDefault(ApplicationContext); ImageLoader.Instance.Init(config); InitUISettings(); }
protected override async void OnCreate(Bundle bundle) { base.OnCreate(bundle); _progressLoaderService = Mvx.Resolve <IProgressLoaderService>(); _progressLoaderService.ShowProgressBar(); _imageLoader = ImageLoader.Instance; if (!_imageLoader.IsInited) { _imageLoader.Init(ImageLoaderConfiguration.CreateDefault(this)); } IProfileService profileService; var service = Mvx.TryResolve(out profileService); var user = await profileService.GetUser(); var title = user.first_name + " " + user.last_name; var birthday = user.bdate; title = string.IsNullOrWhiteSpace(title) ? "New Friend" : title; var toolbar = FindViewById <Toolbar>(Resource.Id.toolbar); SetSupportActionBar(toolbar); SupportActionBar.SetDisplayHomeAsUpEnabled(true); var collapsingToolbar = FindViewById <CollapsingToolbarLayout>(Resource.Id.collapsing_toolbar); collapsingToolbar.SetTitle(title); collapsingToolbar.SetCollapsedTitleTextColor(Color.White); collapsingToolbar.SetExpandedTitleColor(Color.White); try { _imageLoader.DisplayImage(user.photo_100, FindViewById <ImageView>(Resource.Id.imageView1)); } catch (Exception ex) { var m = ex.Message; } _buttonForCategory = (Button)FindViewById(Resource.Id.category); _buttonForShedule = (Button)FindViewById(Resource.Id.schedule); _buttonForCategory.Click += OnCategoryClick; _buttonForShedule.Click += OnSheduleClick; _saveButton = FindViewById <Button>(Resource.Id.save_button); _saveButton.Click += SaveButtonOnClick; _progressLoaderService.HideProgressBar(); }
protected override void OnCreate(Bundle bundle) { base.OnCreate(bundle); SetContentView(Resource.Layout.Main); InitImages(); var pager = FindViewById <ViewPager>(Resource.Id.pager); image_loader = ImageLoader.Instance; image_loader.Init(ImageLoaderConfiguration.CreateDefault(BaseContext)); var adapter = new ViewPagerAdapter(this, listImages, image_loader); pager.Adapter = adapter; }
private void InitImageLoader() { DisplayImageOptions defaultOptions = new DisplayImageOptions. Builder().CacheOnDisk(true). ImageScaleType(ImageScaleType.ExactlyStretched). BitmapConfig(Bitmap.Config.Rgb565). Build(); ImageLoaderConfiguration.Builder builder = new ImageLoaderConfiguration.Builder(Application.Context).DefaultDisplayImageOptions(defaultOptions); ImageLoaderConfiguration config = builder.Build(); imageLoader = ImageLoader.Instance; imageLoader.Init(config); }
//Your ListView and Adapter protected override void OnCreate(Bundle bundle) { base.OnCreate(bundle); // Set our view from the "main" layout resource SetContentView(Resource.Layout.Main); // Set your ListView and Adapter here ImageLoader imageloader = ImageLoader.Instance; imageloader.Init(ImageLoaderConfiguration.CreateDefault(this)); foreach (var card in cards) { imageloader.LoadImage(card.imageUrl, this); } }
protected override void OnCreate(Bundle savedInstanceState) { base.OnCreate(savedInstanceState); SetContentView(Resource.Layout.Shop); var config = ImageLoaderConfiguration.CreateDefault(ApplicationContext); foreach (var str in imgs) { ImageView temp_image = new ImageView(this); ImageLoader loader = ImageLoader.Instance; titles.Add(str); } GridViewAdapter adapter = new GridViewAdapter(this, images, titles); gridView = FindViewById <GridView>(Resource.Id.grid_view_image_text); gridView.Adapter = adapter; }
protected override void OnCreate(Bundle savedInstanceState) { base.OnCreate(savedInstanceState); var config = ImageLoaderConfiguration.CreateDefault(ApplicationContext); // Initialize ImageLoader with configuration. ImageLoader.Instance.Init(config); drawerLayout = FindViewById <DrawerLayout> (Resource.Id.drawer_layout); SupportActionBar.SetHomeAsUpIndicator(Resource.Drawable.ic_menu); navigationView = FindViewById <NavigationView> (Resource.Id.nav_view); navigationView.NavigationItemSelected += (sender, e) => { e.MenuItem.SetChecked(true); switch (e.MenuItem.ItemId) { case Resource.Id.nav_home: ViewModel.ShowBrowse(); break; case Resource.Id.nav_friends: //ViewModel.ShowFriends(); break; case Resource.Id.nav_profile: ViewModel.ShowProfile(); break; } drawerLayout.CloseDrawers(); }; //if first time you will want to go ahead and click first item. //if (savedInstanceState == null) { // ViewModel.ShowBrowse(); //} }
protected override async void OnCreate(Bundle savedInstanceState) { base.OnCreate(savedInstanceState); SetContentView(Resource.Layout.activity_event_detail); eventId = Intent.GetIntExtra("eventId", 0); _IEventListService = new EventListService(); eventDetail = new EventDetail(); imageLoader = ImageLoader.Instance; options = new DisplayImageOptions.Builder() .CacheInMemory(true) .CacheOnDisk(true) .Build(); imageLoader.Init(ImageLoaderConfiguration.CreateDefault(this)); InitilizeView(); eventDetail = await GetEventDetail(); if (eventDetail != null) { setUIData(); } }
protected override async void OnCreate(Bundle bundle) { try { base.OnCreate(bundle); _progressLoaderService = Mvx.Resolve <IProgressLoaderService>(); ViewModel.Title = "Мои записи"; Title = ViewModel.Title; _drawerLayout = FindViewById <DrawerLayout>(Resource.Id.drawer_layout); SupportActionBar.SetHomeAsUpIndicator(Resource.Drawable.ic_menu); var tabFree = FindViewById <RadioButton>(Resource.Id.schedule_view_segment_free); tabSelect = FindViewById <SegmentedGroup>(Resource.Id.schedule_view_segmentedControl); var tabBusy = FindViewById <RadioButton>(Resource.Id.schedule_view_segment_busy); tabSelect.Check(Resource.Id.schedule_view_segment_free); _calendarDate = DateTime.Now; _calendar = FindViewById <CalendarView>(Resource.Id.schedule_view_calendar); _calendar.DateChange += CalendarOnDateChange; _segmentedControl = FindViewById <SegmentedGroup>(Resource.Id.schedule_view_segmentedControl); _segmentedControl.CheckedChange += SegmentedControlOnCheckedChange; var config = ImageLoaderConfiguration.CreateDefault(ApplicationContext); if (!ImageLoader.Instance.IsInited) { ImageLoader.Instance.Init(config); } } catch (Exception ex) { var m = ex.Message; } //// Initialize ImageLoader with configuration. var imageLoader = ImageLoader.Instance; var headerMenu = FindViewById <NavigationView>(Resource.Id.nav_view).GetHeaderView(0); var photoUser = headerMenu.FindViewById <ImageView>(Resource.Id.user_image); var nameUser = headerMenu.FindViewById <TextView>(Resource.Id.user_name); await ViewModel.Initialize() .ContinueWith( task => { RunOnUiThread( () => { imageLoader.DisplayImage(ViewModel?.CurrentUser?.photo_100, photoUser); }); }); IProfileService profileService; Mvx.TryResolve(out profileService); var user = await profileService.GetUser(); nameUser.Text = user.first_name + " " + user.last_name; imageLoader.DisplayImage(user.photo_100, photoUser); _navigationView = FindViewById <NavigationView>(Resource.Id.nav_view); _navigationView.NavigationItemSelected += NavigationViewOnNavigationItemSelected; }
protected override void OnCreate(Bundle savedInstanceState) { var prefs = PreferenceManager.GetDefaultSharedPreferences(Application.Context); if (prefs.GetBoolean("disable_drawer_header", false)) { viewId = Resource.Layout.page_home_noheader; } base.OnCreate(savedInstanceState); var config = ImageLoaderConfiguration.CreateDefault(ApplicationContext); // Initialize ImageLoader with configuration. //ImageLoader.Instance.Init(config); DisplayImageOptions defaultOptions = new DisplayImageOptions.Builder() .CacheInMemory(true) .CacheOnDisk(true) .Build(); ImageLoaderConfiguration newConfig = new ImageLoaderConfiguration.Builder(ApplicationContext) .DefaultDisplayImageOptions(defaultOptions) .Build(); ImageLoader.Instance.Init(newConfig); UserDialogs.Init(this); MicsManager.instance = new MicsManager(); ISharedPreferencesEditor editor = prefs.Edit(); if (string.IsNullOrEmpty(prefs.GetString("notif_title", ""))) { editor.PutString("notif_title", "Sound Detected"); editor.Apply(); } if (string.IsNullOrEmpty(prefs.GetString("notif_body", ""))) { editor.PutString("notif_body", "#SOUND"); editor.Apply(); } drawerLayout = FindViewById <DrawerLayout> (Resource.Id.drawer_layout); SupportActionBar.SetHomeAsUpIndicator(Resource.Drawable.ic_menu); navigationView = FindViewById <NavigationView> (Resource.Id.nav_view); for (int i = 1; i < 6; i++) { navigationView.Menu.GetItem(i).SetCheckable(false); } navigationView.NavigationItemSelected += (sender, e) => { //e.MenuItem.SetChecked (true); e.MenuItem.SetChecked(false); //navigationView.Selected = false; switch (e.MenuItem.ItemId) { case Resource.Id.nav_home: e.MenuItem.SetChecked(true); ListItemClicked(0); break; case Resource.Id.nav_mics: ListItemClicked(1); break; case Resource.Id.nav_bt: ListItemClicked(2); break; case Resource.Id.nav_settings: ListItemClicked(3); break; case Resource.Id.nav_help: ListItemClicked(4); break; case Resource.Id.nav_feedback: ListItemClicked(5); break; } drawerLayout.CloseDrawers(); }; //if first time you will want to go ahead and click first item. if (savedInstanceState == null) { //SupportActionBar.SetWindowTitle("Notifications"); ListItemClicked(-1); } }
// Activity mcontext; public override void OnCreate() { base.OnCreate(); Crashes.GetErrorAttachments = GetErrorAttachments; // Distribute.ReleaseAvailable = OnReleaseAvailable; // This should come before MobileCenter.Start() is called Push.PushNotificationReceived += (sender, e) => { // Add the notification message and title to the message var summary = $"Push notification received:" + $"\n\tNotification title: {e.Title}" + $"\n\tMessage: {e.Message}"; // If there is custom data associated with the notification, // print the entries if (e.CustomData != null) { summary += "\n\tCustom data:\n"; foreach (var key in e.CustomData.Keys) { summary += $"\t\t{key} : {e.CustomData[key]}\n"; } } // Send the notification summary to debug output //System.Diagnostics.Debug.WriteLine(summary); Toast.MakeText(this, summary, ToastLength.Short).Show(); }; AppCenter.Start("6b55d6ce-52b2-4255-a86f-1dd6a3eb4bad", typeof(Analytics), typeof(Crashes), typeof(Push), typeof(Distribute)); var config = ImageLoaderConfiguration.CreateDefault(ApplicationContext); // Initialize ImageLoader with configuration. ImageLoader.Instance.Init(config); RegisterActivityLifecycleCallbacks(this); Analytics.TrackEvent("sessionStart", new Dictionary <string, string> { { "hi", "Music" }, { "123", "sdfhkwejfwefjsdcnjSALFS1213" } }); var installId = AppCenter.GetInstallIdAsync().Result.ToString(); System.Diagnostics.Debug.WriteLine("InstallId=" + installId); CustomProperties properties = new CustomProperties(); properties.Set("color", "red2").Set("score", 101).Set("now", DateTime.UtcNow); AppCenter.SetCustomProperties(properties); try { int a = 0; int b = 1 / a; Crashes.GenerateTestCrash(); } catch (Exception exception) { var properties2 = new Dictionary <string, string> { { "Category", "Music" }, { "Wifi", "On" }, { "add1", "property1" }, { "add2", "property2" } }; Crashes.TrackError(exception, properties2); } //try //{ // Crashes.GenerateTestCrash(); //} //catch (Exception exception) //{ // var properties3 = new Dictionary<string, string> { // { "Appcenter", "generate crash" }, // }; // Crashes.TrackError(exception, properties3); //} }
public SubRedditAdapter(Context context, List <Child> mListSubRedditChildren, OnItemClickListener OnItemClickListener) { this.mListSubRedditChildren = mListSubRedditChildren; this.OnItemClickListener = OnItemClickListener; ImageLoader.Instance.Init(ImageLoaderConfiguration.CreateDefault(context)); }