Exemplo n.º 1
0
        /// <summary>
        ///  Get shared preference Manager with Encryption on for Key and value
        /// </summary>
        /// <param name="context"></param>
        /// <returns>SharedPreference Manager Object</returns>
        public SharedPreferencesManager GetSharedPreferenceManagerWithEncriptionEnabled(Context context)
        {
            SharedPreferencesManager sharedPreferencesManager = new SharedPreferencesManager(context,
                                                                                             Global.ConstantsDroid.SHARED_PREF_NAME, FileCreationMode.Private);

            return(sharedPreferencesManager);
        }
Exemplo n.º 2
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);
            Window.RequestFeature(WindowFeatures.NoTitle);

            // Set our view from the "main" layout resource
            SetContentView(Resource.Layout.activity_add_calendar_event);

            mActivity = this;

            /// Shared Preference manager
            mSharedPreferencesManager = UtilityDroid.GetInstance().
                                        GetSharedPreferenceManagerWithEncriptionEnabled(mActivity.ApplicationContext);
            loginResponse = mSharedPreferencesManager.GetLoginResponse();
            isAddEvent    = Intent.GetBooleanExtra("isAddEvent", false);
            if (!isAddEvent)
            {
                string eventObjString = Intent.GetStringExtra("eventObj");
                eventObj = JsonConvert.DeserializeObject <CalendarEventResponse>(eventObjString);
            }
            try
            {
                Init();
                if (!isAddEvent)
                {
                    SetEventDetails();
                }
            }
            catch (Exception)
            {
            }
        }
        protected override void OnResume()
        {
            base.OnResume();
            /// Shared Preference manager
            SharedPreferencesManager _sharedPreferencesManager = UtilityDroid.GetInstance().
                                                                 GetSharedPreferenceManagerWithEncriptionEnabled(_context.ApplicationContext);


            string retreiveVal = _sharedPreferencesManager.GetString(ConstantsDroid.MOBILE_NUMBER_PREFERENCE, "");

            var handler = new Handler();

            Action myAction = () => {
                if (!string.IsNullOrEmpty(retreiveVal))
                {
                    StartActivity(new Intent(_context, typeof(HomeActivity)));
                    OverridePendingTransition(Resource.Animation.animation_enter,
                                              Resource.Animation.animation_leave);
                    Finish();
                }
                else
                {
                    StartActivity(new Intent(_context, typeof(RegisterActivity)));
                    OverridePendingTransition(Resource.Animation.animation_enter,
                                              Resource.Animation.animation_leave);
                    Finish();
                }
            };

            handler.PostDelayed(myAction, 2000);
        }
Exemplo n.º 4
0
        public BluetoothChatActivity()
        {
            var context = Application.Context;

            _shared         = SharedPreferencesManager.GetInstance(context);
            _localeProvider = LanguageProvider.GetInstance;
            _translator     = new TranslatorApiService();
            _receiver       = new DiscoverableModeReceiver();
        }
