Exemple #1
0
                public override void OnConfigurationChanged(Android.Content.Res.Configuration newConfig)
                {
                    base.OnConfigurationChanged(newConfig);

                    ResultView.SetBounds(new System.Drawing.RectangleF(0, 0, NavbarFragment.GetCurrentContainerDisplayWidth( ), this.Resources.DisplayMetrics.HeightPixels));
                    BlockerView.SetBounds(new System.Drawing.RectangleF(0, 0, NavbarFragment.GetCurrentContainerDisplayWidth( ), this.Resources.DisplayMetrics.HeightPixels));
                }
                public void UpdateNews(List <RockNews> sourceNews)
                {
                    // free existing news
                    FreeImageResources( );

                    News.Clear( );

                    // copy the new news.
                    int i;

                    for (i = 0; i < sourceNews.Count; i++)
                    {
                        NewsEntry newsEntry = new NewsEntry();
                        News.Add(newsEntry);

                        newsEntry.News = sourceNews[i];
                        // see if we can load the file
                        bool fileFound = TryLoadCachedImageAsync(newsEntry, newsEntry.News.ImageName);
                        if (fileFound == false)
                        {
                            // if not, download it
                            string widthParam = string.Format("width={0}", NavbarFragment.GetCurrentContainerDisplayWidth( ));
                            string requestUrl = Rock.Mobile.Util.Strings.Parsers.AddParamToURL(newsEntry.News.ImageURL, widthParam);

                            FileCache.Instance.DownloadFileToCache(requestUrl, newsEntry.News.ImageName, null,
                                                                   delegate
                            {
                                // and THEN load it
                                TryLoadCachedImageAsync(newsEntry, newsEntry.News.ImageName);
                            });
                        }
                    }
                }
Exemple #3
0
                public NewsTask(NavbarFragment navFragment) : base(navFragment)
                {
                    // create our fragments (which are basically equivalent to iOS ViewControllers)

                    // Note: Fragment Tags must be the fully qualified name of the class, including its namespaces.
                    // This is how Android will find it when searching.
                    MainPage = navFragment.FragmentManager.FindFragmentByTag("Droid.Tasks.News.NewsPrimaryFragment") as NewsPrimaryFragment;
                    if (MainPage == null)
                    {
                        MainPage = new NewsPrimaryFragment();
                    }
                    MainPage.ParentTask = this;

                    DetailsPage = navFragment.FragmentManager.FindFragmentByTag("Droid.Tasks.News.NewsDetailsFragment") as NewsDetailsFragment;
                    if (DetailsPage == null)
                    {
                        DetailsPage = new NewsDetailsFragment();
                    }
                    DetailsPage.ParentTask = this;

                    WebFragment            = new TaskWebFragment( );
                    WebFragment.ParentTask = this;

                    // setup a list we can use to cache the news, so should it update we don't use the wrong set.
                    News = new List <RockNews>();
                }
Exemple #4
0
 public GiveTask( NavbarFragment navFragment )
     : base(navFragment)
 {
     // create our fragments (which are basically equivalent to iOS ViewControllers)
     MainPage = new GivePrimaryFragment( );
     MainPage.ParentTask = this;
 }
Exemple #5
0
                public bool OnError(MediaPlayer mp, MediaError error, int extra)
                {
                    ProgressBar.Visibility = ViewStates.Gone;

                    // only show the resultView if we're active.
                    if (FragmentActive == true)
                    {
                        ResultView.Show(MessagesStrings.Error_Title,
                                        PrivateControlStylingConfig.Result_Symbol_Failed,
                                        MessagesStrings.Error_Watch_Playback,
                                        GeneralStrings.Retry);

                        ResultView.SetBounds(new System.Drawing.RectangleF(0, 0, NavbarFragment.GetFullDisplayWidth( ), this.Resources.DisplayMetrics.HeightPixels));
                    }

                    if (mp != null)
                    {
                        mp.Stop( );
                        mp.Reset( );
                    }

                    MediaControllerPrepared = false;

                    PlayerState = MediaPlayerState.None;

                    //SyncUI( );

                    return(true);
                }
Exemple #6
0
                public override void OnConfigurationChanged(Android.Content.Res.Configuration newConfig)
                {
                    base.OnConfigurationChanged(newConfig);

                    // if we're entering landscape (wide or regular, we don't care)
                    if (newConfig.Orientation == Android.Content.Res.Orientation.Landscape)
                    {
                        // go fullscreen
                        ParentTask.NavbarFragment.EnableSpringboardRevealButton(false);
                        ParentTask.NavbarFragment.ToggleFullscreen(true);
                        ParentTask.NavbarFragment.NavToolbar.Reveal(false);
                    }
                    else
                    {
                        // if we're going portrait, turn off fullscreen
                        ParentTask.NavbarFragment.ToggleFullscreen(false);

                        // and if we're NOT in wide, enable the reveal button.
                        if (MainActivity.IsLandscapeWide( ) == false)
                        {
                            ParentTask.NavbarFragment.EnableSpringboardRevealButton(true);
                        }
                    }

                    ResultView.SetBounds(new System.Drawing.RectangleF(0, 0, NavbarFragment.GetFullDisplayWidth( ), this.Resources.DisplayMetrics.HeightPixels));
                }
Exemple #7
0
 public override void OnClick(Android.App.Fragment source, int buttonId, object context = null)
 {
     // only handle input if the springboard is closed
     if (NavbarFragment.ShouldTaskAllowInput( ))
     {
         // if the main page is the source
         if (source == MainPage)
         {
             // and it's button id 0, goto the create page
             if (buttonId == 0)
             {
                 PresentFragment(CreatePage, true);
             }
         }
         else if (source == CreatePage)
         {
             if (buttonId == 0)
             {
                 PostPage.PrayerRequest = (Rock.Client.PrayerRequest)context;
                 PresentFragment(PostPage, true);
             }
         }
         else if (source == PostPage)
         {
             // this is our first / only "circular" navigation, as we're returning to the main page after
             // having posted a prayer. In which case, clear the back stack.
             NavbarFragment.FragmentManager.PopBackStack(null, PopBackStackFlags.Inclusive);
             PresentFragment(MainPage, false);
         }
     }
 }
Exemple #8
0
                ListItemView GetPrimaryView(View convertView, ViewGroup parent)
                {
                    PrimaryListItem primaryItem = convertView as PrimaryListItem;

                    if (primaryItem == null)
                    {
                        primaryItem = new PrimaryListItem(Rock.Mobile.PlatformSpecific.Android.Core.Context);

                        int height = (int)System.Math.Ceiling(NavbarFragment.GetCurrentContainerDisplayWidth( ) * PrivateConnectConfig.MainPageHeaderAspectRatio);
                        primaryItem.Billboard.LayoutParameters = new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MatchParent, height);
                        primaryItem.HasImage = false;
                    }
                    else
                    {
                        primaryItem.FreeImageResources( );
                    }

                    if (ParentFragment.Billboard != null)
                    {
                        if (primaryItem.HasImage == false)
                        {
                            primaryItem.HasImage = true;
                            Rock.Mobile.PlatformSpecific.Android.UI.Util.FadeView(primaryItem.Billboard, true, null);
                        }

                        primaryItem.Billboard.SetImageBitmap(ParentFragment.Billboard);
                    }

                    return(primaryItem);
                }
