Пример #1
1
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);
            SetContentView(Resource.Layout.activity_cheat);

            if (Build.VERSION.SdkInt >= BuildVersionCodes.Honeycomb) {
                ActionBar.SetSubtitle(Resource.String.test_subject);
            }

            // Create your application here
            mAnswerIsTrue = Intent.GetBooleanExtra(EXTRA_ANSWER_IS_TRUE, false);

            mAnswerTextView = (TextView)FindViewById(Resource.Id.answerTextView);
            mVersionTextView = (TextView)FindViewById(Resource.Id.apiVersion);
            mVersionTextView.SetText(String.Format("API Level {0} {1}", Build.VERSION.Sdk, Build.VERSION.SdkInt.ToString()), TextView.BufferType.Normal);

            // Answer will not be shown until the user presses the button
            mWasAnswerShown = false;
            SetAnswerShownResult(mWasAnswerShown);

            mShowAnswer = (Button)FindViewById(Resource.Id.showAnswerButton);
            mShowAnswer.Click += (object sender, EventArgs e) => {
                ShowAnswer();
            };

            if (savedInstanceState != null) {
                mWasAnswerShown = savedInstanceState.GetBoolean(KEY_ANSWER_SHOWN, false);
                ShowAnswer();
            }
        }
Пример #2
0
		public override View OnCreateView (LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
		{
			//	  set View
			var rootView = inflater.Inflate (Resource.Layout.DiemThi_HK, container, false);
			isfirst=true;
			listViewDT = rootView.FindViewById<ListView> (Resource.Id.listDT_HK);
			lbl_HK = rootView.FindViewById<TextView> (Resource.Id.lbl_HK_DT);
			lbl_NH = rootView.FindViewById<TextView> (Resource.Id.lbl_NH_DT);
			progress=rootView.FindViewById<ProgressBar>(Resource.Id.progressDTHK);
			 txtNotify = rootView.FindViewById<TextView> (Resource.Id.txtNotify_DT_HK);
			linear = rootView.FindViewById<LinearLayout> (Resource.Id.linear_HK_DT);
			 linearDT = rootView.FindViewById<LinearLayout> (Resource.Id.linearDT_HK);
			//button 
			 btnHKTruoc = rootView.FindViewById<Button> (Resource.Id.btnHK_Truoc_DT);
			btnHKKe = rootView.FindViewById<Button> (Resource.Id.btnHK_Ke_DT);
			//bundle
			bundle=this.Arguments;
			check = bundle.GetBoolean ("Remind");
			autoupdate = bundle.GetBoolean ("AutoUpdateData");
			//load data
			LoadData ("0", "0");

			//button event
			btnHKTruoc.Click += new EventHandler (btnHK_Truoc_Click);
			btnHKKe.Click += new EventHandler (btnHK_Ke_Click);	


			return rootView;
		}
Пример #3
0
		public override View OnCreateView (LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
		{
			// Use this to return your custom view for this Fragment
			// return inflater.Inflate(Resource.Layout.YourFragment, container, false);

			//	  Lich hoc theo HK
			var rootView = inflater.Inflate (Resource.Layout.LichHoc_HK, container, false);
			isfirst = true;
			listView_HK = rootView.FindViewById<ListView> (Resource.Id.listLH);
			lbl_HK = rootView.FindViewById<TextView> (Resource.Id.lbl_HK_LH);
			lbl_NH = rootView.FindViewById<TextView> (Resource.Id.lbl_NH_LH);
			progress = rootView.FindViewById<ProgressBar> (Resource.Id.progressLH);
			linear = rootView.FindViewById<LinearLayout>(Resource.Id.linear_HK_LH);
			linearLH = rootView.FindViewById<LinearLayout>(Resource.Id.linearLH);
			txtNotify = rootView.FindViewById<TextView>(Resource.Id.txtNotify_LT_HK);
		//	radioGroup = rootView.FindViewById<RadioGroup>(Resource.Id.radioGroup1);
		    bundle=this.Arguments;
			check = bundle.GetBoolean ("Remind");
			autoupdate = bundle.GetBoolean ("AutoUpdateData");

			//load data

			LoadData_HK ();
		
			// row click
			listView_HK.ItemLongClick += listView_ItemClick;
						

			return rootView;
		}
Пример #4
0
        public override Dialog OnCreateDialog(Bundle savedInstanceState)
        {
            Bundle args = Arguments;

            if (args != null)
            {
                if (args.GetBoolean("usedarktheme"))
                {
                    //Developer is explicitly using the dark theme
                    darkTheme = true;
                }
                else
                {
                    //Dynamically detecting the theme declared in manifest
                    ResolveTheme();
                }
            }
            else
            {
                //Dynamically detecting the theme declared in manifest
                ResolveTheme();
            }

            Dialog dialog = new Dialog(Activity, darkTheme ? Resource.Style.SDL_Dialog_Dark : Resource.Style.SDL_Dialog);

            if (args != null)
            {
                dialog.SetCanceledOnTouchOutside(args.GetBoolean("cancelable_oto"));
            }
            dialog.SetOnShowListener(this);
            return(dialog);
        }
Пример #5
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);
            SetContentView(Resource.Layout.Main);

            if (savedInstanceState != null)
            {
                IsResolving   = savedInstanceState.GetBoolean(KEY_IS_RESOLVING);
                ShouldResolve = savedInstanceState.GetBoolean(KEY_SHOULD_RESOLVE);
            }

            FindViewById(Resource.Id.sign_in_button).SetOnClickListener(this);
            FindViewById(Resource.Id.sign_out_button).SetOnClickListener(this);

            //TODO remove oauth client id
            var gso = new GoogleSignInOptions.Builder(GoogleSignInOptions.DefaultSignIn)
                      .RequestIdToken("oauth_client_id")
                      .RequestEmail()
                      .RequestProfile()
                      .Build();

            GoogleApiClient = new GoogleApiClient.Builder(this)
                              .AddConnectionCallbacks(this)
                              .AddOnConnectionFailedListener(this)
                              .AddApi(Auth.GOOGLE_SIGN_IN_API, gso)
                              .AddScope(new Scope(Scopes.Email))
                              .AddScope(new Scope(Scopes.Profile))
                              .Build();
        }
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);

            // Set our view from the "main" layout resource
            SetContentView(Resource.Layout.Main);
            realm = DbManager.GetRealm();

            if (bundle != null)
            {
                isRuToEng     = bundle.GetBoolean(KEY_LANG, true);
                isTextChanged = bundle.GetBoolean(KEY_TEXT_CHANGED, false);
            }

            btnTranslate = FindViewById <Button>(Resource.Id.btnTranslate);
            btnSwap      = FindViewById <Button>(Resource.Id.btnSwapLngs);
            btnAddToFav  = FindViewById <Button>(Resource.Id.btnAddToFav);
            Button btnShow = FindViewById <Button>(Resource.Id.btnShowFavs);

            etFrom   = FindViewById <EditText>(Resource.Id.etTextFrom);
            tvToText = FindViewById <TextView>(Resource.Id.tvTextTo);
            tvFrom   = FindViewById <TextView>(Resource.Id.tvLngFrom);
            tvTo     = FindViewById <TextView>(Resource.Id.tvLngTo);

            etFrom.TextChanged += (o, t) => isTextChanged = true;


            btnTranslate.SetOnClickListener(this);
            btnSwap.SetOnClickListener(this);
            btnAddToFav.SetOnClickListener(this);
            btnShow.SetOnClickListener(this);

            InitTexts();
        }
