All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.robolectric.shadows.ShadowNativePluralRules Maven / Gradle / Ivy

package org.robolectric.shadows;

import static android.os.Build.VERSION_CODES.JELLY_BEAN_MR2;
import static android.os.Build.VERSION_CODES.KITKAT;
import static android.os.Build.VERSION_CODES.M;

import org.robolectric.annotation.Implementation;
import org.robolectric.annotation.Implements;

@Implements(className = "libcore.icu.NativePluralRules", isInAndroidSdk = false, maxSdk = M)
public class ShadowNativePluralRules {

  @Implementation(minSdk = KITKAT)
  protected static int quantityForIntImpl(long address, int quantity) {
    // just return the mapping for english locale for now
    if (quantity == 1) return 1;
    else return 5 /* other */;
  }

  @Implementation(maxSdk = JELLY_BEAN_MR2)
  protected static int quantityForIntImpl(int address, int quantity) {
    return quantityForIntImpl((long)address, quantity);

  }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy