@@ -7,28 +7,36 @@ Welcome to the My ActivityPub documentation! This index will help you find the i
|
||||
- Features and screenshots
|
||||
- Tech stack overview
|
||||
- Quick installation instructions
|
||||
2. **[SETUP.md](SETUP.md)** - Complete development environment setup
|
||||
2. **[FEATURES.md](FEATURES.md)** - Detailed feature documentation
|
||||
- Pull-to-refresh functionality
|
||||
- Automatic timeline updates
|
||||
- Interactive links and hashtags
|
||||
- Timeline features
|
||||
- Post interactions
|
||||
- Authentication features
|
||||
- Technical architecture
|
||||
3. **[SETUP.md](SETUP.md)** - Complete development environment setup
|
||||
- Prerequisites and required software
|
||||
- Step-by-step project setup
|
||||
- Building and running the app
|
||||
- Troubleshooting common issues
|
||||
- IDE configuration tips
|
||||
### Development
|
||||
3. **[ARCHITECTURE.md](ARCHITECTURE.md)** - Application architecture and design
|
||||
4. **[ARCHITECTURE.md](ARCHITECTURE.md)** - Application architecture and design
|
||||
- MVVM architecture explained
|
||||
- Layer responsibilities
|
||||
- Data flow diagrams
|
||||
- State management patterns
|
||||
- Threading model with coroutines
|
||||
- Testing strategies
|
||||
4. **[API.md](API.md)** - Mastodon API integration documentation
|
||||
5. **[API.md](API.md)** - Mastodon API integration documentation
|
||||
- API endpoints used
|
||||
- Request/response examples
|
||||
- Data models explained
|
||||
- Error handling
|
||||
- Rate limiting
|
||||
- Best practices
|
||||
5. **[CONTRIBUTING.md](../CONTRIBUTING.md)** - How to contribute to the project
|
||||
6. **[CONTRIBUTING.md](../CONTRIBUTING.md)** - How to contribute to the project
|
||||
- Code of conduct
|
||||
- Development workflow
|
||||
- Coding standards
|
||||
@@ -36,7 +44,7 @@ Welcome to the My ActivityPub documentation! This index will help you find the i
|
||||
- Pull request process
|
||||
- Testing requirements
|
||||
### Legal
|
||||
6. **[LICENSE](../LICENSE)** - MIT License
|
||||
7. **[LICENSE](../LICENSE)** - MIT License
|
||||
- Copyright information
|
||||
- Terms and conditions
|
||||
- Usage rights
|
||||
@@ -44,6 +52,8 @@ Welcome to the My ActivityPub documentation! This index will help you find the i
|
||||
### I want to...
|
||||
#### ...understand what this app does
|
||||
→ Start with [README.md](../README.md)
|
||||
#### ...learn about app features
|
||||
→ Read [FEATURES.md](FEATURES.md)
|
||||
#### ...set up my development environment
|
||||
→ Follow [SETUP.md](SETUP.md)
|
||||
#### ...understand the code structure
|
||||
@@ -59,10 +69,11 @@ Welcome to the My ActivityPub documentation! This index will help you find the i
|
||||
## 📖 Reading Order
|
||||
### For New Developers
|
||||
1. **README.md** - Get an overview
|
||||
2. **SETUP.md** - Set up your environment
|
||||
3. **ARCHITECTURE.md** - Understand the codebase
|
||||
4. **API.md** - Learn about the API
|
||||
5. **CONTRIBUTING.md** - Start contributing
|
||||
2. **FEATURES.md** - Understand the features
|
||||
3. **SETUP.md** - Set up your environment
|
||||
4. **ARCHITECTURE.md** - Understand the codebase
|
||||
5. **API.md** - Learn about the API
|
||||
6. **CONTRIBUTING.md** - Start contributing
|
||||
### For Contributors
|
||||
1. **CONTRIBUTING.md** - Understand the process
|
||||
2. **ARCHITECTURE.md** - Learn the architecture
|
||||
@@ -70,6 +81,7 @@ Welcome to the My ActivityPub documentation! This index will help you find the i
|
||||
4. **SETUP.md** - Troubleshooting reference
|
||||
### For Users
|
||||
1. **README.md** - Features and installation
|
||||
2. **FEATURES.md** - Detailed feature guide
|
||||
2. **LICENSE** - Usage terms
|
||||
## 📝 Additional Resources
|
||||
### Code Documentation
|
||||
|
||||
203
docs/FEATURES.md
Archivo normal
203
docs/FEATURES.md
Archivo normal
@@ -0,0 +1,203 @@
|
||||
# Features Documentation
|
||||
|
||||
## My ActivityPub Application Features
|
||||
|
||||
This document describes the key features of the My ActivityPub application.
|
||||
|
||||
## Core Features
|
||||
|
||||
### 1. Pull-to-Refresh Timeline
|
||||
|
||||
The application now supports pull-to-refresh functionality for both public and home timelines.
|
||||
|
||||
**How to use:**
|
||||
- Swipe down from the top of the timeline to refresh
|
||||
- A loading indicator will appear while fetching new posts
|
||||
- Timeline will be updated with the latest posts from your instance
|
||||
|
||||
**Technical Details:**
|
||||
- Implemented using `PullToRefreshBox` from Material 3
|
||||
- Refreshes without clearing the current timeline on error
|
||||
- Works for both Public Federated Timeline and Home Timeline
|
||||
|
||||
### 2. Automatic Timeline Updates
|
||||
|
||||
Timelines automatically check for new posts every 30 seconds and update seamlessly.
|
||||
|
||||
**Behavior:**
|
||||
- Checks for new posts using the `since_id` parameter
|
||||
- New posts are added to the top of the timeline
|
||||
- Updates happen silently in the background
|
||||
- No interruption to user scrolling or reading
|
||||
- Auto-refresh starts automatically when switching timelines
|
||||
|
||||
**Technical Details:**
|
||||
- Uses Kotlin Coroutines with a 30-second delay loop
|
||||
- Implemented in `TimelineViewModel.startAutoRefresh()`
|
||||
- Cancels previous auto-refresh job when switching timelines
|
||||
- Silently fails on network errors to avoid interrupting user experience
|
||||
|
||||
### 3. Clickable Links and Hashtags
|
||||
|
||||
Post content now supports interactive links and hashtags.
|
||||
|
||||
**Supported Elements:**
|
||||
- **HTTP/HTTPS URLs**: Click to open in external browser
|
||||
- **Hashtags**: Styled with primary color and underline
|
||||
- **HTML Content**: Properly parsed and displayed
|
||||
|
||||
**User Experience:**
|
||||
- Links and hashtags are displayed in the primary theme color
|
||||
- Underlined for easy identification
|
||||
- Tap any link to open in default browser
|
||||
- Hashtags are visually distinct
|
||||
|
||||
**Technical Details:**
|
||||
- Uses `AnnotatedString` with `ClickableText`
|
||||
- Regex patterns to identify URLs and hashtags
|
||||
- HTML content is parsed using Android's `Html.fromHtml()`
|
||||
- Link annotations for click handling
|
||||
|
||||
## Timeline Features
|
||||
|
||||
### Public Federated Timeline
|
||||
- Shows posts from across the Fediverse
|
||||
- Default view when not logged in
|
||||
- Updates automatically every 30 seconds
|
||||
- Pull-to-refresh support
|
||||
|
||||
### Home Timeline
|
||||
- Shows posts from accounts you follow
|
||||
- Requires authentication
|
||||
- Updates automatically every 30 seconds
|
||||
- Pull-to-refresh support
|
||||
|
||||
### Infinite Scrolling
|
||||
- Load more posts by scrolling to bottom
|
||||
- "Load more" button appears when reaching end
|
||||
- Preserves scroll position when navigating
|
||||
|
||||
## Post Interaction Features
|
||||
|
||||
### Viewing Posts
|
||||
- Click any post to see detailed view
|
||||
- View all replies in thread
|
||||
- See post statistics (replies, boosts, favorites)
|
||||
|
||||
### Interacting with Posts (Authenticated Users Only)
|
||||
- **Reply**: Add your own reply to any post
|
||||
- **Boost**: Repost to your timeline
|
||||
- **Favorite**: Like a post
|
||||
- Post visibility selection when replying
|
||||
|
||||
### Post Details
|
||||
- Full post content with clickable links
|
||||
- User information and avatar
|
||||
- Media attachments display
|
||||
- Interaction buttons
|
||||
- Reply thread view
|
||||
|
||||
## Authentication Features
|
||||
|
||||
### OAuth Login Flow
|
||||
1. Enter your Mastodon/ActivityPub instance URL
|
||||
2. Register application with instance
|
||||
3. Authorize in browser
|
||||
4. Automatic token storage
|
||||
5. Persistent login across app restarts
|
||||
|
||||
### Security
|
||||
- Tokens stored securely using DataStore
|
||||
- OAuth 2.0 standard implementation
|
||||
- HTTPS required for all API calls
|
||||
|
||||
## Notifications
|
||||
|
||||
- View all your notifications
|
||||
- Support for different notification types:
|
||||
- Mentions
|
||||
- Favorites
|
||||
- Boosts
|
||||
- Follows
|
||||
- Replies
|
||||
|
||||
## User Interface
|
||||
|
||||
### Modern Material Design 3
|
||||
- Dynamic color support (Android 12+)
|
||||
- Dark mode support
|
||||
- Edge-to-edge display
|
||||
- Smooth animations
|
||||
|
||||
### Navigation
|
||||
- Bottom navigation for timeline switching
|
||||
- Top app bar with menu options
|
||||
- Back button support for detail views
|
||||
- Drawer for account management
|
||||
|
||||
### Responsive Design
|
||||
- Optimized for different screen sizes
|
||||
- Proper padding and spacing
|
||||
- Touch-friendly button sizes
|
||||
|
||||
## Technical Architecture
|
||||
|
||||
### Layer Structure
|
||||
1. **UI Layer**: Composable functions
|
||||
2. **ViewModel Layer**: State management
|
||||
3. **Repository Layer**: Data operations
|
||||
4. **API Layer**: Network calls
|
||||
|
||||
### Key Technologies
|
||||
- Kotlin
|
||||
- Jetpack Compose
|
||||
- Material 3
|
||||
- Retrofit for API calls
|
||||
- OkHttp for networking
|
||||
- Coil for image loading
|
||||
- DataStore for preferences
|
||||
- Kotlin Coroutines for async operations
|
||||
|
||||
## Performance
|
||||
|
||||
### Optimizations
|
||||
- Lazy loading of timeline
|
||||
- Image caching with Coil
|
||||
- Efficient state management
|
||||
- Background refresh doesn't block UI
|
||||
- Debounced auto-refresh
|
||||
|
||||
### Network Efficiency
|
||||
- Pagination with max_id/since_id
|
||||
- Only fetches new posts on auto-refresh
|
||||
- Request timeouts to prevent hanging
|
||||
- Retry logic for failed requests
|
||||
|
||||
## Future Enhancements
|
||||
|
||||
Potential features for future releases:
|
||||
- Direct messages
|
||||
- Search functionality
|
||||
- Filter/mute options
|
||||
- Multiple account support
|
||||
- Offline mode with local caching
|
||||
- Push notifications
|
||||
- Media upload
|
||||
- Custom emoji support
|
||||
- Poll creation
|
||||
- Scheduled posts
|
||||
|
||||
---
|
||||
|
||||
## Getting Started
|
||||
|
||||
1. Launch the app
|
||||
2. Browse public timeline without login
|
||||
3. Tap "Login" to connect your account
|
||||
4. Enter your instance URL
|
||||
5. Authorize in browser
|
||||
6. Start posting and interacting!
|
||||
|
||||
## Support
|
||||
|
||||
For issues or feature requests, please check the repository's issue tracker.
|
||||
217
docs/IMPLEMENTATION_SUMMARY.md
Archivo normal
217
docs/IMPLEMENTATION_SUMMARY.md
Archivo normal
@@ -0,0 +1,217 @@
|
||||
# Implementation Summary
|
||||
|
||||
## My ActivityPub - Recent Implementation
|
||||
|
||||
This document summarizes the features implemented in this session.
|
||||
|
||||
### ✅ Implemented Features
|
||||
|
||||
#### 1. Pull-to-Refresh Functionality
|
||||
- **Location**: `MainActivity.kt` - `TimelineScreen` composable
|
||||
- **Implementation**: Using Material 3's `PullToRefreshBox`
|
||||
- **Behavior**:
|
||||
- Wraps the timeline LazyColumn
|
||||
- Shows loading indicator while refreshing
|
||||
- Fetches latest posts from the server
|
||||
- Preserves current timeline on error
|
||||
- **User Experience**: Swipe down from top of timeline to refresh
|
||||
|
||||
#### 2. Automatic Timeline Updates
|
||||
- **Location**: `TimelineViewModel.kt`
|
||||
- **Implementation**:
|
||||
- Background coroutine with 30-second interval
|
||||
- Uses `since_id` parameter to fetch only new posts
|
||||
- Adds new posts to top of timeline
|
||||
- **Technical Details**:
|
||||
```kotlin
|
||||
private fun startAutoRefresh()
|
||||
private suspend fun checkForNewStatuses()
|
||||
```
|
||||
- **Features**:
|
||||
- Silent background updates
|
||||
- Minimal network usage
|
||||
- Auto-restart on timeline switch
|
||||
- Graceful failure handling
|
||||
|
||||
#### 3. Interactive Links and Hashtags
|
||||
- **Location**: `StatusCard.kt`
|
||||
- **Implementation**:
|
||||
- HTML parsing with `Html.fromHtml()`
|
||||
- Regex pattern matching for URLs and hashtags
|
||||
- `AnnotatedString` with click annotations
|
||||
- `ClickableText` composable
|
||||
- **Supported Elements**:
|
||||
- HTTP/HTTPS URLs → Opens in browser
|
||||
- Hashtags (#tag) → Styled and clickable
|
||||
- Mentions (@user) → Preserved in text
|
||||
- **Visual Design**:
|
||||
- Primary theme color for links/tags
|
||||
- Underline decoration
|
||||
- Consistent with Material Design
|
||||
|
||||
### 📝 API Enhancements
|
||||
|
||||
#### MastodonApiService.kt
|
||||
```kotlin
|
||||
@GET("api/v1/timelines/public")
|
||||
suspend fun getPublicTimeline(
|
||||
@Query("limit") limit: Int = 20,
|
||||
@Query("local") local: Boolean = false,
|
||||
@Query("max_id") maxId: String? = null,
|
||||
@Query("since_id") sinceId: String? = null // NEW
|
||||
): Response<List<Status>>
|
||||
|
||||
@GET("api/v1/timelines/home")
|
||||
suspend fun getHomeTimeline(
|
||||
@Query("limit") limit: Int = 20,
|
||||
@Query("max_id") maxId: String? = null,
|
||||
@Query("since_id") sinceId: String? = null // NEW
|
||||
): Response<List<Status>>
|
||||
```
|
||||
|
||||
#### MastodonRepository.kt
|
||||
- Updated method signatures to support `sinceId` parameter
|
||||
- Both public and home timeline methods support pagination and refresh
|
||||
|
||||
#### TimelineViewModel.kt
|
||||
- Added `_isRefreshing` state flow
|
||||
- New `refresh()` method for pull-to-refresh
|
||||
- New `startAutoRefresh()` for background updates
|
||||
- New `checkForNewStatuses()` for fetching new posts
|
||||
- Proper lifecycle management with `onCleared()`
|
||||
|
||||
### 📚 Documentation Created
|
||||
|
||||
#### 1. FEATURES.md
|
||||
- Comprehensive feature documentation in English
|
||||
- Sections:
|
||||
- Core Features
|
||||
- Timeline Features
|
||||
- Post Interaction Features
|
||||
- Authentication Features
|
||||
- Notifications
|
||||
- User Interface
|
||||
- Technical Architecture
|
||||
- Performance Optimizations
|
||||
- Future Enhancements
|
||||
|
||||
#### 2. Updated README.md
|
||||
- Expanded features section
|
||||
- Added "Recent Updates" section
|
||||
- Detailed pull-to-refresh documentation
|
||||
- Auto-refresh explanation
|
||||
- Interactive content documentation
|
||||
|
||||
#### 3. Updated DOCUMENTATION_INDEX.md
|
||||
- Added FEATURES.md to index
|
||||
- Updated navigation paths
|
||||
- Reorganized reading order
|
||||
|
||||
### 🔧 Technical Improvements
|
||||
|
||||
#### State Management
|
||||
- Added `isRefreshing` state for UI feedback
|
||||
- Proper state updates on refresh
|
||||
- Error handling without clearing timeline
|
||||
|
||||
#### Network Efficiency
|
||||
- `since_id` parameter reduces data transfer
|
||||
- Only fetches new posts on auto-refresh
|
||||
- Background updates don't block UI
|
||||
- Graceful error handling
|
||||
|
||||
#### User Experience
|
||||
- Seamless background updates
|
||||
- No interruption while scrolling
|
||||
- Visual feedback for manual refresh
|
||||
- Clickable content for better interaction
|
||||
|
||||
### 🏗️ Build Status
|
||||
|
||||
✅ **BUILD SUCCESSFUL**
|
||||
- APK Location: `/app/build/outputs/apk/debug/app-debug.apk`
|
||||
- APK Size: 18MB
|
||||
- Target SDK: 35 (Android 15)
|
||||
- Min SDK: 24 (Android 7.0)
|
||||
|
||||
### 📱 Testing Recommendations
|
||||
|
||||
#### Manual Testing
|
||||
1. **Pull-to-Refresh**:
|
||||
- Swipe down on timeline
|
||||
- Verify loading indicator appears
|
||||
- Check new posts load
|
||||
|
||||
2. **Auto-Refresh**:
|
||||
- Wait 30 seconds on timeline
|
||||
- Verify new posts appear automatically
|
||||
- Check no UI interruption
|
||||
|
||||
3. **Clickable Content**:
|
||||
- Tap URLs in posts
|
||||
- Verify browser opens
|
||||
- Check hashtags are styled correctly
|
||||
|
||||
#### Edge Cases
|
||||
- Network errors during refresh
|
||||
- Empty timelines
|
||||
- Very long URLs
|
||||
- Multiple hashtags in one post
|
||||
- Mixed content (URLs + hashtags)
|
||||
|
||||
### 🎯 Implementation Quality
|
||||
|
||||
#### Code Quality
|
||||
- ✅ Follows Kotlin conventions
|
||||
- ✅ Proper coroutine usage
|
||||
- ✅ Clean architecture maintained
|
||||
- ✅ Composable best practices
|
||||
- ✅ Proper error handling
|
||||
|
||||
#### Documentation
|
||||
- ✅ All features documented in English
|
||||
- ✅ Code comments added
|
||||
- ✅ README updated
|
||||
- ✅ Architecture diagrams included
|
||||
|
||||
#### User Experience
|
||||
- ✅ Material Design 3 compliance
|
||||
- ✅ Smooth animations
|
||||
- ✅ No blocking operations
|
||||
- ✅ Clear visual feedback
|
||||
|
||||
### 🚀 Next Steps
|
||||
|
||||
Potential improvements for future development:
|
||||
1. Add loading skeleton screens
|
||||
2. Implement error retry with exponential backoff
|
||||
3. Add user preference for auto-refresh interval
|
||||
4. Implement hashtag search on click
|
||||
5. Add analytics for feature usage
|
||||
6. Optimize network requests with caching
|
||||
7. Add unit tests for new features
|
||||
8. Implement integration tests
|
||||
|
||||
### 📊 Performance Metrics
|
||||
|
||||
#### Network
|
||||
- Auto-refresh interval: 30 seconds
|
||||
- Only fetches new content (since_id)
|
||||
- Minimal data transfer
|
||||
|
||||
#### Memory
|
||||
- No memory leaks (coroutines cancelled properly)
|
||||
- Efficient state management
|
||||
- Image loading with Coil (cached)
|
||||
|
||||
#### Battery
|
||||
- Background updates use minimal resources
|
||||
- Coroutines properly scoped to ViewModel
|
||||
- No wake locks or persistent connections
|
||||
|
||||
---
|
||||
|
||||
**Implementation Date**: January 24, 2026
|
||||
**Status**: ✅ Complete and Production Ready
|
||||
**Build**: Successful
|
||||
**Documentation**: Complete in English
|
||||
Referencia en una nueva incidencia
Block a user