yashsingh1/xdaforums huggingface dataset:
[Android Apps and Games] ejezisek:
Hey mark! Thanks for the library!

I finished up a professional version for the application and still need to add new features and create a free version, but it wouldn't have looked even close to as nice if I was not using your library. Hopefully the reference to your standout library is acceptable. If you want any changes to how I reference it, please let me know. URL is removed due to a crashing bug on startup found in Android 4.0.4. Will be re-released when bugs are fixed.

Also, thanks again!
[Android Apps and Games] pingpongboss:
Looks great, thanks for the reference!
[Android Apps and Games] tfang:
Resolved:Having issue to start timer thread

thread is running, some other issue in the code
[Android Apps and Games] m0han:
aSNAP wishlist

@Mohammad_Adib, just a reminder: waiting for update. thanks.
[Android Apps and Games] wutk3ksHD:
i just updated Tiny Apps. Tiny Widgets and Tiny Browser have been added to Tiny Apps Pro and the main app got a new design.
[Android Apps and Games] pingpongboss:
Wow! The floating widgets is ****in awesome!!
[Android Apps and Games] webDeWo:
Is there any way to place a Fragment inside a StandOutWindow?
[Android Apps and Games] pingpongboss:
You need to fill standout windows with a view, but how you assign the view is up to you. Normally I don't think it makes sense to associate a fragment with a window
[Android Apps and Games] webDeWo:
Sorry, I wasn't clear. I want to run a Fragment Transaction with a fragment placed in the window but to do this I need a Fragment Manager that I cannot get from withing a class that extends StandOutWindow. And the correct question is: how to obtain a Fragment Manager in the window class?
[Android Apps and Games] pingpongboss:
Yes, that is what you want to do, but it doesn't exactly make sense, since Fragments are pretty much defined to only work in an Activity. The FragmentManager will probably act really weirdly if you try to use it outside of an Activity.

But if you truly want to try to use Fragments, then what you can do is first start an (invisible) Activity, call getFragmentManager() in there, and save that reference to use later. Pretty sure it's a bad idea though.
[Android Apps and Games] webDeWo:
Yes, this isn't the best way to achieve the goal, though I already use this in my app (declare public static instanceOfXXXActivity field in the onCreate method.

What I want to do is to place a sharing dialog from my app (click) in a StandOutWindow, so users could move it and resize. The problem is that my layout is maintained in the Fragment class and I don't want to duplicate a code.
[Android Apps and Games] pingpongboss:
Duplicating code is not fun :p Although I don't know the structure of your app, may I suggest that you refactor your code so that your core code is out of your Fragment, and in a Controller class (yup, MVC). I do not think you will be able to just stick a Fragment in a StandOut window to avoid writing any code.

But if you insist, feel free to try out that trick I shared in an earlier post. Instantiate a throwaway activity, just to get a reference to the FragmentManager, before finish()ing that activity and passing the reference back to your StandOut window.
[Android Apps and Games] webDeWo:
Huh, it's done! I moved a whole Fragment code to the Controller class and now I can use StandOut without any Fragment. So cool!

And now a few questions:

Can I hide the top bar (No. 1 on the screenshot below), but leave the resizing handle (No. 2)?

If so, how can I implement minimize, maximize and close buttons on my own?

Can I set the minimal width and height parameters for a window?

Is there any onSizeChanged event or something like this?

Screenshot: click
[Android Apps and Games] ArmorD:
edit :o

Sent from my panda
[Android Apps and Games] pingpongboss:
Wow I'm glad that worked out easily for you.

Yes, you'll want to remove the system decorations and use your own window decorations. Luckily I made StandOut with this usecase in mind. In getFlags(), you need to not set FLAG_DECORATION_SYSTEM and not set any of the FLAG_ADD_FUNCTIONALITY_XYZ_DISABLE flags. Then, in the view that you generate in createAndAttachView() will need to have a view that has the id R.id.corner. StandOut will find this view, and add a touch handler to it so that moving that view will resize the window. You can borrow the resize corner icon https://github.com/pingpongboss/StandOut/blob/master/library/res/drawable-hdpi/corner.png

