Android 13.0 framework modifies the button style of the AlertDialog dialog box

1 Overview

In the 13.0 system product development, in the two native OK and Cancel buttons of the AlertDialog system dialog box, because the product feels that the default font color is not good-looking, and the product needs to modify the button font color, it is necessary to find the AlertDialog font style. Then just modify it

2. The framework modifies the core class of the button style of the AlertDialog dialog box

frameworks\base\core\res\res\layout\alert_dialog.xml
frameworks/base/core/res/res/values/styles_device_defaults.xml

3. Framework implements and analyzes the core functions of modifying the button style of the AlertDialog dialog box


 In-depth understanding of Android development AlertDialog instructions Introduction pop-up windows are usually used to prompt users to perform certain operations,
such as: click the share button, a pop-up sharing dialog box; double-click the return button, the pop-up window exits the dialog box.
AlertDialog is a prompt that comes with Android. dialog box. What is the use of AlertDialog? AlertDialog
is generally used to display relatively simple prompt dialog boxes, such as dialog boxes with only title, content, and a few buttons.
It is also a common function in system dialog boxes. In the app, AlertDialog is used to display pop-up windows such as reminders and notifications.

3.1alert_dialog.xml related source code analysis


In the implementation of the core function of modifying the button style of the AlertDialog dialog box in the framework,
in the functional analysis of displaying the AlertDialog pop-up window in the system, the first choice is to analyze its pop-up window layout, and then do the processing. The first choice is to look at the
layout file alert_dialog.xml. Which layout style is used to develop related customized functions for the layout style?
Next, the first choice is to analyze the correlation of the layout style.

Guess you like

Origin blog.csdn.net/baidu_41666295/article/details/132922797