Esempio n. 1
0
    private void OTPSubmitCallback(ResponseData <UserData> obj)
    {
        LoaderPanel.SetActive(false);

        if (obj != null)
        {
            if (obj.status)
            {
                navigationPanelsList.Add(VerificationPanel);

                if (oTPInitiator == OTPInitiator.ForgotPassword)
                {
                    ActivatePanel(PasswordPanel.name);
                }
                else if (oTPInitiator == OTPInitiator.Registration)
                {
                    ActivatePanel(ChooseUserNamePanel.name);
                }
            }
            else
            {
                VerificationScreenMessage.text = obj.message;
            }
        }
        else
        {
            VerificationScreenMessage.text = "Some error! Please try after some time.";
        }
    }
Esempio n. 2
0
 private void StudentDetailsSubmitCallback(ResponseData <UserData> obj)
 {
     LoaderPanel.SetActive(false);
     if (obj != null)
     {
         if (obj.status)
         {
             print(">>>\n" + JsonUtility.ToJson(obj));
             Globals.UserLoginDetails = obj.data;
             Globals.USERNAME         = obj.data.username;
             navigationPanelsList.Clear();
             ClearInpuFields();
             ActivatePanel(LoginPanel.name);
             loginPopup.SetPopup(obj.message, () => Globals.LoadLevel(Globals.HOME_SCENE));
         }
         else
         {
             GradeScreenMessage.text = obj.message;
         }
     }
     else
     {
         GradeScreenMessage.text = "Some error! Please try after some time.";
     }
 }
Esempio n. 3
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            AppCenter.Start("ae5403f8-deb8-41b5-8f6c-ebd2bd41648f", typeof(Crashes), typeof(Analytics));
            Analytics.TrackEvent("Application launching");

            base.OnCreate(savedInstanceState);

            AppContext.SetSwitch("System.Net.Http.SocketsHttpHandler.Http2UnencryptedSupport", true);
            Application.UnregisterActivityLifecycleCallbacks(ActivityLifecycleCallbacks.Instance);
            Application.RegisterActivityLifecycleCallbacks(ActivityLifecycleCallbacks.Instance);

            ApplicationContext.RegisterReceiver(AbortBroadcastReceiver.Instance, new IntentFilter(AbortBroadcastReceiver.ActionKindHibernate));
            ApplicationContext.RegisterReceiver(AbortBroadcastReceiver.Instance, new IntentFilter(AbortBroadcastReceiver.ActionKindRestart));
            ApplicationContext.RegisterReceiver(AbortBroadcastReceiver.Instance, new IntentFilter(AbortBroadcastReceiver.ActionKindShutdown));

            NLog.LogManager.Configuration = new XmlLoggingConfiguration("assets/nlog.config");
            Xamarin.Essentials.Platform.Init(this, savedInstanceState);
            SetContentView(Resource.Layout.activity_main);

            _loaderPanel = FindViewById <LoaderPanel>(Resource.Id.content_display_frame_loading_panel);
            GrpcRequestObserver.CallRunning  -= UpdateLoaderPanel;
            GrpcRequestObserver.CallFinished -= UpdateLoaderPanel;
            GrpcRequestObserver.CallRunning  += UpdateLoaderPanel;
            GrpcRequestObserver.CallFinished += UpdateLoaderPanel;

            NotificationHelper.SetupNotificationChannels();

            var toolbar = FindViewById <Toolbar>(Resource.Id.toolbar);

            SetSupportActionBar(toolbar);

            SetupGitCommitInfo();

            var drawer = FindViewById <DrawerLayout>(Resource.Id.drawer_layout);
            var toggle = new ActionBarDrawerToggle(this, drawer, toolbar, Resource.String.navigation_drawer_open,
                                                   Resource.String.navigation_drawer_close);

            drawer.AddDrawerListener(toggle);
            toggle.SyncState();

            var navigationView = FindViewById <NavigationView>(Resource.Id.nav_view);

            navigationView.SetNavigationItemSelectedListener(this);

            if (savedInstanceState == null)
            {
                using (var transaction = SupportFragmentManager.BeginTransaction())
                {
                    transaction.Replace(Resource.Id.content_display_frame, new HostSelectionFragment());
                    transaction.DisallowAddToBackStack();
                    transaction.Commit();
                }
            }
            else
            {
                Log.Debug("Activity restarting - skipping replacing content fragment");
            }

            Analytics.TrackEvent("Application started");
        }
