예제 #1
0
            public void OnClick(View v)
            {
                var videoPlayerActivity = new Android.Content.Intent(activity, typeof(VideoPlayerActivity));

                videoPlayerActivity.PutExtra("VideoUrl", JsonConvert.SerializeObject(weclipVideoInfo));
                activity.StartActivity(videoPlayerActivity);
            }
        public override View GetView(int position, View convertView, ViewGroup parent)
        {
            WeClipFragmentViewHolder holder;

            if (convertView == null)
            {
                convertView                 = activity.LayoutInflater.Inflate(Resource.Layout.WeClipFragmentItem, parent, false);
                holder                      = new WeClipFragmentViewHolder();
                holder.ivWeClipPhoto        = convertView.FindViewById <ImageView>(Resource.Id.ivWeClipFragItemWeClipPhoto);
                holder.ivWeClipOverImage    = convertView.FindViewById <ImageView>(Resource.Id.ivWeClipFragItemvideo);
                holder.ivWeClipPhoto.Click += delegate
                {
                    var videoPlayerActivity = new Android.Content.Intent(activity, typeof(VideoPlayerActivity));
                    videoPlayerActivity.PutExtra("VideoUrl", JsonConvert.SerializeObject(weclipFile[position]));
                    activity.StartActivity(videoPlayerActivity);
                };
                convertView.Tag = holder;
            }
            else
            {
                holder = convertView.Tag as WeClipFragmentViewHolder;
            }

            var da = weclipFile[position].Thumb;

            Picasso.With(activity).Load(weclipFile[position].Thumb).Placeholder(Resource.Drawable.default_event_back)
            .Transform(new RoundedTransformation())
            .Resize(100, 100).Into(holder.ivWeClipPhoto);
            return(convertView);
        }
예제 #3
0
            public void OnClick(View v)
            {
                Intent intent = new Intent(activity, typeof(AddImageAndVideoForEventActivity));

                intent.PutExtra("strCapture", eventID);
                activity.StartActivity(intent);
                btnUploadPhotos.SetOnClickListener(null);
            }
예제 #4
0
            public void OnClick(View v)
            {
                Intent intent = new Intent(activity, typeof(ContactFriend));

                intent.PutExtra("EventID", eventID);
                activity.StartActivity(intent);
                btnInvite.SetOnClickListener(null);
            }
            public void OnClick(View v)
            {
                Intent pwcActivity = new Intent(activity, typeof(CommentActivity));

                pwcActivity.PutExtra("CurrentEvent", eventID);
                activity.StartActivity(pwcActivity);
                btnChat.SetOnClickListener(null);
            }
예제 #6
0
                public void OnItemClick(AdapterView parent, View view, int position, long id)
                {
                    Intent intent = new Intent(activity, typeof(MainActivity));

                    intent.PutExtra("FromESF", "FromESF");
                    MainActivity.myBundle.PutLong("EventID", eventData[position].EventId);
                    activity.StartActivity(intent);
                }
예제 #7
0
            public void OnClick(View v)
            {
                Intent intent = new Intent(activity, typeof(FollowingActivity));

                intent.PutExtra("UserID", userID);
                activity.StartActivity(intent);
                followerCount.SetOnClickListener(null);
            }
                public void OnItemClick(AdapterView parent, View view, int position, long id)
                {
                    Intent intent = new Intent(activity, typeof(AddImageAndVideoForEventActivity));

                    intent.PutExtra("strCapture", eventData[position].EventId);
                    intent.PutExtra("strIsDefaultEvent", false);
                    activity.StartActivity(intent);
                }
                public void OnItemClick(AdapterView parent, View view, int position, long id)
                {
                    var    item         = userdata[position];
                    Intent mainActivity = new Intent(activity, typeof(MainActivity));

                    mainActivity.PutExtra("FromPeople", item.UserId);
                    activity.StartActivity(mainActivity);
                }
예제 #10
0
            public void OnClick(View v)
            {
                Intent intent = new Intent(activity, typeof(EventGalleryView));

                intent.PutExtra("strEventGallery", eventID);
                activity.StartActivity(intent);
                btnCreateWeClip.SetOnClickListener(null);
            }
예제 #11
0
                protected override void OnPostExecute(WeClipVideo result)
                {
                    base.OnPostExecute(result);
                    p.Dismiss();
                    var videoPlayerActivity = new Android.Content.Intent(activity, typeof(VideoPlayerActivity));

                    videoPlayerActivity.PutExtra("VideoUrl", JsonConvert.SerializeObject(weclipVideo));
                    activity.StartActivity(videoPlayerActivity);
                }
예제 #12
0
            public void OnClick(View v)
            {
                ivMore.SetOnClickListener(null);
                Intent pwcActivity = new Intent(context, typeof(CommentActivity));

                pwcActivity.PutExtra("CurrentTab", "comment");
                MainActivity.myBundle.PutLong("EventID", iD);
                context.StartActivity(pwcActivity);
            }
