From 8c7417f91392bab1ee92c26fdeca1f68166c17f2 Mon Sep 17 00:00:00 2001 From: ale Date: Sat, 24 Jan 2026 17:45:29 +0100 Subject: [PATCH] initial commit Signed-off-by: ale --- .gitignore | 15 + CONTRIBUTING.md | 466 ++++++++++++++ LICENSE | 17 + LOGO_README.md | 87 +++ README.md | 231 +++++++ app/.gitignore | 1 + app/build.gradle.kts | 82 +++ app/proguard-rules.pro | 21 + .../myactivitypub/ExampleInstrumentedTest.kt | 24 + app/src/main/AndroidManifest.xml | 41 ++ app/src/main/ic_launcher-playstore.png | Bin 0 -> 25341 bytes .../myactivitypub/MainActivity.kt | 605 ++++++++++++++++++ .../myactivitypub/data/DataStoreProvider.kt | 11 + .../data/api/MastodonApiService.kt | 142 ++++ .../myactivitypub/data/models/Account.kt | 22 + .../myactivitypub/data/models/Auth.kt | 33 + .../myactivitypub/data/models/Instance.kt | 18 + .../data/models/MediaAttachment.kt | 15 + .../myactivitypub/data/models/Notification.kt | 14 + .../myactivitypub/data/models/Status.kt | 23 + .../data/models/StatusContext.kt | 9 + .../data/repository/AuthRepository.kt | 222 +++++++ .../data/repository/MastodonRepository.kt | 195 ++++++ .../ui/components/ReplyDialog.kt | 89 +++ .../myactivitypub/ui/components/StatusCard.kt | 226 +++++++ .../myactivitypub/ui/screens/LoginScreen.kt | 160 +++++ .../ui/screens/NotificationsScreen.kt | 189 ++++++ .../ui/screens/StatusDetailScreen.kt | 344 ++++++++++ .../myactivitypub/ui/theme/Color.kt | 27 + .../myactivitypub/ui/theme/Theme.kt | 58 ++ .../myactivitypub/ui/theme/Type.kt | 34 + .../ui/viewmodel/AuthViewModel.kt | 127 ++++ .../ui/viewmodel/NotificationsViewModel.kt | 50 ++ .../ui/viewmodel/StatusDetailViewModel.kt | 126 ++++ .../ui/viewmodel/TimelineViewModel.kt | 224 +++++++ .../res/drawable/ic_launcher_background.xml | 74 +++ .../res/drawable/ic_launcher_foreground.xml | 37 ++ .../drawable/ic_launcher_foreground_new.xml | 37 ++ app/src/main/res/drawable/ic_logo_myap.xml | 43 ++ app/src/main/res/drawable/logo_myap.xml | 28 + .../res/mipmap-anydpi-v26/ic_launcher.xml | 5 + .../mipmap-anydpi-v26/ic_launcher_round.xml | 5 + app/src/main/res/mipmap-hdpi/ic_launcher.webp | Bin 0 -> 1916 bytes .../res/mipmap-hdpi/ic_launcher_round.webp | Bin 0 -> 3530 bytes app/src/main/res/mipmap-mdpi/ic_launcher.webp | Bin 0 -> 1600 bytes .../res/mipmap-mdpi/ic_launcher_round.webp | Bin 0 -> 2412 bytes .../main/res/mipmap-xhdpi/ic_launcher.webp | Bin 0 -> 2774 bytes .../res/mipmap-xhdpi/ic_launcher_round.webp | Bin 0 -> 4874 bytes .../main/res/mipmap-xxhdpi/ic_launcher.webp | Bin 0 -> 4140 bytes .../res/mipmap-xxhdpi/ic_launcher_round.webp | Bin 0 -> 7848 bytes .../main/res/mipmap-xxxhdpi/ic_launcher.webp | Bin 0 -> 5460 bytes .../res/mipmap-xxxhdpi/ic_launcher_round.webp | Bin 0 -> 10510 bytes app/src/main/res/values/colors.xml | 10 + app/src/main/res/values/strings.xml | 3 + app/src/main/res/values/themes.xml | 5 + app/src/main/res/xml/backup_rules.xml | 13 + .../main/res/xml/data_extraction_rules.xml | 19 + .../myactivitypub/ExampleUnitTest.kt | 17 + build.gradle.kts | 5 + build_output.log | 46 ++ docs/API.md | 337 ++++++++++ docs/ARCHITECTURE.md | 476 ++++++++++++++ docs/DOCUMENTATION_INDEX.md | 153 +++++ docs/OAUTH_LOGIN.md | 364 +++++++++++ docs/SETUP.md | 248 +++++++ gradle.properties | 23 + gradle/libs.versions.toml | 31 + gradle/wrapper/gradle-wrapper.jar | Bin 0 -> 45457 bytes gradle/wrapper/gradle-wrapper.properties | 9 + gradlew | 251 ++++++++ gradlew.bat | 94 +++ logo_myap_standard.svg | 58 ++ settings.gradle.kts | 23 + 73 files changed, 6362 insertions(+) create mode 100644 .gitignore create mode 100644 CONTRIBUTING.md create mode 100644 LICENSE create mode 100644 LOGO_README.md create mode 100644 README.md create mode 100644 app/.gitignore create mode 100644 app/build.gradle.kts create mode 100644 app/proguard-rules.pro create mode 100644 app/src/androidTest/java/com/manalejandro/myactivitypub/ExampleInstrumentedTest.kt create mode 100644 app/src/main/AndroidManifest.xml create mode 100644 app/src/main/ic_launcher-playstore.png create mode 100644 app/src/main/java/com/manalejandro/myactivitypub/MainActivity.kt create mode 100644 app/src/main/java/com/manalejandro/myactivitypub/data/DataStoreProvider.kt create mode 100644 app/src/main/java/com/manalejandro/myactivitypub/data/api/MastodonApiService.kt create mode 100644 app/src/main/java/com/manalejandro/myactivitypub/data/models/Account.kt create mode 100644 app/src/main/java/com/manalejandro/myactivitypub/data/models/Auth.kt create mode 100644 app/src/main/java/com/manalejandro/myactivitypub/data/models/Instance.kt create mode 100644 app/src/main/java/com/manalejandro/myactivitypub/data/models/MediaAttachment.kt create mode 100644 app/src/main/java/com/manalejandro/myactivitypub/data/models/Notification.kt create mode 100644 app/src/main/java/com/manalejandro/myactivitypub/data/models/Status.kt create mode 100644 app/src/main/java/com/manalejandro/myactivitypub/data/models/StatusContext.kt create mode 100644 app/src/main/java/com/manalejandro/myactivitypub/data/repository/AuthRepository.kt create mode 100644 app/src/main/java/com/manalejandro/myactivitypub/data/repository/MastodonRepository.kt create mode 100644 app/src/main/java/com/manalejandro/myactivitypub/ui/components/ReplyDialog.kt create mode 100644 app/src/main/java/com/manalejandro/myactivitypub/ui/components/StatusCard.kt create mode 100644 app/src/main/java/com/manalejandro/myactivitypub/ui/screens/LoginScreen.kt create mode 100644 app/src/main/java/com/manalejandro/myactivitypub/ui/screens/NotificationsScreen.kt create mode 100644 app/src/main/java/com/manalejandro/myactivitypub/ui/screens/StatusDetailScreen.kt create mode 100644 app/src/main/java/com/manalejandro/myactivitypub/ui/theme/Color.kt create mode 100644 app/src/main/java/com/manalejandro/myactivitypub/ui/theme/Theme.kt create mode 100644 app/src/main/java/com/manalejandro/myactivitypub/ui/theme/Type.kt create mode 100644 app/src/main/java/com/manalejandro/myactivitypub/ui/viewmodel/AuthViewModel.kt create mode 100644 app/src/main/java/com/manalejandro/myactivitypub/ui/viewmodel/NotificationsViewModel.kt create mode 100644 app/src/main/java/com/manalejandro/myactivitypub/ui/viewmodel/StatusDetailViewModel.kt create mode 100644 app/src/main/java/com/manalejandro/myactivitypub/ui/viewmodel/TimelineViewModel.kt create mode 100644 app/src/main/res/drawable/ic_launcher_background.xml create mode 100644 app/src/main/res/drawable/ic_launcher_foreground.xml create mode 100644 app/src/main/res/drawable/ic_launcher_foreground_new.xml create mode 100644 app/src/main/res/drawable/ic_logo_myap.xml create mode 100644 app/src/main/res/drawable/logo_myap.xml create mode 100644 app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml create mode 100644 app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml create mode 100644 app/src/main/res/mipmap-hdpi/ic_launcher.webp create mode 100644 app/src/main/res/mipmap-hdpi/ic_launcher_round.webp create mode 100644 app/src/main/res/mipmap-mdpi/ic_launcher.webp create mode 100644 app/src/main/res/mipmap-mdpi/ic_launcher_round.webp create mode 100644 app/src/main/res/mipmap-xhdpi/ic_launcher.webp create mode 100644 app/src/main/res/mipmap-xhdpi/ic_launcher_round.webp create mode 100644 app/src/main/res/mipmap-xxhdpi/ic_launcher.webp create mode 100644 app/src/main/res/mipmap-xxhdpi/ic_launcher_round.webp create mode 100644 app/src/main/res/mipmap-xxxhdpi/ic_launcher.webp create mode 100644 app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.webp create mode 100644 app/src/main/res/values/colors.xml create mode 100644 app/src/main/res/values/strings.xml create mode 100644 app/src/main/res/values/themes.xml create mode 100644 app/src/main/res/xml/backup_rules.xml create mode 100644 app/src/main/res/xml/data_extraction_rules.xml create mode 100644 app/src/test/java/com/manalejandro/myactivitypub/ExampleUnitTest.kt create mode 100644 build.gradle.kts create mode 100644 build_output.log create mode 100644 docs/API.md create mode 100644 docs/ARCHITECTURE.md create mode 100644 docs/DOCUMENTATION_INDEX.md create mode 100644 docs/OAUTH_LOGIN.md create mode 100644 docs/SETUP.md create mode 100644 gradle.properties create mode 100644 gradle/libs.versions.toml create mode 100644 gradle/wrapper/gradle-wrapper.jar create mode 100644 gradle/wrapper/gradle-wrapper.properties create mode 100755 gradlew create mode 100644 gradlew.bat create mode 100644 logo_myap_standard.svg create mode 100644 settings.gradle.kts diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..aa724b7 --- /dev/null +++ b/.gitignore @@ -0,0 +1,15 @@ +*.iml +.gradle +/local.properties +/.idea/caches +/.idea/libraries +/.idea/modules.xml +/.idea/workspace.xml +/.idea/navEditor.xml +/.idea/assetWizardSettings.xml +.DS_Store +/build +/captures +.externalNativeBuild +.cxx +local.properties diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 0000000..c139286 --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,466 @@ +# Contributing to My ActivityPub + +Thank you for your interest in contributing to My ActivityPub! This document provides guidelines and instructions for contributing to the project. + +## Table of Contents + +- [Code of Conduct](#code-of-conduct) +- [Getting Started](#getting-started) +- [Development Setup](#development-setup) +- [How to Contribute](#how-to-contribute) +- [Coding Standards](#coding-standards) +- [Commit Guidelines](#commit-guidelines) +- [Pull Request Process](#pull-request-process) +- [Testing](#testing) +- [Documentation](#documentation) + +## Code of Conduct + +### Our Pledge + +We are committed to providing a welcoming and inspiring community for all. Please be respectful and constructive in your interactions. + +### Expected Behavior + +- Use welcoming and inclusive language +- Be respectful of differing viewpoints +- Accept constructive criticism gracefully +- Focus on what is best for the community +- Show empathy towards other community members + +## Getting Started + +### Prerequisites + +Before you begin, ensure you have: + +- Android Studio Hedgehog (2023.1.1) or newer +- JDK 11 or higher +- Git installed and configured +- Basic knowledge of Kotlin and Jetpack Compose +- Familiarity with the Mastodon API + +### Finding Issues to Work On + +1. Check the [Issues](https://github.com/your-repo/issues) page +2. Look for issues labeled `good first issue` or `help wanted` +3. Comment on the issue to let others know you're working on it +4. Wait for maintainer approval before starting work + +## Development Setup + +### 1. Fork and Clone + +```bash +# Fork the repository on GitHub, then clone your fork +git clone https://github.com/YOUR_USERNAME/MyActivityPub.git +cd MyActivityPub + +# Add the upstream repository +git remote add upstream https://github.com/ORIGINAL_OWNER/MyActivityPub.git +``` + +### 2. Create a Branch + +```bash +# Create a new branch for your feature or bugfix +git checkout -b feature/your-feature-name + +# Or for a bugfix +git checkout -b fix/bug-description +``` + +### 3. Set Up the Project + +```bash +# Sync Gradle files +./gradlew build + +# Run the app +./gradlew installDebug +``` + +## How to Contribute + +### Reporting Bugs + +Before creating a bug report: +1. Check if the bug has already been reported +2. Verify the bug exists in the latest version +3. Collect relevant information (device, Android version, logs) + +**Bug Report Template**: +```markdown +**Description** +A clear description of the bug. + +**Steps to Reproduce** +1. Step one +2. Step two +3. Step three + +**Expected Behavior** +What should happen. + +**Actual Behavior** +What actually happens. + +**Environment** +- Device: [e.g., Pixel 6] +- Android Version: [e.g., Android 13] +- App Version: [e.g., 1.0.0] + +**Logs** +``` +Paste relevant logs here +``` + +**Screenshots** +If applicable, add screenshots. +``` + +### Suggesting Enhancements + +Enhancement suggestions are welcome! Please provide: +1. Clear description of the enhancement +2. Use cases and benefits +3. Possible implementation approach +4. Mockups or examples (if applicable) + +### Contributing Code + +1. **Small Changes**: Typos, bug fixes, small improvements can be submitted directly +2. **Large Changes**: Open an issue first to discuss the change +3. **New Features**: Must be discussed and approved before implementation + +## Coding Standards + +### Kotlin Style Guide + +Follow the [Official Kotlin Coding Conventions](https://kotlinlang.org/docs/coding-conventions.html): + +#### Naming + +```kotlin +// Classes: PascalCase +class StatusCard { } + +// Functions and variables: camelCase +fun loadTimeline() { } +val statusCount = 10 + +// Constants: UPPER_SNAKE_CASE +const val MAX_RETRIES = 3 + +// Private properties: leading underscore +private val _uiState = MutableStateFlow() +``` + +#### Formatting + +```kotlin +// Use 4 spaces for indentation +class Example { + fun method() { + if (condition) { + // code here + } + } +} + +// Line length: max 120 characters +// Break long function signatures: +fun longFunctionName( + parameter1: String, + parameter2: Int, + parameter3: Boolean +): ReturnType { + // implementation +} +``` + +#### Comments and Documentation + +```kotlin +/** + * KDoc for public APIs + * + * @param userId The user identifier + * @return The user's timeline + */ +suspend fun getUserTimeline(userId: String): Result> { + // Implementation comments for complex logic + val result = apiService.getTimeline(userId) + return parseResult(result) +} +``` + +### Compose Best Practices + +```kotlin +// Composable function names: PascalCase +@Composable +fun StatusCard(status: Status, modifier: Modifier = Modifier) { + // Always provide Modifier parameter + // Default to Modifier +} + +// Extract complex composables +@Composable +private fun StatusHeader(account: Account) { + // Smaller, focused components +} + +// Use remember for expensive operations +val formattedDate = remember(timestamp) { + formatDate(timestamp) +} + +// Use derivedStateOf for computed values +val isExpanded by remember { + derivedStateOf { height > maxHeight } +} +``` + +### Architecture Guidelines + +1. **Separation of Concerns**: Each class has a single responsibility +2. **MVVM Pattern**: Follow the established architecture +3. **Repository Pattern**: All data access through repositories +4. **State Management**: Use StateFlow for UI state +5. **Error Handling**: Always handle errors gracefully + +### File Organization + +``` +app/src/main/java/com/manalejandro/myactivitypub/ +├── MainActivity.kt # Entry point +├── data/ +│ ├── api/ # API interfaces +│ ├── models/ # Data models +│ └── repository/ # Repository implementations +└── ui/ + ├── components/ # Reusable UI components + ├── screens/ # Full screen composables + ├── viewmodel/ # ViewModels + └── theme/ # Theme configuration +``` + +## Commit Guidelines + +### Commit Message Format + +``` +(): + + + +