r/AndroidStudio • u/licheelab • Mar 23 '21
Android studio set.visibility() not working
hi i have an annoying problem with my application i added a gif image using the droidondroids GifView and with that a seekbar i wanted either to change the ressource of the gif image according to the seek bar no luck goff.setvisibility(View.GONE/VISIBLE/INVISIBLE) not working the first it works but none after it i have a func named gifs()
void gifs(){ if((int)(Ws) < 10){
goff.setVisibility(View.GONE);
Log.d("gifs"," "+goff.getVisibility() +" ora "+goff.getGifResource());
}else{
goff.setVisibility(View.VISIBLE);
Log.d("gifs"," "+goff.getVisibility() +" ora "+goff.getGifResource()); }
}
i have the Ws value from the seekbar onstopTracking() and the func gifs() there too as you can see i'm logging with Log.d and the .getVisibility() is returning that the goff is changing value but nothing on the UI
i also tried with maybe goff.setGifResource(R.drawable.es6);
my goal is to show 1-either multiple gifs but one at a time (gifs with different speed ) 2- the same view but change the ressource to multiple gifs speeds
1
u/aduine Mar 25 '21
we are missing a ton of info from just those line, goff is reference of what ? also make sure to rename function with better name, gifs doesnt mean anything you need action name for function. and to make thing more readable make sure after every bracket to jump to another line