Floating Notification for Android app - Facebook ChatHeads Notification system

Overview

FloatingView (Application Demo on Play Store)

DEPRECATED SEE FloatingView


Floating View for Android app - Facebook ChatHeads Notification system This is a demo of how works Facebook ChatHeads.

Details

Basiclay all you need to do is to create a service (background running) with image View like this :

windowManager = (WindowManager) getSystemService(WINDOW_SERVICE);

    chatHead = new ImageView(this);
  	chatHead.setImageResource(R.drawable.floating2);

		final WindowManager.LayoutParams params = new WindowManager.LayoutParams(
				WindowManager.LayoutParams.WRAP_CONTENT,
				WindowManager.LayoutParams.WRAP_CONTENT,
				WindowManager.LayoutParams.TYPE_PHONE,
				WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE,
				PixelFormat.TRANSLUCENT);

		params.gravity = Gravity.TOP | Gravity.LEFT;
		params.x = 0;
		params.y = 100;

Then start your service :

    startService(new Intent(MainActivity.this, ServiceFloating.class));

If you wanna have a floating window, you can use PopupWindow :

      LayoutInflater layoutInflater = (LayoutInflater)getBaseContext().getSystemService(LAYOUT_INFLATER_SERVICE);  
  		View popupView = layoutInflater.inflate(R.layout.popup, null);  
			pwindo = new PopupWindow(popupView, LayoutParams.WRAP_CONTENT,  LayoutParams.WRAP_CONTENT);  
			if(_enable == true) {
			pwindo.showAsDropDown(chatHead, 50, -30);

Screenshots

Floating1 Floating2

License

This work is under the MIT License (MIT)

Comments
  • Which settings to import for canDrawOverlays?

    Which settings to import for canDrawOverlays?

    While compiling the project I'm getting a problem with the Settings which is showing a mismatch. Could you suggest which settings should i use? Error:(84, 8) error: cannot find symbol variable Settings

    opened by beingentangled 3
  • Having `gradlew[.bat]` without `gradle` folder is brocken state

    Having `gradlew[.bat]` without `gradle` folder is brocken state

    There should be either gradle folder or gradlew[.bat] should be removed.

    @marshallino16 Anthony, do you need PR for that? I can update build to latest.

    opened by paulvi 3
  • On Android L preview - the icon color does not change

    On Android L preview - the icon color does not change

    Hello. I compiled from source. On Android 4.4.4 it works fine. But on Android L preview device (Nexus 7 2013) the color of the icon ignores the selection.

    Thought I should report it to you ;) Thank you for the App.

    opened by RoundSparrow 2
  • Convert to gradle project

    Convert to gradle project

    I converted the project using Android Studio to gradle. Not much changed, mostly file moves, added a .gitignore and added HoloColorPicker as a gradle dependency.

    The newest HoloColorPicker had a different package naming though. I'm not sure if it broke something, but it looked okay in the Android emulator.

    opened by strayer 1
  • License

    License

    Hi,

    I'm currently thinking about building an app that uses some kind of floating notifications just like this app does. The project misses a license, sadly, so I can't simply base my work on it.

    What are your thoughts about this? I'd suggest taking a look at choosealicense.com and addalicense.com, those pages make it pretty easy to choose a license that fits your needs and may allow people like me to learn and derive from your work.

    Thanks!

    opened by strayer 1
  • Unable to add to window

    Unable to add to window

    i can't understand this issue and this is only in onePlus 3 device

    Fatal Exception: java.lang.RuntimeException: Unable to create service com.skytesters.app.floatingmenu.service.ServiceFloating: android.view.WindowManager$BadTokenException: Unable to add window -- window android.view.ViewRootImpl$W@efad162 has already been added at android.app.ActivityThread.handleCreateService(ActivityThread.java:3308) at android.app.ActivityThread.-wrap5(ActivityThread.java) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1617) at android.os.Handler.dispatchMessage(Handler.java:102) at android.os.Looper.loop(Looper.java:154) at android.app.ActivityThread.main(ActivityThread.java:6290) at java.lang.reflect.Method.invoke(Method.java) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:886) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:776) Caused by android.view.WindowManager$BadTokenException: Unable to add window -- window android.view.ViewRootImpl$W@efad162 has already been added at android.view.ViewRootImpl.setView(ViewRootImpl.java:709) at android.view.WindowManagerGlobal.addView(WindowManagerGlobal.java:342) at android.view.WindowManagerImpl.addView(WindowManagerImpl.java:94) at com.skytesters.app.floatingmenu.service.ServiceFloating.onCreate(ServiceFloating.java:61) at android.app.ActivityThread.handleCreateService(ActivityThread.java:3298) at android.app.ActivityThread.-wrap5(ActivityThread.java) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1617) at android.os.Handler.dispatchMessage(Handler.java:102) at android.os.Looper.loop(Looper.java:154) at android.app.ActivityThread.main(ActivityThread.java:6290) at java.lang.reflect.Method.invoke(Method.java) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:886) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:776)

    opened by AkshayBaldia 0
