How do I stop Android ProgressBar Circle? - java

I've got an app that should show the Android ProgressBar circle when it is processing some input. Right now I just make it invisible when it isn't busy, but I'd like it to still show a motionless progress circle when not busy.
How do I get the Android ProgressBar circle to stop moving but still be visible?

I don't think there is a means within the APIs to make it not move. My guess is that you'd have to "fake" it by grabbing your own copy of the drawables that make up the progress circles and display one of them in an ImageView.

Related

How to make overlay receive touch events without consuming the touch for the other apps?

I'm currently trying to make a utility overlay similar to Facebook Messenger chatheads in which you can move the view around the screen. When you click the view, it expands into a more complex layout. However, the problem is if I set the LayoutParams' flag to WindowManager.LayoutParams.FLAG_NOT_TOUCHABLE, the apps behind receive the touch events while my overlay doesn't receive any touch events at all. But if I remove that flag, the overlay receives the touches but it blocks the touch. Meaning I can't even open the app drawer since the touches are being blocked.
I am using a fullscreen transparent Activity as background so I can move my overlay "widget" around it.
Is there any way I can make it so that it doesn't block touch events. Even if I don't set it to fullscreen, as long as I don't have the FLAG_NOT_TOUCHABLE flag, my overlay completely blocks all screen touches.
Please Remove this flag
WindowManager.LayoutParams.FLAG_NOT_TOUCHABLE
with this flag
WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE
see this link https://medium.com/#kevalpatel2106/create-chat-heads-like-facebook-messenger-32f7f1a62064

Creating a transparent, scrollable, flingable list without passing in a ScrollView for Android

I'm creating a platformer game for Android. However, I'm trying to overlay a transparent, scrollable list of text and (small) images in the title screen, outside of the game. Since the title screen was written in pure Java without the aid of XML, I'm looking to avoid passing in a ScrollView and changing the game's activity. Normally, I would build my own scroller programmatically, but I want my users to be able to fling the list to scroll, which I would have trouble implementing. So I was wondering if there was something for me to use. Also, I was wondering how other mobile games handle scrolling objects vertically with flinging? Do they build it themselves? Unfortunately, I can't think of a good example right now.
I'm looking to make the scrollable list transparent, so I can overlay it across a background image. Here is my title screen:
Title Screen
For example, when the credits button is pressed, the list will appear, overlaying an image in the background. (I haven't made the background image yet).
Sorry for the long post, or if this didn't make sense at all.

Move a JDialog from outside the screen to a position in screen

I'm trying to create a notifications system.
I'm trying to make a JDialog thats moves from outside the screen to a specific position. I'm using timing framework and I can move the dialog from a position to another, but when I try to specify a position outside the screen the dialog does not do that.
This code:
dialog.setLocation(new Point(-dialog.getWidth(), 10));
Should put the dialog on the right side outside the screen but it does not.
I did try to use some notifications libraries as:
JCommunique
jtelegraph
twinkle
jcarrierpigeon
But any of those libraries work properly for my needs.

Is it possible to manually scroll a gallery based on a touch event captured elsewhere on the screen

In my Android app I have a gallery which contains some TextViews. I realized that some users don't understand that they can scroll that gallery although the previous and next TextViews are partially visible. So I put an ImageView with a horizontal arrow under the gallery.
Now the users try to drag the arrow. Is it possible to redirect the touch event from the ImageView to the gallery so that dragging it would scroll the gallery?
Thanks in advance,
Fri
The simplest thing (if you don't mind scrolling one item at a time) is to detect the direction of the touch event on the arrow and then dispatchSetSelected(boolean selected) on the gallery... I believe that will work. after the user does that once, they will probably intuit that they can then just drag the gallery. Of course if you want to measure the touch event speed and do the calculation for how far to scroll based on that, you can do that too... but that seems like a lot of unnecessary trouble.

Cant use capacitive buttons while touching the screen

I'm having issues while coding for my Evo. While touching the screen, the Evo interprets me touching the buttons as another press on the screen instead of a onKeyDown, onBackPressed, etc. (It actually sets the MotionEvent pointer count to 2, and I can get the co-ords that I'm touching that are off the main screen, for example, 830*190 when touching the back button.)
Short of coding in the locations of the buttons (which would be different for every phone with capacitive buttons, if they all have the same issue), is there any way to get around this? Does anyone else have this issue with a different capacitive buttoned device?
On the Evo, the area where the buttons are uses the same capacitive touch sensor as the screen. You can test this by loading up a webpage and scrolling until your finger is in the buttons region. Instead of pressing those buttons, you just continue to scroll around on the webpage, because as far as the phone is concerned you're still touching the "screen".

Categories