Thank you for your interest in contributing to Essentials! This guide will help you set up your development environment and understand the architecture of the project.
- Android Studio: Download and install the latest version of Android Studio.
- JDK: Ensure you have JDK 17 or higher installed.
- Clone the project:
git clone https://github.com/sameerasw/essentials.git
- Open in Android Studio: Open the project and wait for Gradle to sync.
- Shizuku: Many features require Shizuku. Install it on your device for testing.
Essentials follows a modern Android architecture:
- Language: Kotlin
- UI Framework: Jetpack Compose
- Pattern: MVVM (Model-View-ViewModel)
- Dependency Injection: Manual injection (view models are managed by
MainViewModelor passed through activities).
Adding a new feature involves three main steps:
All features must be registered in the FeatureRegistry object. This centralizes metadata and enables automated search indexing.
object : Feature(
id = "MyNewFeature",
title = "My New Feature",
iconRes = R.drawable.my_feature_icon,
category = "Tools",
description = "A short description of the feature",
permissionKeys = listOf("ACCESSIBILITY"), // Optional
searchableSettings = listOf(
SearchSetting("Option Title", "Description", "highlight_key", listOf("keyword1", "keyword2"))
)
) {
override fun isEnabled(viewModel: MainViewModel) = viewModel.isMyFeatureEnabled.value
override fun onToggle(viewModel: MainViewModel, context: Context, enabled: Boolean) {
viewModel.setMyFeatureEnabled(enabled, context)
}
}Create a new composable in app/src/main/java/com/sameerasw/essentials/ui/composables/configs/.
- Use
RoundedCardContainerfor grouped items. - Use
IconToggleItemorSimpleToggleItemfor toggles. - Use
Modifier.highlight(highlightSetting == "key")to support search highlighting.
Add your new UI to the when(feature) block in FeatureSettingsActivity.kt to link it to the registration ID.
"MyNewFeature" -> {
MyNewFeatureSettingsUI(
viewModel = viewModel,
modifier = Modifier.padding(top = 16.dp),
highlightSetting = highlightSetting
)
}The search system is fully automated. By adding SearchSetting objects to your feature in FeatureRegistry.kt, they will automatically:
- Appear in the universal search results.
- Navigate the user to the correct feature screen.
- Trigger a pulse animation on the target item via the
highlightmodifier.
- Use PascalCase for Composables.
- Use camelCase for variables and functions.
- Prefer functional components and avoid heavy logic in the UI layer.
We welcome pull requests! To ensure a smooth review process, please follow these guidelines:
- Create a Branch: Create a new branch for your feature or bugfix (e.g.,
feature/my-new-featureorfix/issue-description). - Keep it Focused: A PR should ideally do one thing. If you have multiple unrelated changes, please separate them into multiple PRs.
- Test Your Changes: Before submitting, ensure that your changes build correctly and that you've tested them on a physical device or emulator.
- Describe Your Work: In your PR description, explain what you changed and why. If your change affects the UI, please include screenshots or a screen recording.
- Code Style: Ensure your code follows the existing style of the project.
- Update Documentation: If you've added a new feature, ensure you've registered it in
FeatureRegistry.ktas described above so it's searchable. - All to develop: Please make sure your branches are based on
developand also they are set to merge back todevelopas well.
If you have any questions or need help, feel free to open an issue or reach out in our community channels.