pingpongboss / standout Goto Github PK
View Code? Open in Web Editor NEWStandOut lets you easily create floating windows in your Android app.
Home Page: http://pingpongboss.github.com/StandOut
License: MIT License
StandOut lets you easily create floating windows in your Android app.
Home Page: http://pingpongboss.github.com/StandOut
License: MIT License
I added the android contacts icon to the folder and clicked on it:
06-15 11:08:24.349: E/AndroidRuntime(13911): FATAL EXCEPTION: main
06-15 11:08:24.349: E/AndroidRuntime(13911): android.content.ActivityNotFoundException: Unable to find explicit activity class {com.android.htccontacts/com.android.internal.app.ResolverActivity}; have you declared this activity in your AndroidManifest.xml?
06-15 11:08:24.349: E/AndroidRuntime(13911): at android.app.Instrumentation.checkStartActivityResult(Instrumentation.java:1565)
06-15 11:08:24.349: E/AndroidRuntime(13911): at android.app.Instrumentation.execStartActivity(Instrumentation.java:1539)
06-15 11:08:24.349: E/AndroidRuntime(13911): at android.app.ContextImpl.startActivity(ContextImpl.java:679)
06-15 11:08:24.349: E/AndroidRuntime(13911): at android.content.ContextWrapper.startActivity(ContextWrapper.java:258)
06-15 11:08:24.349: E/AndroidRuntime(13911): at wei.mark.example.floatingfolders.FloatingFolder$6.onClick(FloatingFolder.java:336)
06-15 11:08:24.349: E/AndroidRuntime(13911): at android.view.View.performClick(View.java:2532)
06-15 11:08:24.349: E/AndroidRuntime(13911): at android.view.View$PerformClick.run(View.java:9277)
06-15 11:08:24.349: E/AndroidRuntime(13911): at android.os.Handler.handleCallback(Handler.java:587)
06-15 11:08:24.349: E/AndroidRuntime(13911): at android.os.Handler.dispatchMessage(Handler.java:92)
06-15 11:08:24.349: E/AndroidRuntime(13911): at android.os.Looper.loop(Looper.java:143)
06-15 11:08:24.349: E/AndroidRuntime(13911): at android.app.ActivityThread.main(ActivityThread.java:4196)
06-15 11:08:24.349: E/AndroidRuntime(13911): at java.lang.reflect.Method.invokeNative(Native Method)
06-15 11:08:24.349: E/AndroidRuntime(13911): at java.lang.reflect.Method.invoke(Method.java:507)
06-15 11:08:24.349: E/AndroidRuntime(13911): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)
06-15 11:08:24.349: E/AndroidRuntime(13911): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)
06-15 11:08:24.349: E/AndroidRuntime(13911): at dalvik.system.NativeStart.main(Native Method)
Hi.
I have this portion of code in display the floating window but somehow when I put a breakpoint it doesnt call createAndAttachView of the VideoClass.java file.
StandOutWindow.closeAll(context, VideoWindow.class);
StandOutWindow.show(context, VideoWindow.class,StandOutWindow.DEFAULT_ID);
Can you please let me know what might be the issue?
orientation change and StandOutFlags.FLAG_WINDOW_EDGE_LIMITS_ENABLE doesnot update limits for the window.
When I start the app with portrait mode and then change to landscape it still has edge limit for portrait only, how can we update the limit when orientation is changed
Unable to add window android.view.ViewRootImpl$W@8d54593 -- permission denied for window type 2002
How to hide window on HOME button click or app goes in background?
As I want to use standout window in app only. When app goes in background/destroy, window should hide.
Kindly suggest solution.
I use floatingfolders project to test.
When screen orientation is portrait, the float window can move to everywhere of the screen, but if I change screen orientation to landscape, the float window can not move to the right half of the screen.
I want to fix the upper left corner to zoom ?
I want to show the standout on screenlock.
Ok when i wanted to open the app the second time i got:
06-15 11:04:29.650: E/AndroidRuntime(13895): FATAL EXCEPTION: main
06-15 11:04:29.650: E/AndroidRuntime(13895): java.lang.RuntimeException: Unable to start service wei.mark.example.floatingfolders.FloatingFolder@405241e8 with Intent { act=SEND_DATA cmp=wei.mark.example/.floatingfolders.FloatingFolder (has extras) }: java.lang.NullPointerException
06-15 11:04:29.650: E/AndroidRuntime(13895): at android.app.ActivityThread.handleServiceArgs(ActivityThread.java:2338)
06-15 11:04:29.650: E/AndroidRuntime(13895): at android.app.ActivityThread.access$2800(ActivityThread.java:132)
06-15 11:04:29.650: E/AndroidRuntime(13895): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1106)
06-15 11:04:29.650: E/AndroidRuntime(13895): at android.os.Handler.dispatchMessage(Handler.java:99)
06-15 11:04:29.650: E/AndroidRuntime(13895): at android.os.Looper.loop(Looper.java:143)
06-15 11:04:29.650: E/AndroidRuntime(13895): at android.app.ActivityThread.main(ActivityThread.java:4196)
06-15 11:04:29.650: E/AndroidRuntime(13895): at java.lang.reflect.Method.invokeNative(Native Method)
06-15 11:04:29.650: E/AndroidRuntime(13895): at java.lang.reflect.Method.invoke(Method.java:507)
06-15 11:04:29.650: E/AndroidRuntime(13895): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)
06-15 11:04:29.650: E/AndroidRuntime(13895): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)
06-15 11:04:29.650: E/AndroidRuntime(13895): at dalvik.system.NativeStart.main(Native Method)
06-15 11:04:29.650: E/AndroidRuntime(13895): Caused by: java.lang.NullPointerException
06-15 11:04:29.650: E/AndroidRuntime(13895): at wei.mark.example.floatingfolders.FloatingFolder.onReceiveData(FloatingFolder.java:219)
06-15 11:04:29.650: E/AndroidRuntime(13895): at wei.mark.standout.StandOutWindow.onStartCommand(StandOutWindow.java:505)
06-15 11:04:29.650: E/AndroidRuntime(13895): at android.app.ActivityThread.handleServiceArgs(ActivityThread.java:2321)
06-15 11:04:29.650: E/AndroidRuntime(13895): ... 10 more
Lets say I have a simple window on top of an activity's button. How can I press the button through the simple window?
Hi,
How can I query to database from class extended standoutwindow?
any help can be useful.
thanks
Is there any way to get Active Windows both Hidden and Shown ???????
Hey thank you for this library..
I am facing this issue at Android 6.
android.view.WindowManager$BadTokenException: Unable to add window android.view.ViewRootImpl$W@480c247 -- permission denied for this window type
07-13 19:09:23.481 15732-15732/com.spoofer W/System.err: at android.view.ViewRootImpl.setView(ViewRootImpl.java:599)
07-13 19:09:23.481 15732-15732/com.spoofer W/System.err: at android.view.WindowManagerGlobal.addView(WindowManagerGlobal.java:310)
07-13 19:09:23.481 15732-15732/com.spoofer W/System.err: at android.view.WindowManagerImpl.addView(WindowManagerImpl.java:85)
07-13 19:09:23.481 15732-15732/com.spoofer W/System.err: at com.spoofer.dp_widget.lib.StandOutWindow.show(StandOutWindow.java:1113)
07-13 19:09:23.481 15732-15732/com.spoofer W/System.err: at com.spoofer.dp_widget.lib.StandOutWindow.onStartCommand(StandOutWindow.java:386)
07-13 19:09:23.481 15732-15732/com.spoofer W/System.err: at android.app.ActivityThread.handleServiceArgs(ActivityThread.java:3028)
07-13 19:09:23.481 15732-15732/com.spoofer W/System.err: at android.app.ActivityThread.access$2200(ActivityThread.java:157)
Looking at the network graph, i can see that these 3 commits are from branches have not merged back (at least not in a way that github can show)
Hi,
Im not able to play video in full screen when window is floating/idle. The same happens when i try to play video in youtube or any other App.
Please Help
in API26, API27, it is not showing .
I was implementing Application run on API 22 and API 23, got issue with Dropdown List Menu, it shows within the box. And I tried to set dropDown.setClippingEnabled(true); But if the column too long, content shows outside the screen.
Please help!!
I modified your StandOutExampleActivity to show VideoView in frame, I also modify my XML but VideoView is not showing in frame.
Here is the modified files.
StandOutExampleActivity
package wei.mark.example;
import wei.mark.standout.StandOutWindow;
import android.app.Activity;
import android.os.Bundle;
import android.widget.MediaController;
import android.widget.VideoView;
public class StandOutExampleActivity extends Activity {
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
StandOutWindow.closeAll(this, SimpleWindow.class);
StandOutWindow
.show(this, SimpleWindow.class, StandOutWindow.DEFAULT_ID);
// show a MultiWindow, SimpleWindow
setContentView(R.layout.simple);
final VideoView videoView = (VideoView) findViewById(R.id.videoView1);
videoView.setVideoPath("http://10.0.2.2/a.mp4");
// MediaController mediaController = new MediaController(this);
// mediaController.setAnchorView(videoView);
// videoView.setMediaController(mediaController);
videoView.start();
/*
* StandOutWindow.show(this, StandOutMostBasicWindow.class,
* StandOutWindow.DEFAULT_ID);
*/
finish();
}
}
simple.xml
<?xml version="1.0" encoding="utf-8"?>
<merge xmlns:android="http://schemas.android.com/apk/res/android" >
<RelativeLayout
android:layout_width="fill_parent"
android:layout_height="128dp"
android:background="#aaff0000"
android:orientation="vertical"
android:padding="8dp" >
<VideoView
android:id="@+id/videoView1"
android:layout_width="200dp"
android:layout_height="200dp" />
<ImageView
android:id="@+id/imageView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_alignParentTop="true"
android:src="@drawable/close" />
</RelativeLayout>
</merge>
If I touch the screen outside of where the window is positioned, is there any way to move the window there?
Maybe caching the displayWidth and displayHeight isn't the way to go.
https://github.com/pingpongboss/StandOut/blob/master/library/src/wei/mark/standout/ui/Window.java#L80
Rotating the screen should also check the window size and bounds to make sure they fit in the screen if need be.
These values don't give the right side and the bottom of the screen if flag
FLAG_WINDOW_EDGE_LIMITS_ENABLE
Is not set.
public static final int RIGHT = Integer.MAX_VALUE;
1783 /**
1784 * Special value for y position that represents the bottom of the
1785 * screen.
*/
public static final int BOTTOM = Integer.MAX_VALUE;
I was just playing around a little bit when this happend:
06-15 10:59:37.395: E/AndroidRuntime(13491): FATAL EXCEPTION: main
06-15 10:59:37.395: E/AndroidRuntime(13491): java.lang.NullPointerException
06-15 10:59:37.395: E/AndroidRuntime(13491): at wei.mark.example.floatingfolders.FloatingFolder$3.onItemClick(FloatingFolder.java:132)
06-15 10:59:37.395: E/AndroidRuntime(13491): at wei.mark.standout.StandOutWindow$7.onTouch(StandOutWindow.java:1640)
06-15 10:59:37.395: E/AndroidRuntime(13491): at android.view.View.dispatchTouchEvent(View.java:3928)
06-15 10:59:37.395: E/AndroidRuntime(13491): at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:943)
06-15 10:59:37.395: E/AndroidRuntime(13491): at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:994)
06-15 10:59:37.395: E/AndroidRuntime(13491): at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:994)
06-15 10:59:37.395: E/AndroidRuntime(13491): at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:994)
06-15 10:59:37.395: E/AndroidRuntime(13491): at android.view.ViewRoot.deliverPointerEvent(ViewRoot.java:2328)
06-15 10:59:37.395: E/AndroidRuntime(13491): at android.view.ViewRoot.handleMessage(ViewRoot.java:1958)
06-15 10:59:37.395: E/AndroidRuntime(13491): at android.os.Handler.dispatchMessage(Handler.java:99)
06-15 10:59:37.395: E/AndroidRuntime(13491): at android.os.Looper.loop(Looper.java:143)
06-15 10:59:37.395: E/AndroidRuntime(13491): at android.app.ActivityThread.main(ActivityThread.java:4196)
06-15 10:59:37.395: E/AndroidRuntime(13491): at java.lang.reflect.Method.invokeNative(Native Method)
06-15 10:59:37.395: E/AndroidRuntime(13491): at java.lang.reflect.Method.invoke(Method.java:507)
06-15 10:59:37.395: E/AndroidRuntime(13491): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)
06-15 10:59:37.395: E/AndroidRuntime(13491): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)
06-15 10:59:37.395: E/AndroidRuntime(13491): at dalvik.system.NativeStart.main(Native Method)
I tried to play a youtube video inside a standoutwindow using android youtube library. I don't think it's possible because youtube view needs a YouTubeBaseActivity, but StandoutWIndow is a Service, therefore YouTubePlayerView cannot be used here. Youtube player library also provides a YouTubePlayerFragment which also cannot be used because StandoutWindow cannot use fragments. I could place a WebView inside a StandOut window and play a youtube video with it. But using a webview is a bit clumsy and it works slower than youtube library.
Also, did you try to play a video from a URL inside a StandoutWIndow?
It's working fine for Android 8 but error with Android 9 and Android 10.
Fatal Exception: android.app.RemoteServiceException: Bad notification for startForeground: java.lang.RuntimeException: invalid channel for service notification: Notification(channel=null pri=0 contentView=null vibrate=null sound=null tick defaults=0x0 flags=0x60 color=0x00000000 vis=SECRET internalType=0 internalPriority=0 internalGroupPriority=0 internalFlag=0)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1965)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loop(Looper.java:224)
at android.app.ActivityThread.main(ActivityThread.java:7081)
at java.lang.reflect.Method.invoke(Method.java)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:536)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:928)
Anyone find solutions for this ?
When has Button onClick, can not to move.
05-07 00:34:30.308 2185-2185/com.example.admin.myapplication E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.example.admin.myapplication, PID: 2185
java.lang.NoClassDefFoundError: Failed resolution of: Lwei/mark/standout/R$id;
at wei.mark.standout.ui.Window.(Window.java:123)
at wei.mark.standout.StandOutWindow.show(StandOutWindow.java:1078)
at wei.mark.standout.StandOutWindow.onStartCommand(StandOutWindow.java:381)
at android.app.ActivityThread.handleServiceArgs(ActivityThread.java:2894)
at android.app.ActivityThread.access$2100(ActivityThread.java:151)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1401)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:135)
at android.app.ActivityThread.main(ActivityThread.java:5254)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:903)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:698)
Caused by: java.lang.ClassNotFoundException: Didn't find class "wei.mark.standout.R$id" on path: DexPathList[[dex file "/data/data/com.example.admin.myapplication/files/instant-run/dex/slice-support-annotations-23.3.0_c67755dd9239b7cd32344b0223290ca5100a4138-classes.dex", dex file "/data/data/com.example.admin.myapplication/files/instant-run/dex/slice-standout_bcbb47795150c084a7b0e1c8ce077377ec96918c-classes.dex", dex file "/data/data/com.example.admin.myapplication/files/instant-run/dex/slice-slice_9-classes.dex", dex file "/data/data/com.example.admin.myapplication/files/instant-run/dex/slice-slice_8-classes.dex", dex file "/data/data/com.example.admin.myapplication/files/instant-run/dex/slice-slice_7-classes.dex", dex file "/data/data/com.example.admin.myapplication/files/instant-run/dex/slice-slice_6-classes.dex", dex file "/data/data/com.example.admin.myapplication/files/instant-run/dex/slice-slice_5-classes.dex", dex file "/data/data/com.example.admin.myapplication/files/instant-run/dex/slice-slice_4-classes.dex", dex file "/data/data/com.example.admin.myapplication/files/instant-run/dex/slice-slice_3-classes.dex", dex file "/data/data/com.example.admin.myapplication/files/instant-run/dex/slice-slice_2-classes.dex", dex file "/data/data/com.example.admin.myapplication/files/instant-run/dex/slice-slice_1-classes.dex", dex file "/data/data/com.example.admin.myapplication/files/instant-run/dex/slice-slice_0-classes.dex", dex file "/data/data/com.example.admin.myapplication/files/instant-run/dex/slice-internal_impl-23.3.0_27d196cbd3a79cebc325459f141e49d7b50664cc-classes.dex", dex file "/data/data/com.example.admin.myapplication/files/instant-run/dex/slice-com.android.support-support-vector-drawable-23.3.0_8ba9fe410acb491094d6e4fdd52eaa7874a78b10-classes.dex", dex file "/data/data/com.example.admin.myapplication/files/instant-run/dex/slice-com.android.support-support-v4-23.3.0_6ba21ae137153f66399c629dd6a373f03764ca58-classes.dex", dex file "/data/data/com.example.admin.myapplication/files/instant-run/dex/slice-com.android.support-appcompat-v7-23.3.0_ac3facb5c100e8ac5ecc4a9e11b8342a1571554e-classes.dex", dex file "/data/data/com.example.admin.myapplication/files/instant-run/dex/slice-com.android.support-animated-vector-drawable-23.3.0_e5b39ef2fbc68703a41bb2f7ca6655a40cc91101-classes.dex"],nativeLibraryDirectories=[/vendor/lib, /system/lib, /vendor/lib, /system/lib]]
at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56)
at com.android.tools.fd.runtime.IncrementalClassLoader$DelegateClassLoader.findClass(IncrementalClassLoader.java:90)
at java.lang.ClassLoader.loadClass(ClassLoader.java:511)
at java.lang.ClassLoader.loadClass(ClassLoader.java:469)
at wei.mark.standout.ui.Window.(Window.java:123)
at wei.mark.standout.StandOutWindow.show(StandOutWindow.java:1078)
at wei.mark.standout.StandOutWindow.onStartCommand(StandOutWindow.java:381)
at android.app.ActivityThread.handleServiceArgs(ActivityThread.java:2894)
at android.app.ActivityThread.access$2100(ActivityThread.java:151)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1401)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:135)
at android.app.ActivityThread.main(ActivityThread.java:5254)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:903)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:698)
Suppressed: java.lang.ClassNotFoundException: Didn't find class "wei.mark.standout.R$id" on path: DexPathList[[zip file "/data/app/com.example.admin.myapplication-2/base.apk"],nativeLibraryDirectories=[/vendor/lib, /system/lib]]
at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56)
at java.lang.ClassLoader.loadClass
05-07 00:34:30.877 2185-2198/com.example.admin.myapplication I/art: Ignoring second debugger -- accepting and dropping
Do you have any plans to support Android Studio that uses grable build tool officialy?
I have some trouble setting up this library in Android Studio
Since Android 4.3 for every new windows there is an icon showing up in the notification bar. Is there any idea how to improve this? When showing more than one interactive windows this clutters the notification bar a lot. Would it make any sense to enhance this lib using Accessibility Services or something else? Would it be possible to hook up the services that the windows require with other services that are already existing and running?
Hi
How put string in activity before show float windows, like:
Bundle data = new Bundle();
data.putString("changedText", mapimg);
StandOutWindow.sendData(view.getContext(), WidgetsWindow.class, StandOutWindow.DEFAULT_ID, DATA_CHANGED_TEXT, data, SimpleWindow.class, 1);
This code show Null
Thanks
Hi Mark,
I'm using StandOut in my new project and there seems to be a issue with VideoView. I asked a question on SO but didn't get any reply, so thought about pointing out to you. Here's the question- https://stackoverflow.com/questions/23699397/videoview-in-windowmanager-not-updating
As you can see in the images, the VideoView does not update on changing the window size. I have used SurfaceView and it works fine after changing the window params. But when changing the params in a window with VideoView, it does not take up the new size but keeps the old one. This happens with both expanding and reducing the window size.
Also, there's a problem with the seekbar as pointed out in the question though I'm not sure if its an issue with StandOut or something wrong with my code.
Can you suggest any workaround or fix for updating the VideoView size?
When i drag the folder around it flickers a lot on my HTC Desire Z (Android 2.3)
Every time the folder "hits" the screen boarders it starts flickering and sometimes it then changes into the small icon. it should be docking at the screen boarder instead i would say?
If getHiddenNotification() returns null, we should just not show any hidden notifications.
when we call MyWindow.closeAll()
function view of windows get closed, but is there any method in MyWindow which will be called when we call closeAll(). I observed that after calling closeAll()
service is still running, so I want to stop some timers, unregister receivers, etc when we close the window using closeAll().
I am wondering what is the preferred way of getting the current Activity or Context object into StandOutWindow? Or the other way around, how to access the FrameView of StandOutWindow from the Activity?
Or did I do something wrong and there exists a development pattern that doesn't get you in such troubles?
It should call getHideIntent()
https://github.com/pingpongboss/StandOut/blob/master/library/src/wei/mark/standout/StandOutWindow.java#L139
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.