Details

    • Type: Bug
    • Status: Resolved
    • Resolution: Needs more info
    • Affects Version/s: Appcelerator Studio 4.5.0
    • Component/s: Alloy
    • Labels:
      None
    • Environment:

      Description

      Packaging for Android and Testing on Pixel 2 Android P 9.0

      In my alloy.js file i've linked to a commonjs file

      //alloy.js
      var dpi = require('/ui/dpi');
      //as this method is call before the index page open it causes the app to not load
      Alloy.CFG.borderWidth = dpi.dipUnitsToPixels(6);

      //dpi.js
      exports.dipUnitsToPixels = function(dipUnits) {
      var DENSITY_SMALL_LDPI = 120;
      var DENSITY_BASELINE_MDPI = 160;
      var DENSITY_HIGH_HDPI = 240;
      var DENSITY_EXTRA_HIGH_XHDPI = 320;
      var ret;

      switch (Ti.Platform.displayCaps.dpi)

      { case DENSITY_SMALL_LDPI: ret = (dipUnits * (Ti.Platform.displayCaps.dpi / DENSITY_SMALL_LDPI)); break; case DENSITY_BASELINE_MDPI: ret = (dipUnits * (Ti.Platform.displayCaps.dpi / DENSITY_BASELINE_MDPI)); break; case DENSITY_HIGH_HDPI: ret = (dipUnits * (Ti.Platform.displayCaps.dpi / DENSITY_HIGH_HDPI)); break; case DENSITY_EXTRA_HIGH_XHDPI: ret = (dipUnits * (Ti.Platform.displayCaps.dpi / DENSITY_EXTRA_HIGH_XHDPI)); break; default: ret = dipUnits; }

      return ret;
      };

        Attachments

          Activity

            People

            • Assignee:
              shossain Shak Hossain
              Reporter:
              dpenney David Penney
            • Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Git Source Code