Пример #7
0
        protected override void OnRestoreInstanceState(Bundle savedInstanceState)
        {
            try
            {
                base.OnRestoreInstanceState(savedInstanceState);
                m_bIsRestoring = true;

                m_itrajetLocalID = savedInstanceState.GetInt("itrajetLocalID");
                if (m_itrajetLocalID == 0)
                {
                    Finish();
                }

                m_bIsModeConduite = savedInstanceState.GetBoolean("IsModeConduite");

                m_bIsSimulatorActivated = savedInstanceState.GetBoolean("IsSimulatorActivated");

                int iCurrentArret_localID = savedInstanceState.GetInt("CurrentArret_localID", -1);
                m_currentArret = LocalDatabase.Get().GetArretFromLocalID(new FileAccessManager(), iCurrentArret_localID);

                int iNextArret_localID = savedInstanceState.GetInt("NextArret_localID", -1);
                m_nextArret = LocalDatabase.Get().GetArretFromLocalID(new FileAccessManager(), iNextArret_localID);

                m_bHasShownSecurityMessage = savedInstanceState.GetBoolean("bHasShownSecurityMessage");
            }
            catch (Exception e)
            {
                MobileCenter_Helper.ReportError(new FileAccessManager(), e, GetType().Name, MethodBase.GetCurrentMethod().Name);
            }
        }
Пример #8
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);
            if (savedInstanceState != null)
            {
                Flash           = savedInstanceState.GetBoolean(FLASH_STATE, false);
                AutoFocus       = savedInstanceState.GetBoolean(AUTO_FOCUS_STATE, true);
                SelectedIndices = savedInstanceState.GetIntegerArrayList(SELECTED_FORMATS);
                CameraId        = savedInstanceState.GetInt(CAMERA_ID, -1);
            }
            else
            {
                Flash           = false;
                AutoFocus       = true;
                SelectedIndices = null;
                CameraId        = -1;
            }
            SetContentView(Resource.Layout.activity_zxing);
            //        Toolbar toolbar = findViewById(R.id.toolbar);
            //        setSupportActionBar(toolbar);
            Android.Support.V7.App.ActionBar actionBar = SupportActionBar;
            if (actionBar != null)
            {
                actionBar.SetDisplayHomeAsUpEnabled(true);
            }
            ViewGroup contentFrame = FindViewById <ViewGroup>(Resource.Id.content_frame);

            ScannerView = new ZXingScannerView(this);
            SetupFormats();
            contentFrame.AddView(ScannerView);
        }
Пример #9
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);

            OverridePendingTransition(Resource.Animation.SlideInLeft, Resource.Animation.SlideOutLeft);

            SetContentView(Resource.Layout.PDFViewer);

            Bundle extras = this.Intent.Extras;

            isFileOffline = extras.GetBoolean("IsFileOffline");

            if (isFileOffline)
            {
                filePath = extras.GetString("PATH");
            }
            else
            {
                fileUri      = new Uri(extras.GetString("URL"));
                isFileNotice = extras.GetBoolean("IsFileNotice");
            }

            titleExpandSize = Functions.ConvertToPixels(this, 66);
            titleShrinkSize = Functions.ConvertToPixels(this, 186);

            SetUpViews();
            SetupLoaderAnimation();

            StartProcess();
        }
Пример #10
0
		protected override void OnCreate (Bundle savedInstanceState)
		{
			base.OnCreate (savedInstanceState);
			SetContentView (Resource.Layout.activity_main);

			if (savedInstanceState != null) {
				mIsResolving = savedInstanceState.GetBoolean (KEY_IS_RESOLVING);
				mShouldResolve = savedInstanceState.GetBoolean (KEY_SHOULD_RESOLVE);
			}

			FindViewById (Resource.Id.sign_in_button).SetOnClickListener (this);
			FindViewById (Resource.Id.sign_out_button).SetOnClickListener (this);
			FindViewById (Resource.Id.disconnect_button).SetOnClickListener (this);

			FindViewById<SignInButton> (Resource.Id.sign_in_button).SetSize (SignInButton.SizeWide);
			FindViewById (Resource.Id.sign_in_button).Enabled = false;

			mStatus = FindViewById<TextView> (Resource.Id.status);

			mGoogleApiClient = new GoogleApiClientBuilder (this)
				.AddConnectionCallbacks (this)
				.AddOnConnectionFailedListener (this)
				.AddApi (PlusClass.API)
				.AddScope (new Scope (Scopes.Profile))
				.Build ();
		}
Пример #11
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);
            SetContentView(Resource.Layout.activity_main);

            if (savedInstanceState != null)
            {
                mIsResolving   = savedInstanceState.GetBoolean(KEY_IS_RESOLVING);
                mShouldResolve = savedInstanceState.GetBoolean(KEY_SHOULD_RESOLVE);
            }

            FindViewById(Resource.Id.sign_in_button).SetOnClickListener(this);
            FindViewById(Resource.Id.sign_out_button).SetOnClickListener(this);
            FindViewById(Resource.Id.disconnect_button).SetOnClickListener(this);

            FindViewById <SignInButton> (Resource.Id.sign_in_button).SetSize(SignInButton.SizeWide);
            FindViewById(Resource.Id.sign_in_button).Enabled = false;

            mStatus = FindViewById <TextView> (Resource.Id.status);

            mGoogleApiClient = new GoogleApiClient.Builder(this)
                               .AddConnectionCallbacks(this)
                               .AddOnConnectionFailedListener(this)
                               .AddApi(PlusClass.API)
                               .AddScope(new Scope(Scopes.Profile))
                               .Build();
        }
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);

            SetContentView(Resource.Layout.Main);
            listview = FindViewById <PinnedSectionListView> (Android.Resource.Id.List);

            //listview.Adapter = new SimpleAdapter(this, Android.Resource.Layout.SimpleListItem1, Android.Resource.Id.Text1);
            if (bundle != null)
            {
                isFastScroll       = bundle.GetBoolean("isFastScroll");
                addPadding         = bundle.GetBoolean("addPadding");
                isShadowVisible    = bundle.GetBoolean("isShadowVisible");
                hasHeaderAndFooter = bundle.GetBoolean("hasHeaderAndFooter");
            }
            isFastScroll       = true;
            addPadding         = true;
            isShadowVisible    = true;
            hasHeaderAndFooter = true;

            initializeHeaderAndFooter();
            initializeAdapter();
            initializePadding();

            // Create your application here
        }