Owner
Fernandez Anthony
Lead Innovation @Pictarine
Fernandez Anthony
StandOut lets you easily create floating windows in your Android app.

Coming Soon Meanwhile, checkout the demo video at http://www.youtube.com/watch?v=S3vHjxonOeg Join the conversation at http://forum.xda-developers.com/

Mark Wei 1.2k Dec 12, 2022
FloatingView can make the target view floating above the anchor view with cool animation

FloatingView FloatingView can make the target view floating above the anchor view with cool animation Links δΈ­ζ–‡η‰ˆ README Blog about FloatingView demo.ap

UFreedom 1.8k Dec 27, 2022
Floating label input widgets

Android Floating Label Widgets A set of input widgets with a hint label that floats when input is not empty. Demo A demo of the widget is worth a thou

MarvinLabs 450 Nov 25, 2022
Simple and lightweight UI library for user new experience, combining floating bottom navigation and bottom sheet behaviour. Simple and beautiful.

Simple and lightweight UI library for user new experience, combining floating bottom navigation and bottom sheet behaviour. Simple and beautiful.

Rizki Maulana 118 Dec 14, 2022
An Android library supports badge notification like iOS in Samsung, LG, Sony and HTC launchers.

ShortcutBadger: The ShortcutBadger makes your Android App show the count of unread messages as a badge on your App shortcut! Supported launchers: Sony

Leo Lin 7.2k Dec 30, 2022
πŸͺ„ It's a library that helps you customize your notification bar

NotificationBarCustom ?? It's a library that helps you customize your notification bar Demo Contrast(white) Contrast(black) Transparent Setup Add it i

박상선 8 Sep 7, 2022
Displays your screen time in a permanent notification.

Screen Time Displays your screen time in a permanent notification. By making screen time more prominent, you can get a better sense of how much of the

Markus Fisch 24 Nov 29, 2022
MIUINativeNotifyIcon - Fix the native notification bar icon function abandoned by the MIUI development team

MIUI εŽŸη”Ÿι€šηŸ₯ε›Ύζ ‡ Fix the native notification bar icon function abandoned by the MIUI

Fankesyooni 189 Jan 4, 2023
[] Apply background tinting to the Android system UI when using KitKat translucent modes

Android System Bar Tint Apply background tinting to the Android system UI when using KitKat translucent modes. Android 4.4 (KitKat) introduced translu

Jeff Gilfelt 5.4k Dec 9, 2022
Celebrate more with this lightweight confetti particle system 🎊

Konfetti ?? ?? Celebrate more with this lightweight confetti particle system. Create realistic confetti by implementing this easy to use library. Demo

Dion Segijn 2.7k Jan 2, 2023
Awesome RunnerBe design system and more!

Honeycomb Awesome RunnerBe design system and more! Core Preview 아직 λͺ¨λ“  μš”μ†Œκ°€ κ΅¬ν˜„λ˜μ§€ μ•Šμ•˜μœΌλ©° λ‹¨μˆœνžˆ 미리보기 μž…λ‹ˆλ‹€ class MainActivity : AppCompatActivity() { overri

RunnerBe 2 Apr 21, 2022
NeoPOP was created with one simple goal; to create the next generation of a beautiful, affirmative design system

NeoPop is CRED's inbuilt library for using NeoPop components in your app

CRED 254 Dec 29, 2022
A tiny window overlay to log app internal on top of your android app

DebugOverlay A logcat alike overlay to display log messages in your app as independent overlay. Typically in android you would log some app internals

Hannes Dorfmann 150 Nov 29, 2022
This a Ride User app in which in integrate almost every features of a Ride Share app.

My-Ride-App This a Ride app(User) in which I integrate almost every features of a Ride Share app. Here I use kotlin programing language, Google map SD

Khairul Islam 5 Apr 27, 2022
Useful library to use custom fonts in your android app

EasyFonts A simple and useful android library to use custom fonts in android apps without adding fonts into asset/resource folder.Also by using this l

Vijay Vankhede 419 Sep 9, 2022
A util for setting status bar style on Android App.

StatusBarUtil A util for setting status bar style on Android App. It can work above API 19(KitKat 4.4). δΈ­ζ–‡η‰ˆη‚Ήζˆ‘ Sample Download StatusBarUtil-Demo Chang

Jaeger 8.8k Jan 7, 2023
Make a cool intro for your Android app.

AppIntro AppIntro is an Android Library that helps you build a cool carousel intro for your App. AppIntro has support for requesting permissions and h

AppIntro Team 10.3k Dec 30, 2022
Modern About Box for an Android App

About Box A modern About Box for an Android App built on the daniel-stoneuk/material-about-library. Easily display the common items of an About Box in

Quality Mobile Puzzle Apps 91 Nov 11, 2022
A lightweight non intrusive app rate reminder for Android

Discreet App Rate A lightweight non intrusive app rate reminder for Android Download repositories { mavenCentral() } dependencies { compile '

Nicolas POMEPUY 469 Nov 10, 2022