You need to make your own views, and add onClick handlers to them. Hide and close buttons are very easy. You can borrow the code here https://github.com/pingpongboss/Sta...ary/src/wei/mark/standout/ui/Window.java#L377

Yes, in getParams(), construct the params with https://github.com/pingpongboss/Sta...c/wei/mark/standout/StandOutWindow.java#L1906

https://github.com/pingpongboss/Sta...rc/wei/mark/standout/StandOutWindow.java#L894
[Android Apps and Games] webDeWo:
Love this, thank you! Looks like I have another killer feature for the next major release of Quick Social ;)
[Android Apps and Games] aldolo:
cut&paste?

Hi. I'm still trying to enable cut&paste in a EditText. Someone succeeded in this task???? Thanks
[Android Apps and Games] webDeWo:
Copy&paste worked out of the box for me. Today I released an update to my app that brings StandOut floating windows. See if copying/pasting works for you in Quick Social. Maybe it happens only on your device?
[Android Apps and Games] wutk3ksHD:
copy and paste depends on your android version i guess. Some users of my app have this issue, others havent.
[Android Apps and Games] JaKeRUS:
good !:good:
[Android Apps and Games] aldolo:
well, indeed i've looked at your app and the copy&past features does not look the standard one, and it hang sometime. i wonder why the standard menu don't come up as usual.

unfortunatly i was not able to find a floating window in webDeWo "quick social" app. maybe it is implemented in the premium version. in the free app, for regular windows, cut&past works well.

looking in the android source code i was not able to track down the problem. the code to create the edittext context menu is there obviously, but i've not found a way to activate it. usually i do nothing special and the menu works by default. really annoying.
[Android Apps and Games] aldolo:
my little app

Well, I've cleaned up all the unfinished parts just to show what I really miss in my app: the cut&past!

It is essentially a terminal window (ls, su, logcat...) with a commands history, but floating of course. Really useful for my work.
[Android Apps and Games] pingpongboss:
I've seen issues with cut and paste in StandOut, and it is because StandOut hosts the EditText within a Service and not an Activity. Text just cannot seem to be selected sometimes in StandOut. Some devs using StandOut create their own Copy/Paste buttons that operate on the entire EditText, not any selected text.
[Android Apps and Games] sak-venom1997:
Hello sir,

I want to remove the title bar and provide a custom implementation of minimize and close buttons any clues how to do it?
[Android Apps and Games] aldolo:
Hi.

I'm experimenting the nice work of Ray Zhou described in stackoverflow question 12346604: "Selectable TextView" (link posting not allowed to me)

Unfortunately even this full custom approach seem infeasible. Selection handles are created via a PopupWindow.Selection Handles movements are almost unpredictable because their placement relative to StandOut is buggy. Probably the cause is the missing underlining Activity. Maybe is the same reason that prevent the standard handle to show up most of the time. I was able to show them in the emulator but not in any other device, so an absolute x,y placement of the selection handles is mandatory.

Still investigating. Is funny :)
[Android Apps and Games] sak-venom1997:
StandOut is based on a system alert window which is not ment to take text inputs so android doesn't bother to show show text selection...

Try doing the text input in an activity themed as dialogue
[Android Apps and Games] pingpongboss:
Yes, this is possible. See http://xdaforums.com/showpost.php?p=42677906&postcount=629
[Android Apps and Games] sak-venom1997:
I should have seen this first

I had to amend the StandOutWindow and almost a new code for Window to get it support my code I guess it was necessary to do this way

Thanks for help
[Android Apps and Games] Re4cTiV3:
how can i start my app maximized, and then with the notification get the float feature?

like DarkCalc
[Android Apps and Games] sak-venom1997:
DarkCalc runs as a normal app and on click of an option it closes the activity and stars a StandOut window
[Android Apps and Games] Re4cTiV3:
I know this but it doesn't start :/

Code:

MainActivity.java http://pastebin.com/6QSXTd5V

PopupWindow.java http://pastebin.com/5ryXe53c

popup.xml http://pastebin.com/UxQFVEns

Ok i didn't put <service android:name="PopupWindow" /> on the manifest
[Android Apps and Games] sak-venom1997:
Thanks for reply on the Git query !

Edit : Here's an app i made

Add it to the apps list if you feel its deserving !

Do tell hows it.

