Android menu does not show German umlaut Ü - character-encoding

I just added a German localization to my app, and I am realy wondering, why the menu doesn't display some German umlauts.
menu.xml:
<?xml version="1.0" encoding="utf-8"?>
<menu xmlns:android="http://schemas.android.com/apk/res/android">
...
<item
android:id="#+id/menu_about"
android:title="#string/app_menu_about"
android:icon="#android:drawable/ic_menu_info_details"
/>
</menu>
strings.xml:
<string name="app_menu_about">äöüÄÖÜß</string>
only the lowercase umlauts and the ß are shown correctly. The uppercase umlauts are show as AOU. So they are displayed as normal chars.
If I remove the menu item icon, the umlauts are shown correctly. Why can't i have upper case umlauts and an icon?
Is there anything you know I can do to be able to show the uppercase umlauts correctly, and also use an icon?
I wan't to localize more languages, but if I can not display all special chars correctly it's not worth the work.

What I have found so far (if anyone comes across this post): http://code.google.com/p/android/issues/detail?id=3974
Use the workaround presented by chris#orr.me.uk at the bottom of the page.

This is just a wild guess, but it may be displaying them but for some reason the top few pixels are being cut off when the icon is displayed.

Related

Is there a way to use anchor links in SVG on IOS?

I have an SVG of the US states, and need anchor links to scroll to the state info on the page below. The anchors work fine on desktop and android, but not on IOS. The state changes to to hover color when clicked and does not link, and the hover color remains.
I found some suggestions to use xlink:href, but that is depreciated. I did try it to see if it worked and it did not. I have also tried some suggestions providing jquery code, but it did not work and also stopped the links from working on desktop.
The SVG is set up with hrefs wrapping each path like this:
<svg viewbox="0 0 959 593"> <a href="#ak"> <path id="AK" ...">
<title>Alaska</title></path></a>
(I've removed the long string of code for the path)
Here is the link to the page with the map. The anchor links work on desktop and android and not IOS:
https://www.automatictrap.com/pages/trappable-species
I have never posted here before, so I apologize if this is not enough info.
This has been resolved. Some of the anchor links on iPhone only seem to work when "a id" is used, and the links from the SVG only work when "a name" is used.

Custom keyboard in WKWebView

I want to control the keyboard displayed when using WKWebView.
I have the following swift code starting the webview:
let webView = WKWebView(frame: self.view.bounds, configuration: configuration)
webView.navigationDelegate = self
It will load html that looks like this:
<!DOCTYPE html>
<html>
<head>
<title>Test</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
</head>
<body>
<div class="inputElement textFieldInput">
<input type="text" id="textField" value="" data-clear-btn="true"/>
</div>
</body>
</html>
Normally the keyboard is controlled by the type option on the input field. "num" for a numeric keyboard and "text" for a alphanumeric keyboard. But I want to have more control.
I have done enough research to know that this can not be accomplished by using the option on the text box. I am fully expecting to write modify the code that opens the webview.
How can I modify the swift code to allow me to do this?
Ideally, I could define multiple keyboards and allow the html code to control them something like this: <input type='customkb1'> and <input type='customkb2'>
My immediate need is to disable the emojis button on the keyboard but I would like a generic solution as I will be able to really improve the usability of my application if I can define a keyboard specific to what the user is inputting.
Here is what we have found so far:
That is trick I know and use for native part of the application:
https://stackoverflow.com/a/25861718/1885345
But it doesn't work for webViews
That is the way to specify keyboard from WKWebView:
https://stackoverflow.com/a/28533488/1885345
But it doesn't have the option to set keyboard without emojis
That is what I use to disable third-party keyboards:
https://stackoverflow.com/a/34863426/1885345
Nice challenge! So far I have tested it on an iPad and got it half-working (with a caveat) by declaring the input field's pattern as such:
<input type="text" pattern="[0-9]*" value="" data-clear-btn="true"/>
The thing is that the keyboard actually pops up first with the numeric view but it allows to toggle the alphanumeric (without emojis) view via the lower ABC side-buttons.
With Javascript I copied the entered value to another field and the Regex does not actually filter out the entered alphanumeric characters. So far so good.
As soon as you put A-Za-z (as prefix or postfix) into the pattern, the emoji button comes back though.
I have tried catching the UIResponder.keyboardWillShowNotification but does not return the keyboard object, as I wanted to set its UIKeyboardType programmatically then, but this attribute only reflects UITextViews apparently.
Alternatively you could declare the input field of password type, clearing the dots with Javascript and displaying the actual value to another non-editable field...
If I find a more elegant way, I will update my answer as it is getting quite late. Cheers.
EDIT: Apparently only using a TextInput element with ReactNative you can directly prop the keyboardType to the ascii-capable iOS keyboard which shall set us free from Emojis.
If you’re looking for a way to only allow certain characters to be entered in an input field, disabling keyboard modes (the emoji keyboard, for example) isn’t the best option. There are many ways to type in unwanted characters: they can be pasted from the clipboard, or even entered in the result of text replacement (for example, you can make :) turn into 😁).
Input validation should be done on the webpage side, not with WKWebView.

Specifying a Webpage Icon Name/Title for Web Clip

I am following this guide for Specifying a Webpage Icon for Web Clip
(https://developer.apple.com/library/ios/documentation/AppleApplications/Reference/SafariWebContent/ConfiguringWebApplications/ConfiguringWebApplications.html)
However, I wasn't able to find how to change the default Name or Title displayed below on the icon on the phone. Anyone know how to change or set a default icon name?
Figured it out
<meta name="apple-mobile-web-app-title" content="Enter Your Name Or Title Here">
put this line in between your head tags in the index.html or your top level html.

Android: It is impossible to input into editText text after crop image

My interface consists of two parts: editText and imageView used to show image
I use intent MediaStore.ACTION_IMAGE_CAPTURE to take photo, then intent com.android.camera.action.CROP is used to crop that photo.
After cropping, Inputting text into editText but can't be performed though keyboard is displayed (sometimes i can input)
If i input text into edit text before cropping, this manipulation is performed normally.
I tried setting focus for editText but this problem was not solved:
editText.setEnabled(true);
editText.requestFocus();
editText.setFocusable(true);
editText.setFocusableInTouchMode(true);
Hope for your help.
Thanks !
http://blog.csdn.net/mmorss/article/details/19190833
I found this blog, it says, adding an invisble edittext would fix your problem. And I tried it, success.
Following is how I did it:
I add this extra edittext named et_none:
<EditText
android:id="#+id/et_none"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:layout_marginTop="15dp"
android:background="#drawable/bg_white_box"
android:gravity="top"
android:inputType="textMultiLine"
android:padding="10dp" />
After crop, I add this code:
et_none.requestFocus();
And this bug never appear.
This bug only appear on Htc G11 at about every two times.

Style anchors in iBooks epub

Is it possible to change the color and other CSS properties of anchors in iBooks epubs?
The color property doesn't react at all, while I do get background-color change on normal and hover link state (which activates on tap). The :hover background-color also remains after I come back to the book from Safari, until I tap another link on the same page, then the first one loses :hover bg color and the second one gets it.
:visited, :active or :focus don't do anything.
Am I missing something?
** Update 2012.09.12 **
You can now specify the option "specified-fonts" in the special ibooks file "com.apple.ibooks.display-options.xml" located in META-INF folder :
<?xml version="1.0" encoding="UTF-8"?>
<display_options>
<platform name="*">
<option name="specified-fonts">true</option>
</platform>
</display_options>
This will activate anchors styling, but only when the reader choose the font "Original" in iBooks. So you still need to use the trick beneath for the other fonts.
** End of update 2012.09.12 **
You're not missing anything, iBooks does not support style on links.
There is a way to get around it with the property -webkit-text-fill-color.
Be aware that it doesn't do anything on Adobe Digital Editions.
Here is a sample :
a:link, a:visited, a:hover, a:active
{
-webkit-text-fill-color: red;
}
I got this from twitter on #eprdctn.

Resources