private void SetUIForProgress100() { var filter = new SimpleColorFilter(ContextCompat.GetColor(this, Resource.Color.accent)); progressLottieAnimationView.AddValueCallback(new KeyPath("**"), LottieProperty.ColorFilter, new LottieValueCallback(filter)); progressLottieAnimationView.PlayAnimation(); }
private void InitUi() { var toolbar = (Toolbar)FindViewById(Resource.Id.toolbar); SetSupportActionBar(toolbar); Title = "Glicemie"; SupportActionBar.SetDisplayHomeAsUpEnabled(true); SupportActionBar.SetDisplayShowHomeEnabled(true); toolbar.NavigationClick += delegate { Finish(); }; LbStatus = FindViewById <TextView>(Resource.Id.status); _dataContainer = FindViewById <ConstraintLayout>(Resource.Id.dataContainer); _manualRegisterButton = FindViewById <Button>(Resource.Id.manual_register); _dataContainer.Visibility = ViewStates.Gone; _glucose = FindViewById <TextView>(Resource.Id.GlucoseTextView); //_scanButton = FindViewById<Button>(Resource.Id.ScanButton); _animationView = FindViewById <LottieAnimationView>(Resource.Id.animation_view); var filter = new SimpleColorFilter(ContextCompat.GetColor(this, Resource.Color.accent)); _animationView.AddValueCallback(new KeyPath("**"), LottieProperty.ColorFilter, new LottieValueCallback(filter)); }
private void InitUi() { var toolbar = FindViewById <Toolbar>(Resource.Id.toolbar); SetSupportActionBar(toolbar); Title = "Tensiune"; SupportActionBar.SetDisplayHomeAsUpEnabled(true); SupportActionBar.SetDisplayShowHomeEnabled(true); toolbar.NavigationClick += (sender, args) => Finish(); LbStatus = FindViewById <TextView>(Resource.Id.status); _manualRegisterButton = FindViewById <Button>(Resource.Id.manual_register); _dataContainer = FindViewById <ConstraintLayout>(Resource.Id.dataContainer); _systole = FindViewById <TextView>(Resource.Id.SystoleTextView); _diastole = FindViewById <TextView>(Resource.Id.DiastoleTextView); _pulse = FindViewById <TextView>(Resource.Id.PulseTextView); //_scanButton = FindViewById<Button>(Resource.Id.ScanButton); AnimationView = FindViewById <LottieAnimationView>(Resource.Id.animation_view); var filter = new SimpleColorFilter(ContextCompat.GetColor(this, Resource.Color.accent)); AnimationView.AddValueCallback(new KeyPath("**"), LottieProperty.ColorFilter, new LottieValueCallback(filter)); }
protected override async void OnCreate(Bundle savedInstanceState) { base.OnCreate(savedInstanceState); SetContentView(Resource.Layout.activity_smart_band_device); _lbBpm = FindViewById <TextView>(Resource.Id.lbBpm); _lbSleep = FindViewById <TextView>(Resource.Id.lbSleepTime); _lbSteps = FindViewById <TextView>(Resource.Id.lbsteps); _lbDisplayName = FindViewById <TextView>(Resource.Id.lbDisplayName); _lbFullName = FindViewById <TextView>(Resource.Id.lbFullName); _lbActivity = FindViewById <TextView>(Resource.Id.lbActivTime); _avatarImage = FindViewById <CircleImageView>(Resource.Id.FitBitprofileImage); _loadingScreen = FindViewById <ConstraintLayout>(Resource.Id.loading); var toolbar = FindViewById <Toolbar>(Resource.Id.toolbar); SetSupportActionBar(toolbar); var animationView = FindViewById <LottieAnimationView>(Resource.Id.animation_view); var filter = new SimpleColorFilter(ContextCompat.GetColor(this, Resource.Color.colorAccent)); animationView.AddValueCallback(new KeyPath("**"), LottieProperty.ColorFilter, new LottieValueCallback(filter)); SupportActionBar.SetDisplayHomeAsUpEnabled(true); SupportActionBar.SetDisplayShowHomeEnabled(true); toolbar.NavigationClick += delegate { OnBackPressed(); }; Title = "Profil de sanatate"; OnNewIntent(Intent); if (_url != null) { string code = _url.Substring(_url.IndexOf("&access_token", StringComparison.Ordinal) + 24).Replace("#_=_", string.Empty); await Task.Run(async() => { var dict = new Dictionary <string, string> { { "code", code }, { "grant_type", "authorization_code" }, { "redirect_uri", Constants.CallbackUrl } }; string response = await WebServices.WebServices.Post("https://api.fitbit.com/oauth2/token", dict); if (response != null) { var obj = new JSONObject(response); _token = obj.GetString("access_token"); string refreshToken = obj.GetString("refresh_token"); string userId = obj.GetString("user_id"); var bleDevicesRecords = await SqlHelper <BluetoothDeviceRecords> .CreateAsync(); await bleDevicesRecords.Insert( new BluetoothDeviceRecords { Name = "SmartBand", Address = _token, DeviceType = DeviceType.SmartBand }); Utils.SetDefaults(GetString(Resource.String.smartband_device), _token); Utils.SetDefaults("FitbitToken", _token); Utils.SetDefaults("FitbitRefreshToken", refreshToken); Utils.SetDefaults("FitbitUserId", userId); Utils.SetDefaults("FitbitAuthCode", code); } }); } else { RefreshToken(); _token = Utils.GetDefaults(GetString(Resource.String.smartband_device)); // Log.Error("TokenFromShared", _token); } _loadingScreen.Visibility = ViewStates.Visible; await Task.Run(async() => await PopulateFields()); _loadingScreen.Visibility = ViewStates.Gone; }
protected override void OnResume() { base.OnResume(); bool fingerprint = !string.IsNullOrEmpty(Utils.GetDefaults("fingerprint")) && Convert.ToBoolean(Utils.GetDefaults("fingerprint")); if (!fingerprint && !string.IsNullOrEmpty(Utils.GetDefaults("UserPin"))) { StartActivity(typeof(PinActivity)); return; } FingerprintManagerCompat checkHardware = FingerprintManagerCompat.From(this); var keyguardManager1 = (KeyguardManager)GetSystemService(KeyguardService); if (!fingerprint || !checkHardware.IsHardwareDetected || !keyguardManager1.IsKeyguardSecure) { return; } SetContentView(Resource.Layout.activity_finger); var animationView = FindViewById <LottieAnimationView>(Resource.Id.animation_view); var filter = new SimpleColorFilter(ContextCompat.GetColor(this, Resource.Color.colorAccent)); animationView.AddValueCallback(new KeyPath("**"), LottieProperty.ColorFilter, new LottieValueCallback(filter)); //Using the Android Support Library v4 var keyguardManager = (KeyguardManager)GetSystemService(KeyguardService); var fingerprintManager = (FingerprintManager)GetSystemService(FingerprintService); var btn = FindViewById <Button>(Resource.Id.btn_pin); btn.Click += (sender, e) => { StartActivity(typeof(PinActivity)); }; if (ContextCompat.CheckSelfPermission(this, Manifest.Permission.UseFingerprint) != (int)Permission.Granted) { return; } if (!fingerprintManager.IsHardwareDetected) { Toast.MakeText(this, "Nu exista permisiuni pentru autentificare utilizand amprenta", ToastLength.Long).Show(); LoadLoginUi(); } else { if (!fingerprintManager.HasEnrolledFingerprints) { Toast.MakeText(this, "Nu ati inregistrat nici o amprenta in setari", ToastLength.Long).Show(); LoadLoginUi(); } else { if (!keyguardManager.IsKeyguardSecure) { Toast.MakeText(this, "Telefonul trebuie sa fie securizat utilizand senzorul de amprente", ToastLength.Long).Show(); LoadLoginUi(); } else { GenKey(); } if (!CipherInit()) { return; } var helper = new FingerprintHandler(this); helper.StartAuthentication(fingerprintManager, new FingerprintManager.CryptoObject(_cipher)); helper.FingerprintAuth += delegate(object sender, FingerprintHandler.FingerprintAuthEventArgs args) { if (args.Status) { StartActivity(typeof(MainActivity)); Finish(); } else { var filterError = new SimpleColorFilter( ContextCompat.GetColor(this, Resource.Color.accent)); animationView.AddValueCallback(new KeyPath("**"), LottieProperty.ColorFilter, new LottieValueCallback(filterError)); var vibrator = (Vibrator)GetSystemService(VibratorService); vibrator?.Vibrate(VibrationEffect.CreateOneShot(100, VibrationEffect.DefaultAmplitude)); if (args.ErrorsCount != 5) { return; } Toast.MakeText(this, "5 incercari gresite de verificare a amprentelor!", ToastLength.Long).Show(); } }; } } }