Versions Compared

Key

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

...

Set CustomPedometerPopHeaderViewAdapter and PopHeaderConfig

Info

Benefit SDK 2.17 이상

  1. PopConfig.feedHeaderViewAdapterClass 를 통해 CustomPedometerPopHeaderViewAdapter.class 를 사용하도록 설정

  2. CustomPedometerPopHeaderViewAdapter class 생성: PedometerPopHeaderViewAdapter 를 상속

  3. PopHeaderConfig 를 통해 customizing 설정

Code Block
final PopConfig popConfig = new PopConfig.Builder(getApplicationContext(), UNIT_ID_POP)
        ...
        .feedHeaderViewAdapterClass(CustomPedometerPopHeaderViewAdapter.class)
        ...
        .build();

public class CustomPedometerPopHeaderViewAdapter extends PedometerPopHeaderViewAdapter {
    @Override
    public PedometerPopHeaderConfig buildPopHeaderConfig(Context context) {
        return new PedometerPopHeaderConfig.Builder(context)
                .stepCountDescription()
                .progressChartColor()
                .progressChartGuideColor()
                .inProgressDescription()
                .rewardableDescription()
                .progressIconResId()
                .descriptionIconResId()
                .boundaryImageResId()
                .build();
    }
}

Note

Benefit SDK 2.17 미만

  1. FeedConfig.feedHeaderViewAdapterClass 를 통해 CustomPedometerPopHeaderViewAdapter.class 를 사용하도록 설정

  2. CustomPedometerPopHeaderViewAdapter class 생성: PedometerPopHeaderViewAdapter 를 상속

  3. PopHeaderConfig 를 통해 customizing 설정

...