예제 #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;
                }

                RelativeLayout view = inflater.Inflate(Resource.Layout.TaskWebView, container, false) as RelativeLayout;
                view.SetOnTouchListener( this );

                WebLayout = new WebLayout( Rock.Mobile.PlatformSpecific.Android.Core.Context );
                WebLayout.LayoutParameters = new ViewGroup.LayoutParams( ViewGroup.LayoutParams.MatchParent, ViewGroup.LayoutParams.MatchParent );
                WebLayout.SetBackgroundColor( Android.Graphics.Color.Black );

                view.AddView( WebLayout );

                ResultView = new UIResultView( view, new System.Drawing.RectangleF( 0, 0, NavbarFragment.GetContainerDisplayWidth( ), this.Resources.DisplayMetrics.HeightPixels ),
                    delegate
                    {
                        ResultView.Hide( );

                        if ( string.IsNullOrEmpty( Url ) == false )
                        {
                            WebLayout.LoadUrl( Url, PageLoaded );
                        }
                    } );

                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);
                }

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

                view.SetOnTouchListener(this);

                WebLayout = new WebLayout(Rock.Mobile.PlatformSpecific.Android.Core.Context);
                WebLayout.LayoutParameters = new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MatchParent, ViewGroup.LayoutParams.MatchParent);
                WebLayout.SetBackgroundColor(Android.Graphics.Color.Black);

                view.AddView(WebLayout);

                ResultView = new UIResultView(view, new System.Drawing.RectangleF(0, 0, NavbarFragment.GetCurrentContainerDisplayWidth( ), this.Resources.DisplayMetrics.HeightPixels),
                                              delegate
                {
                    ResultView.Hide( );

                    if (string.IsNullOrEmpty(Url) == false)
                    {
                        ProcessUrl( );
                    }
                });

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

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

                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.Login, container, false);
            view.SetBackgroundColor( Rock.Mobile.UI.Util.GetUIColor( ControlStylingConfig.BackgroundColor ) );
            view.SetOnTouchListener( this );

            RelativeLayout navBar = view.FindViewById<RelativeLayout>( Resource.Id.navbar_relative_layout );
            navBar.SetBackgroundColor( Rock.Mobile.UI.Util.GetUIColor( ControlStylingConfig.BackgroundColor ) );

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

            LoginResultLayer = view.FindViewById<View>( Resource.Id.result_background );
            ControlStyling.StyleBGLayer( LoginResultLayer );
            LoginResultLayer.Alpha = 0.0f;

            LoginButton = view.FindViewById<Button>( Resource.Id.loginButton );
            ControlStyling.StyleButton( LoginButton, LoginStrings.LoginButton, ControlStylingConfig.Font_Regular, ControlStylingConfig.Small_FontSize );
            LoginButton.Click += (object sender, EventArgs e) => 
                {
                    TryRockBind( );
                };

            CancelButton = view.FindViewById<Button>( Resource.Id.cancelButton );
            ControlStyling.StyleButton( CancelButton, GeneralStrings.Cancel, ControlStylingConfig.Font_Regular, ControlStylingConfig.Small_FontSize );
            CancelButton.Background = null;
            CancelButton.Click += (object sender, EventArgs e) => 
                {
                    SpringboardParent.ModalFragmentDone( null );
                };


            TextView additionalOptions = view.FindViewById<TextView>( Resource.Id.additionalOptions );
            ControlStyling.StyleUILabel( additionalOptions, ControlStylingConfig.Font_Regular, ControlStylingConfig.Small_FontSize );
            additionalOptions.Text = LoginStrings.AdditionalOptions;

            TextView orTextView = view.FindViewById<TextView>( Resource.Id.orTextView );
            ControlStyling.StyleUILabel( orTextView, ControlStylingConfig.Font_Regular, ControlStylingConfig.Small_FontSize );
            orTextView.Text = LoginStrings.OrString;


            RegisterButton = view.FindViewById<Button>( Resource.Id.registerButton );
            ControlStyling.StyleButton( RegisterButton, LoginStrings.RegisterButton, ControlStylingConfig.Font_Regular, ControlStylingConfig.Small_FontSize );
            RegisterButton.Click += (object sender, EventArgs e ) =>
                {
                    SpringboardParent.ModalFragmentDone( null );
                    SpringboardParent.RegisterNewUser( );
                };



            // get the username field and background
            UsernameLayer = view.FindViewById<View>( Resource.Id.login_background );
            ControlStyling.StyleBGLayer( UsernameLayer );

            UsernameField = view.FindViewById<EditText>( Resource.Id.usernameText );
            UserNameBGColor = ControlStylingConfig.BG_Layer_Color;
            ControlStyling.StyleTextField( UsernameField, LoginStrings.UsernamePlaceholder, ControlStylingConfig.Font_Regular, ControlStylingConfig.Medium_FontSize );

            View borderView = UsernameLayer.FindViewById<View>( Resource.Id.middle_border );
            borderView.SetBackgroundColor( Rock.Mobile.UI.Util.GetUIColor( ControlStylingConfig.BG_Layer_BorderColor ) );


            // get the password field and background
            PasswordLayer = view.FindViewById<View>( Resource.Id.password_background );
            ControlStyling.StyleBGLayer( PasswordLayer );
            PasswordField = view.FindViewById<EditText>( Resource.Id.passwordText );
            PasswordBGColor = ControlStylingConfig.BG_Layer_Color;
            ControlStyling.StyleTextField( PasswordField, LoginStrings.PasswordPlaceholder, ControlStylingConfig.Font_Regular, ControlStylingConfig.Medium_FontSize );

            LoginResultLabel = view.FindViewById<TextView>( Resource.Id.loginResult );
            ControlStyling.StyleUILabel( LoginResultLabel, ControlStylingConfig.Font_Regular, ControlStylingConfig.Medium_FontSize );

            // Setup the facebook button
            FacebookButton = view.FindViewById<ImageButton>( Resource.Id.facebookButton );
            FacebookButton.Background = null;
            FacebookButton.Click += (object sender, EventArgs e ) =>
            {
                TryFacebookBind( );
            };

            // invoke a webview
            WebLayout = new WebLayout( Rock.Mobile.PlatformSpecific.Android.Core.Context );
            WebLayout.LayoutParameters = new ViewGroup.LayoutParams( ViewGroup.LayoutParams.MatchParent, ViewGroup.LayoutParams.MatchParent );
            WebLayout.SetBackgroundColor( Android.Graphics.Color.Black );

            return view;
        }
