...
CTA Color 변경
여기에서는 CTA color 변경을 설명합니다. Color 변경 외에 CtaView를 Default로 제공되는 View가 아닌, 다른 모양의 View로 만들고 싶으신 경우 여기를 참조해주세요.
 | 기본 Color |
 | 변경 된 Color |
project 의 colors.xml 파일에 아래의 color resource 값을 추가 하면 CTA color 가 변경됩니다. (Benefit 의 모든 CTA Color 가 변경됩니다.)
...
Code Block |
---|
{
"id": 5,
"unit_id": 1234567890,
"message": "오늘도 아케이드 게임하고 추가최대 포인트90P 팡팡!",
"landing_url": "deeplink://landing?activity=arcade",
"start_date": "2020-03-01T00:00:00Z",
"end_date": "2020-03-31T23:59:59Z",
"start_hour_minute": "21:00",
"end_hour_minute": "23:00",
"dipu": 2,
"tipu": 60,
"dcpu": 1,
"tcpu": 30,
"icon": "http://imagelocation/arcade_icon.png"
} |
...
Expand |
---|
|
Code Block |
---|
public class MyPopAdMessageView extends PopAdMessageView {
private TextView textTitle, textDescription;
public MyPopAdMessageView(@NonNull Context context) {
super(context);
LayoutInflater.from(context).inflate(R.layout.view_my_pop_ad_message, this);
this.textTitle = findViewById(R.id.textTitle);
this.textDescription = findViewById(R.id.textDescription);
}
@Override
public void updateView(int reward, int remainSeconds) {
textTitle.setText(reward + "포인트 적립 가능합니다.");
textDescription.setText(remainSeconds + "초 후에 닫힙니다.");
}
@Override
public int getDurationInSeconds() {
return 5;
}
}
|
|
사용법
Code Block |
---|
new PopConfig.Builder(getApplicationContext(), "POP_UNIT_ID")
.popAdMessageViewClass(MyPopAdMessageView.class) |
...
Expand |
---|
|
Code Block |
---|
import com.buzzvil.buzzad.benefit.presentation.article.NativeArticleView;
public class MyPopArticleMessageView extends PopArticleMessageView {
private final NativeArticleView nativeArticleView;
private TextView textTitle, textDescription;
public MyPopArticleMessageView(@NonNull Context context) {
super(context);
LayoutInflater.from(context).inflate(R.layout.bz_view_article_message, this);
this.nativeArticleView = findViewById(R.id.my_pop_message_native_article);
this.textTitle = findViewById(R.id.textTitle);
this.textDescription = findViewById(R.id.textDescription);
}
@Override
public void updateView(@Nullable String title, int remainSeconds) {
textTitle.setText(title);
textDescription.setText(remainSeconds + "초 후에 닫힙니다.");
}
@NonNull
@Override
public NativeArticleView getNativeArticleView() {
return nativeArticleView;
}
@Override
public int getDurationInSeconds() {
return 5;
}
}
|
|
사용법
Code Block |
---|
new PopConfig.Builder(getApplicationContext(), "POP_UNIT_ID")
.popArticleMessageViewClass(MyPopArticleMessageView.class) |
...