InterstitialAdConfig interstitialAdConfig =
new InterstitialAdConfig.Builder()
.topIcon(R.drawable.bz_ic_checked_circle)
.titleText("지금 바로 참여하고 포인트 받기")
.textColor(android.R.color.white)
.layoutBackgroundColor(R.color.colorPrimaryDark)
.ctaViewBackgroundColorList(getBackgroundColorStateList())
.ctaRewardDrawable(R.drawable.bz_ic_custom_reward)
.ctaParticipatedDrawable(R.drawable.bz_ic_btn_more)
.ctaViewTextColor(getTextColorStateList())
.build();
final InterstitialAdHandler interstitialAdHandler = new InterstitialAdHandlerFactory()
.create("YOUR_INTERSTITIAL_UNIT_ID", InterstitialAdHandler.Type.Dialog);
interstitialAdHandler.show(MainActivity.this, interstitialAdConfig);
private ColorStateList getBackgroundColorStateList() {
final int[][] states = new int[][]{
new int[]{android.R.attr.state_enabled}, // enabled
new int[]{android.R.attr.state_pressed} // pressed
};
final int[] colors = new int[]{
ContextCompat.getColor(this, android.R.color.holo_green_light),
ContextCompat.getColor(this, android.R.color.holo_green_dark)
};
return new ColorStateList(states, colors);
}
private ColorStateList getTextColorStateList() {
int[][] states = new int[][]{
new int[]{android.R.attr.state_enabled}, // enabled
new int[]{android.R.attr.state_pressed} // pressed
};
int[] colors = new int[]{
Color.WHITE,
Color.WHITE
};
return new ColorStateList(states, colors);
}context, interstitialAdConfig); |