diff --git a/.github/workflows/develop.yml b/.github/workflows/develop.yml index 558001c..7070071 100644 --- a/.github/workflows/develop.yml +++ b/.github/workflows/develop.yml @@ -3,8 +3,7 @@ name: Run the documentation generation tool and push changes to develop branch on: push: branches: [ "develop" ] - pull_request: - branches: [ "develop" ] + workflow_dispatch: permissions: contents: write @@ -22,6 +21,8 @@ jobs: steps: - uses: actions/checkout@v3 + with: + token: ${{ secrets.PAT_TOKEN }} - name: Setup .NET uses: actions/setup-dotnet@v4 diff --git a/.github/workflows/master.yml b/.github/workflows/master.yml index 31f57a1..9776c0a 100644 --- a/.github/workflows/master.yml +++ b/.github/workflows/master.yml @@ -3,8 +3,7 @@ name: Build, pack and push HorusStudio.Maui.MaterialDesignControls NuGet package on: push: branches: [ "master" ] - pull_request: - branches: [ "master" ] + workflow_dispatch: permissions: contents: write @@ -57,21 +56,35 @@ jobs: dotnet nuget push "./artifacts/*.nupkg" --source "https://api.nuget.org/v3/index.json" --api-key ${{ secrets.NUGET_API_KEY }} --skip-duplicate echo "✅ NuGet package published successfully!" - - name: Get version from nupkg + - name: Get version from nuget.props id: get_version run: | - FILE=$(ls ./artifacts/*.nupkg | head -n 1) - VERSION=$(echo $FILE | sed -E 's/.*\.([0-9]+\.[0-9]+\.[0-9]+)\.nupkg/\1/') + echo "📦 Extracting version from nuget.props..." + VERSION=$(xmllint --xpath "string(//Project/PropertyGroup/Version)" nuget.props) + echo "Version found: $VERSION" echo "version=$VERSION" >> $GITHUB_OUTPUT + echo "✅ Version extracted successfully!" - - name: Create Git tag + - name: Get release notes from nuget.props + id: get_release_notes run: | - echo "📦 Creating Git tag..." - git config user.name "github-actions[bot]" - git config user.email "41898282+github-actions[bot]@users.noreply.github.com" - git tag -a "v${{ steps.get_version.outputs.version }}" -m "Release v${{ steps.get_version.outputs.version }}" - git push origin "v${{ steps.get_version.outputs.version }}" - echo "✅ Git tag created and pushed successfully!" + echo "📦 Extracting release notes from nuget.props..." + RELEASE_NOTES=$(xmllint --xpath "string(//Project/PropertyGroup/PackageReleaseNotes)" nuget.props) + echo "Release notes found:" + echo "$RELEASE_NOTES" + echo "release_notes<> $GITHUB_OUTPUT + echo "$RELEASE_NOTES" >> $GITHUB_OUTPUT + echo "EOF" >> $GITHUB_OUTPUT + echo "✅ Release notes extracted successfully!" + + # - name: Create Git tag + # run: | + # echo "📦 Creating Git tag..." + # git config user.name "github-actions[bot]" + # git config user.email "41898282+github-actions[bot]@users.noreply.github.com" + # git tag -a "v${{ steps.get_version.outputs.version }}" -m "Release v${{ steps.get_version.outputs.version }}" + # git push origin "v${{ steps.get_version.outputs.version }}" + # echo "✅ Git tag created and pushed successfully!" - name: Create GitHub Release uses: actions/create-release@v1 @@ -81,10 +94,8 @@ jobs: tag_name: ${{ steps.get_version.outputs.version }} release_name: ${{ steps.get_version.outputs.version }} body: | - ### [NuGet package](https://www.nuget.org/packages/HorusStudio.Maui.MaterialDesignControls/${{ steps.get_version.outputs.version }}) - #### New features - - - #### Bug fixes - - + [NuGet package](https://www.nuget.org/packages/HorusStudio.Maui.MaterialDesignControls/${{ steps.get_version.outputs.version }}) + + ${{ steps.get_release_notes.outputs.release_notes }} draft: true prerelease: false \ No newline at end of file diff --git a/nuget.props b/nuget.props index 28e873f..5cc26f3 100644 --- a/nuget.props +++ b/nuget.props @@ -1,7 +1,7 @@ HorusStudio.Maui.MaterialDesignControls - 2.1.0 + 2.1.1 Horus Studio and contributors Horus Studio Material Design Controls for .NET MAUI @@ -15,12 +15,7 @@ dotnet-maui;dotnet;maui;cross-platform;android;ios;macos;maccatalyst;materialdesign;ui README.md -- [BREAKING CHANGE] Change ITouchableView namespace to HorusStudio.Maui.MaterialDesignControls -- [ITouchableView] Add new Touch event and, therefore, to MaterialButton, MaterialCard, MaterialCheckBox, MaterialChip, MaterialIconButton, MaterialRadioButton, MaterialSegmentedButton, MaterialSwitch and MaterialViewButton -- [MaterialCheckbox] Fix touch animation -- [MaterialChip] Fix visual issue when dragging it remained as pressed -- [MaterialSnackbar] Add support for CharacterSpacing, LineBreakMode and FontAttributes -- [Android] [MaterialSnackbar] Show on top of all content +- [Android] [MaterialSnackbar] The background dim/overlay has been removed, and the padding has been adjusted when using an action button. $(MSBuildThisFileDirectory)Artifacts diff --git a/src/HorusStudio.Maui.MaterialDesignControls/Controls/Snackbar/MaterialSnackbarBuilder.Android.cs b/src/HorusStudio.Maui.MaterialDesignControls/Controls/Snackbar/MaterialSnackbarBuilder.Android.cs index 80cb52a..1c5c40e 100644 --- a/src/HorusStudio.Maui.MaterialDesignControls/Controls/Snackbar/MaterialSnackbarBuilder.Android.cs +++ b/src/HorusStudio.Maui.MaterialDesignControls/Controls/Snackbar/MaterialSnackbarBuilder.Android.cs @@ -2,7 +2,6 @@ using Android.Graphics; using Android.OS; using Android.Text; -using Android.Text.Style; using Android.Views; using Android.Widget; using Google.Android.Material.Snackbar; @@ -19,6 +18,7 @@ class MaterialSnackbarBuilder #region Constants private const int TextMaxLines = 20; + private const int MinimumHeight = 60; #endregion Constants @@ -55,11 +55,12 @@ public MaterialSnackbarBuilder(Activity activity, MaterialSnackbarConfig config) } }; + root.SetMinimumHeight(MinimumHeight.DpToPixels()); + var insets = root!.GetInsets(); root.SetRoundedBackground(config.BackgroundColor, config.CornerRadius) - .SetMargin(config.Margin, insets) - .SetPadding(config.Padding); - + .SetMargin(config.Margin, insets); + if (config.LeadingIcon is not null) { _leadingIconView = activity.CreateImageButton(config.LeadingIcon.Source, config.LeadingIcon.Size, @@ -98,9 +99,21 @@ public MaterialSnackbarBuilder(Activity activity, MaterialSnackbarConfig config) _textView!.SetMargin(new Thickness(_leadingIconView is not null ? config.Spacing : 0,0,0,0)); _actionView?.SetMargin(new Thickness(config.Spacing,0,_trailingIconView is not null ? config.Spacing : 0,0)); + if (config.Action is not null) + { + root.SetPadding(new Thickness(config.Padding.Left, 0, config.Padding.Right, 0)); + _textView?.SetPadding(new Thickness(0, config.Padding.Top, 0, config.Padding.Bottom)); + } + else + { + root.SetPadding(config.Padding); + } + _dialog = new Dialog(activity); _dialog.SetContentView(root); + _dialog.Window?.ClearFlags(WindowManagerFlags.DimBehind); + _dialog.Window?.SetGravity(config.Position); _dialog.DismissEvent += (s, e) =>