Exemple #9
0
                public PrayerTask(NavbarFragment navFragment) : base(navFragment)
                {
                    // create our fragments (which are basically equivalent to iOS ViewControllers)

                    // Note: Fragment Tags must be the fully qualified name of the class, including its namespaces.
                    // This is how Android will find it when searching.
                    MainPage = navFragment.FragmentManager.FindFragmentByTag("Droid.Tasks.Prayer.PrayerPrimaryFragment") as PrayerPrimaryFragment;
                    if (MainPage == null)
                    {
                        MainPage = new PrayerPrimaryFragment();
                    }
                    MainPage.ParentTask = this;

                    CreatePage = navFragment.FragmentManager.FindFragmentByTag("Droid.Tasks.Prayer.PrayerCreateFragment") as PrayerCreateFragment;
                    if (CreatePage == null)
                    {
                        CreatePage = new PrayerCreateFragment();
                    }
                    CreatePage.ParentTask = this;

                    PostPage = navFragment.FragmentManager.FindFragmentByTag("Droid.Tasks.Prayer.PrayerPostFragment") as PrayerPostFragment;
                    if (PostPage == null)
                    {
                        PostPage = new PrayerPostFragment();
                    }
                    PostPage.ParentTask = this;
                }
                public ConnectTask( NavbarFragment navFragment ) : base( navFragment )
                {
                    // create our fragments (which are basically equivalent to iOS ViewControllers)
                    MainPage = navFragment.FragmentManager.FindFragmentByTag( "Droid.ConnectPrimaryFragment" ) as ConnectPrimaryFragment;
                    if ( MainPage == null )
                    {
                        MainPage = new ConnectPrimaryFragment();
                    }
                    MainPage.ParentTask = this;

                    GroupFinder = navFragment.FragmentManager.FindFragmentByTag( "Droid.GroupFinderFragment" ) as GroupFinderFragment;
                    if ( GroupFinder == null )
                    {
                        GroupFinder = new GroupFinderFragment();
                    }
                    GroupFinder.ParentTask = this;

                    JoinGroup = navFragment.FragmentManager.FindFragmentByTag( "Droid.JoinGroupFragment" ) as JoinGroupFragment;
                    if ( JoinGroup == null )
                    {
                        JoinGroup = new JoinGroupFragment();
                    }
                    JoinGroup.ParentTask = this;

                    WebFragment = new TaskWebFragment( );
                    WebFragment.ParentTask = this;
                }
Exemple #11
0
            public virtual void Activate(bool forResume)
            {
                // if we're simply resuming, we dont need to reset the fragment, the task is already setup.
                if (forResume == false)
                {
                    Rock.Mobile.Util.Debug.WriteLine("Popping back stack");
                    NavbarFragment.FragmentManager.PopBackStack(null, PopBackStackFlags.Inclusive);

                    // present our starting fragment, and don't allow back navigation
                    PresentFragment(StartingFragment( ), false);
                }

                // if the springboard is already closed, set ourselves as ready.
                // This is always called before any fragment methods, so the fragment
                // will be able to know if it can display or not.

                // alternatively, if we're simply resuming from a pause, it's ok to allow the note to show.
                if (NavbarFragment.ShouldTaskAllowInput( ) || forResume == true)
                {
                    TaskReadyForFragmentDisplay = true;
                }
                else
                {
                    TaskReadyForFragmentDisplay = false;
                }
            }
Exemple #12
0
                public override void OnClick(Fragment source, int buttonId, object context)
                {
                    base.OnClick(source, buttonId, context);

                    // only handle input if the springboard is closed
                    if (NavbarFragment.ShouldTaskAllowInput( ))
                    {
                        // decide what to do.
                        if (source == MainPage)
                        {
                            ConnectLink linkEntry = (ConnectLink)context;

                            // group finder is the only connect link that doesn't use an embedded webView.
                            if (linkEntry.Title == ConnectStrings.Main_Connect_GroupFinder)
                            {
                                // launch group finder (and have it auto-show the search)
                                GroupFinder.ShowSearchOnAppear = true;

                                // if we're logged in, give it a starting address
                                if (MobileApp.Shared.Network.RockMobileUser.Instance.LoggedIn == true && MobileApp.Shared.Network.RockMobileUser.Instance.HasFullAddress( ))
                                {
                                    GroupFinder.SetSearchAddress(MobileApp.Shared.Network.RockMobileUser.Instance.Street1( ),
                                                                 MobileApp.Shared.Network.RockMobileUser.Instance.City( ),
                                                                 MobileApp.Shared.Network.RockMobileUser.Instance.State( ),
                                                                 MobileApp.Shared.Network.RockMobileUser.Instance.Zip( ));
                                }

                                PresentFragment(GroupFinder, true);
                            }
                            else
                            {
                                // launch the ConnectWebFragment.
                                TaskWebFragment.HandleUrl(false, true, linkEntry.Url, this, WebFragment);
                            }
                        }
                        else if (source == GroupFinder)
                        {
                            // turn off auto-show search so that if the user presses 'back', we don't pop it up again.
                            GroupFinder.ShowSearchOnAppear = false;

                            MobileAppApi.GroupSearchResult entry = (MobileAppApi.GroupSearchResult)context;

                            GroupInfo.GroupEntry = entry;

                            PresentFragment(GroupInfo, true);
                        }
                        else if (source == GroupInfo)
                        {
                            MobileAppApi.GroupSearchResult entry = (MobileAppApi.GroupSearchResult)context;

                            JoinGroup.GroupTitle  = entry.Name;
                            JoinGroup.Distance    = string.Format("{0:##.0} {1}", entry.DistanceFromSource, ConnectStrings.GroupFinder_MilesSuffix);
                            JoinGroup.GroupID     = entry.Id;
                            JoinGroup.MeetingTime = string.IsNullOrEmpty(entry.MeetingTime) == false ? entry.MeetingTime : ConnectStrings.GroupFinder_ContactForTime;

                            PresentFragment(JoinGroup, true);
                        }
                    }
                }
                public override View GetView(int position, View convertView, ViewGroup parent)
                {
                    SingleNewsListItem listItem = convertView as SingleNewsListItem;

                    if (listItem == null)
                    {
                        listItem = new SingleNewsListItem(Rock.Mobile.PlatformSpecific.Android.Core.Context);

                        int height = (int)System.Math.Ceiling(NavbarFragment.GetCurrentContainerDisplayWidth( ) * PrivateNewsConfig.NewsMainAspectRatio);
                        listItem.LayoutParameters = new AbsListView.LayoutParams(ViewGroup.LayoutParams.WrapContent, height);
                        listItem.HasImage         = false;
                    }
                    else
                    {
                        listItem.FreeImageResources( );
                    }

                    // if we have a valid item
                    if (position < ParentFragment.News.Count)
                    {
                        // is our image ready?
                        if (ParentFragment.News[position].Image != null)
                        {
                            if (listItem.HasImage == false)
                            {
                                listItem.HasImage = true;
                                Rock.Mobile.PlatformSpecific.Android.UI.Util.FadeView(listItem.Billboard, true, null);
                            }

                            listItem.Billboard.SetImageBitmap(ParentFragment.News[position].Image);
                        }
                        // only show the "Loading..." if the image isn't actually downloaded.
                        else if (ParentFragment.Placeholder != null)
                        {
                            listItem.Billboard.SetImageBitmap(ParentFragment.Placeholder);
                        }
                        else
                        {
                            listItem.Billboard.SetImageBitmap(null);
                        }

                        if (ParentFragment.News[position].News.Developer_Private)
                        {
                            listItem.PrivateOverlay.Visibility = ViewStates.Visible;
                        }
                        else
                        {
                            listItem.PrivateOverlay.Visibility = ViewStates.Gone;
                        }
                    }
                    else
                    {
                        listItem.Billboard.SetImageBitmap(null);
                        listItem.PrivateOverlay.Visibility = ViewStates.Gone;
                    }

                    return(base.AddView(listItem));
                }
Exemple #14
0
                public override void OnConfigurationChanged(Android.Content.Res.Configuration newConfig)
                {
                    base.OnConfigurationChanged(newConfig);

                    PrepareCreateNotes( );

                    ResultView.SetBounds(new System.Drawing.RectangleF(0, 0, NavbarFragment.GetCurrentContainerDisplayWidth( ), this.Resources.DisplayMetrics.HeightPixels));

                    AnimateTutorialScreen(false);
                }
Exemple #15
0
 public GiveTask( NavbarFragment navFragment ) : base( navFragment )
 {
     // create our fragments (which are basically equivalent to iOS ViewControllers)
     MainPage = navFragment.FragmentManager.FindFragmentByTag( "Droid.GivePrimaryFragment" ) as GivePrimaryFragment;
     if ( MainPage == null )
     {
         MainPage = new GivePrimaryFragment();
     }
     MainPage.ParentTask = this;
 }
Exemple #16
0
 public GiveTask(NavbarFragment navFragment) : base(navFragment)
 {
     // create our fragments (which are basically equivalent to iOS ViewControllers)
     MainPage = navFragment.FragmentManager.FindFragmentByTag("Droid.Tasks.Give.GivePrimaryFragment") as GivePrimaryFragment;
     if (MainPage == null)
     {
         MainPage = new GivePrimaryFragment();
     }
     MainPage.ParentTask = this;
 }
Exemple #17
0
                public override void OnResume()
                {
                    base.OnResume();

                    ParentTask.NavbarFragment.NavToolbar.SetBackButtonEnabled(true);
                    ParentTask.NavbarFragment.NavToolbar.SetCreateButtonEnabled(false, null);
                    ParentTask.NavbarFragment.NavToolbar.SetShareButtonEnabled(false, null);
                    ParentTask.NavbarFragment.NavToolbar.Reveal(false);

                    JoinGroupView.DisplayView(GroupTitle, MeetingTime, Distance, GroupID);
                    JoinGroupView.LayoutChanged(new System.Drawing.RectangleF(0, 0, NavbarFragment.GetCurrentContainerDisplayWidth( ), this.Resources.DisplayMetrics.HeightPixels));
                }
Exemple #18
0
                public PrayerTask( NavbarFragment navFragment )
                    : base(navFragment)
                {
                    // create our fragments (which are basically equivalent to iOS ViewControllers)
                    MainPage = new PrayerPrimaryFragment( );
                    MainPage.ParentTask = this;

                    CreatePage = new PrayerCreateFragment();
                    CreatePage.ParentTask = this;

                    PostPage = new PrayerPostFragment();
                    PostPage.ParentTask = this;
                }
Exemple #19
0
                public bool OnError(MediaPlayer mp, MediaError error, int extra)
                {
                    ProgressBar.Visibility = ViewStates.Gone;

                    ResultView.Show(MessagesStrings.Error_Title,
                                    PrivateControlStylingConfig.Result_Symbol_Failed,
                                    MessagesStrings.Error_Watch_Playback,
                                    GeneralStrings.Retry);

                    ResultView.SetBounds(new System.Drawing.RectangleF(0, 0, NavbarFragment.GetFullDisplayWidth( ), this.Resources.DisplayMetrics.HeightPixels));

                    return(true);
                }
Exemple #20
0
                public NotesTask(NavbarFragment navFragment) : base(navFragment)
                {
                    // create our fragments (which are basically equivalent to iOS ViewControllers)

                    // Note: Fragment Tags must be the fully qualified name of the class, including its namespaces.
                    // This is how Android will find it when searching.
                    MainPage = navFragment.FragmentManager.FindFragmentByTag("Droid.Tasks.Notes.NotesPrimaryFragment") as NotesPrimaryFragment;
                    if (MainPage == null)
                    {
                        MainPage = new NotesPrimaryFragment();
                    }
                    MainPage.ParentTask = this;

                    DetailsPage = navFragment.FragmentManager.FindFragmentByTag("Droid.Tasks.Notes.NotesDetailsFragment") as NotesDetailsFragment;
                    if (DetailsPage == null)
                    {
                        DetailsPage = new NotesDetailsFragment();
                    }
                    DetailsPage.ParentTask = this;

                    NotesPage = navFragment.FragmentManager.FindFragmentByTag("Droid.Tasks.Notes.NotesFragment") as NotesFragment;
                    if (NotesPage == null)
                    {
                        NotesPage = new NotesFragment( );
                    }
                    NotesPage.ParentTask = this;

                    WatchPage = navFragment.FragmentManager.FindFragmentByTag("Droid.Tasks.Notes.NotesWatchFragment") as NotesWatchFragment;
                    if (WatchPage == null)
                    {
                        WatchPage = new NotesWatchFragment();
                    }
                    WatchPage.ParentTask = this;

                    ListenPage = navFragment.FragmentManager.FindFragmentByTag("Droid.Tasks.Notes.NotesListenFragment") as NotesListenFragment;
                    if (ListenPage == null)
                    {
                        ListenPage = new NotesListenFragment();
                    }
                    ListenPage.ParentTask = this;

                    DiscGuidePage = navFragment.FragmentManager.FindFragmentByTag("Droid.Tasks.Notes.NotesDiscGuideFragment") as NotesDiscGuideFragment;
                    if (DiscGuidePage == null)
                    {
                        DiscGuidePage = new NotesDiscGuideFragment();
                    }
                    DiscGuidePage.ParentTask = this;

                    WebViewPage            = new TaskWebFragment( );
                    WebViewPage.ParentTask = this;
                }
Exemple #21
0
                ListItemView GetPrimaryView(View convertView, ViewGroup parent)
                {
                    MessagePrimaryListItem messageItem = convertView as MessagePrimaryListItem;

                    if (messageItem == null)
                    {
                        messageItem = new MessagePrimaryListItem(ParentFragment.Activity.BaseContext);

                        int height = (int)System.Math.Ceiling(NavbarFragment.GetCurrentContainerDisplayWidth( ) * PrivateNoteConfig.NotesMainPlaceholderAspectRatio);
                        messageItem.Thumbnail.LayoutParameters = new LinearLayout.LayoutParams(ViewGroup.LayoutParams.WrapContent, height);

                        messageItem.HasImage = false;
                    }
                    else
                    {
                        messageItem.FreeImageResources( );
                    }

                    messageItem.ParentAdapter = this;

                    if (ParentFragment.SeriesBillboard != null)
                    {
                        if (messageItem.HasImage == false)
                        {
                            messageItem.HasImage = true;
                            Rock.Mobile.PlatformSpecific.Android.UI.Util.FadeView(messageItem.Thumbnail, true, null);
                        }

                        messageItem.Thumbnail.SetImageBitmap(ParentFragment.SeriesBillboard);
                        messageItem.Thumbnail.SetScaleType(ImageView.ScaleType.CenterCrop);
                    }
                    else if (ParentFragment.PlaceholderImage != null)
                    {
                        messageItem.Thumbnail.SetImageBitmap(ParentFragment.PlaceholderImage);
                        messageItem.Thumbnail.SetScaleType(ImageView.ScaleType.CenterCrop);
                    }

                    messageItem.Title.Text = ParentFragment.Series.SeriesName;
                    if (ParentFragment.Series.SeriesPrivate == true)
                    {
                        messageItem.Title.Text += " (Private)";
                    }

                    messageItem.DateRange.Text = ParentFragment.Series.DateRanges;
                    messageItem.Desc.Text      = ParentFragment.Series.Description;

                    return(messageItem);
                }
