right to left localisation doesn't work on android - xaml

I want my label to display from right to left. This code bellow works fine on iOS but not on droid. DO I have to set up something else on droid?
<Label x:Name="value" Grid.Row="0" Grid.Column="3" Text="{Binding Value, Mode=TwoWay}" FlowDirection="RightToLeft" HorizontalTextAlignment="Start" />

The app's AndroidManifest.xml file should be updated so that the <uses-sdk> node sets the android:minSdkVersion attribute to 17, and the node sets the android:supportsRtl attribute to true:
<?xml version="1.0" encoding="utf-8"?>
<manifest ... >
<uses-sdk android:minSdkVersion="17" ... />
<application ... android:supportsRtl="true">
</application>
</manifest>
The effect:
More info could refer to here.

Related

I have a problemusing badget in navigation bar kotlin

I'm tyring to use a badget with Materials but I have several custom styles and when I use it, my custom button's style dissapear
I know that it works If I replace in my manifest
android:theme="#style/Theme.AppCompat.NoActionBar"
with
android:theme="#style/Theme.MaterialComponents.DayNight.NoActionBar"
Here is my full manifest
<application
android:allowBackup="true"
android:dataExtractionRules="#xml/data_extraction_rules"
android:fullBackupContent="#xml/backup_rules"
android:icon="#mipmap/ic_launcher"
android:label="#string/app_name"
android:roundIcon="#mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="#style/Theme.AppCompat.NoActionBar"
android:windowSoftInputMode="adjustPan"
tools:targetApi="31">
But I have a custom xml to modify my buttons which I attach using the backgroudn property of buttons and when I change the manifest I lose my effects
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle">
<gradient
android:type="radial"
android:centerX="50%"
android:centerY="50%"
android:startColor="#6859C1"
android:endColor="#34278C"
android:gradientRadius="100%"
/>
<stroke android:width="1dp"
android:color="#FFFFFF"/>
<padding android:left="1dp"
android:top="1dp"
android:right="1dp"
android:bottom="1dp"/>
<corners android:radius="30px"/>
</shape>
What am I doing wrongly?
Thanks in advance!

How to get the default shell flyout icon to react when android dark theme is switched on/off

I have an app which uses the shell flyout. When I added the flyout, it automatically created an icon as shown in the image below:
However, when I switch the android dark theme off:
The flyout icon remains white making it difficult to see:
I am using AppThemeBinding to automatically theme the app accordingly based on the system theme selected by the user, but I do not know how to change the flyout icon to a darker color if the user switches off the dark theme from the android settings.
Any idea how to do that?
The AppShell.xaml currently looks like this:
<?xml version="1.0" encoding="UTF-8" ?>
<Shell
x:Class="MAUIApp1.AppShell"
xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:local="clr-namespace:MAUIApp1"
FlyoutBackgroundColor="{AppThemeBinding Light=#f2f2f2, Dark=#2a2a2a}">
<Shell.Resources>
<ResourceDictionary>
...
</ResourceDictionary>
</Shell.Resources>
<Shell.FlyoutHeader>
...
</Shell.FlyoutHeader>
<Shell.ItemTemplate>
<DataTemplate>
...
</DataTemplate>
</Shell.ItemTemplate>
<FlyoutItem Title="Item1" Icon="item1.svg">
<ShellContent ContentTemplate="{DataTemplate local:page1}" Route="page1"/>
</FlyoutItem>
<FlyoutItem Title="Item2" Icon="item2.svg">
<ShellContent ContentTemplate="{DataTemplate local:page2}" Route="page2"/>
</FlyoutItem>
<FlyoutItem Title="Item3" Icon="item3.svg">
<ShellContent ContentTemplate="{DataTemplate local:page3}" Route="page3"/>
</FlyoutItem>
<Shell.FlyoutFooter>
...
</Shell.FlyoutFooter>
</Shell>
Generally, you could override the Foreground color of the Shell to accomplish this:
<Shell
x:Class="MAUIApp1.AppShell"
xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:local="clr-namespace:MAUIApp1"
FlyoutBackgroundColor="{AppThemeBinding Light=#f2f2f2, Dark=#2a2a2a}"
Shell.ForegroundColor="{AppThemeBinding Light={StaticResource Black}, Dark={StaticResource White}}">
Alternatively, you can overwrite the style directly, by editing the Resources\Styles\styles.xaml:
<Style TargetType="Shell" ApplyToDerivedTypes="True">
<Setter Property="Shell.BackgroundColor" Value="{AppThemeBinding Light={StaticResource Primary}, Dark={StaticResource Gray950}}" />
<!--<Setter Property="Shell.ForegroundColor" Value="{OnPlatform WinUI={StaticResource Primary}, Default={StaticResource White}}" />-->
<Setter Property="Shell.ForegroundColor" Value="{AppThemeBinding Light={StaticResource Black}, Dark={StaticResource White}}" />
</Style>

