Skip to content

Commit

Permalink
v1.6.2 (#187)
Browse files Browse the repository at this point in the history
* workflow - dev| bump version

* fix: Article page HTML rendering (#184)

* Article detail - UI | Introduce a CSS file to set up the layout

* Article page | disable webview for content as it's way too buggy

* cleaup - article view | remove redandent stuff

* Style - article | add brighter colours for links

* Workflow - android dev | unset change review

* Correct README.md

* Fix: Text-to-speech not working (#186)

* Android - TTS | manage permissions

* Article - TTS | mentioning Binding context to the TTS button
  • Loading branch information
bricefriha authored Jan 30, 2025
1 parent 44494ac commit 37d1d63
Show file tree
Hide file tree
Showing 7 changed files with 75 additions and 15 deletions.
1 change: 0 additions & 1 deletion .github/workflows/cd-android.yml
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,6 @@ jobs:
packageName: ${{ inputs.package-name }}
releaseFiles: ${{ github.workspace }}/${{ inputs.project-folder }}/bin/${{ inputs.build-config }}/${{ inputs.dotnet-version-target }}-android/${{ inputs.package-name }}-Signed.aab
track: internal
changesNotSentForReview: true
- uses: r0adkll/[email protected]
name: Upload Android Artifact to Play Console production
if: ${{contains(inputs.deploy-type, 'prod')}}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/dev-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ on:
push:
branches: ['develop']
env:
BUILD_VERSION: '1.5'
BUILD_VERSION: '1.6'
DOTNET_VERSION: 9.0.x
XCODE_VERSION: 16.2
DOTNET_VERSION_TARGETS: net9.0
Expand Down
19 changes: 19 additions & 0 deletions App/Models/Article.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
using SQLite;
using SQLiteNetExtensions.Attributes;
using SQLiteNetExtensions.Extensions;
using System.Reflection;

namespace GamHubApp.Models;

Expand Down Expand Up @@ -141,4 +142,22 @@ public Command ShareArticle
}); ;
}
}

[Ignore]
public string HTMLContent
{
get
{

var assembly = Assembly.GetExecutingAssembly();
string style;
// Read the embedded resource
using (Stream stream = assembly.GetManifestResourceStream($"{assembly.GetName().Name}.Resources.Styles.ArticleStyle.css"))
using (StreamReader reader = new (stream))
{
style = $"<style type=\"text/css\">{reader.ReadToEnd()}</style>";
}
return style+Content;
}
}
}
3 changes: 3 additions & 0 deletions App/Platforms/Android/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,8 @@
<action android:name="android.intent.action.VIEW" />
<data android:scheme="https"/>
</intent>
<intent>
<action android:name="android.intent.action.TTS_SERVICE" />
</intent>
</queries>
</manifest>
21 changes: 21 additions & 0 deletions App/Resources/Styles/ArticleStyle.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
@font-face {
font-family: TextFont;
src: url("file:///android_asset/Ubuntu-Medium.ttf")
}
img, [class^="image-"] {
width: 250px;
height: auto;
}

label {
font-family: TextFont;
font-size: medium;
text-align: justify;
}

a {
color: #4AC776;
}
* {
color: #ecebeb;
}
36 changes: 27 additions & 9 deletions App/Views/ArticlePage.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -157,9 +157,13 @@
<Border Grid.Column="2"
Style="{StaticResource ButtonBorder}"
Padding="0"
BackgroundColor="{Binding TtsColour}">
BackgroundColor="{Binding TtsColour}"
x:Name="TtsButton">
<Border.Behaviors>
<mct:TouchBehavior Command="{Binding PlayTextToSpeech}"/>
<mct:TouchBehavior Command="{Binding PlayTextToSpeech}"
BindingContext="{Binding BindingContext,
Source={x:Reference thy},
x:DataType=ContentPage}"/>
</Border.Behaviors>

<Label TextColor="{StaticResource Primary}"
Expand All @@ -173,13 +177,27 @@
</Grid>
</Grid>
<!-- content -->
<Label Text="{Binding SelectedArticle.Content, Mode=OneWay}"
FontFamily="P-Regular"
TextColor="{StaticResource FontColor}"
Margin="10"
TextType="Html"
Grid.Row="3"
/>
<!-- NOTE: a bug prevent use from using WebView on iOS. see: https://github.com/dotnet/maui/issues/21604-->

<Label Text="{Binding SelectedArticle.Content, Mode=OneWay}"
FontFamily="P-Regular"
IsVisible="{OnPlatform Android='false',
iOS='true'}"
TextColor="{StaticResource FontColor}"
Margin="10"
TextType="Html"
Grid.Row="3"
/>
<WebView Grid.Row="3"
IsVisible="{OnPlatform Android='true',
iOS='false'}"
x:Name="contentView"
BackgroundColor="Transparent"
>
<WebView.Source>
<HtmlWebViewSource Html="{Binding SelectedArticle.HTMLContent, Mode=OneWay}"/>
</WebView.Source>
</WebView>

<!-- Button to open to the default Browser -->
<Button Text="Read more"
Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,12 @@ The app has been built using [Xamarin Forms](https://github.com/xamarin/Xamarin.

Platform | Testing | Production |
--- | ----- | ------|
| **Android**| [![Build status](https://github.com/Gamhub-io/MobileApp/actions/workflows/dev-deploy.yml/badge.svg)](https://github.com/Gamhub-io/MobileApp/actions/workflows/dev-deploy.yml)|[![Build status](https://build.appcenter.ms/v0.1/apps/af152970-a78b-4dc4-9435-c88d5bc7a5d8/branches/master/badge)](https://appcenter.ms)
| **iOS**| [![Build status](https://github.com/Gamhub-io/MobileApp/actions/workflows/dev-deploy.yml/badge.svg)](https://github.com/Gamhub-io/MobileApp/actions/workflows/dev-deploy.yml)|[![Build status](https://build.appcenter.ms/v0.1/apps/ccbb4d7f-7e53-41ca-8da6-be665b7eeeb4/branches/master/badge)](https://appcenter.ms)|
| **Android**| [![Build status](https://github.com/Gamhub-io/MobileApp/actions/workflows/dev-deploy.yml/badge.svg)](https://github.com/Gamhub-io/MobileApp/actions/workflows/dev-deploy.yml)|[![Prod Deployment Build](https://github.com/Gamhub-io/MobileApp/actions/workflows/prod-deploy.yml/badge.svg)](https://github.com/Gamhub-io/MobileApp/actions/workflows/prod-deploy.yml)
| **iOS**| [![Build status](https://github.com/Gamhub-io/MobileApp/actions/workflows/dev-deploy.yml/badge.svg)](https://github.com/Gamhub-io/MobileApp/actions/workflows/dev-deploy.yml)|[![Prod Deployment Build](https://github.com/Gamhub-io/MobileApp/actions/workflows/prod-deploy.yml/badge.svg)](https://github.com/Gamhub-io/MobileApp/actions/workflows/prod-deploy.yml)|

## Contributions
As the app is open-source, the app evolve using
its community's skills, knowledges and opinions.
As the app is open-source, the app evolves using
its community's skills, knowledge and opinions.

### Contribute with skills! 💪

Expand Down

0 comments on commit 37d1d63

Please sign in to comment.