Esempio n. 4
0
 public void ForgotPasswordSubmit()
 {
     if (string.IsNullOrEmpty(EmailFPInput.text))
     {
         EmailFPInput.GetComponent <ValidateInput>().Validate(string.Empty);
     }
     else if (EmailFPInput.GetComponent <ValidateInput>().isValidInput)
     {
         emailid = EmailFPInput.text;
         LoaderPanel.SetActive(true);
         WebRequestObject.ProcessForgotPassword(emailid, ForgotPasswordSubmitCallback);
     }
 }
Esempio n. 5
0
        private async void admincheck()
        {
            FirebaseResponse getter = await client.GetAsync("admin/isadminexist");

            string isexist = getter.ResultAs <string>();

            if (isexist != null)
            {
                RegPanel.Hide();
                Regbtn.Hide();
            }

            LoaderPanel.Hide();
        }
Esempio n. 6
0
    private void GradeSubmit(int gradeNo)
    {
        if (GradeIsAvailable(gradeNo))
        {
            grade = gradeNo;

            // Api for submit student details
            LoaderPanel.SetActive(true);
            WebRequestObject.ProcessStudentDetailsSubmit(user_id, username, emailid, passwordId, grade, StudentDetailsSubmitCallback);
        }
        else
        {
            loginPopup.gameObject.SetActive(true);
            loginPopup.SetPopup("COMING SOON! TRY ANOTHER GRADE!", null);
        }
    }
Esempio n. 7
0
        /// <summary>
        /// 加载场景
        /// </summary>
        /// <param name="level"></param>
        public void LoadLevel(SceneType level)
        {
            sceneType = level;

            if (loaderScene == null)
            {
                loaderScene = Game.GetScene <LoaderScene>();
            }

            loaderPanel = panelMgr.CreatePanel(UI.PanelName.LoaderPanel) as LoaderPanel;
            loaderPanel.SetLoaderProgress(0);

            var       scene        = SceneManager.GetActiveScene();
            SceneType currentLevel = (SceneType)scene.buildIndex;

            StartCoroutine(OnLoadLoaderLevel(currentLevel));
        }
Esempio n. 8
0
    private void ActivatePanel(string panelName)
    {
        if (string.IsNullOrEmpty(panelName))
        {
            return;
        }

        LoginPanel.SetActive(string.Equals(LoginPanel.name, panelName));
        PasswordPanel.SetActive(string.Equals(PasswordPanel.name, panelName));
        ForgotPassowrdPanel.SetActive(string.Equals(ForgotPassowrdPanel.name, panelName));
        WhoAreYouPanel.SetActive(string.Equals(WhoAreYouPanel.name, panelName));
        VerificationPanel.SetActive(string.Equals(VerificationPanel.name, panelName));
        SignUpPanel.SetActive(string.Equals(SignUpPanel.name, panelName));
        ChooseUserNamePanel.SetActive(string.Equals(ChooseUserNamePanel.name, panelName));
        GradePanel.SetActive(string.Equals(GradePanel.name, panelName));
        LoaderPanel.SetActive(string.Equals(LoaderPanel.name, panelName));
    }
Esempio n. 9
0
 private void ForgotPassOTPCallback(ResponseData <UserData> obj)
 {
     LoaderPanel.SetActive(false);
     if (obj != null)
     {
         if (obj.status)
         {
             ClearInpuFields();
             navigationPanelsList.Add(VerificationPanel);
             oTPInitiator = OTPInitiator.ForgotPassword;
             ActivatePanel(PasswordPanel.name);
         }
         else
         {
             VerificationScreenMessage.text = obj.message;
         }
     }
 }
Esempio n. 10
0
    public void OTPSubmit(string otp_intered)
    {
        ClearInpuFields();
        LoaderPanel.SetActive(true);

        if (oTPInitiator == OTPInitiator.ForgotPassword)
        {
            print("user_id " + user_id);
            print("otp_intered " + otp_intered);

            WebRequestObject.ProcessForgotPasswordOTP(user_id, otp_intered, ForgotPassOTPCallback);

            navigationPanelsList.Add(VerificationPanel);
        }
        else if (oTPInitiator == OTPInitiator.Registration)
        {
            WebRequestObject.ProcessOTP(user_id, otp_intered, OTPSubmitCallback);
        }
    }