MultiApp Kiosk Mode - Installation of Provisioning Package Failed

I am getting an error when I attempt to apply a provisioning package which I have created using Windows Configuration Designer. The PPKG is meant to lockdown a specific local user account to only be able to use 3 apps; Google Chrome, PrintStation and BarTender Designer. I have specified in the code the exact path for each app as well as copy/pasting their shortcuts into the Start Menu. I have checked through the code numerous times and can't seem to resolve this issue. I have included the XML code for your reference below, many thanks in advance, I hope we can get this resolved!
<?xml version="1.0" encoding="utf-8" ?>
<AssignedAccessConfiguration
xmlns="http://schemas.microsoft.com/AssignedAccess/2017/config"
xmlns:rs5="http://schemas.microsoft.com/AssignedAccess/201810/config"
>
<Profiles>
<Profile Id="{A039AA28-6A43-4C89-A561-2BCD06282535}">
<AllAppsList>
<AllowedApps>
<App DesktopAppPath="C:\Program Files\Google\Chrome\Application\chrome.exe" />
<App DesktopAppPath="C:\WINDOWS\system32\shutdown.exe" />
<App DesktopAppPath="C:\Windows\SysWOW64\shutdown.exe" />
<App DesktopAppPath="C:\Windows\explorer.exe" />
<App DesktopAppPath="C:\Windows\SysWOW64\explorer.exe" />
<App DesktopAppPath="C:\Program Files\Seagull\Bartender Suite\PrintStation.exe" />
<App DesktopAppPath="C:\Program Files\Seagull\Bartender Suite\bartend.exe" />
</AllowedApps>
</AllAppsList>
<StartLayout>
<![CDATA[<LayoutModificationTemplate xmlns:defaultlayout="http://schemas.microsoft.com/Start/2014/FullDefaultLayout" xmlns:start="http://schemas.microsoft.com/Start/2014/StartLayout" Version="1" xmlns="http://schemas.microsoft.com/Start/2014/LayoutModification">
<LayoutOptions StartTileGroupCellWidth="6" />
<DefaultLayoutOverride>
<StartLayoutCollection>
<defaultlayout:StartLayout GroupCellWidth="6">
<start:Group Name="Fairview Health Kiosk">
<start:DesktopApplicationTile Size="2x2" Column="0" Row="0" DesktopApplicationLinkPath="%AppData%\Microsoft\Windows\Start Menu\Programs\Google Chrome.lnk" />
<start:DesktopApplicationTile Size="2x2" Column="2" Row="0" DesktopApplicationLinkPath="%AppData%\Microsoft\Windows\Start Menu\Programs\PrintStation.lnk" />
<start:DesktopApplicationTile Size="2x2" Column="4" Row="0" DesktopApplicationLinkPath="%AppData%\Microsoft\Windows\Start Menu\Programs\BarTender Designer.lnk" />
</defaultlayout:StartLayout>
</StartLayoutCollection>
</DefaultLayoutOverride>
</LayoutModificationTemplate>
]]>
</StartLayout>
<Taskbar ShowTaskbar="false"/>
</Profile>
</Profiles>
<Configs>
<Config>
<Account>Test</Account>
<DefaultProfile Id="{A039AA28-6A43-4C89-A561-2BCD06282535}"/>
</Config>
</Configs>
</AssignedAccessConfiguration>

JS TileMap iOS 8 and swift, incomprehensible archive?

