Multiple Resolution Adaption

A manifest file that can be run simultaneously on multiple devices, only need to set resources and scaling on the good use of different size or density of devices on it.

Resource Adapter

  • extraResourcesDensity = "320,480" extraResourcesScreenWidth = "720,1280"
  • extraResources = "SW1000-den320: den320: 1.2, SW1000-den320 :: 1.2, SW1000-den320-large: den320: 1.2" (SW1000-den320: den320 : 1.2: which meant that in 1000 the density of screen width is 320 models, using den320 folder under the resources and zoom 1.2x; sw1000-den320 :: 1.2 means that the screen width 1000 the density of the 320 models, using the default resources, and magnify 1.2 times)
  • extraResources = "SW2000-den480: 1.8, SW1000-den320-large: 1.8":two words in the middle is only a colon, meaning Resource models used sw2000-den480 is in sw2000-den480 the resources folder of the same name, and magnify 1.8 times

Layout Adaption

extraScaleByDensity = "320: 1.2,480: 1.8" extraScaleByScreenWidth = "720: 1.2, 1280: 1.8 "
extraScales = "SW1000-den320: 1.2, SW2000-den480-large: 1.8"

Adaption Principles

  • First, put all your customizations appear sw den and make a list (such as where extraResources = "sw1440-den440 :: 0.916, sw720-den320 :: 0.667, sw480-den240 :: 0.444", related to the den 440, 320, 240, plus a default of 480; sw there are 1440, 720, 480, together with a default of 1080 (with den480 correspondence))
  • Then when your subject placed on a device, first take your device density to the above list to find the den, find the closest one, and then the same den if there are multiple sw, so let's use the device screen width to this In several sw find the closest one, so you find the most suitable swXXX-denXXX
  • Finally, the resource will take this resource sw-den corresponding directory, and scaling Sr. Scaling the code numbers on the use of sw-den corresponding Ss.
  • Most Finally, there is scaling
    • If you press the density scaling (ie scaleByDensity = "true"): the true scale of resources is Sr equipment den / den found, the code is Ss digital scale equipment den / den found.
    • If you press the screen width scaling (ie scaleByDensity = "false"): the true scale of resources is sw Sr device sw / found, the code numbers in device scaling is Ss sw / sw Found

Dynamic frameRate

  • Simple Usage : In addition to the original frame rate frameRate properties control the general state, but also support are provided charging, the battery is low, full frame-rate power state to facilitate the control of the frame rate under these conditions, to achieve energy saving goals. Such as no ordinary state animation, the frame rate can be set to 0, the charged state of animation, the frame rate can be set to 30, to show the smooth animation, in this normal state can be very efficient.

    • Example: frameRateCharging = "30" frameRateBatteryLow = "20" frameRateBatteryFull = "1"
  • Advanced Usage : In order to describe the language specified in the xml different frame rates depending on the time line, add an element, called a FramerateController, this element and other interface elements, like can be added to each container, this element contains a frame rate control timeline specified in the certain amount of time to use certain frame rate.

    • Example:
      <FramerateController visibility = "# music_control.visibility" loop = "true">
      <ControlPoint time = "0" frameRate = "20" />
      <ControlPoint time = "1000" frameRate = "0" />
      <ControlPoint time = "3000" />
      </ FramerateController>
      // This element will control the frame rate at which it is under the timeline container,
      // that is, the frame rate change elements of the vessel under all animations are specified
      // synchronization with this element.
      

Custom Lockscreen

Reference http://www.miui.com/thread-2618049-1-1.html

results matching ""

    No results matching ""