Skip to content
This repository was archived by the owner on Feb 3, 2020. It is now read-only.

Commit 0c7b987

Browse files
Fix sample
- use ChatHeadService.EXTRA_CUTOUT_SAFE_AREA
1 parent 13c0520 commit 0c7b987

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

sample/src/main/java/jp/co/recruit_lifestyle/sample/fragment/FloatingViewControlFragment.java

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -156,9 +156,17 @@ private static void startFloatingViewService(Activity activity, boolean isCustom
156156
}
157157

158158
// launch service
159-
final Class<? extends Service> service = isCustomFloatingView ? CustomFloatingViewService.class : ChatHeadService.class;
159+
final Class<? extends Service> service;
160+
final String key;
161+
if (isCustomFloatingView) {
162+
service = CustomFloatingViewService.class;
163+
key = CustomFloatingViewService.EXTRA_CUTOUT_SAFE_AREA;
164+
} else {
165+
service = ChatHeadService.class;
166+
key = ChatHeadService.EXTRA_CUTOUT_SAFE_AREA;
167+
}
160168
final Intent intent = new Intent(activity, service);
161-
intent.putExtra(CustomFloatingViewService.EXTRA_CUTOUT_SAFE_AREA, FloatingViewManager.findCutoutSafeArea(activity));
169+
intent.putExtra(key, FloatingViewManager.findCutoutSafeArea(activity));
162170
ContextCompat.startForegroundService(activity, intent);
163171
}
164172
}

0 commit comments

Comments
 (0)