I've bridged JS TileMap for my spritekit game. I've put a tmx file in my project and I'm trying to init a JSTileMap object
let map = JSTileMap(fileNamed: "level 1-1.tmx")
i get this error
2014-11-15 17:43:03.428 MyGame[5726:1901295] * Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '* -[NSKeyedUnarchiver initForReadingWithData:]: incomprehensible archive (0x3c, 0x3f, 0x78, 0x6d, 0x6c, 0x20, 0x76, 0x65)'
*** First throw call stack:
(
Could it be that it's not finding the file? I noticed if i change the filename to something nonexistent i get the same error..
Here is the contents of my tmx file
<?xml version="1.0" encoding="UTF-8"?>
<map version="1.0" orientation="orthogonal" width="1000" height="800" tilewidth="1" tileheight="1">
<tileset firstgid="1" name="enemies" tilewidth="80" tileheight="75">
<tile id="0">
<properties>
<property name="name" value="EnemyA"/>
</properties>
<image width="66" height="75" source="../Atlases/iPhone/enemyA.atlas/enemy#2x.png"/>
</tile>
<tile id="1">
<image width="65" height="67" source="../Atlases/iPhone/enemyB.atlas/enemy#2x.png"/>
</tile>
<tile id="2">
<properties>
<property name="name" value="EnemyC"/>
</properties>
<image width="60" height="60" source="../Atlases/iPhone/enemyC.atlas/enemy#2x.png"/>
</tile>
<tile id="3">
<image width="61" height="65" source="../Atlases/iPhone/enemyD.atlas/enemy#2x.png"/>
</tile>
<tile id="4">
<image width="74" height="58" source="../Atlases/iPhone/enemyE.atlas/enemy#2x.png"/>
</tile>
<tile id="5">
<properties>
<property name="name" value="EnemyF"/>
</properties>
<image width="80" height="73" source="../Atlases/iPhone/enemyF.atlas/enemy#2x.png"/>
</tile>
</tileset>
<objectgroup color="#000000" name="Object Layer 1">
<object name="EnemyA" type="enemy" gid="1" x="137" y="489"/>
<object name="EnemyC" type="enemy" gid="6" x="468" y="454"/>
<object name="EnemyB" type="enemy" gid="3" x="310" y="321"/>
</objectgroup>
</map>
i've tried editing it down to just and it still throws that error. I'm making sure to include libz.dylib
what am i doing wrong?
I was using the wrong init method
it should be
let map = JSTileMap(named: "level 1-1.tmx")
Try to remove #2 from your image files source.. Then run it again. I think you cannot use #2 in tiled. Also remove spaces from you tmx name.

How to embed and display an SVG image in iReport

I am using iReport 4.5.0, and want to embed an SVG image to generate a PDF.
When using iReport's preview option to run the report, the image won't get rendered to the PDF (i.e. there's an empty space where the image is supposed to be).
I do not see any exceptions in the logs during execution, what's going on?
Here's the image tag code snippet:
<?xml version="1.0" encoding="UTF-8"?>
<jasperReport xmlns="http://jasperreports.sourceforge.net/jasperreports"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://jasperreports.sourceforge.net/jasperreports http://jasperreports.sourceforge.net/xsd/jasperreport.xsd"
name="reportSVGTest" language="groovy" pageWidth="595"
pageHeight="842" columnWidth="555" leftMargin="20" rightMargin="20"
topMargin="20" bottomMargin="20">
<property name="ireport.zoom" value="1.0"/>
<property name="ireport.x" value="0"/>
<property name="ireport.y" value="0"/>
<background>
<band splitType="Stretch"/>
</background>
<title>
<band height="50">
<staticText>
<reportElement x="81" y="13" width="100" height="20"/>
<textElement/>
<text><![CDATA[Hello]]></text>
</staticText>
</band>
</title>
<detail>
<band height="443" splitType="Stretch">
<image hAlign="Center" vAlign="Middle" isUsingCache="true" isLazy="true">
<reportElement x="12" y="17" width="512" height="403"/>
<imageExpression class="net.sf.jasperreports.engine.JRRenderable">
<![CDATA[
net.sf.jasperreports.renderers.BatikRenderer.getInstance(
new java.io.File("C:\\Users\\akshayd\\Desktop\\polygons1.svg"))
]]>
</imageExpression>
</image>
</band>
</detail>
</jasperReport>
I wanted to embed a SVG text in my report, and this topic helped me succeed.
I am using Jaspersoft Studio with full support for JasperReports 5.5.0.
Here is how i did :
Create a image element
Choose Custom expression and let expression empty
Modify JRXML source: add a tag imageExpression in the tag image
<image>
<reportElement x="0" y="60" width="50" height="50" uuid="c0d0856e-0bb1-4634-b8b0- 6f7ace0e3ff3"/>
<imageExpression><![CDATA[net.sf.jasperreports.renderers.BatikRenderer.getInstanceFromText("<svg:svg xmlns:svg=\"http://www.w3.org/2000/svg\" xmlns=\"http://www.w3.org/2000/svg\" version=\"1.0\" width=\"88\" height=\"21\" id=\"svg\"><svg:g id=\"layer1\"><svg:path id=\"path1\" d=\"M 61.799149,2.0342178 L 67.119461,2.0342178 L 67.119461,19.213905 L 61.799149,19.213905 L 61.799149,2.0342178 z\" style=\"text-anchor:start;fill:#FF0000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;\" /></svg:g> </svg:svg>")]]></imageExpression>
</image>
So, i use the method getInstanceFromText of BatikRenderer.
Do not forget to protect double quotes in your SVG text.