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);
 }
Beispiel #3
0
 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();
 }
Beispiel #4
0
        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);
        }
Beispiel #5
0
        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;
        }
Beispiel #7
0
        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();
        }
Beispiel #8
0
        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();
        }
Beispiel #9
0
        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;
        }
Beispiel #10
0
    //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;
        }
Beispiel #12
0
        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();

            //}
        }
Beispiel #13
0
        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();
            }
        }
Beispiel #14
0
        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;
        }
        // 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);
            //}
        }
Beispiel #16
0
        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);
            }
        }
Beispiel #17
0
 public SubRedditAdapter(Context context, List <Child> mListSubRedditChildren, OnItemClickListener OnItemClickListener)
 {
     this.mListSubRedditChildren = mListSubRedditChildren;
     this.OnItemClickListener    = OnItemClickListener;
     ImageLoader.Instance.Init(ImageLoaderConfiguration.CreateDefault(context));
 }