Modifying apk's language - apk

I am trying to modify the language of an apk. I changed all the strings. the app has 2 languages chinese and english. I was able to change the values of chinese to arabic language. But the issue is I dont know from where I can modify the selection text. Now if I choose chinese it will change to arabic. But the selection still says chinese and english.
Language selection
Now I have found some clues but I am not good at coding so I need help.
I found this code 'bg_language_text_unfocsed.xml':
<?xml version="1.0" encoding="utf-8"?>
<selector
xmlns:android="http://schemas.android.com/apk/res/android">
<item
android:state_focused="true">
<bitmap
android:src="#ref/0x7f070068" />
</item>
<item
android:state_focused="false">
<shape>
<stroke
android:width="dimension(1073741873)"
android:color="#ref/0x7f05009a" />
</shape>
</item>
</selector>

Related

How to change Xamarin DatePicker popup header and Background to White and also Font Color to Gray

I am trying to give custom look and feel to the datePicker popup. But I could not find any direct fields to change the header Background and Font Color of text shown in popup
enter image description here
You can try using below code inside styles.xml in Android Project.
<resources>
<style name="MainTheme" parent="MainTheme.Base">
<item name="android:datePickerDialogTheme">#style/AppCompatDialogStyle</item>
</style>
<style name="AppCompatDialogStyle" parent="Theme.AppCompat.Light.Dialog">
<!--header background-->
<item name="colorAccent">#fff</item>
<!--header textcolor-->
<item name="android:textColorPrimaryInverse">#808080</item>
<!--body background-->
<item name="android:windowBackground">#fff</item>
<!--selected day-->
<item name="android:colorControlActivated">#4B6043</item>
<!--days of the month-->
<item name="android:textColorPrimary">#808080</item>
<!--days of the week-->
<item name="android:textColorSecondary">#808080</item>
<!--cancel&ok-->
<item name="android:textColor">#808080</item>
</style>

Using Android Picker without useSpinner in Appcelerator

