Advertisement
bigrushdog

Untitled

Nov 17th, 2012
40
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 2.03 KB | None | 0 0
  1. mmy attempt
  2. ********************************
  3.  
  4.     private static class ResourcesKey {
  5.         final private String mResDir;
  6.         final private int mDisplayId;
  7.         final private Configuration mOverrideConfiguration;
  8.         final private float mScale;
  9.         final private boolean mIsThemeable;
  10.         final private int mHash;
  11.  
  12.  
  13.         ResourcesKey(String resDir, int displayId, Configuration overrideConfiguration, float scale) {
  14.             this(resDir, displayId, overrideConfiguration, scale, true);
  15.         }
  16.  
  17.         ResourcesKey(String resDir, int displayId, Configuration overrideConfiguration, float scale, boolean isThemeable) {
  18.             mResDir = resDir;
  19.             mDisplayId = displayId;
  20.             if (overrideConfiguration != null) {
  21.                 if (Configuration.EMPTY.equals(overrideConfiguration)) {
  22.                     overrideConfiguration = null;
  23.                 }
  24.             }
  25.             mOverrideConfiguration = overrideConfiguration;
  26.             mScale = scale;
  27.             int hash = 17;
  28.             hash = 31 * hash + mResDir.hashCode();
  29.             hash = 31 * hash + mDisplayId;
  30.             hash = 31 * hash + (mOverrideConfiguration != null
  31.                     ? mOverrideConfiguration.hashCode() : 0);
  32.             hash = 31 * hash + Float.floatToIntBits(mScale);
  33.             mHash = hash;
  34.             mIsThemeable = isThemeable;
  35.             mHash = mResDir.hashCode() << 3 + ((mIsThemeable ? 1 : 0) << 2) + (int) (mScale * 2);
  36.         }
  37.  
  38. **************
  39. method from 4.1.2
  40. *****************
  41.  
  42.     private static class ResourcesKey {
  43.         final private String mResDir;
  44.         final private float mScale;
  45.         final private boolean mIsThemeable;
  46.         final private int mHash;
  47.  
  48.         ResourcesKey(String resDir, float scale, boolean isThemeable) {
  49.             mResDir = resDir;
  50.             mScale = scale;
  51.             mIsThemeable = isThemeable;
  52.             mHash = mResDir.hashCode() << 3 + ((mIsThemeable ? 1 : 0) << 2) + (int) (mScale * 2);
  53.         }
  54.  
  55. AmG zHaLpZ!!!!!!!!111
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement