Пример #1
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);
                    }

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

                    view.SetOnTouchListener(this);


                    RelativeLayout headerLayer = view.FindViewById <RelativeLayout>(Resource.Id.background);

                    ControlStyling.StyleBGLayer(headerLayer);

                    TextView headerLabel = view.FindViewById <TextView>(Resource.Id.headerLabel);

                    headerLabel.Text = GiveStrings.Header;
                    ControlStyling.StyleUILabel(headerLabel, ControlStylingConfig.Font_Regular, ControlStylingConfig.Medium_FontSize);

                    Button giveButton = view.FindViewById <Button>(Resource.Id.button);

                    ControlStyling.StyleButton(giveButton, GiveStrings.ButtonLabel, ControlStylingConfig.Font_Regular, ControlStylingConfig.Medium_FontSize);

                    giveButton.Click += (object sender, EventArgs e) =>
                    {
                        LaunchGive( );
                    };

                    return(view);
                }
Пример #2
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);
                    }

                    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);
                }
Пример #3
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);
                    }

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

                    view.SetOnTouchListener(this);

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

                    // setup the first name background
                    FirstNameBGLayer = view.FindViewById <RelativeLayout>(Resource.Id.first_name_background);
                    ControlStyling.StyleBGLayer(FirstNameBGLayer);
                    //

                    LastNameBGLayer = view.FindViewById <RelativeLayout>(Resource.Id.last_name_background);
                    ControlStyling.StyleBGLayer(LastNameBGLayer);

                    EmailBGLayer = view.FindViewById <RelativeLayout>(Resource.Id.email_background);
                    ControlStyling.StyleBGLayer(EmailBGLayer);

                    // setup the prayer request background
                    RequestBGLayer = view.FindViewById <RelativeLayout>(Resource.Id.prayerRequest_background);
                    ControlStyling.StyleBGLayer(RequestBGLayer);
                    //

                    // setup the switch background
                    RelativeLayout backgroundLayout = view.FindViewById <RelativeLayout>(Resource.Id.switch_background);

                    ControlStyling.StyleBGLayer(backgroundLayout);

                    // setup the category background
                    backgroundLayout = view.FindViewById <RelativeLayout>(Resource.Id.spinner_background);
                    ControlStyling.StyleBGLayer(backgroundLayout);

                    // setup the text views
                    FirstNameText = (EditText)view.FindViewById <EditText>(Resource.Id.prayer_create_firstNameText);
                    ControlStyling.StyleTextField(FirstNameText, PrayerStrings.CreatePrayer_FirstNamePlaceholderText, ControlStylingConfig.Font_Regular, ControlStylingConfig.Medium_FontSize);
                    FirstNameBGColor         = ControlStylingConfig.BG_Layer_Color;
                    FirstNameText.InputType |= Android.Text.InputTypes.TextFlagCapWords;

                    LastNameText = (EditText)view.FindViewById <EditText>(Resource.Id.prayer_create_lastNameText);
                    ControlStyling.StyleTextField(LastNameText, PrayerStrings.CreatePrayer_LastNamePlaceholderText, ControlStylingConfig.Font_Regular, ControlStylingConfig.Medium_FontSize);
                    LastNameBGColor         = ControlStylingConfig.BG_Layer_Color;
                    LastNameText.InputType |= Android.Text.InputTypes.TextFlagCapWords;

                    EmailText = (EditText)view.FindViewById <EditText>(Resource.Id.prayer_create_emailText);
                    ControlStyling.StyleTextField(EmailText, PrayerStrings.CreatePrayer_EmailPlaceholderText, ControlStylingConfig.Font_Regular, ControlStylingConfig.Medium_FontSize);
                    EmailBGColor         = ControlStylingConfig.BG_Layer_Color;
                    EmailText.InputType |= Android.Text.InputTypes.TextFlagCapWords;

                    RequestText = (EditText)view.FindViewById <EditText>(Resource.Id.prayer_create_requestText);
                    ControlStyling.StyleTextField(RequestText, PrayerStrings.CreatePrayer_PrayerRequest, ControlStylingConfig.Font_Regular, ControlStylingConfig.Medium_FontSize);
                    RequestBGColor         = ControlStylingConfig.BG_Layer_Color;
                    RequestText.InputType |= Android.Text.InputTypes.TextFlagCapSentences;


                    /*AnonymousSwitch = (Switch)view.FindViewById<Switch>( Resource.Id.postAnonymousSwitch );
                     * AnonymousSwitch.Checked = false;
                     * AnonymousSwitch.CheckedChange += (object sender, CompoundButton.CheckedChangeEventArgs e ) =>
                     * {
                     *      if( AnonymousSwitch.Checked == false )
                     *      {
                     *          FirstNameText.Enabled = true;
                     *          LastNameText.Enabled = true;
                     *
                     *          FirstNameText.Text = string.Empty;
                     *          LastNameText.Text = string.Empty;
                     *      }
                     *      else
                     *      {
                     *          FirstNameText.Enabled = false;
                     *          LastNameText.Enabled = false;
                     *
                     *          FirstNameText.Text = PrayerStrings.CreatePrayer_Anonymous;
                     *          LastNameText.Text = PrayerStrings.CreatePrayer_Anonymous;
                     *      }
                     *
                     *      // set the colors back to neutral
                     *      Rock.Mobile.PlatformSpecific.Android.UI.Util.AnimateViewColor( FirstNameBGColor, ControlStylingConfig.BG_Layer_Color, FirstNameBGLayer, delegate { FirstNameBGColor = ControlStylingConfig.BG_Layer_Color; } );
                     *      Rock.Mobile.PlatformSpecific.Android.UI.Util.AnimateViewColor( LastNameBGColor, ControlStylingConfig.BG_Layer_Color, LastNameBGLayer, delegate { LastNameBGColor = ControlStylingConfig.BG_Layer_Color; } );
                     * };*/

                    PublicSwitch         = (Switch)view.FindViewById <Switch>(Resource.Id.makePublicSwitch);
                    PublicSwitch.Checked = false;

                    //TextView postAnonymousLabel = view.FindViewById<TextView>( Resource.Id.postAnonymous );
                    //ControlStyling.StyleUILabel( postAnonymousLabel, ControlStylingConfig.Font_Regular, ControlStylingConfig.Medium_FontSize );

                    TextView publicLabel = view.FindViewById <TextView>(Resource.Id.makePublic);

                    ControlStyling.StyleUILabel(publicLabel, ControlStylingConfig.Font_Regular, ControlStylingConfig.Medium_FontSize);

                    // setup our category spinner
                    Spinner = (Spinner)view.FindViewById <Spinner>(Resource.Id.categorySpinner);
                    ArrayAdapter adapter = new SpinnerArrayAdapter(Rock.Mobile.PlatformSpecific.Android.Core.Context, Android.Resource.Layout.SimpleListItem1);

                    adapter.SetDropDownViewResource(Android.Resource.Layout.SimpleSpinnerDropDownItem);
                    Spinner.Adapter = adapter;

                    // populate the category
                    foreach (KeyValuePair <string, int> category in MobileApp.Shared.Network.RockLaunchData.Instance.Data.PrayerCategories)
                    {
                        adapter.Add(category.Key);
                    }

                    Button submitButton = (Button)view.FindViewById <Button>(Resource.Id.prayer_create_submitButton);

                    ControlStyling.StyleButton(submitButton, PrayerStrings.CreatePrayer_SubmitButtonText, ControlStylingConfig.Font_Regular, ControlStylingConfig.Small_FontSize);
                    submitButton.Click += (object sender, EventArgs e) =>
                    {
                        SubmitPrayerRequest( );
                    };

                    return(view);
                }