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 ImageButtoncreateDsaInfoIconButton(@NonNull() Context context, @IdRes() int btnId, @DrawableRes() int resId, boolean isFullScreen, boolean isPositionBottom)Create circular DSA info button. static voidresizeDsaInfoBtn(@NonNull() Context mContext, @NonNull() ImageButton dsaIcon, boolean expanded)Resizes the dsa 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 -
-
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
-
createDsaInfoIconButton
@NonNull() static ImageButton createDsaInfoIconButton(@NonNull() Context context, @IdRes() int btnId, @DrawableRes() int resId, boolean isFullScreen, boolean isPositionBottom)
Create circular DSA info button. DSA 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 DSA position is on bottom, false otherwise- Returns:
close button
-
resizeDsaInfoBtn
static void resizeDsaInfoBtn(@NonNull() Context mContext, @NonNull() ImageButton dsaIcon, boolean expanded)
Resizes the dsa 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
-
-
-
-