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

Commit

Permalink
Fix sample
Browse files Browse the repository at this point in the history
- use ChatHeadService.EXTRA_CUTOUT_SAFE_AREA
  • Loading branch information
YoshihideSogawa committed Oct 4, 2018
1 parent 13c0520 commit 0c7b987
Showing 1 changed file with 10 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -156,9 +156,17 @@ private static void startFloatingViewService(Activity activity, boolean isCustom
}

// launch service
final Class<? extends Service> service = isCustomFloatingView ? CustomFloatingViewService.class : ChatHeadService.class;
final Class<? extends Service> service;
final String key;
if (isCustomFloatingView) {
service = CustomFloatingViewService.class;
key = CustomFloatingViewService.EXTRA_CUTOUT_SAFE_AREA;
} else {
service = ChatHeadService.class;
key = ChatHeadService.EXTRA_CUTOUT_SAFE_AREA;
}
final Intent intent = new Intent(activity, service);
intent.putExtra(CustomFloatingViewService.EXTRA_CUTOUT_SAFE_AREA, FloatingViewManager.findCutoutSafeArea(activity));
intent.putExtra(key, FloatingViewManager.findCutoutSafeArea(activity));
ContextCompat.startForegroundService(activity, intent);
}
}

0 comments on commit 0c7b987

Please sign in to comment.