Clean way to implement gradual fading of brightness in Android?

前端 未结 2 761
清酒与你
清酒与你 2021-02-20 05:32

At the moment I have code to fade brightness adjustments which looks something like this:

new Thread() {
    public void run() {
        for (int i = initial; i          


        
2条回答
  •  说谎
    说谎 (楼主)
    2021-02-20 05:41

    how about reducing the brightness to half in each iteration.

    Then loop will complete in O(log n) rather than O(n) in current solution.

提交回复
热议问题