예제 #4
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.Login, container, false);

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

            RelativeLayout navBar = view.FindViewById <RelativeLayout>(Resource.Id.navbar_relative_layout);

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

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

            BlockerView = new UIBlockerView(view, bounds);

            LoginResultLayer = view.FindViewById <View>(Resource.Id.result_background);
            ControlStyling.StyleBGLayer(LoginResultLayer);
            LoginResultLayer.Alpha = 0.0f;

            LoginButton = view.FindViewById <Button>(Resource.Id.loginButton);
            ControlStyling.StyleButton(LoginButton, LoginStrings.LoginButton, ControlStylingConfig.Font_Regular, ControlStylingConfig.Small_FontSize);
            LoginButton.Click += (object sender, EventArgs e) =>
            {
                TryRockBind( );
            };

            CancelButton = view.FindViewById <Button>(Resource.Id.cancelButton);
            ControlStyling.StyleButton(CancelButton, GeneralStrings.Cancel, ControlStylingConfig.Font_Regular, ControlStylingConfig.Small_FontSize);
            CancelButton.Background = null;
            CancelButton.Click     += (object sender, EventArgs e) =>
            {
                SpringboardParent.ModalFragmentDone(null);
            };


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

            ControlStyling.StyleUILabel(additionalOptions, ControlStylingConfig.Font_Regular, ControlStylingConfig.Small_FontSize);
            additionalOptions.Text = LoginStrings.AdditionalOptions;

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

            ControlStyling.StyleUILabel(orTextView, ControlStylingConfig.Font_Regular, ControlStylingConfig.Small_FontSize);
            orTextView.Text = LoginStrings.OrString;


            RegisterButton = view.FindViewById <Button>(Resource.Id.registerButton);
            ControlStyling.StyleButton(RegisterButton, LoginStrings.RegisterButton, ControlStylingConfig.Font_Regular, ControlStylingConfig.Small_FontSize);
            RegisterButton.Click += (object sender, EventArgs e) =>
            {
                SpringboardParent.ModalFragmentDone(null);
                SpringboardParent.RegisterNewUser( );
            };

            ForgotPasswordButton = view.FindViewById <Button>(Resource.Id.forgotPasswordButton);
            ControlStyling.StyleButton(ForgotPasswordButton, LoginStrings.ForgotPasswordButton, ControlStylingConfig.Font_Regular, ControlStylingConfig.Small_FontSize);
            ForgotPasswordButton.Click += (object sender, EventArgs e) =>
            {
                TaskWebFragment.HandleUrl(true, true, LoginConfig.ForgotPassword_Url, null, null);
            };

            // get the username field and background
            UsernameLayer = view.FindViewById <View>(Resource.Id.login_background);
            ControlStyling.StyleBGLayer(UsernameLayer);

            UsernameField   = view.FindViewById <EditText>(Resource.Id.usernameText);
            UserNameBGColor = ControlStylingConfig.BG_Layer_Color;
            ControlStyling.StyleTextField(UsernameField, LoginStrings.UsernamePlaceholder, ControlStylingConfig.Font_Regular, ControlStylingConfig.Medium_FontSize);

            View borderView = UsernameLayer.FindViewById <View>(Resource.Id.middle_border);

            borderView.SetBackgroundColor(Rock.Mobile.UI.Util.GetUIColor(ControlStylingConfig.BG_Layer_BorderColor));


            // get the password field and background
            PasswordLayer = view.FindViewById <View>(Resource.Id.password_background);
            ControlStyling.StyleBGLayer(PasswordLayer);
            PasswordField   = view.FindViewById <EditText>(Resource.Id.passwordText);
            PasswordBGColor = ControlStylingConfig.BG_Layer_Color;
            ControlStyling.StyleTextField(PasswordField, LoginStrings.PasswordPlaceholder, ControlStylingConfig.Font_Regular, ControlStylingConfig.Medium_FontSize);

            LoginResultLabel = view.FindViewById <TextView>(Resource.Id.loginResult);
            ControlStyling.StyleUILabel(LoginResultLabel, ControlStylingConfig.Font_Regular, ControlStylingConfig.Medium_FontSize);

            // Setup the facebook button
            FacebookButton            = view.FindViewById <ImageButton>(Resource.Id.facebookButton);
            FacebookButton.Background = null;
            FacebookButton.Click     += (object sender, EventArgs e) =>
            {
                TryFacebookBind( );
            };

            // invoke a webview
            WebLayout = new WebLayout(Rock.Mobile.PlatformSpecific.Android.Core.Context);
            WebLayout.LayoutParameters = new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MatchParent, ViewGroup.LayoutParams.MatchParent);
            WebLayout.SetBackgroundColor(Android.Graphics.Color.Black);

            return(view);
        }