Custom view Translate animation is not working inside recycler viewAndroid animate Translate in android 2.2Animate view added on WindowManagerRecycling views in custom layoutTranslate a View from One Layout to Another with Translate AnimationTranslate Animation on Android across layoutsRecycler View Layout Not ShowedRecycler view inside NestedScrollView causes scroll to start in the middleChange a view in Recycler view to a ProgressDialogsetTranslationY not initialized correctlyOnClickListener on image-view inside recycler-view not working on Android TV

Authorship dispute on a paper that came out of a final report of a course?

Making a Dataset that emulates `ls -tlra`?

I have found a mistake on someone's code published online: what is the protocol?

How to tell readers that I know my story is factually incorrect?

Are there any satellites in geosynchronous but not geostationary orbits?

Is it possible to have a career in SciComp without contributing to arms research?

Why are flying carpets banned while flying brooms are not?

How did Jayne know when to shoot?

Formating slide

Discontinuous Tube visualization

Linux ext4 restore file and directory access rights after bad backup/restore

Why aren't there any women super Grandmasters (GMs)?

Do pedestrians imitate automotive traffic?

What's a German word for »Sandbagger«?

Why would word of Princess Leia's capture generate sympathy for the Rebellion in the Senate?

Can a creature sustain itself by eating its own severed body parts?

What could make large expeditions ineffective for exploring territory full of dangers and valuable resources?

How should I interpret a promising preprint that was never published in a peer-reviewed journal?

Do Indians need sepearte Hong Kong visa if we already have Chinese visa

Why are there few or no black super GMs?

How do you name this compound using IUPAC system (including steps)?

Which modern firearm should a time traveler bring to be easily reproducible for a historic civilization?

What is the function of "mal" in saying "Das nenn ich mal ein X"?

How was Luke's prosthetic hand in Episode V filmed?



Custom view Translate animation is not working inside recycler view


Android animate Translate in android 2.2Animate view added on WindowManagerRecycling views in custom layoutTranslate a View from One Layout to Another with Translate AnimationTranslate Animation on Android across layoutsRecycler View Layout Not ShowedRecycler view inside NestedScrollView causes scroll to start in the middleChange a view in Recycler view to a ProgressDialogsetTranslationY not initialized correctlyOnClickListener on image-view inside recycler-view not working on Android TV






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;








1















I have a custom view and i have added translate animation on initiate (onLoad). Its working fine when that view is used normally.
But when the view is used inside recycler-view Row layout that animation is not happening properly. Some of the bottom Row having that custom view not showing translate animation. Below code is written in init block. And Recyler-view in implemented as usual.



init
Handler().postDelayed(
val anim = AnimationUtils.loadAnimation(context,
R.anim.translate_alert_to_left)
startAnimation(anim)
, 50)










share|improve this question
























  • Thanks @luciano for Edit

    – Uday
    Mar 26 at 11:50

















1















I have a custom view and i have added translate animation on initiate (onLoad). Its working fine when that view is used normally.
But when the view is used inside recycler-view Row layout that animation is not happening properly. Some of the bottom Row having that custom view not showing translate animation. Below code is written in init block. And Recyler-view in implemented as usual.



init
Handler().postDelayed(
val anim = AnimationUtils.loadAnimation(context,
R.anim.translate_alert_to_left)
startAnimation(anim)
, 50)










share|improve this question
























  • Thanks @luciano for Edit

    – Uday
    Mar 26 at 11:50













1












1








1








I have a custom view and i have added translate animation on initiate (onLoad). Its working fine when that view is used normally.
But when the view is used inside recycler-view Row layout that animation is not happening properly. Some of the bottom Row having that custom view not showing translate animation. Below code is written in init block. And Recyler-view in implemented as usual.



init
Handler().postDelayed(
val anim = AnimationUtils.loadAnimation(context,
R.anim.translate_alert_to_left)
startAnimation(anim)
, 50)










share|improve this question
















I have a custom view and i have added translate animation on initiate (onLoad). Its working fine when that view is used normally.
But when the view is used inside recycler-view Row layout that animation is not happening properly. Some of the bottom Row having that custom view not showing translate animation. Below code is written in init block. And Recyler-view in implemented as usual.



init
Handler().postDelayed(
val anim = AnimationUtils.loadAnimation(context,
R.anim.translate_alert_to_left)
startAnimation(anim)
, 50)







android android-recyclerview android-animation translate-animation






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Mar 27 at 5:48







Uday

















asked Mar 26 at 11:44









UdayUday

146 bronze badges




146 bronze badges












  • Thanks @luciano for Edit

    – Uday
    Mar 26 at 11:50

















  • Thanks @luciano for Edit

    – Uday
    Mar 26 at 11:50
















Thanks @luciano for Edit

– Uday
Mar 26 at 11:50





Thanks @luciano for Edit

– Uday
Mar 26 at 11:50












1 Answer
1






active

oldest

votes


















1














I'd need to see more of your code but I assume the init block is the one in your custom view.
It shouldn't really be there, try putting it in onBindViewHolder might do the trick, but if you should only start an animation when you need it rather than in when the View is created






share|improve this answer























  • I want to see view sliding whenever view is visible first time on the screen. It could be inside recycler view or without recycler view. So binding animation to recycler view makes no sense.

    – Uday
    Mar 26 at 11:57












  • So I added translate animation when view is loaded inside init block.

    – Uday
    Mar 26 at 11:59











  • In that case, you can override onAttachedToWindow() in your CustomView and do you animation here

    – Benoit TH
    Mar 26 at 12:19












  • I want animation to occur only once, Also onAttachedToWindow() is breaking my view inside recyclerview

    – Uday
    Mar 26 at 12:39












  • Not working properly inside onAttachedToWindow()

    – Uday
    Mar 26 at 12:55










Your Answer






StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");

StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);













draft saved

draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55356341%2fcustom-view-translate-animation-is-not-working-inside-recycler-view%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown

























1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes









1














I'd need to see more of your code but I assume the init block is the one in your custom view.
It shouldn't really be there, try putting it in onBindViewHolder might do the trick, but if you should only start an animation when you need it rather than in when the View is created






share|improve this answer























  • I want to see view sliding whenever view is visible first time on the screen. It could be inside recycler view or without recycler view. So binding animation to recycler view makes no sense.

    – Uday
    Mar 26 at 11:57












  • So I added translate animation when view is loaded inside init block.

    – Uday
    Mar 26 at 11:59











  • In that case, you can override onAttachedToWindow() in your CustomView and do you animation here

    – Benoit TH
    Mar 26 at 12:19












  • I want animation to occur only once, Also onAttachedToWindow() is breaking my view inside recyclerview

    – Uday
    Mar 26 at 12:39












  • Not working properly inside onAttachedToWindow()

    – Uday
    Mar 26 at 12:55















1














I'd need to see more of your code but I assume the init block is the one in your custom view.
It shouldn't really be there, try putting it in onBindViewHolder might do the trick, but if you should only start an animation when you need it rather than in when the View is created






share|improve this answer























  • I want to see view sliding whenever view is visible first time on the screen. It could be inside recycler view or without recycler view. So binding animation to recycler view makes no sense.

    – Uday
    Mar 26 at 11:57












  • So I added translate animation when view is loaded inside init block.

    – Uday
    Mar 26 at 11:59











  • In that case, you can override onAttachedToWindow() in your CustomView and do you animation here

    – Benoit TH
    Mar 26 at 12:19












  • I want animation to occur only once, Also onAttachedToWindow() is breaking my view inside recyclerview

    – Uday
    Mar 26 at 12:39












  • Not working properly inside onAttachedToWindow()

    – Uday
    Mar 26 at 12:55













1












1








1







I'd need to see more of your code but I assume the init block is the one in your custom view.
It shouldn't really be there, try putting it in onBindViewHolder might do the trick, but if you should only start an animation when you need it rather than in when the View is created






share|improve this answer













I'd need to see more of your code but I assume the init block is the one in your custom view.
It shouldn't really be there, try putting it in onBindViewHolder might do the trick, but if you should only start an animation when you need it rather than in when the View is created







share|improve this answer












share|improve this answer



share|improve this answer










answered Mar 26 at 11:54









Benoit THBenoit TH

1477 bronze badges