예제 #13
0
        private void ForwardActivity(Screen screen, IActivityScreenResolver resolver)
        {
            var intent = resolver.GetActivityIntent(screen, _activity);

            if (intent.ResolveActivity(_activity.PackageManager) != null)
            {
                _activity.StartActivity(intent);
            }
        }
예제 #14
0
            public void OnClick(View v)
            {
                btnUploadPhotos.SetOnClickListener(null);
                Intent intent = new Intent(activity, typeof(UploadEventProfilePic));

                intent.PutExtra("strCapture", eventID);
                intent.PutExtra("strCreatorId", creatorId);

                activity.StartActivity(intent);
            }
예제 #15
0
        static void SettingsClicked(FragmentActivity ctx)
        {
            if (Common.isTabletDevice(ctx))
            {
                ctx.FindViewById <FrameLayout>(Resource.Id.details_fragment).Visibility = ViewStates.Gone;
                var ft = ctx.SupportFragmentManager.BeginTransaction();
                ft.Replace(Resource.Id.detailInfo_fragment, new SettingsFragment());

                ft.SetTransition(Android.Support.V4.App.FragmentTransaction.TransitFragmentFade);
                ft.Commit();
            }
            else
            {
                var intent = new Android.Content.Intent();
                intent.SetClass(ctx, typeof(SettingsFragmentActivity));
                ctx.StartActivity(intent);
            }
        }
예제 #16
0
        public override View GetView(int position, View convertView, ViewGroup parent)
        {
            ViewHolder holder;
            var        videoInfo = weClipdata[position];

            if (convertView == null)
            {
                convertView                 = activity.LayoutInflater.Inflate(Resource.Layout.WeClipSearchFragmentItem, parent, false);
                holder                      = new ViewHolder();
                holder.ivWeClipPhoto        = convertView.FindViewById <ImageView>(Resource.Id.ivWSFItemPhoto);
                holder.ivWeClipPhoto.Click += delegate
                {
                    var weclipVideo = new WeClipVideo
                    {
                        VideoFileName = videoInfo.Filename,
                        VideoFileUrl  = videoInfo.VideoFileUrl,
                        EventName     = videoInfo.EventName,
                        WeClipTitle   = videoInfo.WeClipTitle,
                        WeClipTag     = videoInfo.WeClipTag
                    };
                    var videoPlayerActivity = new Android.Content.Intent(activity, typeof(VideoPlayerActivity));
                    videoPlayerActivity.PutExtra("VideoUrl", JsonConvert.SerializeObject(weclipVideo));
                    activity.StartActivity(videoPlayerActivity);
                };

                holder.ivWeClipOverImage = convertView.FindViewById <ImageView>(Resource.Id.ivWSFItemPhoto);
                convertView.Tag          = holder;
            }
            else
            {
                holder = convertView.Tag as ViewHolder;
            }

            Picasso.With(activity).Load(weClipdata[position].ImageFileUrl).Placeholder(Resource.Drawable.default_event_back)
            .Transform(new RoundedTransformation())
            .Resize(150, 150).Into(holder.ivWeClipPhoto);
            return(convertView);
        }
예제 #17
0
                public bool OnMenuItemClick(IMenuItem item)
                {
                    if (item.ItemId == Resource.Id.popup_Add_CoHost)
                    {
                        Android.Support.V4.App.Fragment fragment = new AddCoHostFragment();
                        var fragmentManager = activity.SupportFragmentManager;
                        Android.Support.V4.App.FragmentTransaction fragmentTransaction = fragmentManager.BeginTransaction();
                        fragmentTransaction.Replace(Resource.Id.content_frame, fragment);
                        MainActivity.myBundle.PutLong("EventID", eventID);
                        fragmentTransaction.AddToBackStack("AddCoHostFragment");
                        fragmentTransaction.Commit();
                        return(true);
                    }

                    if (item.ItemId == Resource.Id.popup_Add_EventPhoto)
                    {
                        Intent intent = new Intent(activity, typeof(UploadEventProfilePic));
                        intent.PutExtra("strCapture", eventID);
                        intent.PutExtra("strCreatorId", creatorId);
                        activity.StartActivity(intent);
                        return(true);
                    }
                    return(false);
                }
예제 #18
0
            public void OnClick(View v)
            {
                try
                {
                    Intent intent = new Intent(Intent.ActionSend);
                    intent.SetType("text/plain");
                    intent.PutExtra(Intent.ExtraText, result.EventName + "\n" + result.EventDescription + "\n" + result.EventDate + "\n" + "Download weclip from http://www.weclip.com");
                    activity.StartActivity(Intent.CreateChooser(intent, "Share To"));

                    //   ShareDialog shareDialog = new ShareDialog(activity);
                    //   //  shareDialog.RegisterCallback(callbackManager, this);

                    //   ShareLinkContent.Builder shareLinkContentBuilder = new ShareLinkContent.Builder().
                    //         SetContentTitle(result.EventName).
                    //   SetContentDescription(result.EventDescription);
                    //shareLinkContentBuilder.SetContentUrl(Android.Net.Uri.Parse(GlobalClass.strImagePath + result.EventPic));
                    //   ShareLinkContent shareLinkContent = shareLinkContentBuilder.Build();
                    //   shareDialog.Show(shareLinkContent);
                }
                catch (System.Exception ex)
                {
                    Log.Debug("Erorr", ex.Message);
                }
            }