Exemplo n.º 5
0
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);

            _context = this;

            // Set our view from the "main" layout resource
            SetContentView(Resource.Layout.Activity_Change_Number);

            // Set toolbar

            _toolbar = FindViewById <Android.Support.V7.Widget.Toolbar>(Resource.Id.app_bar);
            SetSupportActionBar(_toolbar);
            SupportActionBar.SetTitle(Resource.String.menu_title);
            SupportActionBar.SetDisplayHomeAsUpEnabled(true);

            /// Shared Preference manager
            SharedPreferencesManager _sharedPreferencesManager = UtilityDroid.GetInstance().
                                                                 GetSharedPreferenceManagerWithEncriptionEnabled(_context.ApplicationContext);
            string retreiveVal = _sharedPreferencesManager.GetString(ConstantsDroid.MOBILE_NUMBER_PREFERENCE, "");


            _edtMobNumber = FindViewById <EditText>(Resource.Id.edtMobNumber);
            PhoneNumberFormattingTextWatcher watcher = new PhoneNumberFormattingTextWatcher("US");

            _edtMobNumber.AddTextChangedListener(watcher);

            // Get our button from the layout resource,
            // and attach an event to it
            Button button = FindViewById <Button>(Resource.Id.btn_continue);

            button.TransformationMethod = null;
            button.Click += delegate
            {
                if (!string.IsNullOrEmpty(_edtMobNumber.Text.ToString()))
                {
                    string finalVal = _edtMobNumber.Text.ToString().Replace("(", "").
                                      Replace(")", "").Replace(" ", "").Replace("-", "");

                    if (finalVal.Length == 10)
                    {
                        _sharedPreferencesManager.PutString(
                            ConstantsDroid.MOBILE_NUMBER_PREFERENCE, finalVal);
                        Finish();
                    }

                    else
                    {
                        UtilityDroid.GetInstance().ShowAlertDialog((Activity)_context, "Error", "Please enter valid number.", "Cancel", "Ok");
                    }
                }
                else
                {
                    UtilityDroid.GetInstance().ShowAlertDialog((Activity)_context, "Error", "Please enter valid number.", "Cancel", "Ok");
                }
            };
        }
Exemplo n.º 6
0
        public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
        {
            // Use this to return your custom view for this Fragment
            view           = inflater.Inflate(Resource.Layout.fragment_notes_list, container, false);
            HasOptionsMenu = true;

            mActivity = Activity;

            /// Shared Preference manager
            mSharedPreferencesManager = UtilityDroid.GetInstance().
                                        GetSharedPreferenceManagerWithEncriptionEnabled(mActivity.ApplicationContext);
            objLoginResponse = mSharedPreferencesManager.GetLoginResponse();

            spin_current_entity = view.FindViewById <Spinner>(
                Resource.Id.spin_current_entity);
            spin_account_code = view.FindViewById <Spinner>(
                Resource.Id.spin_account_code);

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

            txt_from_date = view.FindViewById <TextView>(
                Resource.Id.txt_from_date);
            txt_from_date.Click += Edt_from_date_Click;

            txt_to_date = view.FindViewById <TextView>(
                Resource.Id.txt_to_date);
            txt_to_date.Click += Edt_to_date_Click;

            DateTime now = DateTime.Now;

            DateTime startDate       = new DateTime(now.Year, now.Month, 1);
            string   startDateString = startDate.ToString(UtilityDroid.DATE_FORMAT);

            txt_from_date.Text = startDateString.Replace("-", "/");

            DateTime endDate       = startDate.AddMonths(1).AddDays(-1);
            string   endDateString = endDate.ToString(UtilityDroid.DATE_FORMAT);

            txt_to_date.Text = endDateString.Replace("-", "/");

            ImageView img_search = view.FindViewById <ImageView>(Resource.Id.img_search);

            img_search.Click += Img_search_Click;

            ((HomeActivity)mActivity).SetTitle(GetString(Resource.String.notes_title));

            // Set Current Entity in Spinner
            InitEntitySpinnerValues();

            // Initialize listener for spinner
            InitializeListeners();

            return(view);
        }
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);
            Window.RequestFeature(WindowFeatures.NoTitle);

            // Set our view from the "main" layout resource
            SetContentView(Resource.Layout.activity_splash);

            mActivity = this;

            /// Shared Preference manager
            mSharedPreferencesManager = UtilityDroid.GetInstance().
                                        GetSharedPreferenceManagerWithEncriptionEnabled(mActivity.ApplicationContext);
        }
        public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
        {
            mView = inflater.Inflate(Resource.Layout.dialog_add_order_fragment, container, false);

            mActivity = Activity;
            /// Shared Preference manager
            mSharedPreferencesManager = UtilityDroid.GetInstance().
                                        GetSharedPreferenceManagerWithEncriptionEnabled(mActivity.ApplicationContext);

            Dialog.SetTitle(Resource.String.ledger_order_item_title);
            Dialog.SetCancelable(false); //dismiss window on touch outside

            return(mView);
        }