Пример #13
0
        void UpdateValuesFromBundle(Bundle savedInstanceState)
        {
            if (savedInstanceState != null)
            {
                if (savedInstanceState.KeySet().Contains(ADDRESS_REQUESTED_KEY))
                {
                    mAddressRequested = savedInstanceState.GetBoolean(ADDRESS_REQUESTED_KEY);
                }
                if (savedInstanceState.KeySet().Contains(LOCATION_ADDRESS_KEY))
                {
                    mAddressOutput = savedInstanceState.GetString(LOCATION_ADDRESS_KEY);
                    DisplayAddressOutput();
                }

                if (savedInstanceState.KeySet().Contains(REQUESTING_LOCATION_UPDATES_KEY))
                {
                    mRequestingLocationUpdates = savedInstanceState.GetBoolean(REQUESTING_LOCATION_UPDATES_KEY);
                }

                if (savedInstanceState.KeySet().Contains(LOCATION_KEY))
                {
                    mCurrentLocation = (Location)savedInstanceState.GetParcelable(LOCATION_KEY);
                }
                if (savedInstanceState.KeySet().Contains(LAST_UPDATED_TIME_STRING_KEY))
                {
                    mLastUpdateTime = savedInstanceState.GetString(LAST_UPDATED_TIME_STRING_KEY);
                }
                UpdateUI();
            }
        }
        protected override void OnRestoreInstanceState(Android.OS.IParcelable state)
        {
            if (state is Bundle)
            {
                Bundle bundle = (Bundle)state;
                SetProgress(bundle.GetFloat("progress"));
                SetMarkerProgress(bundle.GetFloat("marker_progress"));

                int progressColor = bundle.GetInt("progress_color");
                if (progressColor != _progressColor)
                {
                    _progressColor = progressColor;
                    UpdateProgressColor();
                }

                int progressBackgroundColor = bundle.GetInt("progress_background_color");
                if (progressBackgroundColor != _progressBackgroundColor)
                {
                    _progressBackgroundColor = progressBackgroundColor;
                    UpdateBackgroundColor();
                }

                _isThumbEnabled = bundle.GetBoolean("thumb_visible");

                _isMarkerEnabled = bundle.GetBoolean("marker_visible");

                base.OnRestoreInstanceState((IParcelable)bundle.GetParcelable("saved_state"));
                return;
            }

            base.OnRestoreInstanceState(state);
        }
Пример #15
0
 public override void RestoreFromBundle(Bundle bundle)
 {
     base.RestoreFromBundle(bundle);
     arenaDoor    = bundle.GetInt(DOOR);
     enteredArena = bundle.GetBoolean(ENTERED);
     keyDropped   = bundle.GetBoolean(DROPPED);
 }
Пример #16
0
 public override void RestoreFromBundle(Bundle bundle)
 {
     base.RestoreFromBundle(bundle);
     _stairs       = bundle.GetInt(STAIRS);
     _enteredArena = bundle.GetBoolean(ENTERED);
     _keyDropped   = bundle.GetBoolean(DROPPED);
 }
Пример #17
0
 public override void RestoreFromBundle(Bundle bundle)
 {
     base.RestoreFromBundle(bundle);
     RoomExit      = (Room)bundle.Get(Arena);
     _arenaDoor    = bundle.GetInt(Door);
     _enteredArena = bundle.GetBoolean(Entered);
     _keyDropped   = bundle.GetBoolean(Dropped);
 }
Пример #18
0
 protected override void OnRestoreInstanceState(Bundle savedInstanceState)
 {
     base.OnRestoreInstanceState(savedInstanceState);
     includeClosed = savedInstanceState.GetBoolean("includeClosed");
     myIssues      = savedInstanceState.GetBoolean("myIssues");
     SFilterByStatus.SetSelection(statusAdapter.GetPosition(savedInstanceState.GetString("StatusFilter")));
     SFilterByMonth.SetSelection(monthsAdapter.GetPosition(savedInstanceState.GetString("MonthFilter")));
 }
