Updateable progressbar on top of button - java

Hi i searched this like everywhere but couldnt get a real answer. How do i display i progressbar(tiny) on top of a button or an imagebutton that can be updated. Its for a music app im creating where there are lots of buttons on it like a beat box and each button plays a different music from the sound pool but i want the button to display the progressbar on it when i hit the button and the music starts. And the progress updates according to the music. i tried this in xml but cant figure it, I tried extending the view class but i dont know how to draw the progressbar on a bitmap(i tried bitmap). How can i do this? Thanks for any help. And sorry i know my english is bad.

Related

How to hide a button or textView while implementing screen recording

Suppose I'm having a screen in which there are many buttons and textViews and if someone who comes through this screen while using the application tries to take a Screenshot or Screen Record, some views shouldn't be captured. Is there anyway I can do this?
Use file observer with the path to screen shot directory here is a good tutorial
https://theengineerscafe.com/create-fileobserver-android/

coding button to video

Program: android studio
hello
I'm trying to create a button that when I press on it, a full screen video show up. But the problem is when I set a VideoView it shows a gray screen on top of my play button.
What I want, is to make the VideoView invisible and completely white and use the button to play a full screen video without having any gray box covering my screen.
Call
videoView.setZOrderOnTop(false);
before playing the video, and
videoView.setZOrderOnTop(true);
after .start()
Alternatively you can use
videoView.setBackgroundColor(Color.TRANSPARENT)
Whichever one is applicable

Android "Frozen" Button appearance

I have a certain problem: I have created a quick clicker game, where two players try to click quicker than the other one. A special button freezes the opponent's main button. The frozen button currently only becomes unclickable and its text color becomes gray.
To add some "style", I would like to literally freeze it. I don't really know how it would look like, but I thought about a light blue background, and some light blue spikes around it or something like that. I haven't found any style that would do that, and any image to replace the button with, because "Frozen" finds other images ;)...
I'm not a designer so telling me that tools that can design buttons exist won't help me.
Also, just an image won't probably be enough, because the button can be frozen at any moment, with any text and any text color.
Thanks for your help.
You can create button look (drawable) and set it programmatically.
Example
myButton = (Button) findViewById(R.id.myButton);
myButton.setBackgroundResource(R.drawable.frozenDrawable);
To do some simple looks for buttons i recommend you
Android Button Maker
.
Example 2
For more advanced look you can create some png
ImageButton myButton = (ImageButton)findViewById(R.id.myButton);
myButton.setImageResource(R.drawable.frozenResource);
I don't have code, but here is what I would experiment with, if I had to create create the appearance of a frozen button while keeping its text and general appearance:
To ice the button:
Using Google Image search, find the image of a slab of ice
Create an imageView with that "slab of ice" image as the src, and make it about the same size as your button (or slightly larger if you want the ice to leak out)
Place that icy imageView directly over your button.
Make that imageView slightly transparent by setting the "alpha" property to 0.5 (or whatever looks good, keeping in mind that 0 = invisible and 1=fully visible).
To unfreeze the button:
Make the imageView invisible.
Re-enable the button

Button flash animation android java

So I want to create a button which always flash if my boolean is set to true or with a timer. My first idea was to use the "on click" animation but I don't know if it would work fine. If you got an idea of how to make a flash animation please tell me.

Scrolling functionality in Blackberry

I have 4 buttons 1)left 2)video 3)technical insight 4)right..as seen in the below image.Now I want to provide functionlity to this image.The functionality is
If i click on the left arrow the video technical insight have to scroll to the left and similarly if I click on the right arrow the the two buttons have to scroll to the right and show two more video names..in Blackberry Simulator
Can anyone please help me in writing the code.I would be happy If I can get the code to provide this functionality in Blackberry..
I have some ideas regarding this.Do tell me if this can be done or not..
I created left button ,videos button,technicalinsight button and right button in a manager called hfm
When i click on the left button the entire things in hfm will get deleted using hfm.deleteAll() and then repaint it with the hfm which we get after scroll.
Is this idea good or any better approach for this??
you can Override the paint() method and use graphics.drawBitmap to redraw the screen.

Categories

Resources