Class ResourceHelper

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
    • Constructor Summary

      Constructors 
      Constructor Description
      ResourceHelper(Context context, TypedArray styledAttributes, int orientationResourceId) Initialize the View orientation using the specified style attribute If the style attribute is set to "portrait" or "landscape", the View orientation in this instance is set appropriately.
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
    • Method Summary

      Modifier and Type Method Description
      int getResourceIdForOrientation(int resourceId) Return the resource ID for the specified resource using the View's orientation.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • ResourceHelper

        ResourceHelper(Context context, TypedArray styledAttributes, int orientationResourceId)
        Initialize the View orientation using the specified style attribute If the style attribute is set to "portrait" or "landscape", the View orientation in this instance is set appropriately.
        Parameters:
        context - View's Context
        styledAttributes - array of attributes from obtainStyledAttributes() for this View
        orientationResourceId - resource ID of the style resource that contains the View orientation
    • Method Detail

      • getResourceIdForOrientation

         int getResourceIdForOrientation(int resourceId)

        Return the resource ID for the specified resource using the View's orientation. Use this method to obtain the resource ID of the resource for the correct View orientation. This will return the specified resource ID if the View's orientation is set to "portrait" If the View's orientation is set to "landscape", the resource ID of the resource with the suffix "_land" will be returned (if it exists), otherwise the specified resource ID will be returned

        Parameters:
        resourceId - The portrait (default) resource ID of the resource