Coding standards
Last updated
Was this helpful?
Lawnchair code must be logical, well-formatted, and respect the architectural zone it inhabits.
As seen in the project overview, Lawnchair uses a mix of paradigms:
For Kotlin, follow the official Kotlin coding conventions.
New Lawnchair-specific features must be written in Kotlin.
For existing Java code, follow the existing style seen in the codebase.
Place Lawnchair-specific logic in the lawnchair package. Minimize changes to the src package to facilitate AOSP rebases.
When modifying AOSP files, document changes you made with the prefix LC-Note(<optional modifier>): <reason> and logs with the prefix LC-:
// Example
// LC-Note: These changes are needed to support API X.
public void onChange(Boolean value) {
Log.d("LC-BaseActivity", "Doing something on change")
...
}Strings in strings.xml must follow the standardized naming format to ensure maintainability and ease of translation.
Generic word
$1
disagree
Action
$1_action
apply_action
Preference label
$1_label
folders_label
Preference description
$1_description
folders_description
Preference choice
$1_choice
off_choice
Feature string
[feature]_$1
colorpicker_hsb
Launcher string
$1_launcher
device_contacts_launcher
Avoid using generic names for feature-specific strings to prevent conflicts during rebases.
Last updated
Was this helpful?
Was this helpful?
