The answer to the Huawei P20 Lite dimming problem is probably that you need to adjust the Display / Sleep setting. Find the Display settings by running the phone's Settings App. Then choose for instance 5 minutes of inactivity before the display will sleep. That should work.