Exemplo n.º 9
0
        public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
        {
            // Use this to return your custom view for this Fragment
            view = inflater.Inflate(Resource.Layout.activity_add_third_order, container, false);

            mActivity = Activity;

            /// Shared Preference manager
            mSharedPreferencesManager = UtilityDroid.GetInstance().
                                        GetSharedPreferenceManagerWithEncriptionEnabled(mActivity.ApplicationContext);

            ledgerOrderObj = ((AddOrderFirstActivity)mActivity).LedgerOrderObj;

            return(view);
        }
Exemplo n.º 10
0
        public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
        {
            // Use this to return your custom view for this Fragment
            view           = inflater.Inflate(Resource.Layout.fragment_order_list, container, false);
            HasOptionsMenu = true;

            mActivity = Activity;

            /// Shared Preference manager
            mSharedPreferencesManager = UtilityDroid.GetInstance().
                                        GetSharedPreferenceManagerWithEncriptionEnabled(mActivity.ApplicationContext);

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

            txt_from_date = view.FindViewById <TextView>(
                Resource.Id.txt_from_date);
            txt_from_date.Click += Edt_from_date_Click;

            txt_to_date = view.FindViewById <TextView>(
                Resource.Id.txt_to_date);
            txt_to_date.Click += Edt_to_date_Click;

            DateTime now = DateTime.Now;

            DateTime startDate       = new DateTime(now.Year, now.Month, 1);
            string   startDateString = startDate.ToString(UtilityDroid.CALENDAR_DATE_FORMAT);

            txt_from_date.Text = startDateString.Replace("-", "/");

            DateTime endDate       = startDate.AddMonths(1).AddDays(-1);
            string   endDateString = endDate.ToString(UtilityDroid.CALENDAR_DATE_FORMAT);

            txt_to_date.Text = endDateString.Replace("-", "/");

            ((HomeActivity)mActivity).SetTitle(GetString(Resource.String.order_title));

            ImageView img_search = view.FindViewById <ImageView>(
                Resource.Id.img_search);

            img_search.Click += Img_search_Click;

            return(view);
        }
Exemplo n.º 11
0
        /// <summary>
        /// Returns fragment alert screen view
        /// </summary>
        /// <param name="inflater"></param>-
        /// <param name="container"></param>
        /// <param name="savedInstanceState"></param>
        /// <returns></returns>
        public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
        {
            // Use this to return your custom view for this Fragment
            view           = inflater.Inflate(Resource.Layout.fragment_inbox, container, false);
            HasOptionsMenu = true;
            mActivity      = Activity;


            string title = Arguments.GetString("title");

            ((HomeActivity)mActivity).SetTitle(title);

            /// Shared Preference manager
            mSharedPreferencesManager = UtilityDroid.GetInstance().
                                        GetSharedPreferenceManagerWithEncriptionEnabled(mActivity.ApplicationContext);

            Init();
            return(view);
        }
Exemplo n.º 12
0
        public override void OnActivityCreated(Bundle savedInstanceState)
        {
            base.OnActivityCreated(savedInstanceState);

            _tvSendAlertLbl = _view.FindViewById <TextView>(Resource.Id.tvSendAlertLbl);
            _tvMobVal       = _view.FindViewById <TextView>(Resource.Id.tvMobVal);
            _imgSendAlert   = _view.FindViewById <ImageView>(Resource.Id.img_send_alert);
            _relativeMob    = (RelativeLayout)_view.FindViewById(Resource.Id.relativeMob);

            _sharedPreferencesManager = UtilityDroid.GetInstance().
                                        GetSharedPreferenceManagerWithEncriptionEnabled(Activity.ApplicationContext);

            _imgSendAlert.Enabled = true;
            _imgSendAlert.SetOnTouchListener(this);

            /// Shared Preference manager
            string retreiveVal = _sharedPreferencesManager.GetString(ConstantsDroid.MOBILE_NUMBER_PREFERENCE, "");

            _tvMobVal.Text = String.Format("{0:(###) ###-####}", double.Parse(retreiveVal));
        }
