I created a simple project and added the flutter_native_splash package. I am running this project on my android phone via USB. If my phone is in light mode splash screen works fine. But in the dark mode, it did not work. So then I tried to add my splash screen image to android/app/src/main/res/drawable-night and it worked. The problem is when I tried to build apk it gives me an error. If I remove what I added to android/app/src/main/res/drawable-night I can build apk successfully
In your project folder's android/app/src/main/res there should be a drawable folder, which contains the launch_background.xml for light theme. Duplicate this folder and call the second one drawable-night and configure the dark theme style. It will automatically change based on Android's system theme.
The launch_background.xml in the drawable (light theme) folder can be structured as so, to display an image with a white background:
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="#android:color/white" />
<item>
<bitmap
android:gravity="center"
android:src="#drawable/launch_image" />
</item>
</layer-list>
Here are some sources,Here and
Source
Related
I'm experimenting with .net maui. i'm using vs 17.3 preview 4. I'd like to change the spash screen. i would think that i would change the content of the spash.svg file. I've changed the content of the file. I've left the property of the file as mauispashscreen. I've created a simple png file and have converted it with an online svg converter. the file is viewable with msft edge browser. All i get is a purple screen without the text changes. I'm just trying to do something simple. what should i look for in the setup of the file or the project? any suggestions are appreciated.
Wally
At first, please double click your project and check if there is the code in your projectname.csproj file or not. It seems when you delete the splash.svg file and add a new one in the resources, the code will be auto deleted.
<MauiSplashScreen Include="Resources\Splash\splash.svg" Color="#512BD4" />
And then, I have tried to convert a png to svg, but the picture can't show perfectly as the splash. So I download a svg from the svg picture website and it can work well.
It seems maui can't make all the svg show as the splash screen perfectly. You can also download one instead of converting the png.
My app has a search bar in its top area. There are devices with special cutouts. in order to expand the app to real full screen, I Added to <app_name>\android\app\src\main\AndroidManifest.xml:
<style name="ActivityTheme">
<item name="android:windowLayoutInDisplayCutoutMode">
shortEdges
</item>
</style>
That works fine. However, the obvious next step is to recognize cutout position, and place the search bar accordingly:
The mentioned documentation refers to a JAVA method WindowInsets.getDisplayCutout(). I wonder if there is an equivalent in flutter or a plugin which wraps it.
There is a SafeArea widget that will add insets so that you can avoid device. I'd give this a try - I know it works with common features like the iphone top cutout and the android camera.
The problem
Let's suppose I've got an outlined favicon.
It looks perfect on the selected tab with white background:
But if the tab is inactive / user prefers a dark theme icon cannot be visible:
Minimal example
Is it possible to make icon same color with tab text?
What i've tried
Only my idea was to make svg favicon with fill="currentColor" (rather a silly thing, I know):
<!-- ... -->
<path d="M13 7H11V17H13V7Z" fill="currentColor"></path>
<!-- ... -->
But it is not working.
I'm struggling to set the menu item text color to white on Android, but without much success.
I've tried:
this.actionBar.itemTextColor = "#ffffff"; //this is not working on Android
Any ideas? I'm using Smartface 4.3.0
you can use this code for text color change for menu items
<style
name="myCustomMenuTextApearance"parent="#android:style/TextAppearance.Widget.IconMenu.Item">
<item name="android:textColor">#android:color/primary_text_dark</item>
</style>
In Android Studio, while working in Text mode for a view i have the "Preview" window active to the right. When adding a listview to the view it renders a default list. I have a custom template which is used at runtime but is it possible to have the preview window show me my template at design time?
Thanks
Add the tools namespace to your xml layout:
xmlns:tools="http://schemas.android.com/tools"
next you can specify the listitem layout like this:
tools:listitem="#layout/mycustom_listitem"
Full example:
<ListView
xmlns:tools="http://schemas.android.com/tools"
android:id="#+id/lv_contactslist"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
tools:listitem="#layout/listitem_contact" />
For a graphical way, have a look at this stackoverflow post