One last ques how do i change window size before it is shown because if i call the getWindow(id) before it wont edit a null window and the window size is dynamic itll be new every time
[Android Apps and Games] iflip:
This is great stuff but I have a question. Can a home replacement app be created that could implement its own version of multi Window. Idk and maybe call it multi task home or something equivalent. Something that could incorporate a an enabled split screen view that can utilize all apps installed on the phone? I'm sure something can be created like that in the future due to the fact that Android evolves and all kinds of innovative things are created all the time.
[Android Apps and Games] paulwong2013:
good
[Android Apps and Games] pingpongboss:
In getParams(), make sure you create the params with the size that you want. https://github.com/pingpongboss/Sta...rc/wei/mark/standout/StandOutWindow.java#L473

No you can't use StandOut to do this right now.
[Android Apps and Games] sak-venom1997:
The problem is i create my views programatically and view width and height i can only provide after the onCreateAndAttach views is called

Which of the methods is called first :

onCreateAndAttachViews

Or

getParams
[Android Apps and Games] pingpongboss:
getParams is technically called first, but you could use the onShow() callback to call updateViewLayout() to set the width/height when a window is about to be shown https://github.com/pingpongboss/Sta...c/wei/mark/standout/StandOutWindow.java#L1732
[Android Apps and Games] sak-venom1997:
Thanks again

Edit:

I get error

07-01 11:38:42.031 26403-26403/ic.lunar.floatingwidgetspace E/AndroidRuntime: FATAL EXCEPTION: main
java.lang.RuntimeException: Unable to start service ic.lunar.floatingwidgetspace.FloatingWidget@4052e9a0 with Intent { act=SHOW cmp=ic.lunar.floatingwidgetspace/.FloatingWidget (has extras) }: java.lang.IllegalArgumentException: Tried to updateViewLayout(3) a null window.
at android.app.ActivityThread.handleServiceArgs(ActivityThread.java:2056)
at android.app.ActivityThread.access$2800(ActivityThread.java:117)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:998)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:130)
at android.app.ActivityThread.main(ActivityThread.java:3687)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:507)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:867)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:625)
at dalvik.system.NativeStart.main(Native Method)

Caused Due :

Caused by: java.lang.IllegalArgumentException: Tried to updateViewLayout(3) a null window.
at wei.mark.standout.StandOutWindow.updateViewLayout(StandOutWindow.java:1744)
at ic.lunar.floatingwidgetspace.FloatingWidget.onShow(FloatingWidget.java:129)
at wei.mark.standout.StandOutWindow.show(StandOutWindow.java:1095)
at wei.mark.standout.StandOutWindow.onStartCommand(StandOutWindow.java:383)
at android.app.ActivityThread.handleServiceArgs(ActivityThread.java:2043)
... 10 more

Quite contradicting your statement it says i cant updateViewLayout() for a window windows thats not shown

Here's my code :

[MENTION=439709]override[/MENTION]
public boolean onShow(int id, Window window) {
updateViewLayout(id,new StandOutLayoutParams(id,hostView.getWidth(),hostView.getHeight()));
return super.onShow(id, window);
}
[Android Apps and Games] Re4cTiV3:
customize decorations

I don't understand how can i customize this

https://github.com/pingpongboss/Sta...ary/src/wei/mark/standout/ui/Window.java#L377

must replace each icon from the library?

Can you give me an example?
[Android Apps and Games] pingpongboss:
Instead of updateViewLayout() you can try window.setLayoutParams()

Did this help? http://xdaforums.com/showpost.php?p=42677906&postcount=629
[Android Apps and Games] Re4cTiV3:
i edit the Window.java from the library and make my views??
[Android Apps and Games] pingpongboss:
No, in createAndAttachView(), you make your own decorations as part of the view that you attach to the root. Of course you have to pass the right flags as I said in #1.
[Android Apps and Games] Re4cTiV3:
aha! ok i understood.. it works :) thank you! keep up the good work!
[Android Apps and Games] dasi1241:
Hi,

Standout is a great project!

I have developed an app based on Standout, please check it here: http://xdaforums.com/showthread.php?t=2355373

Thank you very much for your great work!
[Android Apps and Games] pingpongboss:
Oh wow, that is very very pretty.

A shoutout to StandOut would be highly appreciated ;)
[Android Apps and Games] dasi1241:
I have edited the post, and shoutout to StandOut :)
[Android Apps and Games] Azath0t:
Software keyboard

The easier way to do it would be to support the WindowManager.LayoutParams.SOFT_INPUT_ADJUST_RESIZE flag. Unfortunately, I was unable to make it work. If I add it directly to the library, it seems to break all the window behavior.
[Android Apps and Games] Re4cTiV3:
check my floating app!

https://play.google.com/store/apps/details?id=com.bmpak.anagramsolver
[Android Apps and Games] sak-venom1997:
Check out my app based on standout

http://xdaforums.com/showthread.php?t=2343861
[Android Apps and Games] YodaDaCoda:
Please excuse my noobish question...

I'm trying to modify the example project to have a single simplewindow with a textview. I then want to be able to modify the value of the textview in java, but getViewById is undefined. Can someone please point me in the right direction?
[Android Apps and Games] sak-venom1997:
You can do this only after createAndAttachViews() is called

To get the view you must call

getViewById() on FrameLayout passed in above method
[Android Apps and Games] Magnumutz:
AWESOME!

Thanks mate!
[Android Apps and Games] CykloneFij:
Hi

Mark, this is an amazing library and I have been playing around with it a bit when I came across it just recently.

I have a question, I am trying to start a new StandOut window intent (window) from an onClickListener and am getting "Unfortunately app has stopped." error.

This is the portion of code:

-----------------------------------------------------------------------------------------------------------------------------------

Button button = (Button) view.findViewById(R.id.buttonGo);

button.setOnClickListener(new OnClickListener() {

[MENTION=439709]override[/MENTION]

public void onClick(View v) {

final String text = edit.getText().toString();

String changedText = text;

status.setText(changedText);

edit.setText("");

Intent w = StandOutWindow.getShowIntent(AutoWindow.this, StatusWindow.class, getUniqueId());

startActivity(w);

-----------------------------------------------------------------------------------------------------------------------------------

Any help would be much appreciated.

Thank you
[Android Apps and Games] wutk3ksHD:
Well, thats not the way to start a window! Here is how to do it:

StandOutWindow.show(getApplicationContext(), CustomFloatingWindow.class, i);

CustomFloatingWindow.class = your own class extending StandOutWindow (in your case StatusWindow.class).

i = a identifier which makes any window unique.
[Android Apps and Games] pingpongboss:
wutk3ksHD is correct. If you look at https://github.com/pingpongboss/Sta...rc/wei/mark/standout/StandOutWindow.java#L119 you can see that we are actually doing startService() instead of startActivity().
[Android Apps and Games] CykloneFij:
Thank you wutk3ksHD, that works just fine. I was using an intent as I wanted to pass data between the two at some point. I have been hunting around if using the getExtras function will work with this?
[Android Apps and Games] mohit1234:
Hi Mark,

Thanks a ton for the library, its truly amazing! :D

I was just having one issue:

In the window I've created, I have a TextView, EditText(hidden) and a Button. The button basically just switches between showing either the TextView or the EditText. This works fine if there's only one window. If I make multiple windows (ids: 0 to 3), and then I try pressing the button on any window, the change (switch between the textview and edittext) only takes place on the newest window created (id=3).

I setup all my components in the createAndAttachView method and save them as private variables. It seems like each time I create a new window, it overwrites those variables.

Any idea how to resolve this?

Thanks!
[Android Apps and Games] pingpongboss:
There's a method to do exactly this https://github.com/pingpongboss/Sta...rc/wei/mark/standout/StandOutWindow.java#L175

The data structures you use to store private window-specific data should always be indexed by id. So for example, instead of

private boolean mShowTextView;

You should use

private boolean[] mShowTextView;

or

private Map<Integer, Boolean> mShowTextView;

or SparseArray or etc.
[Android Apps and Games] mohit1234:
Just tested this out and it works like a charm! Thanks! :D
[Android Apps and Games] bargie:
Click through window?

Hey

First off, I'd like to thank you for making this amazing lib, has just made my life and what i'm trying to do a whole lot easier.

Now, i'm very new to android development and just working on my second app, I'm trying to make a fixed window take over half the screen but still be able to pass any taps/clicks onto the views below

so for example, my window is semi transparent with a message covering half the screen of a phone, and lets say right now its overlaying the phone app icon..

how would i go on about making this window so that it lets the click/tap pass through it to the app icon below?

Currently, I'm trying to setup WindowManager.LayoutParams.FLAG_NOT_TOUCHABLE in the getParams(id, window) method without any success

would really appreciate any guidance or tips

and once again, thank you!
[Android Apps and Games] pingpongboss:
You may try to change TYPE_PHONE to TYPE_OVERLAY or other types. https://github.com/pingpongboss/Sta...c/wei/mark/standout/StandOutWindow.java#L1812

But actually, I think this might not be possible. It'll be a security concern otherwise.
[Android Apps and Games] bargie:
Thanks Mark, TYPE_OVERLAY did the trick!

Now, is there a way that I can change the opacity or color of a window on the go?

I haven't looked at the source yet about this, I'm going to go take a look there as well but was wondering if you'd be able to point me in the right direction.

Thanks!

I'll let you know once I finish the app as well and maybe if you think its any good you can feature it here.

---

Nevermind actually, I figured it out myself, thanks! Just learning as I go along you know.
[Android Apps and Games] sak-venom1997:
hi mark one question i want to re open the window in the same position i left

like same width ,height ,alpha,xpos and ypos

how i can manage rest but how to get the same position and alpha below AP11
[Android Apps and Games] pingpongboss:
Save the position on close() and restore on getParams()

Restore alpha in createAndAttachView()
[Android Apps and Games] sak-venom1997:
yeah but i cannot call getX() and getY() below AP 11 above that it workd
[Android Apps and Games] lglossman:
Move Programatically

Hi Mark, is there any way to move the window programatically? I had taken a look at the sources but havent found how to do it... Is it really possible?

EDIT:

After investigating a bit more it seems it can be done by getting the Window Editor and setting the new position... is that right? I will try it tomorrow!!!
[Android Apps and Games] pingpongboss:
Did you try window.getLayoutParams().x?

yup. Use window.edit().setPosition( ... ).commit()
[Android Apps and Games] pyrotechr:
going to give this a try today
[Android Apps and Games] MrChops:
This library is fantastic

Hi Mark, thanks for creating and this library and putting so much time and effort into it (and to replying to my email recently, it got me off to a great start).

I've already got my floating window working and having it save it's size and position for the next time it's opened. I also put the fix in to stop it crashing if you click the opening icon multiple times.

My next step then is to subclass the main functionality out of my Activity so it can provide data to either the Activity itself and/or my floating window. This is the bit that I think I'll find most challenging!

Attached is a pic of my apps floating mode (the speed is only a mockup!!).

Oh, have you seen any weird behavior with 2.2.1 devices? If I run my app on the HTC Wildfire I have and I click my icon to call

StandOutWindow.show(DigiHUDActivity.this, FloatingWindow.class, FloatingWindow.DEFAULT_ID);

the phone locks up and after about 5 seconds it reboots :confused: I have set minSdkVersion=8, targetSdkVersion=10.

Thanks again Mark and keep up the good work,

James.
[Android Apps and Games] pingpongboss:
You'll want to refactor the main functionality out of your Activity, not subclass it :p

I have not seen or heard about the 5 second lock-up + reboot. Sounds bad. I'm not sure what could possible cause an entire system reboot like that..
[Android Apps and Games] MrChops:
Ah ok :o)

Just debugging it and the last thing it hit before rebooting was

// only show notification if not shown before
if (!startedForeground) {
// tell Android system to show notification
startForeground(
getClass().hashCode() + ONGOING_NOTIFICATION_ID,
notification);
startedForeground = true;
}

Maybe notifications work differently in that version?

Cheers.

---------- Post added at 12:50 AM ---------- Previous post was at 12:08 AM ----------

D'oh! I remembered I'd removed a couple of the overrides thinking it would suppress the 'Click to add a new ' action (I only want one window). It did for my S3 but others I tried just died horribly. I put them back in and it's not crashing, and still works fine on the S3. The Wildfire however doesn't actually show the window but it says its running in the notification area.

I'll get there :fingers-crossed: