Class POBUIUtil
-
- All Implemented Interfaces:
public class POBUIUtilUtility class for Common UI controls
-
-
Constructor Summary
Constructors Constructor Description POBUIUtil()
-
Method Summary
Modifier and Type Method Description static ImageButtoncreateSkipButton(@NonNull() Context context, @IdRes() int btnId, @DrawableRes() int resId)Create circular close button. static ImageButtoncreateAdInfoIconButton(@NonNull() Context context, @IdRes() int btnId, @DrawableRes() int resId, boolean isFullScreen, boolean isPositionBottom)Create circular ad info info button. static voidresizeAdInfoIconBtn(@NonNull() Context mContext, @NonNull() ImageButton adInfoIcon, boolean expanded)Resizes the ad info info button based on the parameters received. static voidupdateSkipButtonToCloseButton(@NonNull() ImageButton button)Method to update forward button to close button static TextViewcreateSkipDurationTextView(@NonNull() Context context, int id)Creates skip duration TextView component static FrameLayout.LayoutParamsgetLayoutParamsForTopRightPosition(@NonNull() Context context)Layout Params for Top Right corner of the view. static TextViewcreateTextView(@NonNull() Context context, @Nullable() String text, float textSize, int accessibilityId)Create button control from given arguments static StringgetLocalizedStringForKey(@NonNull() Context context, @NonNull() String key, @NonNull() String defaultValue)Returns the localized title text for given key static voidupdateSkipBtnColor(@NonNull() Context context, @NonNull() ImageView skipBtn, @ColorRes() int colorId)Update close button with black background static ImageViewcreateWatermarkView(@NonNull() Context context, @NonNull() String encodedWatermarkImage)Used to create the ImageView with the watermark image passed or return null if failed to create the watermark static voidbringViewsToFront(@NonNull() Array<View> views)Used to bring the list of view tp front. -
-
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 contextbtnId- the resource id which is going to set as button idresId- the resource id which is going to set as button imageisFullScreen- true if full screen, false otherwiseisPositionBottom- 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
-
updateSkipButtonToCloseButton
static void updateSkipButtonToCloseButton(@NonNull() ImageButton button)
Method to update forward button to close button
- Parameters:
button- instance of button to be updated
-
createSkipDurationTextView
@NonNull() static TextView createSkipDurationTextView(@NonNull() Context context, int id)
Creates skip duration TextView component
- Parameters:
context- activity contextid- the resource id which is going to set as button id- Returns:
instance of skip duration button
-
getLayoutParamsForTopRightPosition
@NonNull() static FrameLayout.LayoutParams getLayoutParamsForTopRightPosition(@NonNull() Context context)
Layout Params for Top Right corner of the view.
- Parameters:
context- the context- Returns:
the instance of FrameLayout.LayoutParams
-
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 contexttext- the text which is going to set on buttontextSize- the text size in pixels which is going to set on buttonaccessibilityId- the id which is going to set on button- Returns:
newly generated instance of Button
-
getLocalizedStringForKey
@NonNull() static String getLocalizedStringForKey(@NonNull() Context context, @NonNull() String key, @NonNull() String defaultValue)
Returns the localized title text for given key
- Parameters:
context- the android contextkey- key for the localized StringdefaultValue- default Value of the localized string- Returns:
localized title text
-
updateSkipBtnColor
static void updateSkipBtnColor(@NonNull() Context context, @NonNull() ImageView skipBtn, @ColorRes() int colorId)
Update close button with black background
- Parameters:
context- activity/application contextskipBtn- instance of close buttoncolorId- color id to be set on skip button
-
createWatermarkView
@Nullable() static ImageView createWatermarkView(@NonNull() Context context, @NonNull() String encodedWatermarkImage)
Used to create the ImageView with the watermark image passed or return null if failed to create the watermark
-
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
-
-
-
-