Beispiel #1
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();

            var    handler  = new Handler();
            Action myAction = () =>
            {
                LoginResponse loginResponse = mSharedPreferencesManager.GetLoginResponse();
                if (loginResponse != null)
                {
                    StartActivity(new Intent(mActivity, typeof(HomeActivity)));
                    OverridePendingTransition(Resource.Animation.animation_enter,
                                              Resource.Animation.animation_leave);
                }
                else
                {
                    StartActivity(new Intent(mActivity, typeof(LoginActivity)));
                    OverridePendingTransition(Resource.Animation.animation_enter,
                                              Resource.Animation.animation_leave);
                }
                Finish();
            };

            handler.PostDelayed(myAction, 2000);
        }
        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);
        }
Beispiel #4
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)
            {
            }
        }
        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);
        }