Exemplo n.º 13
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);
            Window.RequestFeature(WindowFeatures.NoTitle);

            // Set our view from the "main" layout resource
            SetContentView(Resource.Layout.activity_email_detail);

            mActivity = this;

            /// Shared Preference manager
            mSharedPreferencesManager = UtilityDroid.GetInstance().
                                        GetSharedPreferenceManagerWithEncriptionEnabled(mActivity.ApplicationContext);

            try
            {
                Init();

                emailTypeId = Intent.GetIntExtra("emailTypeId", -1);
                string emailResonseString = Intent.GetStringExtra("emailResponseString");
                emailResponseObj = JsonConvert.DeserializeObject <EmailResponse>(emailResonseString);

                TextView txt_subject_val = FindViewById <TextView>(Resource.Id.txt_subject_val);
                TextView txt_img_lbl     = FindViewById <TextView>(Resource.Id.txt_img_lbl);
                TextView txt_sender_name = FindViewById <TextView>(Resource.Id.txt_sender_name);

                txt_subject_val.Text = emailResponseObj.Subject;
                txt_sender_name.Text = emailResponseObj.SenderName;

                string lbl = emailResponseObj.SenderName.Substring(0, 1);
                txt_img_lbl.Text = lbl;



                GetEmailDetails(emailResponseObj.MailId,
                                mSharedPreferencesManager.GetString(ConstantsDroid.USER_ID_PREFERENCE, ""));
            }
            catch (Exception)
            {
            }
        }
Exemplo n.º 14
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            try
            {
                base.OnCreate(savedInstanceState);
                Window.RequestFeature(WindowFeatures.NoTitle);

                // Set our view from the "main" layout resource
                SetContentView(Resource.Layout.activity_add_first_order);

                mActivity = this;

                /// Shared Preference manager
                mSharedPreferencesManager = UtilityDroid.GetInstance().
                                            GetSharedPreferenceManagerWithEncriptionEnabled(mActivity.ApplicationContext);

                LedgerOrderObj = new LedgerOrder();

                isEdit = Intent.GetBooleanExtra("isEdit", false);
                string orderObjString = Intent.GetStringExtra("orderObj");

                if (orderObjString != null)
                {
                    LedgerOrderObj = JsonConvert.DeserializeObject <LedgerOrder>(orderObjString);
                    if (isEdit)
                    {
                        GetLedgerItems(LedgerOrderObj.CompCode, LedgerOrderObj.JournalNo);
                    }
                }



                Init();

                DisplayFragment(isEdit);
            }
            catch (Exception e)
            {
            }
        }
Exemplo n.º 15
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);
            SetContentView(Resource.Layout.activity_home);
            drawerLayout = FindViewById <DrawerLayout>(Resource.Id.drawer_layout);

            mActivity = this;

            /// Shared Preference manager
            mSharedPreferencesManager = UtilityDroid.GetInstance().
                                        GetSharedPreferenceManagerWithEncriptionEnabled(mActivity.ApplicationContext);


            // Init toolbar
            toolbar = FindViewById <Toolbar>(Resource.Id.app_bar);
            SetSupportActionBar(toolbar);
            SupportActionBar.SetTitle(Resource.String.inbox_title);


            SupportActionBar.SetDisplayHomeAsUpEnabled(true);
            SupportActionBar.SetDisplayShowHomeEnabled(true);

            SetupSideMenu();

            bool isOrderListScreen = Intent.GetBooleanExtra("addOrder", false);

            if (isOrderListScreen)
            {
                ShowScreen(0, 0);
            }
            else
            {
                Android.Support.V4.App.Fragment fragment = InboxFragment.GetInstance(WebserviceConstants.
                                                                                     INBOX_EMAIL_TYPE_ID, GetString(Resource.String.inbox_title));
                AddFrament(fragment, false);
                // mAdapter.SetSelectedPosition(0);
            }
        }
