-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Added view for place detail * Place detail view * Page viewmodels renaming
- Loading branch information
1 parent
b3b956e
commit 6098ed7
Showing
18 changed files
with
207 additions
and
108 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 2 additions & 1 deletion
3
src/Client/ShareLoc.Client.App/ViewModels/MyGuessesViewModel.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
namespace ShareLoc.Client.App.ViewModels; | ||
|
||
public sealed class MyGuessesViewModel : BaseViewModel | ||
public sealed class MyGuessesViewModel | ||
: BaseViewModel | ||
{ | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 5 additions & 0 deletions
5
src/Client/ShareLoc.Client.App/ViewModels/PlaceDetailPageViewModel.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
namespace ShareLoc.Client.App.ViewModels; | ||
|
||
public sealed partial class PlaceDetailPageViewModel : BaseViewModel | ||
{ | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
31 changes: 1 addition & 30 deletions
31
src/Client/ShareLoc.Client.App/Views/Pages/CreatePlacePage.xaml.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,38 +1,9 @@ | ||
using ShareLoc.Client.App.Services; | ||
|
||
namespace ShareLoc.Client.App.Views.Pages; | ||
|
||
public sealed partial class CreatePlacePage : ContentPage | ||
{ | ||
private readonly INavigationService _navigationService; | ||
public CreatePlacePage(INavigationService navigationService) | ||
public CreatePlacePage() | ||
{ | ||
InitializeComponent(); | ||
|
||
_navigationService = navigationService; | ||
// Make Image expand to fill the whole screen on tap and collapse on tap again | ||
var tapGestureRecognizer = new TapGestureRecognizer(); | ||
tapGestureRecognizer.Tapped += OnImageTapped!; | ||
photo.GestureRecognizers.Add(tapGestureRecognizer); | ||
} | ||
|
||
private void OnImageTapped(object sender, EventArgs e) | ||
{ | ||
if (sender is not Image photo) return; | ||
|
||
var windowWidth = _navigationService.GetCurrentPage().Width; | ||
var mapHeight = map.Height; | ||
var scale = Math.Min(windowWidth / photo.Width, mapHeight / photo.Height); | ||
|
||
if (photo.Scale == 1) | ||
{ | ||
photo.ScaleTo(scale * 0.8, 250, Easing.CubicInOut); | ||
photo.TranslateTo((windowWidth - photo.Width * 0.8) / 2, (mapHeight - photo.Height) / 2, 250, Easing.CubicInOut); | ||
} | ||
else | ||
{ | ||
photo.ScaleTo(1, 250, Easing.CubicInOut); | ||
photo.TranslateTo(0, 0, 250, Easing.CubicInOut); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.