summaryrefslogtreecommitdiff
path: root/navit
diff options
context:
space:
mode:
authormdankov <mdankov@ffa7fe5e-494d-0410-b361-a75ebd5db220>2015-01-07 13:38:25 +0000
committermdankov <mdankov@ffa7fe5e-494d-0410-b361-a75ebd5db220>2015-01-07 13:38:25 +0000
commitda4504b83ef7d717d90e7e8687a78167f40fa574 (patch)
treeec5c516d77562ff15124ce96c0d67e459bb9e6bd /navit
parent4dab8a81b127b8503ccd5015d9cd4a311fb172d9 (diff)
downloadnavit-svn-da4504b83ef7d717d90e7e8687a78167f40fa574.tar.gz
Add:port_android:Better image sizes for high dpi screens, scale icons consistently, scale dashes of dashed lines propotionally to other graphic parameters. Related to #1181.
git-svn-id: http://svn.code.sf.net/p/navit/code/trunk/navit@5994 ffa7fe5e-494d-0410-b361-a75ebd5db220
Diffstat (limited to 'navit')
-rw-r--r--navit/CMakeLists.txt12
-rw-r--r--navit/xslt/android.xslt17
2 files changed, 20 insertions, 9 deletions
diff --git a/navit/CMakeLists.txt b/navit/CMakeLists.txt
index b3bfb1f2..d0d57e23 100644
--- a/navit/CMakeLists.txt
+++ b/navit/CMakeLists.txt
@@ -139,12 +139,12 @@ macro(process_xslt SRC_XML DEST_XML)
endmacro()
if(ANDROID)
- process_xslt(${CMAKE_CURRENT_SOURCE_DIR}/navit_shipped.xml ${CMAKE_CURRENT_BINARY_DIR}/navitxxxhdpi.xml OSD_SIZE=5.33 ICON_SMALL=96 ICON_MEDIUM=128 ICON_BIG=128)
- process_xslt(${CMAKE_CURRENT_SOURCE_DIR}/navit_shipped.xml ${CMAKE_CURRENT_BINARY_DIR}/navitxxhdpi.xml OSD_SIZE=4 ICON_SMALL=64 ICON_MEDIUM=96 ICON_BIG=96)
- process_xslt(${CMAKE_CURRENT_SOURCE_DIR}/navit_shipped.xml ${CMAKE_CURRENT_BINARY_DIR}/navitxhdpi.xml OSD_SIZE=2.67 ICON_MEDIUM=64)
- process_xslt(${CMAKE_CURRENT_SOURCE_DIR}/navit_shipped.xml ${CMAKE_CURRENT_BINARY_DIR}/navithdpi.xml OSD_SIZE=2 ICON_MEDIUM=48)
- process_xslt(${CMAKE_CURRENT_SOURCE_DIR}/navit_shipped.xml ${CMAKE_CURRENT_BINARY_DIR}/navitmdpi.xml OSD_SIZE=1.33)
- process_xslt(${CMAKE_CURRENT_SOURCE_DIR}/navit_shipped.xml ${CMAKE_CURRENT_BINARY_DIR}/navitldpi.xml OSD_SIZE=1)
+ process_xslt(${CMAKE_CURRENT_SOURCE_DIR}/navit_shipped.xml ${CMAKE_CURRENT_BINARY_DIR}/navitxxxhdpi.xml OSD_SIZE=5.33 ICON_SMALL=128 ICON_MEDIUM=192 ICON_BIG=256)
+ process_xslt(${CMAKE_CURRENT_SOURCE_DIR}/navit_shipped.xml ${CMAKE_CURRENT_BINARY_DIR}/navitxxhdpi.xml OSD_SIZE=4 ICON_SMALL=96 ICON_MEDIUM=128 ICON_BIG=192)
+ process_xslt(${CMAKE_CURRENT_SOURCE_DIR}/navit_shipped.xml ${CMAKE_CURRENT_BINARY_DIR}/navitxhdpi.xml OSD_SIZE=2.67 ICON_SMALL=64 ICON_MEDIUM=96 ICON_BIG=128)
+ process_xslt(${CMAKE_CURRENT_SOURCE_DIR}/navit_shipped.xml ${CMAKE_CURRENT_BINARY_DIR}/navithdpi.xml OSD_SIZE=2 ICON_SMALL=48 ICON_MEDIUM=64 ICON_BIG=96)
+ process_xslt(${CMAKE_CURRENT_SOURCE_DIR}/navit_shipped.xml ${CMAKE_CURRENT_BINARY_DIR}/navitmdpi.xml OSD_SIZE=1.33 ICON_SMALL=32 ICON_MEDIUM=48 ICON_BIG=64)
+ process_xslt(${CMAKE_CURRENT_SOURCE_DIR}/navit_shipped.xml ${CMAKE_CURRENT_BINARY_DIR}/navitldpi.xml OSD_SIZE=1 ICON_SMALL=24 ICON_MEDIUM=32 ICON_BIG=48)
add_custom_target( navit_config_xml ALL DEPENDS navitxxxhdpi.xml navitxxhdpi.xml navitxhdpi.xml navithdpi.xml navitmdpi.xml navitldpi.xml)
else()
process_xslt(${CMAKE_CURRENT_SOURCE_DIR}/navit_shipped.xml ${CMAKE_CURRENT_BINARY_DIR}/navit.xml "")
diff --git a/navit/xslt/android.xslt b/navit/xslt/android.xslt
index ab0d114b..0a5ee40b 100644
--- a/navit/xslt/android.xslt
+++ b/navit/xslt/android.xslt
@@ -66,7 +66,7 @@
</xsl:template>
<xsl:template match="/config/navit/layout/layer/itemgra/child::*">
<xsl:copy>
- <xsl:copy-of select="@*[not(name()='text_size') and not(name()='width') and not(name()='radius') and not(name()='w') and not(name()='h') and not(name()='x') and not(name()='y')]"/>
+ <xsl:copy-of select="@*[not(name()='text_size') and not(name()='width') and not(name()='radius') and not(name()='w') and not(name()='h') and not(name()='x') and not(name()='y') and not(name()='dash')]"/>
<xsl:if test="@text_size">
<xsl:attribute name="text_size"><xsl:value-of select="round(number(@text_size)*number($OSD_SIZE))"/></xsl:attribute>
</xsl:if>
@@ -77,8 +77,8 @@
<xsl:attribute name="radius"><xsl:value-of select="round(number(@radius)*number($OSD_SIZE))"/></xsl:attribute>
</xsl:if>
<xsl:if test="name()='icon'">
- <xsl:attribute name="w"><xsl:value-of select="round(24.0*number($OSD_SIZE))"/></xsl:attribute>
- <xsl:attribute name="h"><xsl:value-of select="round(24.0*number($OSD_SIZE))"/></xsl:attribute>
+ <xsl:attribute name="w"><xsl:value-of select="$ICON_SMALL"/></xsl:attribute>
+ <xsl:attribute name="h"><xsl:value-of select="$ICON_SMALL"/></xsl:attribute>
</xsl:if>
<xsl:if test="@w and not(name()='icon')">
<xsl:attribute name="w"><xsl:value-of select="round(number(@w)*number($OSD_SIZE))"/></xsl:attribute>
@@ -93,6 +93,17 @@
<xsl:if test="@y">
<xsl:attribute name="y"><xsl:value-of select="round(number(@y)*number($OSD_SIZE))"/></xsl:attribute>
</xsl:if>
+ <xsl:if test="@offset">
+ <xsl:attribute name="offset"><xsl:value-of select="round(number(@offset)*number($OSD_SIZE))"/></xsl:attribute>
+ </xsl:if>
+ <xsl:if test="@dash">
+ <xsl:attribute name="dash">
+ <xsl:for-each select="tokenize(@dash,',')">
+ <xsl:value-of select="round(number(.)*number($OSD_SIZE))"/>
+ <xsl:if test="not(position() eq last())"><xsl:text>,</xsl:text></xsl:if>
+ </xsl:for-each>
+ </xsl:attribute>
+ </xsl:if>
</xsl:copy>
</xsl:template>
<xsl:template match="/config/navit/layout">