Exemplo n.º 16
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);
            Window.RequestFeature(WindowFeatures.NoTitle);

            // Set our view from the "main" layout resource
            SetContentView(Resource.Layout.activity_add_notes);

            mActivity = this;

            /// Shared Preference manager
            mSharedPreferencesManager = UtilityDroid.GetInstance().
                                        GetSharedPreferenceManagerWithEncriptionEnabled(mActivity.ApplicationContext);
            objLoginResponse = mSharedPreferencesManager.GetLoginResponse();

            isAddNote = Intent.GetBooleanExtra("isAddNote", false);
            if (!isAddNote)
            {
                string noteObjString = Intent.GetStringExtra("noteObj");
                noteObj     = JsonConvert.DeserializeObject <CrmNotesResponse>(noteObjString);
                entityCode  = Intent.GetStringExtra("entityCode");
                accountCode = Intent.GetStringExtra("accountCode");
                accountId   = Intent.GetStringExtra("accountId");
            }

            try
            {
                Init();
                if (!isAddNote)
                {
                    SetNotesDetails();
                }
            }
            catch (Exception e)
            {
            }
        }
Exemplo n.º 17
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);
            Window.RequestFeature(WindowFeatures.NoTitle);
            // Set our view from the "main" layout resource
            SetContentView(Resource.Layout.activity_login);

            mActivity = this;


            /// Shared Preference manager
            mSharedPreferencesManager = UtilityDroid.GetInstance().
                                        GetSharedPreferenceManagerWithEncriptionEnabled(mActivity.ApplicationContext);


            // Get our button from the layout resource,
            // and attach an event to it
            Button button = FindViewById <Button>(Resource.Id.btn_login);

            button.Click += Button_Click;

            CheckBox chk_show_pwd = FindViewById <CheckBox>(Resource.Id.chk_show_pwd);

            chk_show_pwd.CheckedChange += Chk_show_pwd_CheckedChange;

            edt_username      = FindViewById <EditText>(Resource.Id.edt_username);
            edt_password      = FindViewById <EditText>(Resource.Id.edt_password);
            txt_database_name = FindViewById <TextView>(Resource.Id.txt_database_name);

            chk_remember_me = FindViewById <CheckBox>(Resource.Id.chk_remember_me);
            radio_group     = FindViewById <RadioGroup>(Resource.Id.radio_group);

            radio_btn_db_demo         = FindViewById <RadioButton>(Resource.Id.radio_btn_db_demo);
            radio_btn_db_saas         = FindViewById <RadioButton>(Resource.Id.radio_btn_db_saas);
            radio_btn_db_hq           = FindViewById <RadioButton>(Resource.Id.radio_btn_db_hq);
            radio_btn_db_lucid        = FindViewById <RadioButton>(Resource.Id.radio_btn_db_lucid);
            radio_btn_db_demo.Checked = true;
            txt_database_name.Text    = GetString(Resource.String.db_demo);

            username = mSharedPreferencesManager.GetString(ConstantsDroid.USERNAME_PREFERENCE, "");
            password = mSharedPreferencesManager.GetString(ConstantsDroid.PASSWORD_PREFERENCE, "");
            string databaseName = mSharedPreferencesManager.GetString(ConstantsDroid.DATABASE_PREFERENCE, GetString(Resource.String.db_demo_connection));

            if (!string.IsNullOrEmpty(username) && !string.IsNullOrEmpty(password))
            {
                chk_remember_me.Checked = true;
                edt_username.Text       = username;
                edt_password.Text       = password;
                if (databaseName.Equals(GetString(Resource.String.db_saas_connection)))
                {
                    radio_btn_db_saas.Checked           = true;
                    WebserviceConstants.CONNECTION_NAME = GetString(Resource.String.db_saas_connection);
                    txt_database_name.Text = "(" + GetString(Resource.String.db_saas) + ")";
                }
                else if (databaseName.Equals(GetString(Resource.String.db_demo_connection)))
                {
                    radio_btn_db_demo.Checked           = true;
                    WebserviceConstants.CONNECTION_NAME = GetString(Resource.String.db_demo_connection);
                    txt_database_name.Text = "(" + GetString(Resource.String.db_demo) + ")";
                }
                else if (databaseName.Equals(GetString(Resource.String.db_hq_connection)))
                {
                    radio_btn_db_hq.Checked             = true;
                    WebserviceConstants.CONNECTION_NAME = GetString(Resource.String.db_hq_connection);
                    txt_database_name.Text = "(" + GetString(Resource.String.db_hq) + ")";
                }
                else
                {
                    radio_btn_db_lucid.Checked          = true;
                    WebserviceConstants.CONNECTION_NAME = GetString(Resource.String.db_lucid_connection);
                    txt_database_name.Text = "(" + GetString(Resource.String.db_lucid) + ")";
                }
            }

            spin_language = FindViewById <Spinner>(Resource.Id.spin_language);


            // Set Language in spinner
            InitLanguageSpinnerValues();
            SetLanguageSpinnerAdapter();

            // Initialize listener for spinner
            InitializeListeners();


            string preferenceLang = mSharedPreferencesManager.GetString(ConstantsDroid.APP_LANG_PREFERENCE, ConstantsDroid.LANG_ENGLISH_CODE);

            spin_language.SetSelection((preferenceLang.Equals(ConstantsDroid.LANG_ENGLISH_CODE)) ? 0 : 1);
            HelpMe.SetLocale(preferenceLang, mActivity);
        }