Exemple #22
0
                public ConnectTask( NavbarFragment navFragment )
                    : base(navFragment)
                {
                    // create our fragments (which are basically equivalent to iOS ViewControllers)
                    MainPage = new ConnectPrimaryFragment( );
                    MainPage.ParentTask = this;

                    GroupFinder = new GroupFinderFragment( );
                    GroupFinder.ParentTask = this;

                    JoinGroup = new JoinGroupFragment( );
                    JoinGroup.ParentTask = this;

                    WebFragment = new TaskWebFragment( );
                    WebFragment.ParentTask = this;
                }
Exemple #23
0
                public NewsTask( NavbarFragment navFragment )
                    : base(navFragment)
                {
                    // create our fragments (which are basically equivalent to iOS ViewControllers)
                    MainPage = new NewsPrimaryFragment( );
                    MainPage.ParentTask = this;

                    DetailsPage = new NewsDetailsFragment( );
                    DetailsPage.ParentTask = this;

                    WebFragment = new TaskWebFragment( );
                    WebFragment.ParentTask = this;

                    // setup a list we can use to cache the news, so should it update we don't use the wrong set.
                    News = new List<RockNews>();
                }
Exemple #24
0
                public override void OnConfigurationChanged(Android.Content.Res.Configuration newConfig)
                {
                    base.OnConfigurationChanged(newConfig);

                    Point displaySize = new Point( );

                    Activity.WindowManager.DefaultDisplay.GetSize(displaySize);

                    if (MapView != null)
                    {
                        MapView.LayoutParameters.Height = (int)(displaySize.Y * .50f);
                    }

                    BlockerView.SetBounds(new System.Drawing.RectangleF(0, 0, NavbarFragment.GetCurrentContainerDisplayWidth( ), this.Resources.DisplayMetrics.HeightPixels));

                    SearchPage.LayoutChanged(new System.Drawing.RectangleF(0, 0, NavbarFragment.GetCurrentContainerDisplayWidth( ), this.Resources.DisplayMetrics.HeightPixels));
                }
Exemple #25
0
                public NotesTask( NavbarFragment navFragment ) : base( navFragment )
                {
                    // create our fragments (which are basically equivalent to iOS ViewControllers)
                    MainPage = navFragment.FragmentManager.FindFragmentByTag( "Droid.NotesPrimaryFragment" ) as NotesPrimaryFragment;
                    if ( MainPage == null )
                    {
                        MainPage = new NotesPrimaryFragment();
                    }
                    MainPage.ParentTask = this;

                    DetailsPage = navFragment.FragmentManager.FindFragmentByTag( "Droid.NotesDetailsFragment" ) as NotesDetailsFragment;
                    if ( DetailsPage == null )
                    {
                        DetailsPage = new NotesDetailsFragment();
                    }
                    DetailsPage.ParentTask = this;

                    NotesPage = navFragment.FragmentManager.FindFragmentByTag( "Droid.NotesFragment" ) as NotesFragment;
                    if ( NotesPage == null )
                    {
                        NotesPage = new NotesFragment( );
                    }
                    NotesPage.ParentTask = this;

                    WatchPage = navFragment.FragmentManager.FindFragmentByTag( "Droid.NotesWatchFragment" ) as NotesWatchFragment;
                    if ( WatchPage == null )
                    {
                        WatchPage = new NotesWatchFragment();
                    }
                    WatchPage.ParentTask = this;

                    ListenPage = navFragment.FragmentManager.FindFragmentByTag( "Droid.NotesListenFragment" ) as NotesListenFragment;
                    if ( ListenPage == null )
                    {
                        ListenPage = new NotesListenFragment();
                    }
                    ListenPage.ParentTask = this;

                    WebViewPage = new TaskWebFragment( );
                    WebViewPage.ParentTask = this;
                }
Exemple #26
0
                void SetupDisplay(View view)
                {
                    // get the placeholder image in case we need it
                    // attempt to load the image from cache. If that doesn't work, use a placeholder
                    HeaderImage = null;

                    bool imageExists = TryLoadBanner(HeaderImageName);

                    if (imageExists == false)
                    {
                        // use the placeholder and request the image download
                        string widthParam = string.Format("&width={0}", NavbarFragment.GetContainerDisplayWidth_Landscape( ));
                        string requestUrl = Rock.Mobile.Util.Strings.Parsers.AddParamToURL(HeaderImageURL, widthParam);

                        FileCache.Instance.DownloadFileToCache(requestUrl, HeaderImageName, null,
                                                               delegate
                        {
                            TryLoadBanner(HeaderImageName);
                        });


                        AsyncLoader.LoadImage(PrivateGeneralConfig.NewsDetailsPlaceholder, true, false,
                                              delegate(Bitmap imageBmp)
                        {
                            if (IsFragmentActive == true && imageBmp != null)
                            {
                                HeaderImage = imageBmp;
                                ImageBanner.SetImageBitmap(HeaderImage);
                                ImageBanner.Invalidate( );

                                Rock.Mobile.PlatformSpecific.Android.UI.Util.FadeView(ImageBanner, true, null);

                                return(true);
                            }

                            return(false);
                        });
                    }
                }
Exemple #27
0
                public NotesTask( NavbarFragment navFragment )
                    : base(navFragment)
                {
                    // create our fragments (which are basically equivalent to iOS ViewControllers)
                    MainPage = new NotesPrimaryFragment( );
                    MainPage.ParentTask = this;

                    DetailsPage = new NotesDetailsFragment( );
                    DetailsPage.ParentTask = this;

                    NotesPage = new NotesFragment( );
                    NotesPage.ParentTask = this;

                    WatchPage = new NotesWatchFragment( );
                    WatchPage.ParentTask = this;

                    ListenPage = new NotesListenFragment( );
                    ListenPage.ParentTask = this;

                    WebViewPage = new TaskWebFragment( );
                    WebViewPage.ParentTask = this;
                }
Exemple #28
0
                public ConnectTask(NavbarFragment navFragment) : base(navFragment)
                {
                    // create our fragments (which are basically equivalent to iOS ViewControllers)

                    // Note: Fragment Tags must be the fully qualified name of the class, including its namespaces.
                    // This is how Android will find it when searching.
                    MainPage = navFragment.FragmentManager.FindFragmentByTag("Droid.Tasks.Connect.ConnectPrimaryFragment") as ConnectPrimaryFragment;
                    if (MainPage == null)
                    {
                        MainPage = new ConnectPrimaryFragment();
                    }
                    MainPage.ParentTask = this;

                    GroupFinder = navFragment.FragmentManager.FindFragmentByTag("Droid.Tasks.Connect.GroupFinderFragment") as GroupFinderFragment;
                    if (GroupFinder == null)
                    {
                        GroupFinder = new GroupFinderFragment();
                    }
                    GroupFinder.ParentTask = this;

                    GroupInfo = navFragment.FragmentManager.FindFragmentByTag("Droid.Tasks.Connect.GroupInfoFragment") as GroupInfoFragment;
                    if (GroupInfo == null)
                    {
                        GroupInfo = new GroupInfoFragment();
                    }
                    GroupInfo.ParentTask = this;

                    JoinGroup = navFragment.FragmentManager.FindFragmentByTag("Droid.Tasks.Connect.JoinGroupFragment") as JoinGroupFragment;
                    if (JoinGroup == null)
                    {
                        JoinGroup = new JoinGroupFragment();
                    }
                    JoinGroup.ParentTask = this;

                    WebFragment            = new TaskWebFragment( );
                    WebFragment.ParentTask = this;
                }
Exemple #29
0
                public PrayerTask( NavbarFragment navFragment ) : base( navFragment )
                {
                    // create our fragments (which are basically equivalent to iOS ViewControllers)
                    MainPage = navFragment.FragmentManager.FindFragmentByTag( "Droid.PrayerPrimaryFragment" ) as PrayerPrimaryFragment;
                    if ( MainPage == null )
                    {
                        MainPage = new PrayerPrimaryFragment();
                    }
                    MainPage.ParentTask = this;

                    CreatePage = navFragment.FragmentManager.FindFragmentByTag( "Droid.PrayerCreateFragment" ) as PrayerCreateFragment;
                    if ( CreatePage == null )
                    {
                        CreatePage = new PrayerCreateFragment();
                    }
                    CreatePage.ParentTask = this;

                    PostPage = navFragment.FragmentManager.FindFragmentByTag( "Droid.PrayerPostFragment" ) as PrayerPostFragment;
                    if ( PostPage == null )
                    {
                        PostPage = new PrayerPostFragment();
                    }
                    PostPage.ParentTask = this;
                }
Exemple #30
0
                void LayoutChanged( )
                {
                    GroupInfoView.LayoutChanged(new System.Drawing.RectangleF(0, 0, NavbarFragment.GetCurrentContainerDisplayWidth( ), this.Resources.DisplayMetrics.HeightPixels));

                    ScrollViewLayout.LayoutParameters.Height = (int)(GroupInfoView.GetControlBottom( ) * 1.05f);
                }
Exemple #31
0
 public Task( NavbarFragment navFragment )
 {
     NavbarFragment = navFragment;
 }
Exemple #32
0
            public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
            {
                if (container == null)
                {
                    // Currently in a layout without a container, so no reason to create our view.
                    return(null);
                }

                RelativeLayout view = inflater.Inflate(Resource.Layout.BiblePassage, container, false) as RelativeLayout;

                view.SetOnTouchListener(this);

                PassageWebView = new WebView(Rock.Mobile.PlatformSpecific.Android.Core.Context);
                PassageWebView.SetBackgroundColor(Android.Graphics.Color.Rgb(28, 28, 28));
                PassageWebView.SetPadding(10, 0, 40, 0);

                view.AddView(PassageWebView);
                view.SetBackgroundColor(Android.Graphics.Color.Rgb(28, 28, 28));

                // get our power management control
                PowerManager pm = PowerManager.FromContext(Rock.Mobile.PlatformSpecific.Android.Core.Context);

                WakeLock = pm.NewWakeLock(WakeLockFlags.Full, "Bible Passage");

                BlockerView = new UIBlockerView(view, new System.Drawing.RectangleF(0, 0, NavbarFragment.GetCurrentContainerDisplayWidth( ), this.Resources.DisplayMetrics.HeightPixels));

                ResultView = new UIResultView(view, new System.Drawing.RectangleF(0, 0, NavbarFragment.GetCurrentContainerDisplayWidth( ), this.Resources.DisplayMetrics.HeightPixels),
                                              delegate
                {
                    if (RequestingBiblePassage == false)
                    {
                        RetrieveBiblePassage( );
                    }
                });

                return(view);
            }
Exemple #33
0
                public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
                {
                    if (container == null)
                    {
                        // Currently in a layout without a container, so no reason to create our view.
                        return(null);
                    }

                    GroupEntries   = new List <MobileAppApi.GroupSearchResult>();
                    MarkerList     = new List <Android.Gms.Maps.Model.Marker>();
                    SourceLocation = new MobileAppApi.GroupSearchResult();

                    // limit the address to 90% of the screen so it doesn't conflict with the progress bar.
                    Point displaySize = new Point( );

                    Activity.WindowManager.DefaultDisplay.GetSize(displaySize);
                    //float fixedWidth = displaySize.X / 4.0f;

                    // catch any exceptions thrown, as they'll be related to no map API key
                    try
                    {
                        MapView = new Android.Gms.Maps.MapView(Rock.Mobile.PlatformSpecific.Android.Core.Context);
                        MapView.LayoutParameters        = new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MatchParent, ViewGroup.LayoutParams.MatchParent);
                        MapView.LayoutParameters.Height = (int)(displaySize.Y * .50f);
                        MapView.GetMapAsync(this);
                        MapView.SetBackgroundColor(Color.Black);

                        MapView.OnCreate(savedInstanceState);
                    }
                    catch
                    {
                        MapView = null;
                        Rock.Mobile.Util.Debug.WriteLine("GOOGLE MAPS: Unable to create. Verify you have a valid API KEY.");
                    }

                    NumRequestedGroups = 10;


                    SearchAddressButton = new Button(Rock.Mobile.PlatformSpecific.Android.Core.Context);
                    SearchAddressButton.LayoutParameters = new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MatchParent, ViewGroup.LayoutParams.WrapContent);
                    ControlStyling.StyleButton(SearchAddressButton, ConnectStrings.GroupFinder_SearchButtonLabel, ControlStylingConfig.Font_Regular, ControlStylingConfig.Small_FontSize);
                    SearchAddressButton.Click += (object sender, EventArgs e) =>
                    {
                        SearchPage.Show( );
                    };


                    // setup the linear layout containing the "Your Neighborhood is: Horizon" text
                    SearchLayout = new LinearLayout(Rock.Mobile.PlatformSpecific.Android.Core.Context);
                    SearchLayout.LayoutParameters = new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MatchParent, ViewGroup.LayoutParams.WrapContent);
                    SearchLayout.SetBackgroundColor(Rock.Mobile.UI.Util.GetUIColor(ControlStylingConfig.BG_Layer_Color));
                    SearchLayout.SetGravity(GravityFlags.Center);

                    SearchResultPrefix = new TextView(Rock.Mobile.PlatformSpecific.Android.Core.Context);
                    SearchResultPrefix.LayoutParameters = new LinearLayout.LayoutParams(ViewGroup.LayoutParams.WrapContent, ViewGroup.LayoutParams.WrapContent);
                    SearchResultPrefix.SetTypeface(Rock.Mobile.PlatformSpecific.Android.Graphics.FontManager.Instance.GetFont(ControlStylingConfig.Font_Regular), TypefaceStyle.Normal);
                    SearchResultPrefix.SetTextSize(Android.Util.ComplexUnitType.Dip, ControlStylingConfig.Small_FontSize);
                    SearchResultPrefix.SetTextColor(Rock.Mobile.UI.Util.GetUIColor(ControlStylingConfig.TextField_PlaceholderTextColor));
                    SearchResultPrefix.Text = ConnectStrings.GroupFinder_NoGroupsFound;

                    SearchResultNeighborhood = new TextView(Rock.Mobile.PlatformSpecific.Android.Core.Context);
                    SearchResultNeighborhood.LayoutParameters = new LinearLayout.LayoutParams(ViewGroup.LayoutParams.WrapContent, ViewGroup.LayoutParams.WrapContent);
                    SearchResultNeighborhood.SetTypeface(Rock.Mobile.PlatformSpecific.Android.Graphics.FontManager.Instance.GetFont(ControlStylingConfig.Font_Regular), TypefaceStyle.Normal);
                    SearchResultNeighborhood.SetTextSize(Android.Util.ComplexUnitType.Dip, ControlStylingConfig.Small_FontSize);
                    SearchResultNeighborhood.SetTextColor(Rock.Mobile.UI.Util.GetUIColor(ControlStylingConfig.TextField_ActiveTextColor));
                    SearchResultNeighborhood.Text = "";


                    Seperator = new View(Rock.Mobile.PlatformSpecific.Android.Core.Context);
                    Seperator.LayoutParameters        = new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MatchParent, 0);
                    Seperator.LayoutParameters.Height = 2;
                    Seperator.SetBackgroundColor(Rock.Mobile.UI.Util.GetUIColor(ControlStylingConfig.BG_Layer_BorderColor));

                    ListView = new ListView(Rock.Mobile.PlatformSpecific.Android.Core.Context);
                    ListView.LayoutParameters = new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MatchParent, ViewGroup.LayoutParams.MatchParent);
                    ListView.ItemClick       += (object sender, AdapterView.ItemClickEventArgs e) =>
                    {
                        OnClick(e.Position, 0);
                    };
                    ListView.SetOnTouchListener(this);
                    ListView.Adapter = new GroupArrayAdapter(this);

                    View view = inflater.Inflate(Resource.Layout.Connect_GroupFinder, container, false);

                    view.SetOnTouchListener(this);

                    view.SetBackgroundColor(Rock.Mobile.UI.Util.GetUIColor(ControlStylingConfig.BG_Layer_Color));

                    LinearLayout groupLayout = view.FindViewById <LinearLayout>(Resource.Id.groupFrame) as LinearLayout;

                    // setup the address layout, which has the address text, padding, and finally the progress bar.
                    if (MapView != null)
                    {
                        ((LinearLayout)groupLayout).AddView(MapView);
                    }

                    ((LinearLayout)groupLayout).AddView(SearchAddressButton);

                    ((LinearLayout)groupLayout).AddView(SearchLayout);
                    ((LinearLayout)SearchLayout).AddView(SearchResultPrefix);
                    ((LinearLayout)SearchLayout).AddView(SearchResultNeighborhood);

                    ((LinearLayout)groupLayout).AddView(Seperator);
                    ((LinearLayout)groupLayout).AddView(ListView);

                    BlockerView = new UIBlockerView(view, new System.Drawing.RectangleF(0, 0, NavbarFragment.GetCurrentContainerDisplayWidth( ), this.Resources.DisplayMetrics.HeightPixels));

                    SearchPage = new UIGroupFinderSearch();
                    SearchPage.Create(view, new System.Drawing.RectangleF(0, 0, NavbarFragment.GetCurrentContainerDisplayWidth( ), this.Resources.DisplayMetrics.HeightPixels),
                                      // Search Neighborhood Groups
                                      delegate
                    {
                        SearchPage.Hide(true);
                        GetInitialGroups(PrivateGeneralConfig.GroupType_Neighborhood_GroupId, SearchPage.Street.Text, SearchPage.City.Text, SearchPage.State.Text, SearchPage.ZipCode.Text);
                    },

                                      // Search Next Gen Groups
                                      delegate
                    {
                        SearchPage.Hide(true);
                        GetInitialGroups(PrivateGeneralConfig.GroupType_NextGenGroupId, SearchPage.Street.Text, SearchPage.City.Text, SearchPage.State.Text, SearchPage.ZipCode.Text);
                    },

                                      // Search Young Adult Groups
                                      delegate
                    {
                        SearchPage.Hide(true);
                        GetInitialGroups(PrivateGeneralConfig.GroupType_YoungAdultsGroupId, SearchPage.Street.Text, SearchPage.City.Text, SearchPage.State.Text, SearchPage.ZipCode.Text);
                    });
                    SearchPage.SetTitle(ConnectStrings.GroupFinder_SearchPageHeader, ConnectStrings.GroupFinder_SearchPageDetails);
                    SearchPage.LayoutChanged(new System.Drawing.RectangleF(0, 0, NavbarFragment.GetCurrentContainerDisplayWidth( ), this.Resources.DisplayMetrics.HeightPixels));
                    SearchPage.Hide(false);

                    // if we should automatically show the search page...
                    if (ShowSearchOnAppear == true)
                    {
                        // don't allow them to tap the address button until we reveal the search page.
                        SearchAddressButton.Enabled = false;

                        // wait a couple seconds before revealing the search page.
                        System.Timers.Timer timer = new System.Timers.Timer();
                        timer.AutoReset = false;
                        timer.Interval  = 1000;
                        timer.Elapsed  += (object sender, System.Timers.ElapsedEventArgs e) =>
                        {
                            Rock.Mobile.Threading.Util.PerformOnUIThread(delegate
                            {
                                SearchAddressButton.Enabled = true;
                                SearchPage.Show( );
                            });
                        };
                        timer.Start( );
                    }
                    else
                    {
                        // otherwise, just allow the seach button
                        SearchAddressButton.Enabled = true;
                    }

                    // hook into the search page as its listener
                    ((View)SearchPage.View.PlatformNativeObject).SetOnTouchListener(this);
                    ((EditText)SearchPage.Street.PlatformNativeObject).SetOnEditorActionListener(this);
                    ((EditText)SearchPage.City.PlatformNativeObject).SetOnEditorActionListener(this);
                    ((EditText)SearchPage.State.PlatformNativeObject).SetOnEditorActionListener(this);
                    ((EditText)SearchPage.ZipCode.PlatformNativeObject).SetOnEditorActionListener(this);
                    return(view);
                }
Exemple #34
0
                public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
                {
                    if (container == null)
                    {
                        // Currently in a layout without a container, so no reason to create our view.
                        return(null);
                    }

                    JoinGroupView = new UIJoinGroup();

                    View view = inflater.Inflate(Resource.Layout.JoinGroup, container, false);

                    view.SetOnTouchListener(this);

                    view.SetBackgroundColor(Rock.Mobile.UI.Util.GetUIColor(ControlStylingConfig.BG_Layer_Color));

                    RelativeLayout backgroundView = view.FindViewById <RelativeLayout>(Resource.Id.view_background);

                    JoinGroupView.Create(backgroundView, new System.Drawing.RectangleF(0, 0, NavbarFragment.GetCurrentContainerDisplayWidth( ), this.Resources.DisplayMetrics.HeightPixels));


                    // get the native object types so we can hook in necessary support pointers
                    ((View)JoinGroupView.View.PlatformNativeObject).SetOnTouchListener(this);
                    ((EditText)JoinGroupView.CellPhone.PlatformNativeObject).AddTextChangedListener(new PhoneNumberFormattingTextWatcher());

                    return(view);
                }
Exemple #35
0
                public override void OnClick(Android.App.Fragment source, int buttonId, object context = null)
                {
                    // only handle input if the springboard is closed
                    if (NavbarFragment.ShouldTaskAllowInput( ))
                    {
                        // decide what to do.
                        if (source == MainPage)
                        {
                            // on the main page, if the buttonId was -1, the user tapped the header,
                            // so we need to either go to the Watch or Take Notes page
                            if (buttonId == -1)
                            {
                                // the context is the button they clicked (watch or take notes)
                                int buttonChoice = (int)context;

                                // 0 is listen
                                if (buttonChoice == 0)
                                {
                                    ListenPage.MediaUrl = MainPage.SeriesEntries[0].Series.Messages[0].AudioUrl;
                                    ListenPage.ShareUrl = MainPage.SeriesEntries[0].Series.Messages[0].ShareUrl;
                                    ListenPage.Name     = MainPage.SeriesEntries[0].Series.Messages[0].Name;
                                    PresentFragment(ListenPage, true);
                                }
                                // 1 is watch
                                else if (buttonChoice == 1)
                                {
                                    WatchPage.MediaUrl = MainPage.SeriesEntries[0].Series.Messages[0].WatchUrl;
                                    WatchPage.ShareUrl = MainPage.SeriesEntries[0].Series.Messages[0].ShareUrl;
                                    WatchPage.Name     = MainPage.SeriesEntries[0].Series.Messages[0].Name;
                                    PresentFragment(WatchPage, true);
                                }
                                // 2 is read
                                else if (buttonChoice == 2)
                                {
                                    NotesPage.NoteUrl  = MainPage.SeriesEntries[0].Series.Messages[0].NoteUrl;
                                    NotesPage.NoteName = MainPage.SeriesEntries[0].Series.Messages[0].Name;

                                    PresentFragment(NotesPage, true);
                                }
                                // 3 is discussion guide
                                else if (buttonChoice == 3)
                                {
                                    DiscGuidePage.DiscGuideURL = MainPage.SeriesEntries[0].Series.Messages[0].DiscussionGuideUrl;
                                    PresentFragment(DiscGuidePage, true);
                                }
                            }
                            else
                            {
                                DetailsPage.Series = MainPage.SeriesEntries[buttonId].Series;
                                PresentFragment(DetailsPage, true);
                            }
                        }
                        else if (source == DetailsPage)
                        {
                            // the context is the button they clicked (watch or take notes)
                            int buttonChoice = (int)context;

                            // 0 is listen
                            if (buttonChoice == 0)
                            {
                                ListenPage.MediaUrl = DetailsPage.Series.Messages[buttonId].AudioUrl;
                                ListenPage.ShareUrl = DetailsPage.Series.Messages[buttonId].ShareUrl;
                                ListenPage.Name     = DetailsPage.Series.Messages[buttonId].Name;
                                PresentFragment(ListenPage, true);
                            }
                            // 1 is watch
                            else if (buttonChoice == 1)
                            {
                                WatchPage.MediaUrl = DetailsPage.Series.Messages[buttonId].WatchUrl;
                                WatchPage.ShareUrl = DetailsPage.Series.Messages[buttonId].ShareUrl;
                                WatchPage.Name     = DetailsPage.Series.Messages[buttonId].Name;
                                PresentFragment(WatchPage, true);
                            }
                            // 2 is read
                            else if (buttonChoice == 2)
                            {
                                NotesPage.NoteUrl  = DetailsPage.Series.Messages[buttonId].NoteUrl;
                                NotesPage.NoteName = DetailsPage.Series.Messages[buttonId].Name;

                                PresentFragment(NotesPage, true);
                            }
                            // 3 is discussion guide
                            else if (buttonChoice == 3)
                            {
                                DiscGuidePage.DiscGuideURL = DetailsPage.Series.Messages[buttonId].DiscussionGuideUrl;
                                PresentFragment(DiscGuidePage, true);
                            }
                        }
                        else if (source == NotesPage)
                        {
                            NotesFragment.UrlClickParams clickParams = (NotesFragment.UrlClickParams)context;

                            if (Springboard.IsAppURL(clickParams.Url) == true)
                            {
                                NavbarFragment.HandleAppURL(clickParams.Url);
                            }
                            else if (App.Shared.BibleRenderer.IsBiblePrefix(clickParams.Url))
                            {
                                BiblePassagePage            = new BiblePassageFragment(clickParams.Url);
                                BiblePassagePage.ParentTask = this;
                                PresentFragment(BiblePassagePage, true);
                            }
                            else
                            {
                                // the context is the activeURL to visit.
                                WebViewPage.DisableIdleTimer = true;
                                TaskWebFragment.HandleUrl(clickParams.UseExternalBrowser,
                                                          clickParams.UseImpersonationToken,
                                                          clickParams.Url,
                                                          this,
                                                          WebViewPage);
                            }
                        }
                        else if (source == DiscGuidePage)
                        {
                            // Discussion Guide page only has one button, so if it was clicked,
                            // let them view the guide.

                            WebViewPage.DisableIdleTimer = true;
                            TaskWebFragment.HandleUrl(true,
                                                      false,
                                                      DiscGuidePage.DiscGuideURL,
                                                      this,
                                                      WebViewPage);
                        }
                    }
                }
                void LayoutChanged( )
                {
                    float prayerRegionHeight = GetPrayerRegionHeight( );

                    float cardWidth  = GetCardWidth( );
                    float cardHeight = GetCardHeight( );

                    // setup the card positions to be to the offscreen to the left, centered on screen, and offscreen to the right
                    float cardYOffset = (prayerRegionHeight - cardHeight) / 2;

                    PrayerCardSize = new RectangleF(0, 0, cardWidth, cardHeight);

                    Carousel.LayoutChanged(cardWidth, cardHeight, new RectangleF(0, cardYOffset, NavbarFragment.GetCurrentContainerDisplayWidth( ), prayerRegionHeight));

                    // now update the layout for each prayer card
                    foreach (PrayerCard prayerCard in PrayerRequestCards)
                    {
                        prayerCard.LayoutChanged(PrayerCardSize);
                    }
                }
                public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
                {
                    if (container == null)
                    {
                        // Currently in a layout without a container, so no reason to create our view.
                        return(null);
                    }

                    View view = inflater.Inflate(Resource.Layout.Prayer_Primary, container, false);

                    view.SetOnTouchListener(this);

                    view.SetBackgroundColor(Rock.Mobile.UI.Util.GetUIColor(ControlStylingConfig.BackgroundColor));

                    ActivityIndicator            = (ProgressBar)view.FindViewById <ProgressBar>(Resource.Id.prayer_primary_activityIndicator);
                    ActivityIndicator.Visibility = ViewStates.Invisible;

                    // create the carousel
                    float prayerRegionHeight = GetPrayerRegionHeight( );

                    float cardWidth  = GetCardWidth( );
                    float cardHeight = GetCardHeight( );

                    // setup the card positions to be to the offscreen to the left, centered on screen, and offscreen to the right
                    float cardYOffset = (prayerRegionHeight - cardHeight) / 2;

                    PrayerCardSize = new RectangleF(0, 0, cardWidth, cardHeight);

                    // setup the card positions to be to the offscreen to the left, centered on screen, and offscreen to the right
                    Carousel = PlatformCardCarousel.Create(view, cardWidth, cardHeight, new RectangleF(0, cardYOffset, NavbarFragment.GetCurrentContainerDisplayWidth( ), prayerRegionHeight), PrivatePrayerConfig.Card_AnimationDuration);


                    // setup our error UI
                    StatusLayer = view.FindViewById <View>(Resource.Id.status_background);
                    ControlStyling.StyleBGLayer(StatusLayer);

                    StatusText = StatusLayer.FindViewById <TextView>(Resource.Id.text);
                    ControlStyling.StyleUILabel(StatusText, ControlStylingConfig.Font_Regular, ControlStylingConfig.Medium_FontSize);

                    ResultLayer = view.FindViewById <View>(Resource.Id.result_background);
                    ControlStyling.StyleBGLayer(ResultLayer);

                    ResultSymbol = ResultLayer.FindViewById <TextView>(Resource.Id.resultSymbol);
                    ResultSymbol.SetTypeface(FontManager.Instance.GetFont(PrivateControlStylingConfig.Icon_Font_Secondary), TypefaceStyle.Normal);
                    ResultSymbol.SetTextSize(ComplexUnitType.Dip, PrivatePrayerConfig.PostPrayer_ResultSymbolSize_Droid);
                    ResultSymbol.SetTextColor(Rock.Mobile.UI.Util.GetUIColor(ControlStylingConfig.TextField_ActiveTextColor));
                    ResultSymbol.Text = PrivateControlStylingConfig.Result_Symbol_Failed;

                    ResultText = ResultLayer.FindViewById <TextView>(Resource.Id.text);
                    ControlStyling.StyleUILabel(ResultText, ControlStylingConfig.Font_Regular, ControlStylingConfig.Large_FontSize);

                    RetryButton = view.FindViewById <Button>(Resource.Id.retryButton);
                    ControlStyling.StyleButton(RetryButton, GeneralStrings.Retry, ControlStylingConfig.Font_Regular, ControlStylingConfig.Large_FontSize);

                    RetryButton.Click += (object sender, EventArgs e) =>
                    {
                        if (IsRequesting == false)
                        {
                            DownloadPrayers( );
                        }
                    };

                    return(view);
                }
