User Tools

Site Tools


manual:advanced:customization:screens

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
manual:advanced:customization:screens [2015/09/03 16:58] – external edit 127.0.0.1manual:advanced:customization:screens [2023/07/14 13:46] (current) mstupka
Line 1: Line 1:
-====== Custom Screens and Dashboards ======+====== Custom Screen ======
  
 ---- ----
-Method of creating custom screens requires at least essential knowledge of developing Android and XML files system. Otherwise we recommend to use already created skins. To edit them, use just simple NotePad or any text editing software with XML syntax highlight (for example [[http://notepad-plus-plus.org/|Notepad++]])+The method of creating custom screens requires at least essential knowledge of developing Android and XML files system. Otherwisewe recommend using already-created skins. To edit them, use just simple NotePad or any text editing software with XML syntax highlight (for example [[http://notepad-plus-plus.org/|Notepad++]])
 <WRAP round tip> <WRAP round tip>
-For most people who want to create their own screens should be enough using much simpler **[[manual:user_guide:tools:dashboards|dashboard]]** system that offers similar functionality in much less painful way.+For most people who want to create their own screens should be enough to use a much simpler **[[manual:user_guide:tools:dashboards|dashboard]]** system that offers similar functionality in much less painful way.
  
-However, **Dashboard** is available only for Pro version and misses some advanced possibilities like rotating images, completely free layout etc.+However, **Dashboard** is available only with Premium and misses some advanced possibilities like rotating images, completely free layout etc.
 </WRAP> </WRAP>
 ==== Method using Eclipse ==== ==== Method using Eclipse ====
  
   - Download and install Eclipse and Android SDK tools from [[http://developer.android.com/sdk/index.html|here >>]].   - Download and install Eclipse and Android SDK tools from [[http://developer.android.com/sdk/index.html|here >>]].
-  - When all works, create a new android project. This will create basic data structure. You'll not need to program anything.+  - When all works, create a new Android project. This will create basic data structure. You'll not need to program anything.
   - The project contains //res/layout/main.xml// file - that's our target. Learn to work with Eclipse GUI builder and edit this file.   - The project contains //res/layout/main.xml// file - that's our target. Learn to work with Eclipse GUI builder and edit this file.
   - Put resources (best to use 9-patch images) into //res// folders (supported - //drawable, drawable-hdpi, drawable-mdpi, drawable-ldpi//)   - Put resources (best to use 9-patch images) into //res// folders (supported - //drawable, drawable-hdpi, drawable-mdpi, drawable-ldpi//)
-  - After compilation, take //mail.xml// file and image resources from compiled source (this is because of 9-patch images. If you want to use basic .png files, you can add them directly into result. 9-patch have to be pre-compiled!).+  - After compilation, take //mail.xml// file and image resources from compiled source (this is because of 9-patch images. If you want to use basic .png files, you can add them directly into the result. 9-patch have to be pre-compiled!).
  
 ==== Using basic text editor ==== ==== Using basic text editor ====
  
-You do not have to do previous steps. You can edit xml file directly in any editor. Previous steps are just recommended way for easy "Drag and drop" creating and also only way to support 9-patch images!+You do not have to do the previous steps. You can edit XML files directly in any editor. The previous steps are just recommended ways for easy "Drag and drop" creating and also the only way to support 9-patch images!
  
 ===== How to make it work ===== ===== How to make it work =====
Line 38: Line 38:
 </code> </code>
  
-Place your main layout file into layout directory (or two files, one to layout-land, second to layout-port) and rename it to //main.xml//. That is important because //main.xml// file is gate to whole layout, it has to be included!+Place your main layout file into the layout directory (or two files, one to layout-land, second to layout-port) and rename it to //main.xml//. That is important because //main.xml// file is the gate to the whole layout, it has to be included!
  
-You can place these files also in root of you .ZIP file (optional)+You can place these files also in the root of your .ZIP file (optional)
   * **icon.png** - small (48x48px) logo of your skin   * **icon.png** - small (48x48px) logo of your skin
-  * **info.html** - HTML page that will contain description of your skin (some links, donate button or similar is possible)+  * **info.html** - HTML page that will contain description of your skin (some links, donate button or similar is possible)
  
 Finally, place this .zip file into the root directory described above! Finally, place this .zip file into the root directory described above!
Line 61: Line 61:
  
   * [[http://developer.android.com/reference/android/widget/TextView.html|TextView]] extends View   * [[http://developer.android.com/reference/android/widget/TextView.html|TextView]] extends View
-    * [[http://developer.android.com/reference/android/widget/TextView.html#attr_android:text|android:text]] - this contain ACTIONS below+    * [[http://developer.android.com/reference/android/widget/TextView.html#attr_android:text|android:text]] - this contains ACTIONS below
     * [[http://developer.android.com/reference/android/widget/TextView.html#attr_android:textColor|android:textSize]]     * [[http://developer.android.com/reference/android/widget/TextView.html#attr_android:textColor|android:textSize]]
     * [[http://developer.android.com/reference/android/widget/TextView.html#attr_android:textColor|android:textColor]]     * [[http://developer.android.com/reference/android/widget/TextView.html#attr_android:textColor|android:textColor]]
Line 83: Line 83:
  
   * MapScreenView (custom locus view) extends View   * MapScreenView (custom locus view) extends View
-    * no custom parametres+    * no custom parameters
  
   * RotateView (custom locus view) extends View   * RotateView (custom locus view) extends View
     * locus:action - attach to which rotation action... for example locus:action="{orient_course}"     * locus:action - attach to which rotation action... for example locus:action="{orient_course}"
-    * locus:rotateImage - reference to drawable, actually centered and rotated around center by angle defined by action+    * locus:rotateImage - reference to drawable, actually centered and rotated around the center by an angle defined by action
     * locus:rotatePivotX - move rotation point by X value (+X to bottom)     * locus:rotatePivotX - move rotation point by X value (+X to bottom)
     * locus:rotatePivotY - move rotation point by Y value (+Y to bottom)     * locus:rotatePivotY - move rotation point by Y value (+Y to bottom)
-    * locus:rotateStartAngle - angle at which rotation starts with rotateStartValue value (- value for counter-clockwise orientation) +    * locus:rotateStartAngle - the angle at which rotation starts with rotateStartValue value (- value for counter-clockwise orientation) 
-    * locus:rotateStartValue - value for variable that starts at rotateStartAngle (in base units, so metres, second, ..) +    * locus:rotateStartValue - value for the variable that starts at rotateStartAngle (in base units, so meters, second, ..) 
-    * locus:rotateEndAngle - angle at which rotation ends with rotateEndValue value+    * locus:rotateEndAngle - the angle at which rotation ends with rotateEndValue value
     * locus:rotateEndValue - value for variable that ends at rotateEndValue     * locus:rotateEndValue - value for variable that ends at rotateEndValue
  
Line 98: Line 98:
   * **SlideView** (custom Locus view) extends View   * **SlideView** (custom Locus view) extends View
     * locus:action - attaches to which slide action ... for example locus:action="{orient_course}"     * locus:action - attaches to which slide action ... for example locus:action="{orient_course}"
-    * locus:slideImage - reference to a drawable item used for slide+    * locus:slideImage - reference to a drawable item used for slide
     * locus:slideStartPosition - position of image pixel that matches //slideStartValue// value.     * locus:slideStartPosition - position of image pixel that matches //slideStartValue// value.
     * locus:slideStartValue - action value for //slideStartPosition// (in base units - metres, seconds, ..)     * locus:slideStartValue - action value for //slideStartPosition// (in base units - metres, seconds, ..)
Line 106: Line 106:
  
 <WRAP round info> <WRAP round info>
-**Sample** - let's imagine this image of compass: +**Sample** - let's imagine this image of the compass: 
  
 {{ :manual:advanced:customization:img_compass_slide.png?nolink |}} {{ :manual:advanced:customization:img_compass_slide.png?nolink |}}
Line 123: Line 123:
 </code> </code>
  
-By this definition you say that:+By this definitionyou say that:
  
-  * 1. if orientation angle is 180°, the first pixel (slideStartPosition) will be drawn really as the first pixel. Because the defined whole range is from 0° - 360° and end value has position on the end (//locus:slideEndPosition="match_parent"//), image will be stretched over whole screen. Middle of image (**S**), will be in the middle, as we want! +  * 1. if the orientation angle is 180°, the first pixel (slideStartPosition) will be drawn really as the first pixel. Because the defined whole range is from 0° - 360° and the end value has position on the end (//locus:slideEndPosition="match_parent"//), the image will be stretched over the whole screen. The middle of the image (**S**), will be in the middle, as we want! 
-  * 2. if orientation is for example 90°, Locus Map firstly computes percent part of image that should be moved. It's computed by **(current value - slideStartValue) / (slideEndValue - slideStartValue)**, so in this case it's (90 - 180) / (-180 - 180) = **25%**!. This means that image will be moved by 25%+  * 2. if orientation is for example 90°, Locus Map first computes the percent part of the image that should be moved. It's computed by **(current value - slideStartValue) / (slideEndValue - slideStartValue)**, so in this case it's (90 - 180) / (-180 - 180) = **25%**!. This means that image will be moved by 25%
 </WRAP> </WRAP>
  
 ==== Global attributes ==== ==== Global attributes ====
  
-On all Views can be applied these attributes:+All Views can be applied with these attributes:
  
   * [[http://developer.android.com/reference/android/view/View.html#attr_android:id|android:id]]   * [[http://developer.android.com/reference/android/view/View.html#attr_android:id|android:id]]
   * [[http://developer.android.com/reference/android/view/ViewGroup.LayoutParams.html#attr_android:layout_width|android:layout_width]]   * [[http://developer.android.com/reference/android/view/ViewGroup.LayoutParams.html#attr_android:layout_width|android:layout_width]]
   * [[http://developer.android.com/reference/android/view/ViewGroup.LayoutParams.html#attr_android:layout_height|android:layout_height]]   * [[http://developer.android.com/reference/android/view/ViewGroup.LayoutParams.html#attr_android:layout_height|android:layout_height]]
-  * [[http://developer.android.com/reference/android/widget/LinearLayout.LayoutParams.html#attr_android:layout_weight|android:layout_weight]] - if parent view is LinearLayout +  * [[http://developer.android.com/reference/android/widget/LinearLayout.LayoutParams.html#attr_android:layout_weight|android:layout_weight]] - if the parent view is LinearLayout 
-  * [[http://developer.android.com/reference/android/widget/RelativeLayout.LayoutParams.html|RelativeLayout.LayoutParams]] - if parent view is RelativeLayout+  * [[http://developer.android.com/reference/android/widget/RelativeLayout.LayoutParams.html|RelativeLayout.LayoutParams]] - if the parent view is RelativeLayout
   * [[http://developer.android.com/reference/android/view/ViewGroup.MarginLayoutParams.html|android:layout_margin]]   * [[http://developer.android.com/reference/android/view/ViewGroup.MarginLayoutParams.html|android:layout_margin]]
   * android:layout_marginLeft   * android:layout_marginLeft
Line 218: Line 218:
  
   * parametres should be {i}, {d}, {i.d}, {u} "integer part, double part, both, only units"   * parametres should be {i}, {d}, {i.d}, {u} "integer part, double part, both, only units"
-  * for example - //"locus:textFormat="{i.d} - {u}"//. Can be applied tospeed, distance, altitude and accuracy now+  * for example - //"locus:textFormat="{i.d} - {u}"//. Can be applied to speed, distance, altitudeand accuracy now
manual/advanced/customization/screens.1441292290.txt.gz · Last modified: 2015/09/03 16:58 by 127.0.0.1