Пример #19
0
		public override View OnCreateView (LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
		{

			//Theo Tuan

			var rootView = inflater.Inflate (Resource.Layout.LichHoc_Tuan, container, false);
			listView_Tuan = rootView.FindViewById<ExpandableListView> (Resource.Id.listLH_Tuan);
			listView_Tuan.GroupClick += (sender, e) => {
				listView_ItemClick(sender,e);
			};
			isfirst = true;
			progress = rootView.FindViewById<ProgressBar> (Resource.Id.progressLHTuan);
			lbl_TuNgay = rootView.FindViewById<TextView> (Resource.Id.lbl_TuNgay);
			lbl_DenNgay = rootView.FindViewById<TextView> (Resource.Id.lbl_DenNgay);
			lbl_HK = rootView.FindViewById<TextView> (Resource.Id.lbl_HK_Tuan);
			LinearLayout linear_ThoiGian= rootView.FindViewById<LinearLayout> (Resource.Id.linear_LH_Tuan_ThoiGian);
			TextView txtNotify = rootView.FindViewById<TextView> (Resource.Id.txtNotify_LH_Tuan);
			//RadioGroup radioGroup = rootView.FindViewById<RadioGroup>(Resource.Id.radioGroup2);
			//button 
			 btnTuanTruoc = rootView.FindViewById<Button> (Resource.Id.btnTuanTruoc);
			 btnTuanKe = rootView.FindViewById<Button> (Resource.Id.btnTuanKe);
			//bundle
			bundle=this.Arguments;
			check = bundle.GetBoolean ("Remind");
			autoupdate = bundle.GetBoolean ("AutoUpdateData");

			LichHoc lh = BLichHoc.GetLast (SQLite_Android.GetConnection ());
			if (lh != null) {
				btnTuanTruoc.Enabled = true;
				btnTuanKe.Enabled = true;
				btnTuanTruoc.SetBackgroundResource(Android.Resource.Color.HoloBlueDark);
				btnTuanKe.SetBackgroundResource(Android.Resource.Color.HoloBlueDark);
			//	radioGroup.Visibility = ViewStates.Visible;
				linear_ThoiGian.Visibility = ViewStates.Visible;
				txtNotify.Visibility = ViewStates.Gone;
				LoadData_Tuan (DateTime.Today);
			}
			else {
				progress.Visibility = ViewStates.Gone;
				btnTuanTruoc.Enabled = false;
				btnTuanKe.Enabled = false;
				btnTuanTruoc.SetBackgroundResource(Android.Resource.Color.DarkerGray);
				btnTuanKe.SetBackgroundResource(Android.Resource.Color.DarkerGray);
			//	radioGroup.Visibility = ViewStates.Gone;
				linear_ThoiGian.Visibility = ViewStates.Gone;
				txtNotify.Visibility = ViewStates.Visible;
				txtNotify.Text = "Hiện tại lịch học chưa có dữ liệu. Xin vui lòng thử lại sau!!!";
			}

			// button event
			btnTuanTruoc.Click += new EventHandler (btnTuanTruoc_Click);
			btnTuanKe.Click += new EventHandler (btnTuanKe_Click);



			return rootView;
		}
        protected override void OnRestoreInstanceState(Bundle savedInstanceState)
        {
            base.OnRestoreInstanceState(savedInstanceState);

            addNewPersonGroup  = savedInstanceState.GetBoolean("AddNewPersonGroup");
            personGroupId      = savedInstanceState.GetString("PersonGroupId");
            oldPersonGroupName = savedInstanceState.GetString("OldPersonGroupName");
            personGroupExists  = savedInstanceState.GetBoolean("PersonGroupExists");
        }
Пример #21
0
 /// <summary>
 /// Use this to dig out some properties about the device screen
 /// You should take these device properties into account when drawing your watch face:
 ///  For devices that use low-bit ambient mode, the screen supports fewer bits for each color in ambient mode, so you should disable anti-aliasing and bitmap filtering when the device switches to ambient mode.
 /// For devices that require burn-in protection, avoid using large blocks of white pixels in ambient mode and do not place content within 10 pixels of the edge of the screen, since the system shifts the content periodically to avoid pixel burn-in.
 /// </summary>
 /// <param name="properties"></param>
 public override void OnPropertiesChanged(Bundle properties)
 {
     base.OnPropertiesChanged(properties);
     _hasLowBitAmbient    = properties.GetBoolean(PropertyLowBitAmbient, false);
     _hasBurnInProtection = properties.GetBoolean(PropertyBurnInProtection, false);
     if (Log.IsLoggable(Tag, LogPriority.Debug))
     {
         Log.Debug(Tag, "OnPropertiesChanged: low-bit ambient = " + _hasLowBitAmbient);
     }
 }
        private void UnPackBundle()
        {
            Bundle args = Arguments;

            mInitialDate = new DateTime(args.GetLong("initialDate"));
            mMinDate     = new DateTime(args.GetLong("minDate"));
            mMaxDate     = new DateTime(args.GetLong("maxDate"));
            mIsClientSpecified24HourTime = args.GetBoolean("isClientSpecified24HourTime");
            mIs24HourTime   = args.GetBoolean("is24HourTime");
            mTheme          = args.GetInt("theme");
            mIndicatorColor = args.GetInt("indicatorColor");
        }
Пример #23
0
 public ArticalOverview(Bundle bundle)
 {
     Title                       = bundle.GetString("title");
     SummaryText                 = bundle.GetString("summaryText");
     Date                        = bundle.GetString("date");
     LinkOfActualArtical         = bundle.GetString("articalLink");
     OfflineAvailableOn          = bundle.GetString(nameof(OfflineAvailableOn));
     SeenOn                      = bundle.GetString("SeenOn");
     IsDatabaseConfirmed_Offline = bundle.GetBoolean("IsDatabaseConfirmed_Offline");
     IsDatabaseConfirmed_SeenOn  = bundle.GetBoolean("IsDatabaseConfirmed_SeenOn");
     //TODO: Read Authors[] and Category[] from bundle
 }
        private void UnpackBundle()
        {
            Bundle args = Arguments;

            _initialDate = (Date)args.GetSerializable("initialDate");
            _minDate     = (Date)args.GetSerializable("minDate");
            _maxDate     = (Date)args.GetSerializable("maxDate");
            _isClientSpecified24HourTime = args.GetBoolean("isClientSpecified24HourTime");
            _is24HourTime   = args.GetBoolean("is24HourTime");
            _theme          = args.GetInt("theme");
            _indicatorColor = args.GetInt("indicatorColor");
        }
        public override void OnReceive(Context context, Intent intent)
        {
            string intentActionPrefix = context.PackageName + ".ACTION_";

            if (intent.Action == null || !intent.Action.StartsWith(intentActionPrefix))
            {
                return;
            }

            Bundle bundle = intent.GetBundleExtra(NotificationConstants.Notification);

            if (bundle == null)
            {
                return;
            }


            NotificationManager notificationManager = (NotificationManager)context.GetSystemService(Context.NotificationService);

            if (notificationManager == null)
            {
                return;
            }

            int id = bundle.GetInt(NotificationConstants.Id);


            if (bundle.GetBoolean(NotificationConstants.AutoCancel, true))
            {
                if (bundle.ContainsKey(NotificationConstants.Tag))
                {
                    string tag = bundle.GetString(NotificationConstants.Tag);
                    notificationManager.Cancel(tag, id);
                }
                else
                {
                    notificationManager.Cancel(id);
                }
            }
            if (bundle.GetBoolean(NotificationConstants.InvokeApp, true))
            {
                NotificationController.InvokeApp(context, bundle);
            }
            else
            {
                string Action     = "com.huawei.HMSActionService";
                Intent sendIntent = new Intent(Action);
                sendIntent.SetPackage(context.PackageName);
                sendIntent.PutExtra(NotificationConstants.Notification, bundle);
                context.StartService(sendIntent);
            };
        }
Пример #26
0
            public override void OnPropertiesChanged(Bundle properties)
            {
                base.OnPropertiesChanged(properties);
                bool burnInProtection = properties.GetBoolean(WatchFaceService.PropertyBurnInProtection);

                hourPaint.SetTypeface(burnInProtection ? NormalTypeFace : BoldTypeFace);
                lowBitAmbient = properties.GetBoolean(WatchFaceService.PropertyLowBitAmbient);
                if (Log.IsLoggable(Tag, LogPriority.Debug))
                {
                    Log.Debug(Tag, "OnPropertiesChanged: burn-in protection: " + burnInProtection
                              + ", low-bit ambient = " + lowBitAmbient);
                }
            }
Пример #27
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);

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

            try
            {
                Button btnAddAccount             = FindViewById <Button>(Resource.Id.btnAddAccount);
                Button btnGetAuthToken           = FindViewById <Button>(Resource.Id.btnGetAuthToken);
                Button btnInvalidateAuthToken    = FindViewById <Button>(Resource.Id.btnInvalidateAuthToken);
                Button btnGetAuthTokenConvenient = FindViewById <Button>(Resource.Id.btnGetAuthTokenConvenient);

                mAccountManager = AccountManager.Get(this);

                btnAddAccount.Click += delegate
                {
                    AddNewAccount(AccountGeneral.ACCOUNT_TYPE, AccountGeneral.AUTHTOKEN_TYPE_FULL_ACCESS);

                    availableAccounts = mAccountManager.GetAccountsByType(AccountGeneral.ACCOUNT_TYPE);
                };

                btnGetAuthToken.Click += delegate
                {
                    ShowAccountPicker(AccountGeneral.AUTHTOKEN_TYPE_FULL_ACCESS, false);
                };
                btnGetAuthTokenConvenient.Click += delegate
                {
                    GetTokenForAccountCreateIfNeeded(AccountGeneral.ACCOUNT_TYPE, AccountGeneral.AUTHTOKEN_TYPE_FULL_ACCESS);
                };
                btnInvalidateAuthToken.Click += delegate
                {
                    ShowAccountPicker(AccountGeneral.AUTHTOKEN_TYPE_FULL_ACCESS, true);
                };

                if (savedInstanceState != null)
                {
                    bool showDialog = savedInstanceState.GetBoolean(STATE_DIALOG);
                    bool invalidate = savedInstanceState.GetBoolean(STATE_INVALIDATE);
                    if (showDialog)
                    {
                        ShowAccountPicker(AccountGeneral.AUTHTOKEN_TYPE_FULL_ACCESS, invalidate);
                    }
                }
            }
            catch (System.Exception xe)
            {
            }
        }