Exemple #38
0
                public override void OnClick(Android.App.Fragment source, int buttonId, object context = null)
                {
                    // only handle input if the springboard is closed
                    if (NavbarFragment.ShouldTaskAllowInput( ))
                    {
                        // if the main page had a VALID news item clicked, go to it
                        if (source == MainPage && buttonId < News.Count)
                        {
                            // mark that they tapped this item.
                            NewsAnalytic.Instance.Trigger(NewsAnalytic.Read, MainPage.News[buttonId].News.Title);

                            // either take them to the details page, or skip it and go straight to Learn More.
                            if (MainPage.News[buttonId].News.SkipDetailsPage == true && string.IsNullOrEmpty(MainPage.News[buttonId].News.ReferenceURL) == false)
                            {
                                if (Springboard.IsAppURL(MainPage.News[buttonId].News.ReferenceURL) == true)
                                {
                                    NavbarFragment.HandleAppURL(MainPage.News[buttonId].News.ReferenceURL);
                                }
                                else
                                {
                                    // copy the news item's relevant members. That way, if we're running in debug,
                                    // and they want to override the news item, we can do that below.
                                    string newsUrl             = MainPage.News[buttonId].News.ReferenceURL;
                                    bool   newsImpersonation   = MainPage.News[buttonId].News.IncludeImpersonationToken;
                                    bool   newsExternalBrowser = MainPage.News[buttonId].News.ReferenceUrlLaunchesBrowser;

                                    // If we're running a debug build, see if we should override the news
                                    #if DEBUG
                                    if (DebugConfig.News_Override_Item == true)
                                    {
                                        newsUrl             = DebugConfig.News_Override_ReferenceURL;
                                        newsImpersonation   = DebugConfig.News_Override_IncludeImpersonationToken;
                                        newsExternalBrowser = DebugConfig.News_Override_ReferenceUrlLaunchesBrowser;
                                    }
                                    #endif

                                    TaskWebFragment.HandleUrl(newsExternalBrowser, newsImpersonation, newsUrl, this, WebFragment);
                                }
                            }
                            else
                            {
                                // store the news index they chose so we can manage the 'tap details' page.
                                DetailsPage.SetNewsInfo(MainPage.News[buttonId].News.Title,
                                                        MainPage.News[buttonId].News.Description,
                                                        MainPage.News[buttonId].News.GetDeveloperInfo( ),
                                                        MainPage.News[buttonId].News.ReferenceURL,
                                                        MainPage.News[buttonId].News.ReferenceUrlLaunchesBrowser,
                                                        MainPage.News[buttonId].News.IncludeImpersonationToken,
                                                        MainPage.News[buttonId].News.ImageName,
                                                        MainPage.News[buttonId].News.ImageURL);

                                PresentFragment(DetailsPage, true);
                            }
                        }
                        else if (source == DetailsPage)
                        {
                            // otherwise visit the reference URL
                            if (buttonId == Resource.Id.news_details_launch_url || buttonId == Resource.Id.news_details_header_image_button)
                            {
                                // if this is an app url, handle it internally
                                if (Springboard.IsAppURL(DetailsPage.ReferenceURL) == true)
                                {
                                    NavbarFragment.HandleAppURL(DetailsPage.ReferenceURL);
                                }
                                else
                                {
                                    // copy the news item's relevant members. That way, if we're running in debug,
                                    // and they want to override the news item, we can do that below.
                                    string newsUrl             = DetailsPage.ReferenceURL;
                                    bool   newsImpersonation   = DetailsPage.IncludeImpersonationToken;
                                    bool   newsExternalBrowser = DetailsPage.ReferenceURLLaunchesBrowser;

                                    // If we're running a debug build, see if we should override the news
                                    #if DEBUG
                                    if (DebugConfig.News_Override_Item == true)
                                    {
                                        newsUrl             = DebugConfig.News_Override_ReferenceURL;
                                        newsImpersonation   = DebugConfig.News_Override_IncludeImpersonationToken;
                                        newsExternalBrowser = DebugConfig.News_Override_ReferenceUrlLaunchesBrowser;
                                    }
                                    #endif

                                    TaskWebFragment.HandleUrl(newsExternalBrowser, newsImpersonation, newsUrl, this, WebFragment);
                                }
                            }
                        }
                    }
                }
 float GetCardWidth( )
 {
     return(NavbarFragment.GetCurrentContainerDisplayWidth( ) * PrayerCardSizePerc);
 }
Exemple #40
0
                public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
                {
                    if (container == null)
                    {
                        // Currently in a layout without a container, so no reason to create our view.
                        return(null);
                    }

                    GroupInfoView = new UIGroupInfo();

                    View view = inflater.Inflate(Resource.Layout.GroupInfo, container, false);

                    view.SetOnTouchListener(this);

                    view.SetBackgroundColor(Rock.Mobile.UI.Util.GetUIColor(ControlStylingConfig.BG_Layer_Color));

                    ScrollView       = view.FindViewById <ScrollView>(Resource.Id.scroll_view);
                    ScrollViewLayout = ScrollView.FindViewById <RelativeLayout>(Resource.Id.view_background);
                    ScrollViewLayout.SetBackgroundColor(Rock.Mobile.UI.Util.GetUIColor(ControlStylingConfig.BackgroundColor));

                    GroupInfoView.Create(ScrollViewLayout, new System.Drawing.RectangleF(0, 0, NavbarFragment.GetCurrentContainerDisplayWidth( ), this.Resources.DisplayMetrics.HeightPixels), OnJoinClicked);

                    return(view);
                }