Esempio n. 1
0
        private void OnCameraLocationClicked()
        {
            GpsLocation location = _photoData.GetPhotoGpsLocation();

            if (!GpsUtils.HasLocation(location))
            {
                location = AppContext.MyLocation;
            }

            Intent intent = new Intent(this, typeof(PoiSelectActivity));

            intent.SetAction(PoiSelectActivity.REQUEST_SELECT_CAMERALOCATION.ToString());
            intent.PutExtra("Longitude", location.Longitude);
            intent.PutExtra("Latitude", location.Latitude);
            intent.PutExtra("SortBy", PoiSelectActivity.SortBy.Name.ToString());
            StartActivityForResult(intent, PoiSelectActivity.REQUEST_SELECT_CAMERALOCATION);
        }
Esempio n. 2
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);
            AppContextLiveData.Instance.SetLocale(this);
            Platform.Init(this, savedInstanceState);

            if (AppContextLiveData.Instance.IsPortrait)
            {
                SetContentView(Resource.Layout.PhotoParametersActivityPortrait);
            }
            else
            {
                SetContentView(Resource.Layout.PhotoParametersActivityLandscape);
            }


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

            SetActionBar(toolbar);

            ActionBar.SetDisplayShowHomeEnabled(true);
            ActionBar.SetDisplayHomeAsUpEnabled(true);
            ActionBar.SetDisplayShowTitleEnabled(true);
            ActionBar.SetTitle(Resource.String.PhotoParametersActivity);

            _editTextTag                 = FindViewById <EditText>(Resource.Id.editTextTag);
            _editTextLatitude            = FindViewById <EditText>(Resource.Id.editTextLatitude);
            _editTextLongitude           = FindViewById <EditText>(Resource.Id.editTextLongitude);
            _editTextAltitude            = FindViewById <EditText>(Resource.Id.editTextAltitude);
            _editTextHeading             = FindViewById <EditText>(Resource.Id.editTextHeading);
            _editTextViewAngleHorizontal = FindViewById <EditText>(Resource.Id.editTextViewAngleHorizontal);
            _editTextViewAngleVertical   = FindViewById <EditText>(Resource.Id.editTextViewAngleVertical);
            _imageViewThumbnail          = FindViewById <ImageView>(Resource.Id.Thumbnail);

            FindViewById <Button>(Resource.Id.buttonBearing).SetOnClickListener(this);
            FindViewById <Button>(Resource.Id.buttonLocation).SetOnClickListener(this);
            FindViewById <Button>(Resource.Id.buttonMap).SetOnClickListener(this);
            FindViewById <ImageButton>(Resource.Id.buttonCameraLocationInfo).SetOnClickListener(this);
            FindViewById <ImageButton>(Resource.Id.buttonViewDirectionInfo).SetOnClickListener(this);
            FindViewById <ImageButton>(Resource.Id.buttonViewAnglesInfo).SetOnClickListener(this);

            _editTextLatitude.TextChanged            += OnTextChanged;
            _editTextLongitude.TextChanged           += OnTextChanged;
            _editTextAltitude.TextChanged            += OnTextChanged;
            _editTextHeading.TextChanged             += OnTextChanged;
            _editTextViewAngleVertical.TextChanged   += OnTextChanged;
            _editTextViewAngleHorizontal.TextChanged += OnTextChanged;

            long id = Intent.GetLongExtra("Id", -1);

            _photoData = Context.Database.GetPhotoDataItem(id);

            var bmp = BitmapFactory.DecodeByteArray(_photoData.Thumbnail, 0, _photoData.Thumbnail.Length);

            _imageViewThumbnail.SetImageBitmap(bmp);

            UpdateName(_photoData.Tag);
            UpdateCameraLocation(_photoData.GetPhotoGpsLocation());
            UpdateCameraAltitude(_photoData.GetPhotoGpsLocation());
            UpdateViewAngles(_photoData.ViewAngleVertical, _photoData.ViewAngleHorizontal);
            UpdateHeading(_photoData.Heading);
        }