Esempio n. 11
0
 public void PasswordSubmit()
 {
     // perform login here with username and password available
     if (oTPInitiator == OTPInitiator.Login)
     {
         LoaderPanel.SetActive(true);
         WebRequestObject.ProcessLogin(username, passwordId, LoginCallback);
     }
     if (oTPInitiator == OTPInitiator.ForgotPassword)
     {
         LoaderPanel.SetActive(true);
         WebRequestObject.ForgotPasswordNewPasswordSubmit(user_id, passwordId, passwordId, PasswordSubmitCallback);
     }
     else if (oTPInitiator == OTPInitiator.Registration)
     {
         //navigationPanelsList.Clear();
         ClearInpuFields();
         ActivatePanel(GradePanel.name);
     }
 }
Esempio n. 12
0
 private void FBLoginCallback(ResponseData <FBLoginResponseData> obj)
 {
     LoaderPanel.SetActive(false);
     if (obj != null)
     {
         if (obj.status)
         {
             Globals.fBLoginResponseData = obj.data;
             Globals.LoginType           = 1;
             navigationPanelsList.Clear();
             Globals.LoadLevel(Globals.HOME_SCENE);
         }
         else
         {
             LoginScreenMessage.text = obj.message;
         }
     }
     else
     {
         LoginScreenMessage.text = "Some error! Please try after some time.";
     }
 }
Esempio n. 13
0
 private void ResendOTPCallback(ResponseData <UserData> obj)
 {
     LoaderPanel.SetActive(false);
     if (obj != null)
     {
         if (obj.status)
         {
             VerificationScreenMessage.color = Color.green;
             VerificationScreenMessage.text  = obj.message;
         }
         else
         {
             VerificationScreenMessage.color = Color.red;
             VerificationScreenMessage.text  = obj.message;
         }
     }
     else
     {
         VerificationScreenMessage.color = Color.red;
         VerificationScreenMessage.text  = "Some error! Please try after some time.";
     }
 }
Esempio n. 14
0
 private void LoginCallback(ResponseData <UserData> obj)
 {
     LoaderPanel.SetActive(false);
     if (obj == null)
     {
         PasswordScreenMessage.text = "Some error in login! Please try after some time.";
     }
     if (obj != null)
     {
         if (obj.status)
         {
             ClearInpuFields();
             navigationPanelsList.Clear();
             Globals.UserLoginDetails = obj.data;
             Globals.LoadLevel(Globals.HOME_SCENE);
         }
         else
         {
             PasswordScreenMessage.text = obj.message;
         }
     }
 }
Esempio n. 15
0
 private void PasswordSubmitCallback(ResponseData <UserData> obj)
 {
     LoaderPanel.SetActive(false);
     if (oTPInitiator == OTPInitiator.ForgotPassword)
     {
         if (obj != null)
         {
             if (obj.status)
             {
                 ClearInpuFields();
                 navigationPanelsList.Clear();
                 loginPopup.SetPopup(obj.message, () => Globals.LoadLevel(Globals.HOME_SCENE));
             }
             else
             {
                 PasswordScreenMessage.text = obj.message;
             }
         }
         else
         {
             PasswordScreenMessage.text = "Some error! Please try after some time.";
         }
     }
 }
Esempio n. 16
0
    private void ForgotPasswordSubmitCallback(ResponseData <UserData> obj)
    {
        LoaderPanel.SetActive(false);
        if (obj == null)
        {
            ForgotPasswordScreenMessage.text = "Some error! Please try after some time.";
        }
        else
        {
            if (obj.status)
            {
                navigationPanelsList.Add(ForgotPassowrdPanel);
                ClearInpuFields();
                oTPInitiator = OTPInitiator.ForgotPassword;
                user_id      = obj.data.user_id;

                ActivatePanel(VerificationPanel.name);
            }
            else
            {
                ForgotPasswordScreenMessage.text = obj.message;
            }
        }
    }
Esempio n. 17
0
 public void ResendOtpClicked()
 {
     LoaderPanel.SetActive(true);
     WebRequestObject.ProcessResendOTP(user_id, ResendOTPCallback);
 }
Esempio n. 18
0
 void OnFBLogin(string token)
 {
     LoaderPanel.SetActive(true);
     WebRequestObject.ProcessFBLogin(token, FBLoginCallback);
 }