Skip to content

Commit

Permalink
Merge pull request #99 from Gamhub-io/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
bricefriha authored Oct 22, 2023
2 parents 9ea56fe + 8ab60f9 commit 07c6b22
Show file tree
Hide file tree
Showing 59 changed files with 10,665 additions and 3,747 deletions.
32 changes: 28 additions & 4 deletions AresNews/AresNews.Android/AresNews.Android.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<MonoAndroidResourcePrefix>Resources</MonoAndroidResourcePrefix>
<MonoAndroidAssetsPrefix>Assets</MonoAndroidAssetsPrefix>
<AndroidUseLatestPlatformSdk>false</AndroidUseLatestPlatformSdk>
<TargetFrameworkVersion>v12.0</TargetFrameworkVersion>
<TargetFrameworkVersion>v13.0</TargetFrameworkVersion>
<AndroidEnableSGenConcurrent>true</AndroidEnableSGenConcurrent>
<AndroidUseAapt2>true</AndroidUseAapt2>
<AndroidHttpClientHandlerType>Xamarin.Android.Net.AndroidClientHandler</AndroidHttpClientHandlerType>
Expand Down Expand Up @@ -90,26 +90,44 @@
<Reference Include="System.Numerics.Vectors" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Rg.Plugins.Popup">
<Version>2.1.0</Version>
</PackageReference>
<PackageReference Include="Sharpnado.CollectionView">
<Version>2.1.0</Version>
</PackageReference>
<PackageReference Include="Sharpnado.Tabs">
<Version>2.2.0</Version>
</PackageReference>
<PackageReference Include="sqlite-net-pcl">
<Version>1.8.116</Version>
</PackageReference>
<PackageReference Include="SQLiteNetExtensions">
<Version>2.1.0</Version>
</PackageReference>
<PackageReference Include="System.Net.Http">
<Version>4.3.4</Version>
</PackageReference>
<PackageReference Include="Xam.Plugin.HtmlLabel">
<Version>5.1.0</Version>
</PackageReference>
<PackageReference Include="Xamarin.Android.Support.Design">
<Version>28.0.0.3</Version>
</PackageReference>
<PackageReference Include="Xamarin.AndroidX.Legacy.Support.Core.UI">
<Version>1.0.0.21</Version>
</PackageReference>
<PackageReference Include="Xamarin.AndroidX.Lifecycle.LiveData">
<Version>2.6.2.1</Version>
</PackageReference>
<PackageReference Include="Xamarin.CommunityToolkit">
<Version>2.0.5</Version>
<Version>2.0.6</Version>
</PackageReference>
<PackageReference Include="Xamarin.FFImageLoading.Forms">
<Version>2.4.11.982</Version>
</PackageReference>
<PackageReference Include="Xamarin.Forms" Version="5.0.0.2545" />
<PackageReference Include="Xamarin.Essentials" Version="1.7.4" />
<PackageReference Include="Xamarin.Forms" Version="5.0.0.2612" />
<PackageReference Include="Xamarin.Essentials" Version="1.8.0" />
</ItemGroup>
<ItemGroup>
<Compile Include="MainActivity.cs" />
Expand Down Expand Up @@ -159,6 +177,12 @@
<ItemGroup>
<AndroidResource Include="Resources\drawable\GamHubLogo.png" />
</ItemGroup>
<ItemGroup>
<AndroidResource Include="Resources\layout\custom_tab_layout.xml" />
</ItemGroup>
<ItemGroup>
<Folder Include="Layouts\" />
</ItemGroup>
<Import Project="$(MSBuildExtensionsPath)\Xamarin\Android\Xamarin.Android.CSharp.targets" />
<ProjectExtensions>
<VisualStudio>
Expand Down
11 changes: 11 additions & 0 deletions AresNews/AresNews.Android/MainActivity.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@
using Android.Views;
using Android.OS;
using LabelHtml.Forms.Plugin.Droid;
using Sharpnado.CollectionView.Droid;
using FFImageLoading.Forms.Platform;
using FFImageLoading;
using FFImageLoading.Config;
using System.Net.Http;