Пример #28
0
        private void FillViewModelWithBundle(Bundle bundle, IQuestViewModel viewModel)
        {
            DateTime?startTime = null;
            DateTime?deadline  = null;

            viewModel.IsImportant  = bundle.GetBoolean(IsImportantKey);
            viewModel.UseStartTime = bundle.GetBoolean(UseStartTimeKey);
            viewModel.UseDeadline  = bundle.GetBoolean(UseDeadlineKey);

            _dateTimeStateHandler.Extract(StartTimeKey, bundle, ref startTime);
            _dateTimeStateHandler.Extract(DeadlineKey, bundle, ref deadline);

            viewModel.StartTime = startTime;
            viewModel.Deadline  = deadline;
        }
Пример #29
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);

            // Layout .axml page is mapped here
            SetContentView(Resource.Layout.sign_layout);
            // che ks for saved instance
            if (savedInstanceState != null)
            {
                mIsResolving   = savedInstanceState.GetBoolean(KEY_IS_RESOLVING);
                mShouldResolve = savedInstanceState.GetBoolean(KEY_SHOULD_RESOLVE);
            }
            // gets the references to layout elements
            FindViewById(Resource.Id.sign_in_button).SetOnClickListener(this);
            FindViewById(Resource.Id.sign_out_button).SetOnClickListener(this);
            FindViewById(Resource.Id.disconnect_button).SetOnClickListener(this);

            FindViewById <SignInButton>(Resource.Id.sign_in_button).SetSize(SignInButton.SizeWide);
            FindViewById(Resource.Id.sign_in_button).Enabled = false;

            mStatus = FindViewById <TextView>(Resource.Id.status);
            // setting up properties to connect to Google
            mGoogleApiClient = new GoogleApiClient.Builder(this)
                               .AddConnectionCallbacks(this)
                               .AddOnConnectionFailedListener(this)
                               .AddApi(PlusClass.API)
                               .AddScope(new Scope(Scopes.Profile))
                               .Build();

            Button loginButton = (Button)FindViewById(Resource.Id.move_ahead);

            loginButton.Click += delegate {
                if (this.ApplicationContext == null)
                {
                    Toast.MakeText(this, "Incorrect Username Password Combination", ToastLength.Short).Show();
                }
                //Call API to evaluate a patient/therapist and get the isPatient value.
                //Get isPatient from the user
                //if (isPatient == 0)
                {
                    StartActivity(typeof(MainActivity));
                }
                //else
                {
                    //    StartActivity(typeof(PatientVisit));
                }
            };
        }
        protected override void OnCreate (Bundle savedInstanceState) 
        {
            base.OnCreate (savedInstanceState);
            SetContentView (Resource.Layout.person_list_activity);

            var options = new PlusClass.PlusOptions.Builder ().AddActivityTypes (MomentUtil.ACTIONS).Build ();
            mGoogleApiClient = new GoogleApiClientBuilder (this)
                .AddConnectionCallbacks (this)
                .AddOnConnectionFailedListener (this)
                .AddApi (PlusClass.API, options)
                .AddScope (PlusClass.ScopePlusLogin)
                .Build ();

            mListItems = new List<string>();
            mListAdapter = new ArrayAdapter<string> (this,
                Android.Resource.Layout.SimpleListItem1, mListItems);
            mPersonListView = FindViewById<ListView> (Resource.Id.person_list);
            mResolvingError = savedInstanceState != null
                && savedInstanceState.GetBoolean (STATE_RESOLVING_ERROR, false);

            var available = GooglePlayServicesUtil.IsGooglePlayServicesAvailable (this);
            if (available != CommonStatusCodes.Success)
                ShowDialog (DIALOG_GET_GOOGLE_PLAY_SERVICES);

            if (Build.VERSION.SdkInt >= BuildVersionCodes.Honeycomb) {
                this.ActionBar.SetDisplayHomeAsUpEnabled (true);
            }
        }
Пример #31
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);

            // If a setting that requires changes to the main activity has changed
            // return a result telling it to recreate.
            _shouldRecreateMain = savedInstanceState != null && savedInstanceState.GetBoolean("shouldRecreateMain", false);
            _preferences        = new PreferenceWrapper(this);

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

            SetSupportActionBar(toolbar);

            SupportActionBar.SetTitle(Resource.String.settings);
            SupportActionBar.SetDisplayHomeAsUpEnabled(true);
            SupportActionBar.SetDisplayShowHomeEnabled(true);
            SupportActionBar.SetHomeAsUpIndicator(Resource.Drawable.ic_action_arrow_back);

            var prefs = PreferenceManager.GetDefaultSharedPreferences(this);

            prefs.RegisterOnSharedPreferenceChangeListener(this);

            _fragment = new SettingsFragment();
            _fragment.PreferencesCreated += delegate
            {
                UpdateBackupRemindersEnabled(prefs);
                UpdateSecuritySettingsEnabled();
            };

            SupportFragmentManager.BeginTransaction()
            .Replace(Resource.Id.layoutFragment, _fragment)
            .Commit();
        }
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);
            SetContentView(Resource.Layout.ac_sign_in);
            EditText editEmail    = FindViewById <EditText>(Resource.Id.editEmail);
            EditText editPassword = FindViewById <EditText>(Resource.Id.editPassword);

            ProgressGenerator   progressGenerator = new ProgressGenerator(this);
            ActionProcessButton btnSignIn         = FindViewById <ActionProcessButton>(Resource.Id.btnSignIn);
            Bundle extras = Intent.Extras;

            if (extras != null && extras.GetBoolean(EXTRAS_ENDLESS_MODE))
            {
                btnSignIn.setMode(ActionProcessButton.Mode.ENDLESS);
            }
            else
            {
                btnSignIn.setMode(ActionProcessButton.Mode.PROGRESS);
            }
            btnSignIn.Click += (object sender, EventArgs e) => {
                this.RunOnUiThread(() => {
                    progressGenerator.start(btnSignIn, this);
                    btnSignIn.Enabled    = false;
                    editEmail.Enabled    = false;
                    editPassword.Enabled = false;
                });
            };
        }
