In my Android application I create such menu:
<menu xmlns:android="http://schemas.android.com/apk/res/android" >
<item
android:id="#+id/rymcium"
android:title="rymcium"
android:icon="#android:drawable/ic_delete"
/>
</menu>
When I run it on old Android version (on emulated Android 1.6), icon is visible. When I run it on new Android version (on real or emulated Android 4), the icon is invisible. Is it normal? Can I do something to make it visible?
It was because my activity used theme android:Theme.Light (it was default when I created my project in eclipse). When I changed theme for android:style/Holo.ButtonBar, icons are visible.
Related
I'm making an app with Xamarin Forms.
Usually the app will have a blue NavBar, but I'm changing the NavBarfor a specific page.
The way I do that is:
InitializeComponent();
var navigationPage = Application.Current.MainPage as NavigationPage;
navigationPage.BarBackgroundColor = Color.FromHex("#99CC07");
But then the statusbar doesn't update it's color:
How can I make it so that the statusbar has the same (shade of) color as the navigationbar?
On iOS it works just fine.
You can modify both colors in the Android project. Go to Resources > values > styles.xml and edit the following values:
<!-- colorPrimary is used for the default action bar background -->
<item name="colorPrimary">#0066A1</item>
<!-- colorPrimaryDark is used for the status bar -->
<item name="colorPrimaryDark">#0E4369</item>
I want to set a navigation bar background image, but so far, no methods worked.
I don't know if I have to override the navigation-page renderer or if I have to change the "styles.xml", or if I have to override the Android "Toolbar", I have tried everything and I can't seem to find the solution.
I am using Xamarin Forms and Master Detail Page navigation.
I already tried changing styles.xml, making a custom toolbar layout, but doesn't mean I have done it right.
<item name="windowNoTitle">true</item>
<!--We will be using the toolbar so no need to show ActionBar-->
<item name="windowActionBar">false</item>
I have a Xamarin Forms page with a toolbar item like this:
<ToolbarItem Name="Cancel">
<ToolbarItem.Icon>
<OnPlatform x:TypeArguments="FileImageSource" WinPhone="button_cancel.png" />
</ToolbarItem.Icon>
</ToolbarItem>
This is using a bitmap for showing a cancel icon in Windows Phone. But in Windows Phone there is already predefined icons like this (in the Segoe UI Symbol font). Can I use them instead of bitmaps?
You can make a custom renderer for a NavigationPage which then replaces normal images sources to the native one while using custom fonts. More here (examples are for Android and iOS but should be easily adopted to Windows too: https://forums.xamarin.com/discussion/17278/custom-font-in-xamarin-forms-font-awesome/p1
I am creating a Android Wear app that has an touch area. The user is suppose to be able to move it's finger in all directions over the screen (Think touchpad on your laptop). However the back swipe makes this a bit problematic. Any help with getting around this issue would be a great help.
How to disable the android wear back swipe?
/Jakob
There is an attribute in window style to disable this behavior:
<style name="AppTheme" parent="#android:style/Theme.DeviceDefault.Light">
<item name="android:windowSwipeToDismiss">false</item>
</style>
Once you disable it you have to provide other way of exiting your app.
There is a DismissOverlayView class (listed here https://developer.android.com/training/wearables/apps/layouts.html#UiLibrary) that you should use instead.
Basically it provides an overlay that will show a red button with cross after a long press. Clicking the red button will exit your app.
Here is a video from Google I/O 2014 with some bookmarked moments:
https://www.youtube.com/watch?v=sha_w3_5c2c#t=1390 <- disabling android:windowSwipeToDismiss
https://www.youtube.com/watch?v=sha_w3_5c2c#t=1505 <- Java code for DismissOverlayView
You can also check another video called:
Fullscreen apps for Android Wear:
https://www.youtube.com/watch?v=naf_WbtFAlY
You can try to write AndroidManifest.xml theme
android:theme="#style/Theme.Wearable.Modal inside activity tag
<activity
android:name="com.smart.remote.wear.MainActivity"
android:label="#string/app_name"
android:theme="#style/Theme.Wearable.Modal">
If you want the whole app to override Swipe, place the theme property under your Manifest's <application> tag. If you want it to apply only to a certain activity, then place the property under that activity's <activity> tag.
So:
create or update styles.xml in the res/values folder with the android:windowSwipeToDismiss property, such as:
...
false
If you want to override swipe in the whole app, Update your Manifest as such:
<application
...
android:theme="#style/AppTheme">
If you want to override swipe in a specific activity, Update your Manifest as such:
<activity
...
android:theme="#style/AppTheme">
</activity>
where ... represents all your other settings you already have. Remember you will need to give alternative ways out of the activity and/or app depending on which level you overrode
I am facing a really annoying problem. I am supplying both 16x16 and 32x32 application icons yet the initial window is using the 32x32 icon, scaled down, instead of the 16x16 icon.
Here are the respective icon images:
So it would make sense to use the 16x16 icon for the application icon, Windows or whatever doesn't seem to think so:
How do I fix this? It's really annoying and looks incredibly unprofessional when every other use of the application icons are clear and crisp except the damn window icon.
This error/bug also occurs in the taskbar.
Any ideas?
Edit: application.xml
<?xml version="1.0" encoding="utf-8"?>
<application xmlns="http://ns.adobe.com/air/application/3.5">
<id>com.yahrly.PixelTBSLevelEditor</id>
<versionNumber>1.0.0</versionNumber>
<filename>PixelTBS Level Editor</filename>
<name>PixelTBS Level Editor</name>
<copyright>© 2013, YahRly LLC</copyright>
<initialWindow>
<title>PixelTBS Level Editor</title>
<content>PixelTBSLevelEditor.swf</content>
<systemChrome>standard</systemChrome>
<transparent>false</transparent>
<visible>true</visible>
<minimizable>true</minimizable>
<maximizable>false</maximizable>
<resizable>false</resizable>
</initialWindow>
<installFolder>YahRly</installFolder>
<programMenuFolder>PixelTBS Level Editor</programMenuFolder>
<supportedProfiles>desktop</supportedProfiles>
<icon>
<image16x16>icons/icon16.png</image16x16>
<image32x32>icons/icon32.png</image32x32>
<image48x48>icons/icon48.png</image48x48>
<image128x128>icons/icon128.png</image128x128>
</icon>
<description>Create and customise your own maps for PixelTBS.</description>
</application>
Edit 2: I found someone else with my problem but they've had no response either >> here
Some things to try:
Make sure the correct icon files are being packaged. Sometimes it's easy to forget that previous icons are still being used if they are still available in the bin folder (for example) of your project, which ADT might still be calling.
Check your icons to see if they are indeed the correct versions.
Clean your project, recompile and then repackage.
Use all available icon sizes in your descriptor file:
application.xml
<icon>
<image512x512>icons/OffAirIcon512.png</image512x512>
<image128x128>icons/OffAirIcon128.png</image128x128>
<image72x72>icons/OffAirIcon72.png</image72x72>
<image57x57>icons/OffAirIcon57.png</image57x57>
<image48x48>icons/OffAirIcon48.png</image48x48>
<image36x36>icons/OffAirIcon36.png</image36x36>
<image32x32>icons/OffAirIcon32.png</image32x32>
<image29x29>icons/OffAirIcon29.png</image29x29>
<image16x16>icons/OffAirIcon16.png</image16x16>
</icon>
I suspect the problem is #1, but If none of this works please reply with details on how you are your packaging your application? What is your ADT command? Are you using FlashDevelop? Flash Builder?
[EDIT]
It seems that unique Taskbar and System Trey icons need to be loaded programmatically and an array of the flash.desktop.InteractiveIcon.bitmaps assigned to flash.desktop.NativeApplication.nativeApplication.icon.bitmaps, as indicated here:
Taskbar icons in AIR
I realize that while this doesn't answer your question, it should certainly work. It does raise questions about the 16 x 16 pixel sized icon file not being used as one would expect (for the Taskbar / System Trey), but perhaps the application.xml icons are specifically for viewing in Windows Explorer. If you mouse over your Desktop and press Ctrl while scrolling your mouse, you will see that Windows Explorer is also capable of displaying 16 x 16 pixel sized icons.