Skip to content

Commit

Permalink
Merge pull request #227 from OudomMunint/dev
Browse files Browse the repository at this point in the history
PR: Dev => Main
  • Loading branch information
OudomMunint authored Jul 20, 2024
2 parents a2e50ee + 60c6df7 commit e715ae9
Show file tree
Hide file tree
Showing 10 changed files with 215 additions and 21 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -74,4 +74,4 @@ jobs:
- name: Create Release
uses: ncipollo/[email protected]
with:
tag: v1.7.5
tag: v1.7.6
Binary file added Resources/Images/disclosure_indicator_icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
93 changes: 93 additions & 0 deletions Resources/Images/dotnet_bot.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Resources/Images/error_icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Resources/Images/globe.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 7 additions & 0 deletions Resources/Styles/Styles.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,13 @@
</Setter>
</Style>

<Style TargetType="Image" x:Key="SettingsCaret">
<Setter Property="HorizontalOptions" Value="End" />
<Setter Property="Source" Value="disclosure_indicator_icon.png" />
<Setter Property="Aspect" Value="AspectFit" />
<Setter Property="HeightRequest" Value="20" />
</Style>

<Style TargetType="Label">
<Setter Property="TextColor" Value="{AppThemeBinding Light={StaticResource Gray900}, Dark={StaticResource White}}" />
<Setter Property="FontFamily" Value="OpenSansRegular" />
Expand Down
43 changes: 43 additions & 0 deletions Views/Settings.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,49 @@
<Button Grid.Column="1" Text="Generate data" BackgroundColor="Gray" TextColor="White" Pressed="GenerateData_Button_Pressed"/>
</Grid>
</Frame>

<HorizontalStackLayout>
<Label Text="App Info" FontSize="Title" Margin="5,15,20,20" />
<Image Source="description.png" Aspect="AspectFit" HeightRequest="30"/>
</HorizontalStackLayout>

<Frame CornerRadius="20" Style="{DynamicResource SettingsFrame}" Margin="0,15,0,0">
<Grid Margin="0" HorizontalOptions="FillAndExpand" RowSpacing="20">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="250" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<Image Grid.Column="0" Grid.Row="0" Source="globe.png" Aspect="AspectFit" HeightRequest="30" HorizontalOptions="Start"/>
<Label Margin="20,0,0,0" Grid.Column="1" Grid.Row="0" Text="Home Page" HorizontalOptions="Start" VerticalOptions="Center">
<Label.GestureRecognizers>
<TapGestureRecognizer Tapped="Home_Clicked"/>
</Label.GestureRecognizers>
</Label>
<ImageButton x:Name="Home" Style="{StaticResource SettingsCaret}" Grid.Column="2" Grid.Row="0" Clicked="Home_Clicked"/>

<Image Grid.Column="0" Grid.Row="1" Source="priority.png" Aspect="AspectFit" HeightRequest="30" HorizontalOptions="Start"/>
<Label Margin="20,0,0,0" Grid.Column="1" Grid.Row="1" Text="Feedback &amp; Sugguestions" HorizontalOptions="Start" VerticalOptions="Center">
<Label.GestureRecognizers>
<TapGestureRecognizer Tapped="Feedback_Clicked"/>
</Label.GestureRecognizers>
</Label>
<ImageButton x:Name="Feedback" Style="{StaticResource SettingsCaret}" Grid.Column="2" Grid.Row="1" Clicked="Feedback_Clicked"/>

<Image Grid.Column="0" Grid.Row="2" Source="dotnet_bot.png" Aspect="AspectFit" HeightRequest="30" HorizontalOptions="Center"/>
<Label Margin="20,0,0,0" Grid.Column="1" Grid.Row="2" Text="About Me" TextColor="White" HorizontalOptions="Start" VerticalOptions="Center">
<Label.GestureRecognizers>
<TapGestureRecognizer Tapped="AboutMe_Clicked"/>
</Label.GestureRecognizers>
</Label>
<ImageButton x:Name="AboutMe" Style="{StaticResource SettingsCaret}" Grid.Column="2" Grid.Row="2" Clicked="AboutMe_Clicked"/>
</Grid>
</Frame>

</StackLayout>
</Grid>
Expand Down
42 changes: 42 additions & 0 deletions Views/Settings.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -118,4 +118,46 @@ await MainThread.InvokeOnMainThreadAsync(async () =>
Navigation.RemovePage(this);
});
}

private async void Home_Clicked(System.Object sender, System.EventArgs e)
{
try
{
Uri uri = new("https://github.com/OudomMunint/.NetMAUI-To-Do-List-App");
await Browser.Default.OpenAsync(uri, BrowserLaunchMode.SystemPreferred);
}
catch (Exception ex)
{
await DisplayAlert("Error", ex.ToString(), "Cancel");
}
}

private async void Feedback_Clicked(System.Object sender, System.EventArgs e)
{
try
{
Uri uri = new("https://github.com/OudomMunint/.NetMAUI-To-Do-List-App/issues");
await Browser.Default.OpenAsync(uri, BrowserLaunchMode.SystemPreferred);
}
catch (Exception ex)
{
await DisplayAlert("Error", ex.ToString(), "Cancel");
}
}

private async void AboutMe_Clicked(System.Object sender, System.EventArgs e)
{
try
{
Uri uri = new("https://github.com/OudomMunint");
Uri uri2 = new("https://oudommunint.netlify.app");

bool result = await DisplayAlert("About Me", "Do you want to visit my GitHub or Portfolio?", "GitHub", "Portfolio");
await Browser.Default.OpenAsync(result ? uri : uri2, BrowserLaunchMode.SystemPreferred);
}
catch (Exception ex)
{
await DisplayAlert("Error", ex.ToString(), "Cancel");
}
}
}
10 changes: 8 additions & 2 deletions Views/TodoListPage.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,7 @@ async void OnDeleteClicked(object sender, EventArgs e)

async void OnListItemSelected(object sender, SelectedItemChangedEventArgs e)
{
HapticFeedback.Default.Perform(HapticFeedbackType.Click);
if (e.SelectedItem != null)
{
await Navigation.PushAsync(new TodoitemPage
Expand Down Expand Up @@ -208,7 +209,12 @@ async void DeleteSelectedItems(object sender, EventArgs e)

if (!selectedItems.Any())
{
await DisplayAlert("No Items Selected", "Please select items to delete", "OK");
bool Confirmed = await DisplayAlert("Delete All", "Are you sure you want to delete everything?", "OK", "Cancel");

if (Confirmed)
{
DeleteAllItems(sender, e);
}
}
else
{
Expand All @@ -234,7 +240,7 @@ public async void OpenMenu(object sender, EventArgs e)
string deleteall = "Delete all";
string settings = "Settings";

var action = await Application.Current.MainPage.DisplayActionSheet(null, "Cancel", null, new[] { deleteall, settings });
var action = await Application.Current.MainPage.DisplayActionSheet(null, "Cancel", null, [settings]);

if (action != null && action.Equals(deleteall))
{
Expand Down
Loading

0 comments on commit e715ae9

Please sign in to comment.