Android View Lifecycle

I am using SemiClosedSlidingDrawer in my application.

Brief explanation:

  • A sliding box has a handle and content .
  • Part of the content partially opens when creating a view

Problem:

When I create a view, some of the content is pumped and cached, showing partially. If I perform any operation on the main content. This affected some of the contents of the sliding drawer. Even it is partially viewable.

I managed to find the answer that the content is not installed in GONE, so it only receives touch events.

I have to install the GONE content after caching is complete. Therefore i need to know

What kind of lifecycle image creation is called last? or Where to set ChildView's visibility properties?

I can reference the contents of slideWrawer in action and install GONE , it works fine. But there must be a proper way to fix this problem.

+6
source share
1 answer

I donโ€™t understand why you canโ€™t just specify a piece of content in onCreate () of your activity?

Alternatively, make your own implementation of SemiClosedSlidingDrawer and override all constructors with your own implementation. Something like that:

SemiClosedSlidingDrawer() { super.SemiClosedSlidingDrawer(); mContent.setVisibility(View.GONE); } 
0
source

Source: https://habr.com/ru/post/921213/


All Articles