namespace AresNews.Droid
{
Expand All @@ -23,8 +28,14 @@ protected override void OnCreate(Bundle savedInstanceState)

Xamarin.Essentials.Platform.Init(this, savedInstanceState);
HtmlLabelRenderer.Initialize();
Rg.Plugins.Popup.Popup.Init(this);
global::Xamarin.Forms.Forms.Init(this, savedInstanceState);

Initializer.Initialize(enableInternalLogger: true, enableInternalDebugLogger: true);
FFImageLoading.Forms.Platform.CachedImageRenderer.Init(true);
CachedImageRenderer.Init(true);

ImageService.Instance.Initialize(new FFImageLoading.Config.Configuration { HttpClient = new HttpClient() });
LoadApplication(new App());

if (Build.VERSION.SdkInt >= Android.OS.BuildVersionCodes.Lollipop)
Expand Down
11,039 changes: 7,458 additions & 3,581 deletions AresNews/AresNews.Android/Resources/Resource.designer.cs

Large diffs are not rendered by default.

30 changes: 30 additions & 0 deletions AresNews/AresNews.Android/Resources/layout/custom_tab_layout.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<?xml version="1.0" encoding="utf-8" ?>
<GridLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:columnCount="1"
android:rowCount="2"
android:layout_gravity="center">

<ImageView
android:id="@+id/icon"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:scaleType="centerInside"
android:layout_row="0"
android:layout_column="0"
android:contentDescription="@android:id/title" />

<TextView
android:id="@+id/title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceSmall"
android:textColor="?android:attr/textColorPrimary"
android:gravity="center"
android:layout_row="1"
android:text="@android:id/title"
android:layout_column="0" />

</GridLayout>
34 changes: 34 additions & 0 deletions AresNews/AresNews.Android/Services/DroidKeyboardHelper.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
using Android.App;
using Android.Content;
using Android.OS;
using Android.Runtime;
using Android.Views;
using Android.Views.InputMethods;
using Android.Widget;
using AresNews.Helpers.Tools;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Xamarin.Forms;

namespace AresNews.Droid.Services
{
public class DroidKeyboardHelper : IKeyboardHelper
{
public void HideKeyboard()
{
var context = Forms.Context;
var inputMethodManager = context.GetSystemService(Context.InputMethodService) as InputMethodManager;
if (inputMethodManager != null && context is Activity)
{
var activity = context as Activity;
var token = activity.CurrentFocus?.WindowToken;
inputMethodManager.HideSoftInputFromWindow(token, HideSoftInputFlags.None);

activity.Window.DecorView.ClearFocus();
}
}
}

}
4 changes: 4 additions & 0 deletions AresNews/AresNews.iOS/AppDelegate.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

using Foundation;
using LabelHtml.Forms.Plugin.iOS;
using Sharpnado.CollectionView.iOS;
using UIKit;

namespace AresNews.iOS
Expand All @@ -24,7 +25,10 @@ public partial class AppDelegate : global::Xamarin.Forms.Platform.iOS.FormsAppli
public override bool FinishedLaunching(UIApplication app, NSDictionary options)
{
HtmlLabelRenderer.Initialize();
Rg.Plugins.Popup.Popup.Init();
Initializer.Initialize();
global::Xamarin.Forms.Forms.Init();
Sharpnado.Tabs.iOS.Preserver.Preserve();
FFImageLoading.Forms.Platform.CachedImageRenderer.Init();
LoadApplication(new App());

Expand Down
25 changes: 17 additions & 8 deletions AresNews/AresNews.iOS/AresNews.iOS.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<MtouchArch>x86_64</MtouchArch>
<MtouchLink>None</MtouchLink>
<MtouchLink>SdkOnly</MtouchLink>
<MtouchDebug>true</MtouchDebug>
<CodesignKey>Apple Development: Brice Friha (H63WXT9HFN)</CodesignKey>
<CodesignProvision>VS: WildCard Development</CodesignProvision>
<CodesignKey>iPhone Developer</CodesignKey>
<CodesignProvision>VS: com.bricefriha.aresgaming Development</CodesignProvision>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|iPhoneSimulator' ">
<DebugType>none</DebugType>
Expand All @@ -48,12 +48,12 @@
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<MtouchArch>ARM64</MtouchArch>
<CodesignKey>Apple Development: Brice Friha (H63WXT9HFN)</CodesignKey>
<CodesignKey>iPhone Developer</CodesignKey>
<MtouchDebug>true</MtouchDebug>
<CodesignEntitlements>Entitlements.plist</CodesignEntitlements>
<MtouchLink>None</MtouchLink>
<MtouchInterpreter>-all</MtouchInterpreter>
<CodesignProvision>VS: WildCard Development</CodesignProvision>
<CodesignProvision>VS: com.bricefriha.aresgaming Development</CodesignProvision>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|iPhone' ">
<DebugType>none</DebugType>
Expand Down Expand Up @@ -164,17 +164,26 @@
<Reference Include="System.Numerics.Vectors" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Rg.Plugins.Popup">
<Version>2.1.0</Version>
</PackageReference>
<PackageReference Include="Sharpnado.CollectionView">
<Version>2.1.0</Version>
</PackageReference>
<PackageReference Include="Sharpnado.Tabs">
<Version>2.2.0</Version>
</PackageReference>
<PackageReference Include="SQLiteNetExtensions">
<Version>2.1.0</Version>
</PackageReference>
<PackageReference Include="Xamarin.CommunityToolkit">
<Version>2.0.5</Version>
<Version>2.0.6</Version>
</PackageReference>
<PackageReference Include="Xamarin.FFImageLoading.Forms">
<Version>2.4.11.982</Version>
</PackageReference>
<PackageReference Include="Xamarin.Forms" Version="5.0.0.2545" />
<PackageReference Include="Xamarin.Essentials" Version="1.7.4" />
<PackageReference Include="Xamarin.Forms" Version="5.0.0.2612" />
<PackageReference Include="Xamarin.Essentials" Version="1.8.0" />
</ItemGroup>
<Import Project="$(MSBuildExtensionsPath)\Xamarin\iOS\Xamarin.iOS.CSharp.targets" />
<ItemGroup>
Expand Down
13 changes: 10 additions & 3 deletions AresNews/AresNews.iOS/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,15 @@
<array>
<string>mailto</string>
</array>
<key>UIApplicationSceneManifest</key>
<dict>
<key>UIApplicationSupportsMultipleScenes</key>
<true/>
<key>UISceneConfigurations</key>
<dict/>
</dict>
<key>MinimumOSVersion</key>
<string>15.4</string>
<string>15.3</string>
<key>CFBundleDisplayName</key>
<string>GamHub</string>
<key>CFBundleIdentifier</key>
Expand All @@ -43,8 +50,8 @@
<string>LaunchScreen</string>
<key>UIApplicationSceneManifest</key>
<dict>
<key>UIApplicationSupportsMultipleScenes</key>
<false/>

</dict>

</dict>
</plist>
17 changes: 17 additions & 0 deletions AresNews/AresNews.iOS/Services/iOSKeyboardHelper.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
using Foundation;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using UIKit;

namespace AresNews.iOS.Services
{
public class iOSKeyboardHelper : IKeyboardHelper
{
public void HideKeyboard()
{
UIApplication.SharedApplication.KeyWindow.EndEditing(true);
}
}
}
13 changes: 12 additions & 1 deletion AresNews/AresNews/App.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,26 +6,37 @@
<Application.Resources>
<ResourceDictionary>
<Color x:Key="Primary" >#84D1AC</Color>
<Color x:Key="SelectionColor" >#528e70</Color>
<Color x:Key="PrimaryAccent" >#1DB954</Color>
<Color x:Key="Secondary" >#666666</Color>
<Color x:Key="Alternate">#8B8E92</Color>
<Color x:Key="Dark" >#1a1a1a</Color>
<Color x:Key="Dark" >#191414</Color>
<Color x:Key="DarkSecondary" >#4A4A4A</Color>
<Color x:Key="LightDark" >#404348</Color>
<Color x:Key="Light" >#9FDBBE</Color>
<Color x:Key="FontColor" >#ecebeb</Color>
<Color x:Key="BgBannerColor" >#262626</Color>
<!--
Potential future colour scheme:
<Color x:Key="Light">#87afc5</Color>
<Color x:Key="Primary">#5f94b1</Color>
-->
</ResourceDictionary>

<!-- Converters-->
<helpers:BoolToBookmarkConveter x:Key="BoolToBookmarkConveter"/>
<helpers:MultipleTOBoolConverter x:Key="MultipleTOBoolConverter"/>
<helpers:MaxLengthConverter x:Key="MaxLengthConverter"/>
<helpers:ThumbnailConverter x:Key="ThumbnailConverter"/>
<helpers:BoolInverseConverter x:Key="BoolInverseConverter"/>
<helpers:ZeroToFalseConverter x:Key="ZeroToFalseConverter"/>

<ResourceDictionary>
<OnPlatform x:Key="TitleRightMargin"
x:TypeArguments="GridLength"
iOS="2*" Android="1.9*" />
</ResourceDictionary>

<!-- Converter to convert time span to string-->
<helpers:TimeSpanConverter x:Key="TimeSpanConverter"/>

Expand Down
Loading

0 comments on commit 07c6b22

Please sign in to comment.