Пример #33
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);

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

            var layout = FindViewById<SlidingUpPanelLayout>(Resource.Id.sliding_layout);
            FindViewById<TextView>(Resource.Id.more_info).MovementMethod = new LinkMovementMethod();

            layout.ShadowDrawable = Resources.GetDrawable(Resource.Drawable.above_shadow);
            layout.AnchorPoint = 0.3f;
            layout.PanelExpanded += (s, e) => Log.Info(Tag, "PanelExpanded");
            layout.PanelCollapsed += (s, e) => Log.Info(Tag, "PanelCollapsed");
            layout.PanelAnchored += (s, e) => Log.Info(Tag, "PanelAnchored");
            layout.PanelSlide += (s, e) =>
            {
                if (e.SlideOffset < 0.2)
                {
                    if (SupportActionBar.IsShowing)
                        SupportActionBar.Hide();
                }
                else
                {
                    if (!SupportActionBar.IsShowing)
                        SupportActionBar.Show();
                }
            };

            var actionBarHidden = savedInstanceState != null &&
                                  savedInstanceState.GetBoolean(SavedStateActionBarHidden, false);
            if (actionBarHidden)
                SupportActionBar.Hide();
        }
        protected override async void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);

            _stateMemory = new StateMemory();
            //positionInEpisodeTabList = 0;

            LayoutInflater.Inflate(Resource.Layout.shows_overview_activity, _BaseFrameLayout);

            _myShow = await PopulateSeasons(Intent.GetStringExtra("TMDBID"));

            SetTitle("Description for show " + _myShow.Name);
            if (savedInstanceState != null)
            {
                _stateMemory._isAfterAnimation = savedInstanceState.GetBoolean(KEY_ISAFTERANIMATION, false);
                //positionInEpisodeTabList = savedInstanceState.GetInt("position", 0);
            }
            else
            {
                _stateMemory._isAfterAnimation = false;
            }

            SetUpBeforeFragment();

        }
Пример #35
0
        protected override void OnCreateActivity(Bundle bundle)
        {
            base.OnCreateActivity(bundle);

            SetContentView(Resource.Layout.LoginActivity);
            FindViews();

            ScrollView.ViewTreeObserver.AddOnGlobalLayoutListener(this);

            TabsRadioGroup.CheckedChange += OnTabsRadioGroupCheckedChange;
            LoginButton.Click            += OnLoginButtonClick;
            GoogleLoginButton.Click      += OnGoogleLoginButtonClick;
            EmailEditText.Adapter         = MakeEmailsAdapter();
            EmailEditText.Threshold       = 1;
            EmailEditText.TextChanged    += OnEmailEditTextTextChanged;
            PasswordEditText.TextChanged += OnPasswordEditTextTextChanged;
            PasswordToggleButton.Click   += OnPasswordToggleButtonClick;

            hasGoogleAccounts            = GoogleAccounts.Count > 0;
            GoogleLoginButton.Visibility = hasGoogleAccounts ? ViewStates.Visible : ViewStates.Gone;

            if (bundle != null)
            {
                showPassword = bundle.GetBoolean(ExtraShowPassword);
            }

            SyncContent();
            SyncPasswordVisibility();
        }
Пример #36
0
		protected override void OnCreate(Bundle savedInstanceState)
		{
			base.OnCreate(savedInstanceState);

			SetContentView(Resource.Layout.Main);

			if (savedInstanceState != null)
			{
				isStarted = savedInstanceState.GetBoolean(SERVICE_STARTED_KEY, false);
			}

			serviceToStart = new Intent(this, typeof(TimestampService));

			stopServiceButton = FindViewById<Button>(Resource.Id.stop_timestamp_service_button);
			startServiceButton = FindViewById<Button>(Resource.Id.start_timestamp_service_button);

			if (isStarted)
			{
				stopServiceButton.Click += StopServiceButton_Click;
				stopServiceButton.Enabled = true;
				startServiceButton.Enabled = false;
			}
			else 
			{
				startServiceButton.Click += StartServiceButton_Click;
				startServiceButton.Enabled = true;
				stopServiceButton.Enabled = false;
			}
		}
        public async Task <string> GetBrokerAuthTokenSilentlyAsync(IDictionary <string, string> brokerPayload, Activity callerActivity)
        {
            CheckForBrokerAccountInfoInAccountManager(brokerPayload, callerActivity);
            Bundle silentOperationBundle = GetSilentBrokerBundle(brokerPayload);

            silentOperationBundle.PutString(BrokerConstants.BrokerAccountManagerOperationKey, BrokerConstants.AcquireTokenSilent);

            IAccountManagerFuture result = _androidAccountManager.AddAccount(BrokerConstants.BrokerAccountType,
                                                                             BrokerConstants.AuthtokenType,
                                                                             null,
                                                                             silentOperationBundle,
                                                                             null,
                                                                             null,
                                                                             GetPreferredLooper(callerActivity));

            if (result != null)
            {
                Bundle bundleResult = (Bundle)await result.GetResultAsync(
                    AccountManagerTimeoutSeconds,
                    TimeUnit.Seconds)
                                      .ConfigureAwait(false);

                if (bundleResult.GetBoolean(BrokerConstants.BrokerRequestV2Success))
                {
                    _logger.Info("Android Broker succsesfully refreshed the access token.");
                    return(bundleResult.GetString(BrokerConstants.BrokerResultV2));
                }
            }

            _logger.Info("Android Broker didn't return any results.");
            return(null);
        }
Пример #38
0
        /// <summary>
        /// Loads the parameters of the task from the given bundle. Embeded task is not setup from this bundle
        /// </summary>
        /// <param name="b">The bundle component.</param>
        public override void Setup(Bundle b)
        {
            int numberOfGroups = b.GetInt(NumberOfGroupsKey);

            _groupUuid = new LinkedList <String>();
                        #if INCLUDE_DEBUG_MOVE_GROUPNAME
            groupNameList = new LinkedList <String> {
            };
                        #endif

            int i = 0;

            while (i < numberOfGroups)
            {
                _groupUuid.AddLast(b.GetString(GUuidKey + i));

                                #if INCLUDE_DEBUG_MOVE_GROUPNAME
                groupNameList.AddLast(b.GetString(gNameKey + i);
                                #endif
                i++;
            }

            FullGroupName = b.GetString(FullGroupNameKey);
            ToastEnable   = b.GetBoolean(ToastEnableKey);
        }
Пример #39
0
        public virtual void RestoreCacheConfiguration(Bundle savedInstanceState, IMvxJsonConverter serializer)
        {
            if (savedInstanceState == null)
            {
                return;
            }

            EnableOnFragmentPoppedCallback =
                savedInstanceState.GetBoolean(SavedFragmentCacheConfigurationEnabledFragmentPoppedCallbackState, true);

            // restore what fragments we have registered - and informations about registered fragments.
            string jsonSerializedMvxCachedFragmentInfosToRestore;

            if (Build.VERSION.SdkInt >= BuildVersionCodes.HoneycombMr1)
            {
                jsonSerializedMvxCachedFragmentInfosToRestore = savedInstanceState.GetString(SavedFragmentCacheConfiguration, string.Empty);
            }
            else
            {
                jsonSerializedMvxCachedFragmentInfosToRestore = savedInstanceState.GetString(SavedFragmentCacheConfiguration);
            }

            // there are no registered fragments at this moment, skip restore
            if (string.IsNullOrEmpty(jsonSerializedMvxCachedFragmentInfosToRestore))
            {
                return;
            }

            var serializedMvxCachedFragmentInfos = serializer.DeserializeObject <Dictionary <string, TSerializableMvxCachedFragmentInfo> >(jsonSerializedMvxCachedFragmentInfosToRestore);

            _lookup = serializedMvxCachedFragmentInfos.ToDictionary(x => x.Key,
                                                                    keyValuePair => MvxCachedFragmentInfoFactory.ConvertSerializableFragmentInfo(keyValuePair.Value as SerializableMvxCachedFragmentInfo));
        }
		// Returns the current status of the restriction
		private bool CanSayHello(Bundle restrictions)
		{
			bool defaultValue = false;
			bool canSayHello = restrictions == null ? defaultValue :
				restrictions.GetBoolean("can_say_hello", defaultValue);
			Log.Debug (TAG, "canSayHello: " + canSayHello);
			return canSayHello;
		}
Пример #41
0
		public override View OnCreateView (LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
		{

			var rootView = inflater.Inflate(Resource.Layout.DiemThi, container, false);
			bundle = this.Arguments;
			check = bundle.GetBoolean ("Remind");
			autoupdate = bundle.GetBoolean ("AutoUpdateData");

			listView = rootView.FindViewById<ListView>(Resource.Id.listDT);
			progress=rootView.FindViewById<ProgressBar>(Resource.Id.progressDT);
			linear = rootView.FindViewById<LinearLayout>(Resource.Id.linear11);
			txtNotify = rootView.FindViewById<TextView>(Resource.Id.txtNotify_DT);
			txtHocKyDT = rootView.FindViewById<TextView> (Resource.Id.txtHocKyDT);
			LoadData ();

			return rootView;
		}
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);

            if (bundle != null)
            {
                _authInProgress = bundle.GetBoolean(AUTH_IN_PROGRESS_STATE, false);
            }
        }
