Пример #1
0
        public ProfileView()
        {
            profileViewModel = new ProfileViewModel();
            DataContext = profileViewModel;
            InitializeComponent();

            TotalDistanceTab.Title1 = "Total";
            TotalDistanceTab.Title2 = "DISTANCE";

            TotalTimeTab.Title1 = "Total";
            TotalTimeTab.Title2 = "TIME";

            MaxSpeedTab.Title1 = "Max";
            MaxSpeedTab.Title2 = "SPEED";

            FuelConsumptionTab.Title1 = "Total";
            FuelConsumptionTab.Title2 = "FUEL USED";

            HardBreaksTab.Title1 = "Hard";
            HardBreaksTab.Title2 = "STOPS";

            HardAccelTab.Title1 = "Hard";
            HardAccelTab.Title2 = "ACCELERATIONS";

            TotalTripsTab.Title1 = "Total";
            TotalTripsTab.Title2 = "TRIPS";
        }
Пример #2
0
        public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
        {
            base.OnCreateView(inflater, container, savedInstanceState);
            var view = inflater.Inflate(Resource.Layout.fragment_profile, null);

            ratingCircle = view.FindViewById<RatingCircle>(Resource.Id.rating_circle);
            circleImage = view.FindViewById<CircleImageView>(Resource.Id.profile_image);


            viewModel = new ProfileViewModel();
            Square.Picasso.Picasso.With(Activity).Load(Settings.Current.UserProfileUrl).Into(circleImage);

            trips = view.FindViewById<TextView>(Resource.Id.text_trips);
            time = view.FindViewById<TextView>(Resource.Id.text_time);
            distance = view.FindViewById<TextView>(Resource.Id.text_distance);
            maxSpeed = view.FindViewById<TextView>(Resource.Id.text_max_speed);
            fuelUsed = view.FindViewById<TextView>(Resource.Id.text_fuel_consumption);
            accelerations = view.FindViewById<TextView>(Resource.Id.text_hard_accelerations);
            stops = view.FindViewById<TextView>(Resource.Id.text_hard_breaks);
            profileAll = view.FindViewById<LinearLayout>(Resource.Id.text_profile_all);

            profileGreat = view.FindViewById<TextView>(Resource.Id.text_profile_great);
            profileRating = view.FindViewById<TextView>(Resource.Id.text_profile_rating);
            profileAll.Visibility = ViewStates.Invisible;
            UpdateUI();
            return view;
        }
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();

            ViewModel = new ProfileViewModel();
            NavigationItem.Title = $"{ViewModel.Settings.UserFirstName} {ViewModel.Settings.UserLastName}";

            var url = ViewModel.Settings.UserProfileUrl;
            imgAvatar.SetImage(new NSUrl(url));

            imgAvatar.Layer.CornerRadius = imgAvatar.Frame.Width/2;
            imgAvatar.Layer.BorderWidth = 2;
            imgAvatar.Layer.BorderColor = "15A9FE".ToUIColor().CGColor;
            imgAvatar.Layer.MasksToBounds = true;

            UpdateUI();
        }