Important Modules in the alfaazplus/quranapp Android Project: Architecture Guide

The alfaazplus/quranapp Android project is organized as a multi-module Gradle project comprising two primary modules: :app for core application logic and :peacedesign for reusable UI components.

The Quran App follows modern Android architectural patterns by separating business logic from presentation utilities. Understanding these important modules in the alfaazplus/quranapp Android project is essential for contributing to or extending the codebase. Both modules are defined in settings.gradle.kts and work together to produce the final APK.

Module Overview: :app and :peacedesign

The project structure divides responsibilities between two distinct modules:

  • :app – Contains the core Android application including Activities, Fragments, API clients, database helpers, and business logic.
  • :peacedesign – Provides a standalone UI widget library with custom dialogs, animations, and view utilities under the com.peacedesign namespace.

This separation ensures that presentation utilities remain decoupled from domain logic, making the UI components reusable across different contexts.

The :app Module: Core Application Architecture

The :app module serves as the primary entry point and houses all domain-specific code. It manages everything from user navigation to local data caching and remote API communication.

Entry Points and Navigation

The user journey begins in MainActivity.java, which bootstraps the interface and initializes the navigation system.

// Example: Configuring bottom navigation in MainActivity
BottomTabLayout bottomTabLayout = findViewById(R.id.bottomTabLayout);
bottomTabLayout.setTabs(getBottomTabs());
bottomTabLayout.setKingTab(
    new BottomTab(R.drawable.quran_kareem),
    kingTab -> launchActivity(ActivityReaderIndexPage.class)
);

Data Layer and Networking

The module implements a robust data layer combining remote APIs with local SQLite storage.

Background Utilities and State Management

Several utility classes handle asynchronous operations and persistent state:

// Example: Triggering the index menu from MainActivity
mBinding.header.indexMenu.setOnClickListener(v -> mIndexMenu.open());

The :peacedesign Module: Reusable UI Toolkit

The :peacedesign module functions as an independent library supplying generic UI components. It eliminates code duplication by centralizing dialog management, animations, and view manipulation utilities.

Custom Dialog Framework

The dialog system provides a consistent look-and-feel across the application:

// Example: Displaying a custom dialog
PeaceDialogParams params = new PeaceDialogParams()
    .setTitle("Update available")
    .setMessage("A new version is ready to download.")
    .setPositiveButton("Download", v -> startDownload())
    .setNegativeButton("Later", null);

new PeaceDialog(this, params).show();

Animation and View Utilities

Supporting classes handle visual transitions and text styling:

Module Interactions and Build Configuration

The settings.gradle.kts file registers both modules in the Gradle build system. The :app module declares a dependency on project(":peacedesign"), allowing direct instantiation of Peace widgets within application code.

This architecture enforces strict separation of concerns:

  1. :app concentrates on domain logic, data fetching, and navigation patterns.
  2. :peacedesign focuses exclusively on presentation utilities, remaining agnostic to business rules.

Summary

  • The :app module contains all core functionality including MainActivity, API clients (AlfaazPlusApi), database helpers (QuranTranslDBHelper), and navigation components (BottomTabLayout).
  • The :peacedesign module supplies reusable UI infrastructure through PeaceDialog, animation utilities (HeightAnimation), and view helpers (ViewUtils).
  • Both modules are configured in settings.gradle.kts, with :app depending on :peacedesign to maintain consistent styling across the application.
  • Key entry points reside in app/src/main/java/com/quranapp/android/activities/, while shared UI components live under peacedesign/src/main/java/com/peacedesign/.

Frequently Asked Questions

What is the purpose of the :peacedesign module in quranapp?

The :peacedesign module serves as a reusable UI widget library that supplies custom dialogs, animations, and view utilities under the com.peacedesign namespace. It decouples presentation logic from business rules, allowing consistent styling across Activities and Fragments while remaining portable for future projects.

How does the :app module handle data persistence?

The :app module implements SQLite-based local storage through specialized helpers like QuranTranslDBHelper.kt for translations, ReadHistoryDBHelper for reading history, and BookmarkDBHelper for user bookmarks. These classes manage CRUD operations and caching strategies to support offline functionality.

Where is the main navigation logic implemented in the alfaazplus/quranapp project?

Main navigation resides in MainActivity.java at app/src/main/java/com/quranapp/android/activities/MainActivity.java, which coordinates ViewPager2 with ViewPagerAdapter2 for fragment paging. The custom BottomTabLayout widget handles bottom-bar interactions, while IndexMenu.java manages the slide-out navigation drawer for Juz and Chapter access.

Can the :peacedesign module be used independently of the Quran App?

Yes, the :peacedesign module is structured as a standalone library with no dependencies on Quranic domain logic. Its generic widgets—such as PeaceDialog, HeightAnimation, and TypefaceSpan2—can be imported into any Android project by declaring the module dependency in Gradle, making it suitable for reuse in unrelated applications.

Have a question about this repo?

These articles cover the highlights, but your codebase questions are specific. Give your agent direct access to the source. Share this with your agent to get started:

Share the following with your agent to get started:
curl -s "https://instagit.com/install.md"

Works with
Claude Codex Cursor VS Code OpenClaw Any MCP Client

Maintain an open-source project? Get it listed too →