예제 #19
0
 public void OnClick(View v)
 {
     activity.StartActivity(typeof(SearchActivity));
 }
예제 #20
0
        private async void LocationSearchFragment_clickListener(object sender, RecyclerClickEventArgs e)
        {
            // Get selected query view
            LocationQuery          v        = (LocationQuery)e.View;
            LocationQueryViewModel query_vm = null;

            try
            {
                if (!String.IsNullOrEmpty(mAdapter.Dataset[e.Position].LocationQuery))
                {
                    query_vm = mAdapter.Dataset[e.Position];
                }
            }
            catch (ArgumentOutOfRangeException)
            {
                query_vm = null;
            }
            finally
            {
                if (query_vm == null)
                {
                    query_vm = new LocationQueryViewModel();
                }
            }

            if (String.IsNullOrWhiteSpace(query_vm.LocationQuery))
            {
                // Stop since there is no valid query
                return;
            }

            if (Settings.UsePersonalKey && String.IsNullOrWhiteSpace(Settings.API_KEY) && wm.KeyRequired)
            {
                Toast.MakeText(App.Context, App.Context.GetString(Resource.String.werror_invalidkey), ToastLength.Short).Show();
                return;
            }

            // Cancel pending searches
            CtsCancel();
            var ctsToken = cts.Token;

            ShowLoading(true);

            if (ctsToken.IsCancellationRequested)
            {
                ShowLoading(false);
                return;
            }

            // Get Weather Data
            var location = new WeatherData.LocationData(query_vm);

            if (!location.IsValid())
            {
                Toast.MakeText(App.Context, App.Context.GetString(Resource.String.werror_noweather), ToastLength.Short).Show();
                ShowLoading(false);
                return;
            }
            WeatherData.Weather weather = await Settings.GetWeatherData(location.query);

            if (weather == null)
            {
                try
                {
                    weather = await wm.GetWeather(location);
                }
                catch (WeatherException wEx)
                {
                    weather = null;
                    Toast.MakeText(App.Context, wEx.Message, ToastLength.Short).Show();
                }
            }

            if (weather == null)
            {
                ShowLoading(false);
                return;
            }

            // We got our data so disable controls just in case
            mAdapter.Dataset.Clear();
            mAdapter.NotifyDataSetChanged();
            mRecyclerView.Enabled = false;

            // Save weather data
            await Settings.DeleteLocations();

            await Settings.AddLocation(location);

            if (wm.SupportsAlerts && weather.weather_alerts != null)
            {
                await Settings.SaveWeatherAlerts(location, weather.weather_alerts);
            }
            await Settings.SaveWeatherData(weather);

            // If we're using search
            // make sure gps feature is off
            Settings.FollowGPS     = false;
            Settings.WeatherLoaded = true;

            // Send data for wearables
            mActivity.StartService(new Intent(mActivity, typeof(WearableDataListenerService))
                                   .SetAction(WearableDataListenerService.ACTION_SENDSETTINGSUPDATE));
            mActivity.StartService(new Intent(mActivity, typeof(WearableDataListenerService))
                                   .SetAction(WearableDataListenerService.ACTION_SENDLOCATIONUPDATE));
            mActivity.StartService(new Intent(mActivity, typeof(WearableDataListenerService))
                                   .SetAction(WearableDataListenerService.ACTION_SENDWEATHERUPDATE));

            if (mAppWidgetId == AppWidgetManager.InvalidAppwidgetId)
            {
                // Start WeatherNow Activity with weather data
                Intent intent = new Intent(mActivity, typeof(MainActivity));
                intent.PutExtra("data", location.ToJson());

                mActivity.StartActivity(intent);
                mActivity.FinishAffinity();
            }
            else
            {
                // Create return intent
                Intent resultValue = new Intent();
                resultValue.PutExtra(AppWidgetManager.ExtraAppwidgetId, mAppWidgetId);
                resultValue.PutExtra("data", location.ToJson());
                mActivity.SetResult(Android.App.Result.Ok, resultValue);
                mActivity.Finish();
            }
        }
예제 #21
0
 public void OnClick(View v)
 {
     activity.StartActivity(typeof(CreateEvent));
     createEvent.SetOnClickListener(null);
 }
예제 #22
0
        private void ForwardActivity(Screen screen, IActivityScreenResolver resolver)
        {
            var intent = resolver.GetActivityIntent(screen, _activity);

            _activity.StartActivity(intent);
        }