A lightweight Android library that displays app version information as an overlay on all activities. Perfect for QA testing, internal builds, and debug environments.
- 🎯 Zero Configuration - Works with just one line of code
- 🎨 Fully Customizable - Colors, position, text size, and content
- 🖱️ Drag & Drop Support - Users can drag overlay to any position
- 📱 No Permissions Required - Uses standard Android APIs
- 🔧 Build Variant Aware - Easy to enable/disable based on build types
- 💾 Lightweight - Minimal performance impact (~8KB)
- 🧩 Framework Compatible - Works with Views, Compose, Fragments
- 🔄 Lifecycle Aware - Automatic cleanup, no memory leaks
Add JitPack repository to your project's settings.gradle.kts:
dependencyResolutionManagement {
    repositories {
        google()
        mavenCentral()
        maven { url = uri("https://jitpack.io") }
    }
}Add the dependency to your app's build.gradle.kts:
dependencies {
    implementation("com.github.mobven:MBVersionAndroid:Tag")
}Add to your Application class:
class MyApplication : Application() {
    override fun onCreate() {
        super.onCreate()
        
        // Enable only for debug builds
        MBVersionOverlay.init(this, BuildConfig.DEBUG)
    }
}Don't forget to register your Application class in AndroidManifest.xml:
<application
    android:name=".MyApplication"
    ... >That's it! 🎉 Version overlay will automatically appear on all activities.
Configure before calling init():
class MyApplication : Application() {
    override fun onCreate() {
        super.onCreate()
        
        MBVersionOverlay.configure(
            backgroundColor = ContextCompat.getColor(this, R.color.overlay_bg),
            textColor = Color.WHITE,
            textSize = 14f,
            position = MBVersionOverlay.Position.TOP,
            bottomMargin = 60, // Custom margin from bottom
            isDraggable = true // Enable drag & drop
        )
        
        MBVersionOverlay.init(this, BuildConfig.DEBUG)
    }
}| Parameter | Type | Default | Description | 
|---|---|---|---|
| customText | String? | null | Custom text (overrides version info) | 
| backgroundColor | Int | Blue ( #AA4444FF) | Background color (ARGB) | 
| textColor | Int | Color.WHITE | Text color | 
| textSize | Float | 16f | Text size in SP | 
| position | Position | BOTTOM | TOPorBOTTOM | 
| bottomMargin | Int | 32 | Bottom margin in DP | 
| isDraggable | Boolean | true | Enable drag & drop | 
The overlay supports intuitive drag & drop functionality:
- Drag to Move: Long press and drag to reposition
- Click to Hide: Quick tap to show/hide overlay
- Smart Snapping: Automatically snaps to nearest screen edge
- Boundary Protection: Cannot be dragged outside screen bounds
// Enable drag & drop
MBVersionOverlay.configure(isDraggable = true)
// Disable drag & drop (click to hide/show only)
MBVersionOverlay.configure(isDraggable = false)class MainActivity : AppCompatActivity() {
    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        
        // Manually show overlay
        MBVersionOverlay.show(this, true)
        
        // Hide overlay
        MBVersionOverlay.show(this, false)
    }
}- Ensure init()is called inApplication.onCreate()
- Check if enabledparameter istrue
- Verify Application class is registered in AndroidManifest.xml
- Make sure isDraggable = truein configuration
- Test on physical device (emulator touch might be different)
- Check if overlay is clickable (not behind other views)
// Increase bottom margin to avoid navigation bars
MBVersionOverlay.configure(
    bottomMargin = 100 // Adjust as needed
)Issue: On devices with edge-to-edge displays (like those using enableEdgeToEdge()), the drag & drop functionality may allow the overlay to be dragged outside the visible screen area, particularly near system bars.
Contributions are welcome! Please feel free to submit a Pull Request.
- Fork the repository
- Create your feature branch (git checkout -b feature/amazing-feature)
- Commit your changes (git commit -m '[DEV][Add amazing feature]')
- Push to the branch (git push origin feature/amazing-feature)
- Open a Pull Request
MIT License
Copyright (c) 2025 Mobven
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
If this library helped you, please ⭐ star this repository and share it with others!
Made with ❤️ by Mobven
