Using FrameLayout as a live table

I am trying to use FrameLayout as the contents of a Live Wallpaper. According to Romain Guy's answer, it should be possible, but I was not lucky to name .measure() and .layout() in the view. Can someone give me a brief example of how to use a normal layout inside Live Wallpaper?

+6
source share
1 answer

This is a wallpaper you can chat with, isn't it? If you are moving from ordinary views, you might have to implement some custom logic, especially if you are drawing images. The FrameLayout function has functions for highlighting and foreground. You can use XML or Java to add regular views to FrameLayout

You can also create a custom Drawable to do a lot of fun things about custom painting. The Drawable object just sends the view canvas.

If you want to measure representations, you will need to do this after the presentation has passed through its measures and layouts. That means doing it in onCreate () returns 0. Many people are fortunate enough to do this in a callback, for example onWindowFocusedChanged

+1
source

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


All Articles