Java Code Examples for com.android.resources.UiMode#NORMAL

The following examples show how to use com.android.resources.UiMode#NORMAL . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: UiModeQualifier.java    From java-n-IDE-for-Android with Apache License 2.0 6 votes vote down vote up
@Override
public boolean isBetterMatchThan(ResourceQualifier compareTo, ResourceQualifier reference) {
    if (compareTo == null) {
        return true;
    }

    UiModeQualifier compareQualifier = (UiModeQualifier)compareTo;
    UiModeQualifier referenceQualifier = (UiModeQualifier)reference;

    if (compareQualifier.getValue() == referenceQualifier.getValue()) {
        // what we have is already the best possible match (exact match)
        return false;
    } else  if (mValue == referenceQualifier.mValue) {
        // got new exact value, this is the best!
        return true;
    } else if (mValue == UiMode.NORMAL) {
        // else "normal" can be a match in case there's no exact match
        return true;
    }

    return false;
}
 
Example 2
Source File: UiModeQualifier.java    From javaide with GNU General Public License v3.0 6 votes vote down vote up
@Override
public boolean isBetterMatchThan(ResourceQualifier compareTo, ResourceQualifier reference) {
    if (compareTo == null) {
        return true;
    }

    UiModeQualifier compareQualifier = (UiModeQualifier)compareTo;
    UiModeQualifier referenceQualifier = (UiModeQualifier)reference;

    if (compareQualifier.getValue() == referenceQualifier.getValue()) {
        // what we have is already the best possible match (exact match)
        return false;
    } else  if (mValue == referenceQualifier.mValue) {
        // got new exact value, this is the best!
        return true;
    } else if (mValue == UiMode.NORMAL) {
        // else "normal" can be a match in case there's no exact match
        return true;
    }

    return false;
}
 
Example 3
Source File: UiModeQualifier.java    From java-n-IDE-for-Android with Apache License 2.0 5 votes vote down vote up
@Override
public boolean isMatchFor(ResourceQualifier qualifier) {
    // only normal is a match for all UI mode, because it's not an actual mode.
    if (mValue == UiMode.NORMAL) {
        return true;
    }

    // others must be an exact match
    return ((UiModeQualifier)qualifier).mValue == mValue;
}
 
Example 4
Source File: UiModeQualifier.java    From javaide with GNU General Public License v3.0 5 votes vote down vote up
@Override
public boolean isMatchFor(ResourceQualifier qualifier) {
    // only normal is a match for all UI mode, because it's not an actual mode.
    if (mValue == UiMode.NORMAL) {
        return true;
    }

    // others must be an exact match
    return ((UiModeQualifier)qualifier).mValue == mValue;
}