Skip to content

Commit

Permalink
Merge pull request #41 from lochidev/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
lochidev authored Jan 20, 2025
2 parents 08e1d9b + 7ad7783 commit a74adcb
Show file tree
Hide file tree
Showing 15 changed files with 144 additions and 124 deletions.
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,9 @@ Espanso configuration YML files will take a few tries to parse correctly. Try re

You can further customize date time formats by referring to the C# DateTime.ToString() method documentation from Microsoft.

Clipboard extension will not work on android 10 or higher due to security measures introduced by google. (Note: I have not tested this app on android versions below 12)
Clipboard extension will not work on android 10 or higher due to security measures introduced by google. However a workaround was found at issue: <a href="https://github.com/lochidev/Expandroid/issues/35#issue-2531110035">#35</a> and should work on all devices after v7.1.0

Note: I have not tested this app on android versions below 12.

Starting with v7.0.0 forms support has been added.
Multi-line, choice & list have been added.
Expand Down
13 changes: 13 additions & 0 deletions examples/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,11 @@ matches:
format: dd/MM/%y
- trigger: :cursor
replace: '<div>$|$</div>'
- trigger: :cx
replace: 'here is the replacement from cb: {{cxx}}'
vars:
- name: cxx
type: clipboard
- trigger: :yesterday
replace: '{{date}}'
vars:
Expand Down Expand Up @@ -67,6 +72,14 @@ matches:
values:
- First choice
- Second choice

- trigger: :clip
form: |
[[text]],
form_fields:
text:
multiline: true

- trigger: ":list"
form: |
[[choices]]
Expand Down
2 changes: 1 addition & 1 deletion src/App.xaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="UTF-8" ?>
<?xml version="1.0" encoding="UTF-8" ?>
<Application xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:local="clr-namespace:Expandroid"
Expand Down
166 changes: 74 additions & 92 deletions src/Expandroid.csproj
Original file line number Diff line number Diff line change
@@ -1,93 +1,75 @@
<Project Sdk="Microsoft.NET.Sdk.Razor">

<PropertyGroup>
<TargetFrameworks>net8.0-android34.0</TargetFrameworks>
<!-- Uncomment to also build the tizen app. You will need to install tizen by following this: https://github.com/Samsung/Tizen.NET -->
<!-- <TargetFrameworks>$(TargetFrameworks);net8.0-tizen</TargetFrameworks> -->
<OutputType>Exe</OutputType>
<RootNamespace>Expandroid</RootNamespace>
<UseMaui>true</UseMaui>
<SingleProject>true</SingleProject>
<ImplicitUsings>enable</ImplicitUsings>
<EnableDefaultCssItems>false</EnableDefaultCssItems>

<!-- Display name -->
<ApplicationTitle>Expandroid</ApplicationTitle>

<!-- App Identifier -->
<ApplicationId>com.dingleinc.texttoolspro</ApplicationId>
<ApplicationIdGuid>A9E98E65-AE83-5428-9AB1-578DC0552CB8</ApplicationIdGuid>

<!-- Versions -->
<ApplicationDisplayVersion>7.0.0</ApplicationDisplayVersion>
<ApplicationVersion>23</ApplicationVersion>

<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'ios'">14.2</SupportedOSPlatformVersion>
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'maccatalyst'">14.0</SupportedOSPlatformVersion>
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'android'">24.0</SupportedOSPlatformVersion>
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'windows'">10.0.17763.0</SupportedOSPlatformVersion>
<TargetPlatformMinVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'windows'">10.0.17763.0</TargetPlatformMinVersion>
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'tizen'">6.5</SupportedOSPlatformVersion>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)|$(TargetFramework)|$(Platform)'=='Release|net8.0-android|AnyCPU'">
<AndroidPackageFormat>aab</AndroidPackageFormat>
<AndroidCreatePackagePerAbi>False</AndroidCreatePackagePerAbi>
<AndroidUseAapt2>True</AndroidUseAapt2>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)|$(TargetFramework)|$(Platform)'=='Debug|net8.0-android|AnyCPU'">
<AndroidCreatePackagePerAbi>False</AndroidCreatePackagePerAbi>
<AndroidUseAapt2>True</AndroidUseAapt2>
<AndroidPackageFormat>aab</AndroidPackageFormat>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)|$(TargetFramework)|$(Platform)'=='Release|net8.0-android34.0|AnyCPU'">
<AndroidPackageFormat>apk</AndroidPackageFormat>
<AndroidCreatePackagePerAbi>True</AndroidCreatePackagePerAbi>
<AndroidUseAapt2>True</AndroidUseAapt2>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)|$(TargetFramework)|$(Platform)'=='Debug|net8.0-android34.0|AnyCPU'">
<AndroidCreatePackagePerAbi>True</AndroidCreatePackagePerAbi>
<AndroidUseAapt2>True</AndroidUseAapt2>
<AndroidPackageFormat>apk</AndroidPackageFormat>
</PropertyGroup>

<ItemGroup>
<!-- App Icon -->
<MauiIcon Include="Resources\AppIcon\appicon.svg" BaseSize="512,512" />

<!-- Splash Screen -->
<MauiSplashScreen Include="Resources\Splash\splash.svg" Color="#D1F00F" BaseSize="512,512" />

<!-- Images -->
<MauiImage Include="Resources\Images\*" />

<!-- Custom Fonts -->
<MauiFont Include="Resources\Fonts\*" />

<!-- Raw Assets (also remove the "Resources\Raw" prefix) -->
<MauiAsset Include="Resources\Raw\**" LogicalName="%(RecursiveDir)%(Filename)%(Extension)" />
</ItemGroup>

<ItemGroup>
<None Remove="Platforms\Android\Resources\Layout\floatview.xml" />
<None Remove="Platforms\Android\Resources\values\strings.xml" />
<None Remove="Platforms\Android\Resources\xml\accessibility_service.xml" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="MudBlazor" Version="6.19.1" />
<PackageReference Include="YamlDotNet" Version="15.1.4" />
<PackageReference Include="CommunityToolkit.Mvvm" Version="8.2.2" />
<PackageReference Include="CommunityToolkit.Maui" Version="7.0.1" />
<PackageReference Include="Microsoft.AspNetCore.Components.WebView.Maui" Version="8.0.6" />
<PackageReference Include="Microsoft.Maui.Controls" Version="8.0.6" />
</ItemGroup>

<ItemGroup>
<Folder Include="Resources\Images\" />
</ItemGroup>

</Project>
<PropertyGroup>
<TargetFrameworks>net9.0-android35.0</TargetFrameworks>
<!-- Uncomment to also build the tizen app. You will need to install tizen by following this: https://github.com/Samsung/Tizen.NET -->
<!-- <TargetFrameworks>$(TargetFrameworks);net9.0-tizen</TargetFrameworks> -->
<OutputType>Exe</OutputType>
<RootNamespace>Expandroid</RootNamespace>
<UseMaui>true</UseMaui>
<SingleProject>true</SingleProject>
<ImplicitUsings>enable</ImplicitUsings>
<EnableDefaultCssItems>false</EnableDefaultCssItems>
<!-- Display name -->
<ApplicationTitle>Expandroid</ApplicationTitle>
<!-- App Identifier -->
<ApplicationId>com.dingleinc.texttoolspro</ApplicationId>
<ApplicationIdGuid>A9E98E65-AE83-5428-9AB1-578DC0552CB8</ApplicationIdGuid>
<!-- Versions -->
<ApplicationDisplayVersion>7.1.0</ApplicationDisplayVersion>
<ApplicationVersion>24</ApplicationVersion>
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'ios'">14.2</SupportedOSPlatformVersion>
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'maccatalyst'">14.0</SupportedOSPlatformVersion>
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'android'">24.0</SupportedOSPlatformVersion>
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'windows'">10.0.17763.0</SupportedOSPlatformVersion>
<TargetPlatformMinVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'windows'">10.0.17763.0</TargetPlatformMinVersion>
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'tizen'">6.5</SupportedOSPlatformVersion>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(TargetFramework)|$(Platform)'=='Release|net9.0-android|AnyCPU'">
<AndroidPackageFormat>aab</AndroidPackageFormat>
<AndroidCreatePackagePerAbi>False</AndroidCreatePackagePerAbi>
<AndroidUseAapt2>True</AndroidUseAapt2>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(TargetFramework)|$(Platform)'=='Debug|net9.0-android|AnyCPU'">
<AndroidCreatePackagePerAbi>False</AndroidCreatePackagePerAbi>
<AndroidUseAapt2>True</AndroidUseAapt2>
<AndroidPackageFormat>aab</AndroidPackageFormat>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(TargetFramework)|$(Platform)'=='Release|net9.0-android.0|AnyCPU'">
<AndroidPackageFormat>apk</AndroidPackageFormat>
<AndroidCreatePackagePerAbi>True</AndroidCreatePackagePerAbi>
<AndroidUseAapt2>True</AndroidUseAapt2>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(TargetFramework)|$(Platform)'=='Debug|net9.0-android.0|AnyCPU'">
<AndroidCreatePackagePerAbi>True</AndroidCreatePackagePerAbi>
<AndroidUseAapt2>True</AndroidUseAapt2>
<AndroidPackageFormat>apk</AndroidPackageFormat>
</PropertyGroup>
<ItemGroup>
<!-- App Icon -->
<MauiIcon Include="Resources\AppIcon\appicon.svg" BaseSize="512,512" />
<!-- Splash Screen -->
<MauiSplashScreen Include="Resources\Splash\splash.svg" Color="#D1F00F" BaseSize="512,512" />
<!-- Images -->
<MauiImage Include="Resources\Images\*" />
<!-- Custom Fonts -->
<MauiFont Include="Resources\Fonts\*" />
<!-- Raw Assets (also remove the "Resources\Raw" prefix) -->
<MauiAsset Include="Resources\Raw\**" LogicalName="%(RecursiveDir)%(Filename)%(Extension)" />
</ItemGroup>
<ItemGroup>
<None Remove="Platforms\Android\Resources\Layout\floatview.xml" />
<None Remove="Platforms\Android\Resources\values\strings.xml" />
<None Remove="Platforms\Android\Resources\xml\accessibility_service.xml" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="MudBlazor" Version="6.19.1" />
<PackageReference Include="YamlDotNet" Version="15.1.4" />
<PackageReference Include="CommunityToolkit.Mvvm" Version="8.2.2" />
<PackageReference Include="CommunityToolkit.Maui" Version="7.0.1" />
<PackageReference Include="Microsoft.AspNetCore.Components.WebView.Maui" Version="8.0.6" />
<PackageReference Include="Microsoft.Maui.Controls" Version="8.0.6" />
</ItemGroup>
<ItemGroup>
<Folder Include="Resources\Images\" />
</ItemGroup>
</Project>
2 changes: 1 addition & 1 deletion src/MainPage.xaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8" ?>
<?xml version="1.0" encoding="utf-8" ?>
<ContentPage xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:local="clr-namespace:Expandroid"
Expand Down
1 change: 1 addition & 0 deletions src/MauiProgram.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
using Expandroid.Models;
using Expandroid.Services;
using MudBlazor.Services;
using Microsoft.Maui.Storage;

namespace Expandroid;

Expand Down
3 changes: 2 additions & 1 deletion src/Models/AppSettings.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
namespace Expandroid.Models
using Microsoft.Maui.Storage;
namespace Expandroid.Models
{
internal static class AppSettings
{
Expand Down
42 changes: 21 additions & 21 deletions src/Pages/Index.razor
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
<MudButton @onclick="ForceQuit" Color="Color.Error" Variant="Variant.Outlined">Force Quit App</MudButton>
</div>
@*<div class="d-flex justify-center">
<MudCheckBox Label="Case sensitive" @onclick="ToggleSens" Checked="@sens" Color="Color.Success"></MudCheckBox>
<MudCheckBox Label="Case sensitive" @onclick="ToggleSens" Value="@sens" Color="Color.Success"></MudCheckBox>
</div>*@
<MudText class="mb-3">Keywords</MudText>
<div class="d-flex">
Expand Down Expand Up @@ -61,7 +61,7 @@
<MudPaper class="mt-2">

<div class="d-flex justify-center">
<MudCheckBox @bind-Checked="currentMatch.Word" Label="Word" />
<MudCheckBox @bind-Value="currentMatch.Word" Label="Word" />
</div>
</MudPaper>
<MudExpansionPanels Elevation="0" class="mt-2">
Expand Down Expand Up @@ -142,25 +142,25 @@
<MudTabs class="mt-3" Elevation="0" Rounded="true" ApplyEffectsToContainer="true" PanelClass="pa-2">
<MudTabPanel Text="Basic">
<div class="d-flex flex-wrap">
<MudCheckBox Label="Compare" @bind-Checked="@compare" Color="Color.Primary"></MudCheckBox>
<MudCheckBox Label="Ignore Case" @bind-Checked="@ignoreCase" Color="Color.Secondary"></MudCheckBox>
<MudCheckBox Label="Compare Length" @bind-Checked="@lengthCompare" Color="Color.Warning"></MudCheckBox>
<MudCheckBox Label="Contains" @bind-Checked="@contains" Color="Color.Primary"></MudCheckBox>
<MudCheckBox Label="Replace" @bind-Checked="@replace" Color="Color.Secondary"></MudCheckBox>
<MudCheckBox Label="To Upper" @bind-Checked="@toUpper" Color="Color.Warning"></MudCheckBox>
<MudCheckBox Label="To Lower" @bind-Checked="@toLower" Color="Color.Tertiary"></MudCheckBox>
<MudCheckBox Label="Compare" @bind-Value="@compare" Color="Color.Primary"></MudCheckBox>
<MudCheckBox Label="Ignore Case" @bind-Value="@ignoreCase" Color="Color.Secondary"></MudCheckBox>
<MudCheckBox Label="Compare Length" @bind-Value="@lengthCompare" Color="Color.Warning"></MudCheckBox>
<MudCheckBox Label="Contains" @bind-Value="@contains" Color="Color.Primary"></MudCheckBox>
<MudCheckBox Label="Replace" @bind-Value="@replace" Color="Color.Secondary"></MudCheckBox>
<MudCheckBox Label="To Upper" @bind-Value="@toUpper" Color="Color.Warning"></MudCheckBox>
<MudCheckBox Label="To Lower" @bind-Value="@toLower" Color="Color.Tertiary"></MudCheckBox>
</div>
</MudTabPanel>
<MudTabPanel Text="Discord (& Markdown)">
<div class="d-flex flex-wrap">
<MudCheckBox Label="Bold" @bind-Checked="@makeBold" Color="Color.Primary"></MudCheckBox>
<MudCheckBox Label="Italic" @bind-Checked="@makeItalic" Color="Color.Secondary"></MudCheckBox>
<MudCheckBox Label="Underline" @bind-Checked="@makeUnderline" Color="Color.Warning"></MudCheckBox>
<MudCheckBox Label="Strikethrough" @bind-Checked="@makeStrike" Color="Color.Primary"></MudCheckBox>
<MudCheckBox Label="Spoilers" @bind-Checked="@makeSpoiler" Color="Color.Secondary"></MudCheckBox>
<MudCheckBox Label="Code Block" @bind-Checked="@makeCode" Color="Color.Warning"></MudCheckBox>
<MudCheckBox Label="Quote" @bind-Checked="@makeQuote" Color="Color.Tertiary"></MudCheckBox>
<MudCheckBox Label="Add timestamp" @bind-Checked="@addTimeStamp" Color="Color.Tertiary"></MudCheckBox>
<MudCheckBox Label="Bold" @bind-Value="@makeBold" Color="Color.Primary"></MudCheckBox>
<MudCheckBox Label="Italic" @bind-Value="@makeItalic" Color="Color.Secondary"></MudCheckBox>
<MudCheckBox Label="Underline" @bind-Value="@makeUnderline" Color="Color.Warning"></MudCheckBox>
<MudCheckBox Label="Strikethrough" @bind-Value="@makeStrike" Color="Color.Primary"></MudCheckBox>
<MudCheckBox Label="Spoilers" @bind-Value="@makeSpoiler" Color="Color.Secondary"></MudCheckBox>
<MudCheckBox Label="Code Block" @bind-Value="@makeCode" Color="Color.Warning"></MudCheckBox>
<MudCheckBox Label="Quote" @bind-Value="@makeQuote" Color="Color.Tertiary"></MudCheckBox>
<MudCheckBox Label="Add timestamp" @bind-Value="@addTimeStamp" Color="Color.Tertiary"></MudCheckBox>
</div>
</MudTabPanel>
@if (contains)
Expand Down Expand Up @@ -204,10 +204,10 @@
<MudDivider class="mb-2 mt-2" />
<div class="d-flex flex-wrap">

<MudCheckBox Label="Is text equal" ReadOnly="true" Checked="@compareResult" Color="Color.Success"></MudCheckBox>
<MudCheckBox Label="Contains the word specified" ReadOnly="true" Checked="@containsResult" Color="Color.Primary"></MudCheckBox>
<MudCheckBox Label="Is length equal" ReadOnly="true" Checked="@lengthCompareResult" Color="Color.Warning"></MudCheckBox>
<MudCheckBox Label="Can text expand" ReadOnly="true" Checked="@canTextExpand" Color="Color.Warning"></MudCheckBox>
<MudCheckBox Label="Is text equal" ReadOnly="true" Value="@compareResult" Color="Color.Success"></MudCheckBox>
<MudCheckBox Label="Contains the word specified" ReadOnly="true" Value="@containsResult" Color="Color.Primary"></MudCheckBox>
<MudCheckBox Label="Is length equal" ReadOnly="true" Value="@lengthCompareResult" Color="Color.Warning"></MudCheckBox>
<MudCheckBox Label="Can text expand" ReadOnly="true" Value="@canTextExpand" Color="Color.Warning"></MudCheckBox>
</div>
</MudCardContent>
</MudCard>
Expand Down
8 changes: 5 additions & 3 deletions src/Platforms/Android/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" android:versionCode="23"
android:versionName="7.0.0">
<manifest xmlns:android="http://schemas.android.com/apk/res/android" android:versionCode="24"
android:versionName="7.1.0">
<application android:allowBackup="true" android:icon="@mipmap/appicon" android:supportsRtl="true"></application>
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" android:maxSdkVersion="32" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-sdk android:minSdkVersion="24" android:targetSdkVersion="34" />
<!--<uses-permission android:name="android.permission.READ_CLIPBOARD_IN_BACKGROUND" />
<uses-permission android:name="android.permission.WRITE_CLIPBOARD_IN_BACKGROUND" />-->
<uses-sdk android:minSdkVersion="24" android:targetSdkVersion="35" />
</manifest>
1 change: 1 addition & 0 deletions src/Platforms/Android/MainActivity.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
using Android.App;
using Android.Content.PM;
using System.Diagnostics;
using Microsoft.Maui;

namespace Expandroid;

Expand Down
1 change: 1 addition & 0 deletions src/Platforms/Android/Services/CheckIfActivated.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
using AndroidX.Core.App;
using AndroidX.Core.Content;
using Expandroid.Models;
using Microsoft.Maui.ApplicationModel;

namespace Expandroid.Services
{
Expand Down
Loading

0 comments on commit a74adcb

Please sign in to comment.