Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  1. CustomPopToolbarHolder class

    Code Block
    languagejava
    // DefaultPopToolbarHolder 상속
    public class CustomPopToolbarHolder extends DefaultPopToolbarHolder {
        @Override
        public View getView(Activity activity, @NonNull final String unitId) {
            // 직접 구성한 layout 을 사용합니다
            ViewGroup root =  (ViewGroup) activity.getLayoutInflater().inflate(R.layout.view_pop_custom_toolbar, null);
    
            View buttonInquiry = root.findViewById(R.id.buttonInquiry);
            buttonInquiry.setOnClickListener(new View.OnClickListener() {
                @Override
                public void onClick(View v) {
                    // 문의하기 페이지 열기
                    showInquiry(activity, unitId);
                }
            });
            return root;
        }
    }
  2. CustomPopToolbarHolder에서 사용하는 layout.view_pop_custom_toolbar

    Code Block
    languagexml
    <?xml version="1.0" encoding="utf-8"?>
    <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:gravity="center_vertical"
        android:orientation="horizontal"
        android:background="@color/bzv_white_100">
    
        <LinearLayout
            android:layout_width="0dp"
            android:layout_height="wrap_content"
            android:layout_weight="1"
            android:gravity="center_vertical"
            android:orientation="horizontal"
            android:paddingLeft="16dp">
    
            <ImageView
                android:id="@+id/imageIcon"
                android:layout_width="154dp"
                android:layout_height="24dp"
                android:src="@drawable/bz_img_buzzvil_logo" />
    
        </LinearLayout>
    
        <LinearLayout
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:gravity="center_vertical">
    
            <ImageView
                android:id="@+id/buttonInquiry"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_gravity="center_vertical"
                android:layout_marginRight="16dp"
                android:src="@drawable/bzv_ic_circle_question"
                android:tint="@color/bzv_gray_light" />
    
        </LinearLayout>
    
    </LinearLayout>

Custom Feedback (Snackbar, Toast)

...

팝 지면에서 보여주는 다양한 피드백을 customize 할 수 있습니다. 오른쪽의 이미지는 피드 오픈 리워드 피드백을 customize 했을 때 보여주는 커스텀 피드백입니다.

Info

2.7.0 미만의 버전에서는 Toast 가 항시 노출됩니다.

다음의 적용이 필요합니다.

  1. PopFeedbackHandler 인터페이스를 구현하는 커스텀 클래스를 생성합니다. 기본으로 제공되는 피드백의 일부를 사용하고 싶다면, DefaultPopFeedbackHandler를 확장하는 것을 권장합니다. (하단의 PopFeedbackHandler 인터페이스에 대한 부연 설명을 참고)

  2. PopConfig를 초기화할 때에, 이전 스텝에서 생성한 Custom PopFeedbackHandler 클래스를 넘겨줍니다.

Expand
title예시 코드
Code Block
languagekotlin
class CustomPopFeedbackHandler : DefaultPopFeedbackHandler() {
    override fun notifyFeedLaunchReward(
        context: Context,
        view: View,
        canUseSnackbar: Boolean,
        reward: Int
    ) {
        val message = "Customized feed launch reward message"

        if (canUseSnackbar) {
            showSnackbar(context, view, message)
        } else {
            showToast(context, message)
        }
    }

    ...
}
Code Block
languagejava
final PopConfig popConfig = new PopConfig.Builder(this, unitIdPop)
      ...
      .PopFeedbackHandlerClass(CustomPopFeedbackHandlerClass.class)
      ...
      .build();

PopFeedbackHandler Interface

Code Block
languagekotlin
interface PopFeedbackHandler {
    fun notifyFeedLaunchReward(context: Context, view: View, canUseSnackbar: Boolean, reward: Int)

    fun notifyNativeAdReward(context: Context, view: View, canUseSnackbar: Boolean, reward: Int)

    fun notifyPottoDrawOneMore(context: Context, view: View, canUseSnackbar: Boolean)

    fun notifyPottoStatus(context: Context, view: View, canUseSnackbar: Boolean)
}

methods

Description

notifyFeedLaunchReward

피드 오픈 리워드 피드백을 보여줍니다.

notifyNativeAdReward

광고 적립 피드백을 보여줍니다.

notifyPottoDrawOneMore

포또 한번 더 뽑기 피드백을 보여줍니다.

notifyPottoStatus

포또 뽑기가 가능한 상태일 때를 알려주는 피드백을 보여줍니다. 해당 피드백은 한 번 만 노출됩니다.

Parameters

Description

context: Context

snackbar나 toast를 사용할 때 인수로 넘겨주는 context입니다.

view: View

snackbar를 사용할 때 인수로 넘겨주는 view입니다.

canUseSnackbar: Boolean

snackbar를 사용할 수 있는 상태인지를 알려주는 flag입니다.

reward: Int

적립된 리워드 포인트 양을 나타내는 인수입니다. 해당 인수를 사용해서 커스텀 메시지를 formatting 하면 유저에게 좀 더 구체적인 피드백을 제공할 수 있습니다.

Custom in-app-landing

유틸리티 영역이나 툴바 영역에 버튼을 추가한 경우, 버튼을 클릭했을때 유저를 새로운 activity로 랜딩시키거나 fragment로 랜딩시킬 수 있습니다. (fragment를 이용하는 경우, 보다 자연스러운 UX를 만들 수 있습니다.)

...