android.content.res.Configuration.updateFrom()方法的使用及代码示例

x33g5p2x  于2022-01-18 转载在 其他  
字(3.5k)|赞(0)|评价(0)|浏览(228)

本文整理了Java中android.content.res.Configuration.updateFrom()方法的一些代码示例,展示了Configuration.updateFrom()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Configuration.updateFrom()方法的具体详情如下:
包路径:android.content.res.Configuration
类名称:Configuration
方法名:updateFrom

Configuration.updateFrom介绍

暂无

代码示例

代码示例来源:origin: android-hacker/VirtualXposed

public void updateConfiguration(Configuration config) {
  synchronized (this) {
    int changes = mConfiguration.updateFrom(config);
    if ((changes & ~(ActivityInfo.CONFIG_FONT_SCALE | ActivityInfo.CONFIG_KEYBOARD_HIDDEN
        | ActivityInfo.CONFIG_ORIENTATION)) != 0) {
      // The configurations being masked out are ones that commonly
      // change so we don't want flushing the cache... all others
      // will flush the cache.
      mPackages.clear();
    }
  }
}

代码示例来源:origin: SimonMarquis/Android-SecretCodes

boolean applyNewConfig(Resources res) {
    int configChanges = mLastConfiguration.updateFrom(res.getConfiguration());
    return (configChanges & (ActivityInfo.CONFIG_LOCALE)) != 0;
  }
}

代码示例来源:origin: tupunco/tup.dota2recipe

public boolean applyNewConfig(Resources res) {
    int configChanges = mLastConfiguration.updateFrom(res.getConfiguration());
    boolean densityChanged = mLastDensity != res.getDisplayMetrics().densityDpi;
    if (densityChanged
        || (configChanges & (ActivityInfo.CONFIG_LOCALE | ActivityInfo.CONFIG_UI_MODE | ActivityInfo.CONFIG_SCREEN_LAYOUT)) != 0) {
      mLastDensity = res.getDisplayMetrics().densityDpi;
      return true;
    }
    return false;
  }
}

代码示例来源:origin: qiubiteme/android_api_demos

boolean applyNewConfig(Resources res) {
    int configChanges = mLastConfiguration.updateFrom(res.getConfiguration());
    boolean densityChanged = mLastDensity != res.getDisplayMetrics().densityDpi;
    if (densityChanged || (configChanges&(ActivityInfo.CONFIG_LOCALE
        |ActivityInfo.CONFIG_UI_MODE|ActivityInfo.CONFIG_SCREEN_LAYOUT)) != 0) {
      mLastDensity = res.getDisplayMetrics().densityDpi;
      return true;
    }
    return false;
  }
}

代码示例来源:origin: jahirfiquitiva/IconShowcase

boolean applyNewConfig(Resources res) {
    int configChanges = mLastConfiguration.updateFrom(res.getConfiguration());
    boolean densityChanged = mLastDensity != res.getDisplayMetrics().densityDpi;
    if (densityChanged || (configChanges & (ActivityInfo.CONFIG_LOCALE
        | ActivityInfo.CONFIG_UI_MODE | ActivityInfo.CONFIG_SCREEN_LAYOUT)) != 0) {
      mLastDensity = res.getDisplayMetrics().densityDpi;
      return true;
    }
    return false;
  }
}

代码示例来源:origin: li2/learning-android-open-source

boolean applyNewConfig(Resources res) {
    int configChanges = mLastConfiguration.updateFrom(res.getConfiguration());
    boolean densityChanged = mLastDensity != res.getDisplayMetrics().densityDpi;
    if (densityChanged || (configChanges&(ActivityInfo.CONFIG_LOCALE
        |ActivityInfo.CONFIG_UI_MODE|ActivityInfo.CONFIG_SCREEN_LAYOUT)) != 0) {
      mLastDensity = res.getDisplayMetrics().densityDpi;
      return true;
    }
    return false;
  }
}

代码示例来源:origin: darkskygit/VirtualApp

public void updateConfiguration(Configuration config) {
  synchronized (this) {
    int changes = mConfiguration.updateFrom(config);
    if ((changes & ~(ActivityInfo.CONFIG_FONT_SCALE | ActivityInfo.CONFIG_KEYBOARD_HIDDEN
        | ActivityInfo.CONFIG_ORIENTATION)) != 0) {
      // The configurations being masked out are ones that commonly
      // change so we don't want flushing the cache... all others
      // will flush the cache.
      mPackages.clear();
    }
  }
}

代码示例来源:origin: bzsome/VirtualApp-x326

public void updateConfiguration(Configuration config) {
  synchronized (this) {
    int changes = mConfiguration.updateFrom(config);
    if ((changes & ~(ActivityInfo.CONFIG_FONT_SCALE | ActivityInfo.CONFIG_KEYBOARD_HIDDEN
        | ActivityInfo.CONFIG_ORIENTATION)) != 0) {
      // The configurations being masked out are ones that commonly
      // change so we don't want flushing the cache... all others
      // will flush the cache.
      mPackages.clear();
    }
  }
}

相关文章