Exemplo n.º 18
0
        public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
        {
            // Use this to return your custom view for this Fragment
            view           = inflater.Inflate(Resource.Layout.fragment_calendar_expandable, container, false);
            HasOptionsMenu = true;

            mActivity = Activity;
            mSharedPreferencesManager = UtilityDroid.GetInstance().
                                        GetSharedPreferenceManagerWithEncriptionEnabled(mActivity.ApplicationContext);
            loginResponse        = mSharedPreferencesManager.GetLoginResponse();
            linear_user_and_type = view.FindViewById <LinearLayout>(
                Resource.Id.linear_user_and_type);
            relative_date_layout = view.FindViewById <RelativeLayout>(
                Resource.Id.relative_date_layout);
            relative_selected_layout = view.FindViewById <RelativeLayout>(
                Resource.Id.relative_selected_layout);
            txt_no_events = view.FindViewById <TextView>(
                Resource.Id.txt_no_events);
            txt_user_calendar_val = view.FindViewById <TextView>(
                Resource.Id.txt_user_calendar_val);
            ImageView img_search = view.FindViewById <ImageView>(
                Resource.Id.img_search);

            img_search.Click += Img_search_Click;

            ImageView img_return = view.FindViewById <ImageView>(
                Resource.Id.img_return);

            img_return.Click += Img_return_Click;

            txt_calendar_type = view.FindViewById <TextView>(
                Resource.Id.txt_calendar_type);
            txt_calendar_type.Click += Txt_calendar_type_Click;

            txt_from_date = view.FindViewById <TextView>(
                Resource.Id.txt_from_date);
            txt_from_date.Click += Edt_from_date_Click;

            txt_to_date = view.FindViewById <TextView>(
                Resource.Id.txt_to_date);
            txt_to_date.Click += Edt_to_date_Click;

            DateTime now = DateTime.Now;

            DateTime startDate       = new DateTime(now.Year, now.Month, 1);
            string   startDateString = startDate.ToString(UtilityDroid.CALENDAR_DATE_FORMAT);

            txt_from_date.Text = startDateString.Replace("-", "/");

            DateTime endDate       = startDate.AddMonths(1).AddDays(-1);
            string   endDateString = endDate.ToString(UtilityDroid.CALENDAR_DATE_FORMAT);

            txt_to_date.Text = endDateString.Replace("-", "/");

            spin_users = view.FindViewById <Spinner>(
                Resource.Id.spin_users);

            ((HomeActivity)mActivity).SetTitle(GetString(Resource.String.calendar_title));

            // Set users in spinner
            InitUserSpinnerValues();

            //GetNotesTypes();
            return(view);
        }