Пример #43
0
        protected override void OnRestoreInstanceState(Bundle savedInstanceState)
        {
            this.wasClicked = savedInstanceState.GetBoolean ("clicked");
            if (this.wasClicked)
            {
                HandleClick (this, null);
            }

            base.OnRestoreInstanceState (savedInstanceState);
        }
        /**
         * Further SlidingMenu initialization. Should be called within the activitiy's onPostCreate()
         *
         * @param savedInstanceState the saved instance state (unused)
         */
        public void OnPostCreate(Bundle savedInstanceState)
        {
            if (mViewBehind == null || mViewAbove == null)
            {
                throw new Java.Lang.IllegalStateException("Both setBehindContentView must be called " +
                        "in onCreate in addition to setContentView.");
            }

            mOnPostCreateCalled = true;

            mSlidingMenu.attachToActivity(mActivity,
                    mEnableSlide ? SlidingMenu.SLIDING_WINDOW : SlidingMenu.SLIDING_CONTENT);

            bool open;
            bool secondary;
            if (savedInstanceState != null)
            {
                open = savedInstanceState.GetBoolean("SlidingActivityHelper.open");
                secondary = savedInstanceState.GetBoolean("SlidingActivityHelper.secondary");
            }
            else
            {
                open = false;
                secondary = false;
            }
            
            //new Handler().post(new Runnable() {
            //    public void run() {
            //        if (open) {
            //            if (secondary) {
            //                mSlidingMenu.showSecondaryMenu(false);
            //            } else {
            //                mSlidingMenu.showMenu(false);
            //            }
            //        } else {
            //            mSlidingMenu.showContent(false);					
            //        }
            //    }
            //});

             
            new Handler().Post(new runclass(open, secondary, mSlidingMenu));
        }
Пример #45
0
		protected override void OnCreate (Bundle savedInstanceState)
		{
			base.OnCreate (savedInstanceState);
			SetContentView (Resource.Layout.activity_main);
			InitializeLogging();

			if (savedInstanceState != null) {
				authInProgress = savedInstanceState.GetBoolean(AUTH_PENDING);
			}

			BuildFitnessClient();
		}
        void UpdateCanSayHello(RestrictionEntry entry, Bundle restrictions)
        {
            bool canSayHello;
            if (restrictions == null || !restrictions.ContainsKey (KEY_CAN_SAY_HELLO))
                canSayHello = entry.SelectedState;
            else
                canSayHello = restrictions.GetBoolean (KEY_CAN_SAY_HELLO);

            textSayHello.SetText (canSayHello ? Resource.String.explanation_can_say_hello_true :
                Resource.String.explanation_can_say_hello_false);
            buttonSayHello.Enabled = canSayHello;
        }
Пример #47
0
		void UpdateValuesFromBundle (Bundle savedInstanceState)
		{
			if (savedInstanceState != null) {
				if (savedInstanceState.KeySet ().Contains (ADDRESS_REQUESTED_KEY)) {
					mAddressRequested = savedInstanceState.GetBoolean (ADDRESS_REQUESTED_KEY);
				}
				if (savedInstanceState.KeySet ().Contains (LOCATION_ADDRESS_KEY)) {
					mAddressOutput = savedInstanceState.GetString (LOCATION_ADDRESS_KEY);
					DisplayAddressOutput ();
				}
			}
		}
Пример #48
0
		protected override void OnCreate (Bundle savedInstanceState)
		{
			var sharedElementEnterTransition = TransitionInflater.From (this).InflateTransition (Resource.Transition.quiz_enter);
			Window.SharedElementEnterTransition = sharedElementEnterTransition;

			categoryId = Intent.GetStringExtra (Category.TAG);
			interpolator = AnimationUtils.LoadInterpolator (this, Android.Resource.Interpolator.FastOutSlowIn);
			if (savedInstanceState != null)
				savedStateIsPlaying = savedInstanceState.GetBoolean (StateIsPlaying);
			Populate (categoryId);
			base.OnCreate (savedInstanceState);
		}
Пример #49
0
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate (bundle);
            SetContentView (Resource.Layout.Main);

            // extract authInProgress from bundle if it's in there
            if (bundle != null && bundle.ContainsKey ("authInProgress")) {
                authInProgress = bundle.GetBoolean ("authInProgress");
            }

            BuildApiClient ();
        }
Пример #50
0
 override protected void OnCreate(Bundle savedInstanceState)
 {
    base.OnCreate(savedInstanceState);
    SetContentView(R.Layouts.share_activity);
    mSendButton = (Button)FindViewById(R.Ids.send_interactive_button);
    mSendButton.SetOnClickListener(this);
    mSendButton.SetEnabled(true);
    mEditSendText = (EditText)FindViewById(R.Ids.share_prefill_edit);
    mPlusClientFragment =
            PlusClientFragment.GetPlusClientFragment(this, MomentUtil.VISIBLE_ACTIVITIES);
    mSharing =
            savedInstanceState != null && savedInstanceState.GetBoolean(STATE_SHARING, false);
 }
        public override void OnViewCreated (View view, Bundle savedInstanceState)
        {
            base.OnViewCreated (view, savedInstanceState);

            bool useDraft = false;
            if (savedInstanceState != null) {
                useDraft = savedInstanceState.GetBoolean (UseDraftKey, useDraft);
            }

            viewModel = new EditTimeEntryView (TimeEntryId);
            viewModel.OnIsLoadingChanged += OnModelLoaded;
            viewModel.Init (useDraft);
        }
