Coder Social home page Coder Social logo

draftsman's Introduction


Draftsman

Draftsman is an on-device layout inspector for Android apps. It allows you to view various properties of rendered Android Views such as width, height, class name, paddings, margins etc.

Draftsman aims to combine capabilities of different Android tools such as Show Layout Bounds and Android Studio's layout inspector.

The primary objective of Draftsman is to provide information around rendered views directly from your app which is easily accessible to devs, designers, PMs or any one who has installed the app. No need to use any external tool or rely on debug variant of your app.

Features

  • Width & Height Info for any view

  • Class name for any view

  • Margin and Padding visualization

  • Dimension values in both Pixel(Px) and dp/sp

  • TextView color and size information

  • Overlay a grid

  • Overlay a image to compare UI

Check usage guide at bottom for more details.

Integration

Maven Central

Add following code to your build.gradle

repositories {
  mavenCentral()
}

dependencies {
  implementation "com.gojek.draftsman:draftsman:x.y.z"
}

To enable Draftsman in an activity

Draftsman.install(activity)

To exit from Draftsman, there is an exit button in information window. And if you want do it programmatically, you can call

Draftsman.uninstall(activity)

Usage Guide

This section will help you understand what information Draftsman can capture from a view.

This is our base view

draftsman-base.png

When Draftsman is enabled

This is how our view looks like once Draftsman is enabled. Inspectable views are highlighted and a arrow appears on right to open drawer.

draftsman-enabled.png

Draftsman Setting Drawer

You can use this drawer to customise a few settings.

draftsman-drawer.png

TextView Inspection

On tapping of first text "Hi Folks" we can observe this overlay. It provides information on height, width, textsize and textcolor. Dimensions can be observed in dp or px.

Inspection details overlay can be closed using cross icon and Draftsman can be closed by pressing Exit button.

draftsman-text.png

View Inspection

Any arbitrary view can be inspected as well allowing us to inspect height, width and class name

draftsman-view.png

Margin and Padding

Tapping around views highlights margins and paddings if available. Padding is shown with green background and margin with red line.

draftsman-padding.png

draftsman-margin.png

Nested Views

If there are multiple views stacked within same bounds, Draftsman will prompt you to select the view to be inspected

draftsman-nested-views.png

Grid Overlay

You can also add a size configurable grid overlay on your screen from setting drawer.

draftsman-grid.png

Image Overlay

You can also overlay a screenshot on top of existing screen to check for UI differences. A slider on bottom can be used to fade out overlay image.

Note: Storage read permission should be provided for this to work.

draftsman-overlay.png

draftsman's People

Contributors

jitinsharma avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.