Exemplo n.º 1
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);

            SetContentView(Resource.Layout.NoInternet);

            Android.Support.V7.App.AlertDialog.Builder dialog = new Android.Support.V7.App.AlertDialog.Builder(this);
            dialog.SetMessage(GetString(Resource.String.NoInternet));
            dialog.SetNeutralButton("OK", this);
            dialog.Create().Show();

            MainToolbar    = FindViewById <SupportToolBar>(Resource.Id.toolbar);
            TryAgainButton = FindViewById <Button>(Resource.Id.RetryButton);
            LoadingPanel   = FindViewById <View>(Resource.Id.loadingPanel);
            NoInternetText = FindViewById <TextView>(Resource.Id.NoInternetText);

            LoadingPanel.Visibility = ViewStates.Invisible;

            if (Android.OS.Build.VERSION.SdkInt >= BuildVersionCodes.Lollipop)
            {
                TryAgainButton.SetBackgroundResource(Resource.Color.button_ripple);
            }

            MainToolbar.SetLogo(Resource.Drawable.ic_cloud_queue_white_24dp);
            MainToolbar.Title            = "Merit Money";
            MainToolbar.TitleMarginStart = AdditionalFunctions.ConvertDpToPx(40);

            TryAgainButton.Click += TryAgainButton_Click;
        }
Exemplo n.º 2
0
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);

            FrameLayout MainLayout = new FrameLayout(this);

            SetContentView(MainLayout);
            base.CombineWith(MainLayout, Resource.Layout.Main, ActivityIs.Home);

            MainToolbar     = FindViewById <SupportToolBar>(Resource.Id.toolbar);
            SayThanksButton = FindViewById <Button>(Resource.Id.thanksButton);
            UserAvatar      = FindViewById <CircularImageView>(Resource.Id.UserAvatar);
            UserName        = FindViewById <TextView>(Resource.Id.UserName);
            UserEmail       = FindViewById <TextView>(Resource.Id.UserEmail);
            Balance         = FindViewById <TextView>(Resource.Id.ABpoints);
            Rewards         = FindViewById <TextView>(Resource.Id.Rpoints);
            Distribute      = FindViewById <TextView>(Resource.Id.CDpoints);
            RefreshInfo     = FindViewById <SwipeRefreshLayout>(Resource.Id.activity_main_swipe_refresh_layout);

            ABPointstext = FindViewById <TextView>(Resource.Id.ABpointsText);
            RPointstext  = FindViewById <TextView>(Resource.Id.RpointsText);
            CDPointstext = FindViewById <TextView>(Resource.Id.CDpointsText);

            ISharedPreferences info = Application.Context.GetSharedPreferences(GetString(Resource.String.ApplicationInfo), FileCreationMode.Private);

            Loggedin = info.GetBoolean(GetString(Resource.String.LogIn), false);

            if (!Loggedin)
            {
                Intent LogInIntent = new Intent(this, typeof(LogInActivity));
                LogInIntent.AddFlags(ActivityFlags.NoAnimation);
                this.StartActivityForResult(LogInIntent, LOG_IN_REQUEST);
                OverridePendingTransition(0, 0);
            }
            else
            {
                InitializeProfile();
            }

            CorrectPointsText();

            if (Android.OS.Build.VERSION.SdkInt >= BuildVersionCodes.Lollipop)
            {
                SayThanksButton.SetBackgroundResource(Resource.Color.button_ripple);
            }

            MainToolbar.InflateMenu(Resource.Menu.top_menu);
            MainToolbar.SetLogo(Resource.Drawable.ic_cloud_queue_white_24dp);
            MainToolbar.Title            = "Merit Money";
            MainToolbar.TitleMarginStart = AdditionalFunctions.ConvertDpToPx(40);

            SayThanksButton.Click     += SayThanksButton_Click;
            MainToolbar.MenuItemClick += MainToolbar_MenuItemClick;
            RefreshInfo.Refresh       += Profile_Refresh;
        }
Exemplo n.º 3
0
        protected void CombineWith(FrameLayout MainLayout,
                                   int mainLayoutId, ActivityIs curScreen)
        {
            LayoutInflater inflate = (LayoutInflater)GetSystemService(Context.LayoutInflaterService);

            RelativeLayout main = (RelativeLayout)LayoutInflater.Inflate(
                mainLayoutId, null);
            RelativeLayout bottom = (RelativeLayout)LayoutInflater.Inflate(
                Resource.Layout.bottom_bar, null);

            main.SetPadding(0, 0, 0, AdditionalFunctions.ConvertDpToPx(BottomHeightInDps));

            MainLayout.AddView(main, RelativeLayout.LayoutParams.MatchParent,
                               RelativeLayout.LayoutParams.MatchParent);
            MainLayout.AddView(bottom, RelativeLayout.LayoutParams.MatchParent,
                               RelativeLayout.LayoutParams.MatchParent);

            BottomBarClickInit(curScreen);
        }
Exemplo n.º 4
0
 private int GetBottomHeightInPx()
 {
     return(AdditionalFunctions.ConvertDpToPx(BottomHeightInDps));
 }