Пример #52
0
		// 打印所有的 intent extra 数据
		private static String printBundle(Bundle bundle) {
			StringBuilder sb = new StringBuilder();
			foreach (string key in bundle.KeySet()) {
				if (key.Equals(JPushInterface.ExtraNotificationId)) {
					sb.Append("\nkey:" + key + ", value:" + bundle.GetInt(key));
				}else if(key.Equals(JPushInterface.ExtraConnectionChange)){
					sb.Append("\nkey:" + key + ", value:" + bundle.GetBoolean(key));
				} 
				else {
					sb.Append("\nkey:" + key + ", value:" + bundle.GetString(key));
				}
			}
			return sb.ToString();
		}
Пример #53
0
        public override void OnCreate (Bundle savedInstanceState)
        {
            base.OnCreate (savedInstanceState);

            if (savedInstanceState != null) {
                useDraft = savedInstanceState.GetBoolean (UseDraftKey, useDraft);
            }

            if (!useDraft && TimeEntryId != Guid.Empty) {
                LoadRequestedModel ();
            } else {
                ResetModel ();
            }
        }
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);

            viewPager = new HackyViewPager(this);
            SetContentView(viewPager);

            viewPager.Adapter = new SamplePagerAdapter();

            if (savedInstanceState != null)
            {
                viewPager.IsLocked = savedInstanceState.GetBoolean(IsLockedArgument, false);
            }
        }
        public void OnPostCreate(Bundle savedInstanceState)
        {
            if (null == _viewBehind && null == _viewAbove)
                throw new InvalidOperationException("Both SetBehindContentView must be called " +
                    "in OnCreate in addition to SetContentView.");

            _onPostCreateCalled = true;

            _slidingMenu.AttachToActivity(_activity, 
                _enableSlide ? SlideStyle.Window : SlideStyle.Content);

            bool open, secondary;
            if (null != savedInstanceState)
            {
                open = savedInstanceState.GetBoolean("SlidingActivityHelper.open");
                secondary = savedInstanceState.GetBoolean("SlidingActivityHelper.secondary");
            }
            else
            {
                open = false;
                secondary = false;
            }

            new Handler().Post(() =>
                {
                    if (open)
                    {
                        if (secondary)
                            _slidingMenu.ShowSecondaryMenu(false);
                        else
                            _slidingMenu.ShowMenu(false);
                    }
                    else
                        _slidingMenu.ShowContent(false);
                });
        }
Пример #56
0
		protected override void OnCreate (Bundle savedInstanceState)
		{
			base.OnCreate(savedInstanceState);
			SetContentView(Resource.Layout.activity_main);

			// This method sets up our custom logger, which will print all log messages to the device
			// screen, as well as to adb logcat.
			InitializeLogging();

			if (savedInstanceState != null) {
				authInProgress = savedInstanceState.GetBoolean(AUTH_PENDING);
			}

			BuildFitnessClient();
		}
		protected override void OnCreate (Bundle bundle)
		{
			base.OnCreate (bundle);

			SetContentView (Resource.Layout.Sensors);

			trackButton = FindViewById<Button> (Resource.Id.trackButton);
			stepCount = FindViewById<TextView> (Resource.Id.stepCount);

			// create a sensor manager to schedule batches of sensor data
			senMgr = (SensorManager) GetSystemService (SensorService);

			// update state from orientation change
			if (bundle != null)
			{
				count = bundle.GetFloat ("step_count", 0);
				if (bundle.GetBoolean ("visible", false)) {
					visible = true;
					stepCount.Text = count.ToString ();
				}
				Log.Debug(GetType().FullName, "Recovered instance state");
			}


			// This button gets the user's step count since the last time the device was rebooted
			trackButton.Click += (o, e) => {
				// get the step counter sensor via the SensorManager
				counter = senMgr.GetDefaultSensor (SensorType.StepCounter);

				// button's been clicked, so counter visibility gets set to true
				visible = true;

				// This sensor is only available on Nexus 5 and Moto X at time of writing
				// The following line will check if the sensor is available explicitly:
				bool counterAvailabe = PackageManager.HasSystemFeature(PackageManager.FeatureSensorStepCounter);
				Log.Info("SensorManager", "Counter available");

				if (counterAvailabe && counter != null) {
					// Set sensor delay to normal, the default rate for batching sensor data
					senMgr.RegisterListener(this, counter, SensorDelay.Normal);
					Toast.MakeText(this,"Count sensor started",ToastLength.Long).Show();
				} else {
					Toast.MakeText(this, "Count sensor unavailable", ToastLength.Long).Show();
				}
			};

		}
Пример #58
0
		void UpdateValuesFromBundle (Bundle savedInstanceState)
		{
			if (savedInstanceState != null) {
				if (savedInstanceState.KeySet ().Contains (KEY_REQUESTING_LOCATION_UPDATES)) {
					mRequestingLocationUpdates = savedInstanceState.GetBoolean (
						KEY_REQUESTING_LOCATION_UPDATES);
				}

				if (savedInstanceState.KeySet ().Contains (KEY_LOCATION)) {
					mCurrentLocation = (Location)savedInstanceState.GetParcelable (KEY_LOCATION);
				}

				if (savedInstanceState.KeySet ().Contains (KEY_LAST_UPDATED_TIME_STRING)) {
					mLastUpdateTime = savedInstanceState.GetString (KEY_LAST_UPDATED_TIME_STRING);
				}
				UpdateUI ();
			}
		}
Пример #59
0
		void UpdateValuesFromBundle (Bundle savedInstanceState)
		{
			Log.Info (TAG, "Updating values from bundle");
			if (savedInstanceState != null) {
				if (savedInstanceState.KeySet ().Contains (REQUESTING_LOCATION_UPDATES_KEY)) {
					mRequestingLocationUpdates = savedInstanceState.GetBoolean (REQUESTING_LOCATION_UPDATES_KEY);
					SetButtonsEnabledState();
				}

				if (savedInstanceState.KeySet ().Contains (LOCATION_KEY)) {
					mCurrentLocation = (Location)savedInstanceState.GetParcelable (LOCATION_KEY);
				}

				if (savedInstanceState.KeySet ().Contains (LAST_UPDATED_TIME_STRING_KEY)) {
					mLastUpdateTime = savedInstanceState.GetString (LAST_UPDATED_TIME_STRING_KEY);
				}
				UpdateUI ();
			}
		}
Пример #60
0
        // [END mListener_variable_reference]


        // [START auth_oncreate_setup_beginning]
        protected override void OnCreate (Bundle savedInstanceState) 
        {
            base.OnCreate (savedInstanceState);
            // Put application specific code here.
            // [END auth_oncreate_setup_beginning]
            SetContentView (Resource.Layout.activity_main);

            logView = FindViewById<TextView> (Resource.Id.sample_logview);
            logView.SetTextAppearance (this, Resource.Style.Log);
            logView.SetBackgroundColor (Android.Graphics.Color.White);
            logView.Append ("\r\n");

            // [START auth_oncreate_setup_ending]

            if (savedInstanceState != null)
                authInProgress = savedInstanceState.GetBoolean (AUTH_PENDING);

            buildFitnessClient();
        }