1477 bronze badges












  • I want to see view sliding whenever view is visible first time on the screen. It could be inside recycler view or without recycler view. So binding animation to recycler view makes no sense.

    – Uday
    Mar 26 at 11:57












  • So I added translate animation when view is loaded inside init block.

    – Uday
    Mar 26 at 11:59











  • In that case, you can override onAttachedToWindow() in your CustomView and do you animation here

    – Benoit TH
    Mar 26 at 12:19












  • I want animation to occur only once, Also onAttachedToWindow() is breaking my view inside recyclerview

    – Uday
    Mar 26 at 12:39












  • Not working properly inside onAttachedToWindow()

    – Uday
    Mar 26 at 12:55

















  • I want to see view sliding whenever view is visible first time on the screen. It could be inside recycler view or without recycler view. So binding animation to recycler view makes no sense.

    – Uday
    Mar 26 at 11:57












  • So I added translate animation when view is loaded inside init block.

    – Uday
    Mar 26 at 11:59











  • In that case, you can override onAttachedToWindow() in your CustomView and do you animation here

    – Benoit TH
    Mar 26 at 12:19












  • I want animation to occur only once, Also onAttachedToWindow() is breaking my view inside recyclerview

    – Uday
    Mar 26 at 12:39












  • Not working properly inside onAttachedToWindow()

    – Uday
    Mar 26 at 12:55
















I want to see view sliding whenever view is visible first time on the screen. It could be inside recycler view or without recycler view. So binding animation to recycler view makes no sense.

– Uday
Mar 26 at 11:57






I want to see view sliding whenever view is visible first time on the screen. It could be inside recycler view or without recycler view. So binding animation to recycler view makes no sense.

– Uday
Mar 26 at 11:57














So I added translate animation when view is loaded inside init block.

– Uday
Mar 26 at 11:59





So I added translate animation when view is loaded inside init block.

– Uday
Mar 26 at 11:59













In that case, you can override onAttachedToWindow() in your CustomView and do you animation here

– Benoit TH
Mar 26 at 12:19






In that case, you can override onAttachedToWindow() in your CustomView and do you animation here

– Benoit TH
Mar 26 at 12:19














I want animation to occur only once, Also onAttachedToWindow() is breaking my view inside recyclerview

– Uday
Mar 26 at 12:39






I want animation to occur only once, Also onAttachedToWindow() is breaking my view inside recyclerview

– Uday
Mar 26 at 12:39














Not working properly inside onAttachedToWindow()

– Uday
Mar 26 at 12:55





Not working properly inside onAttachedToWindow()

– Uday
Mar 26 at 12:55








Got a question that you can’t ask on public Stack Overflow? Learn more about sharing private information with Stack Overflow for Teams.







Got a question that you can’t ask on public Stack Overflow? Learn more about sharing private information with Stack Overflow for Teams.



















draft saved

draft discarded
















































Thanks for contributing an answer to Stack Overflow!


  • Please be sure to answer the question. Provide details and share your research!

But avoid


  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.

To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55356341%2fcustom-view-translate-animation-is-not-working-inside-recycler-view%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

Kamusi Yaliyomo Aina za kamusi | Muundo wa kamusi | Faida za kamusi | Dhima ya picha katika kamusi | Marejeo | Tazama pia | Viungo vya nje | UrambazajiKuhusu kamusiGo-SwahiliWiki-KamusiKamusi ya Kiswahili na Kiingerezakuihariri na kuongeza habari

Swift 4 - func physicsWorld not invoked on collision? The Next CEO of Stack OverflowHow to call Objective-C code from Swift#ifdef replacement in the Swift language@selector() in Swift?#pragma mark in Swift?Swift for loop: for index, element in array?dispatch_after - GCD in Swift?Swift Beta performance: sorting arraysSplit a String into an array in Swift?The use of Swift 3 @objc inference in Swift 4 mode is deprecated?How to optimize UITableViewCell, because my UITableView lags

Access current req object everywhere in Node.js ExpressWhy are global variables considered bad practice? (node.js)Using req & res across functionsHow do I get the path to the current script with Node.js?What is Node.js' Connect, Express and “middleware”?Node.js w/ express error handling in callbackHow to access the GET parameters after “?” in Express?Modify Node.js req object parametersAccess “app” variable inside of ExpressJS/ConnectJS middleware?Node.js Express app - request objectAngular Http Module considered middleware?Session variables in ExpressJSAdd properties to the req object in expressjs with Typescript