I am new to android. I have a lottie json file and based upon a seekbar want to control the amount of animation it is showing like at 0 the animation should start and at 50 it should show only 50 and finish at 100 also .
I havent tried anything so far as have no clue on this.
You can't control lottie animation file with seekbar.
But you can edit your lottie animation file here
Related
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/
I'm trying to fade my image alpha from 1 to 0 by 2000ms but it seems like it goes rather quickly like half a second. Here's my code:
ImageView tom = (ImageView) findViewById(R.id.imgJerry);
tom.animate().alpha(0f).setDuration(2000);
I'm following a lesson from Udemy and they got it work fine.
You should use Animation on it. Declare the animation in xml and its duration and then refer this in to Code.Yes previous answer is correct..
How to do a fadein of an image on an Android Activity screen?
For those who also face the same problem make sure that you turn on Animation in the developer setting in your android phone.
I've been turn it off for a while and just turn it back to 1x or 0.5x is enough.
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
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.
I'am using this player as a base for the project:
http://www.androidhive.info/2012/03/android-building-audio-player-tutorial/
I addition to that when I wanted to show different Images (kind of a slideshow) while playing the Audiofile.
Each image has a starttime and duration value.
I've archieved to play this slideshow of images, but with the problem, that I can't stop or pause it.
My Goal is an ImageView where I can controll the shown Image over the seekbar and the Play and Pause function, so that every Image will be shown at the right time while scrolling through the seekbar. (Same like the Audio file gets controlled kind of)
Right know I'm kind of stuck and need some approach to continue my work.
Anybody an idea how to solve this?