Here it reads http://docs.appcelerator.com/platform/latest/#!/api/Titanium.UI.Picker that the useSpinner property is deprecated. How do I use the picker properly then?
When I use the picker in Android without the useSpinner property it does not show up (left picker). When I click on the picker (green border) the values are showing up and it works properly.
With useSpinner set to true, it shows up properly (right). see screenshot.
Visibility of the picker is initially in the .xml set to false. When the user clicks on corresponding labels, the picker becomes visible. This works fine in iOS.
Actually, this is not any wrong behaviour. The red-border picker is outdated and you will hardly see it in any app, even native ones.
The standard picker is the left one which initially shows the selected value or the first value as default. As far as I know, you cannot directly change the text-color of left picker through .tss files.
Instead you can use custom themes and use it for that window which contains pickers.
Here is a quick example of how you can apply themes to pickers and other elements.
Save this xml code in a file (name it anything, let's say theme.xml).
Put this file at below location (create folders if doesn't exist).
Your_Project_Folder -> app -> platform -> android -> res -> values -> theme.xml
<?xml version="1.0" encoding="utf-8"?>
<resources xmlns:android="http://schemas.android.com/apk/res/android">
<style name="PickerTheme" parent="#style/Theme.AppCompat.Light">
<item name="android:spinnerItemStyle">#style/SpinnerItem</item>
<!-- Activate this for Spinners/Plain Pickers in selected/popup state -->
<!-- <item name="android:spinnerDropDownItemStyle">#style/SpinnerDropDownItem</item> -->
<!-- Override Date Dialog -->
<item name="android:datePickerDialogTheme">#style/MyDatePickerDialogTheme</item>
<!-- Override Time Dialog -->
<item name="android:timePickerDialogTheme">#style/MyTimePickerDialogTheme</item>
</style>
<!-- Use this style for Spinners/Plain Pickers in default state -->
<style name="SpinnerItem">
<item name="android:textColor">#000000</item>
</style>
<style name="SpinnerDropDownItem">
<item name="android:textColor">#color/primary_dark</item>
<item name="android:background">#color/accent</item>
</style>
<style name="MyDatePickerDialogTheme" parent="android:Theme.Material.Light.Dialog">
<item name="colorAccent">#color/primary</item>
<item name="android:textColorSecondary">#000000</item>
</style>
<style name="MyTimePickerDialogTheme" parent="android:Theme.Material.Light.Dialog">
<item name="colorAccent">#color/primary</item>
<item name="android:textColorSecondary">#000000</item>
</style>
</resources>
Now, you can use this theme either globally for all windows, or for particular window.
1 - Using theme for whole app, use this in tiapp.xml file.
<android xmlns:android="http://schemas.android.com/apk/res/android">
<manifest>
<application android:theme="#style/PickerTheme">
....
</application>
</manifest>
</android>
2 - Using theme in .tss file
"Window[platform=android]": {
theme : 'PickerTheme',
backgroundColor : 'white',
windowSoftInputMode : Ti.UI.Android.SOFT_INPUT_STATE_ALWAYS_HIDDEN | Titanium.UI.Android.SOFT_INPUT_ADJUST_RESIZE
}

Maven-pdf-plugin: How to include nested items in pdf?

I'm generating a pdf document from my maven site documentation using the maven-pdf-plugin. The documentation is written in Markdown.
Unfortunately the generated document does not include nested <item> tags.
For example, I have the the following content in my site.xml:
<menu name="Documentation">
<item name="Sweets" href="sweets/sweets.html" collapse="true">
<item name="Chocolate" href="sweets/chocolate.html"/>
<item name="Bublegum" href="sweets/bublegum.html"/>
<item name="Marzipan" href="sweets/marzipan.html"/>
</item>
</menu>
In the resulting pdf I have the contents of sweets.html, but not the content of all the sub items.
I also tried using a pdf.xml file with the following content included:
<toc name="Table of Contents" depth="4">
<item name="Sweets" ref="sweets/sweets.md">
<item name="Chocolate" ref="sweets/chocolate.md"/>
<item name="Bublegum" ref="sweets/bublegum.md"/>
<item name="Marzipan" ref="sweets/marzipan.md"/>
</item>
</toc>
Which gave me the same result.
Looking at the document model reference, it should be possible to nest <item> tags.
What am I doing wrong?
Here is some additional information:
Maven: 3.3.1
maven-pdf-plugin: 1.2
doxia-module-markdown: 1.6
Using maven-pdf-plugin Version 1.3 fixed the problem.

xpath internal link parsing

I have got a soap response from a webservice where it looks like this:
<?xml version="1.0" encoding="UTF-8"?>
<Body>
<multiref id="1">
<cpuclock>2300</cpuclock>
<memoryComponent>
<item href="#2"/>
<item href="#3"/>
</memoryComponent>
</multiref>
<multiref id="2" type="ns2:MemoryComponent">
<type>RAM</type>
<quantity>2048</quantity>
</multiref>
<multiref id="3" type="ns3:MemoryComponent">
<type>RAM</type>
<quantity>1024</quantity>
</multiref>
</Body>
What I am trying to achieve is to recover the memoryComponent elements.
Since I am using the XMLUtil of VBScript/QTP, I've been trying to workaround using XPATH (by predicates). Ends-with is not supported by my QTP framework version.
Any suggestions?
TIA!
I've found a way to retrieve the elements I wanted.
Set childElements = XMLFile.ChildElementsByPath("/Body/multiref[contains(#type,'MemoryComponent')]")
This workaround suits my needs pretty well.
Thanks!

XSLT to display news item images with consistent size

I have a RSS XML news file, which contains a list of items inclusive of a URL to an image. I also have an associated XSLT.
The problem is that the image sizes are not consistent and I want to limit the image sizes, resize them, to a nice thumbnail.
How would I modify the XSLT to accomplish that?
XML Sample:
<?xml version="1.0" encoding="UTF-8" ?>
<rss version ="2.0" xmlns:g="http://base.google.com/ns/1.0">
<channel>
<title>Company Name</title>
<description>Company description</description>
<link>http://www.mycompanyurl.com</link>
<item>
<title>News Item Title</title>
<link>http://www.whateverurl.com/</link>
<category>Space</category>
<pubDate>12 April 1961</pubDate>
<description>Software to reduce your job search to a half hour per day. all major job sites, job boards, classifieds. unemployment paperwork, CRM, interviews, more</description>
<image>
<url>~/App_Data/NewsControl/whatever.png</url>
<title>Whatever1</title>
<link>javascript:void(0)</link>
</image>
<g:id>1</g:id>
<g:brand>Whatever2</g:brand>
<g:condition>whatever3</g:condition>
<g:price>$whatever4</g:price>
<g:product_type>Whatever5</g:product_type>
</item>
</channel>
</rss>
Here is the associated XSLT:
<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/">
<items>
<xsl:for-each select="//item">
<item Name="{position()}" HeaderText="{title}" Text="{description}" NavigateUrl="{position()}" Date="{pubDate}" ImageUrl="{image/url}"/>
</xsl:for-each>
</items>
</xsl:template>
</xsl:stylesheet>
Results of First Answer:
<items>
<xsl:for-each select="//item">
<item Name="{position()}" HeaderText="{title}" Text="{description}" NavigateUrl="{position()}" Date="{pubDate}" ImageUrl="/Tools/thumber.php?img={image/url}"/>
</xsl:for-each>
</items>
I made these changes, enabled PHP on the server (testing on from the server and locally), and saw 2 issues:
1. I get no image, merely a no image box.
If I try to edit the ImageUrl and tack on a "&W=xxx&H=xxx", the Visual Studio validator complains and throws up errors on the &.
Update 2
Here is the latest line in the XSLT:
http://myserver.com/Tools/thumber.php?img=',image/url)}"/>
The corresponding image section in the XML
<image>
<url>/Products/Jobfish/Images/Boxshots/Jobfish_DVDCaseCD_ShadowOut.jpg</url>
<title>Jobfish</title>
<link>javascript:void(0)</link>
XSLT has no built in function for resizing or thumbnailing. You will have to use an external processor for that eg. by using a PHP thumbnail generator.
Then replace the original image path with a URL pointing to your thumbnail generator, with the source being the original image.
suppose ImageUrl = mediaserver.xyz/ourlogo.jpg
the new ImageUrl would become myserver.com/thumbnailgenerator.php?src=http://mediaserver.xyz/ourlogo.jpg
Please make shure you select a caching thumbnail library (eg https://code.google.com/p/phpthumbmaker/wiki/ThumberWiki ) , since it will be a serious resource hog if you skip that. Also take into account copyright issues when re-serving these thumbnails.

Resources