Class POBUIUtil

  • All Implemented Interfaces:

    
    public class POBUIUtil
    
                        

    Utility class for Common UI controls

    • Constructor Detail

      • POBUIUtil

        POBUIUtil()
    • Method Detail

      • createSkipButton

        @NonNull() static ImageButton createSkipButton(@NonNull() Context context, @IdRes() int btnId, @DrawableRes() int resId)

        Create circular close button. Close button already has layout params of type FrameLayout which is aligned to top right corner of the view. If you want to add it on different position, you can always override LayoutParams of different type.

        Parameters:
        context - activity/application context
        Returns:

        close button

      • createAdInfoIconButton

        @NonNull() static ImageButton createAdInfoIconButton(@NonNull() Context context, @IdRes() int btnId, @DrawableRes() int resId, boolean isFullScreen, boolean isPositionBottom)

        Create circular ad info info button. ad info info button already has layout params of type FrameLayout which is aligned to - - Banner / MREC display - Top left - MREC Video - Top left - Full screen - Top left If you want to add it on different position, you can always override LayoutParams of different type.

        Parameters:
        context - activity/application context
        btnId - the resource id which is going to set as button id
        resId - the resource id which is going to set as button image
        isFullScreen - true if full screen, false otherwise
        isPositionBottom - true if ad info position is on bottom, false otherwise
        Returns:

        close button

      • resizeAdInfoIconBtn

         static void resizeAdInfoIconBtn(@NonNull() Context mContext, @NonNull() ImageButton adInfoIcon, boolean expanded)

        Resizes the ad info info button based on the parameters received.

        Parameters:
        expanded - true if the button is added to expanded view, false otherwise
      • createSkipDurationTextView

        @NonNull() static TextView createSkipDurationTextView(@NonNull() Context context, int id)

        Creates skip duration TextView component

        Parameters:
        context - activity context
        id - the resource id which is going to set as button id
        Returns:

        instance of skip duration button

      • createTextView

        @NonNull() static TextView createTextView(@NonNull() Context context, @Nullable() String text, float textSize, int accessibilityId)

        Create button control from given arguments

        Parameters:
        context - the android context
        text - the text which is going to set on button
        textSize - the text size in pixels which is going to set on button
        accessibilityId - the id which is going to set on button
        Returns:

        newly generated instance of Button

      • updateSkipBtnColor

         static void updateSkipBtnColor(@NonNull() Context context, @NonNull() ImageView skipBtn, @ColorRes() int colorId)

        Update close button with black background

        Parameters:
        context - activity/application context
        skipBtn - instance of close button
        colorId - color id to be set on skip button
      • bringViewsToFront

         static void bringViewsToFront(@NonNull() Array<View> views)

        Used to bring the list of view tp front. Note - Please pass the list of view in the reverse sequence in which the views should be displayed in the hierarchy from top to bottom. For Example - Top view - View1, View2, View3, View4, .... , ViewN Pass the list in the format - [ViewN, .... , View4, View3, View2, View1]

        Parameters:
        views - List of view to bring to front in reverse order of the top view hierarchy