MCPcopy Index your code
hub / github.com/f2prateek/device-frame-generator

github.com/f2prateek/device-frame-generator @3.2.1

Chat with this repo
repository ↗ · DeepWiki ↗ · release 3.2.1 ↗ · + Follow
389 symbols 1,158 edges 63 files 46 documented · 12%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

Device Frame Generator

Wrap your app screenshots in real device artwork. For more information, see the website.

Adding Devices

To add new devices, you'll need to add 7 images in the app/src/main/res/drawable-nodpi: * device_land_back * device_land_glare * device_land_shadow * device_port_back * device_port_glare * device_port_shadow * device_thumb

All these should be in the png format and named as above - with device replaced with a key that will identify this set of frames. Once that's done, simply add the metadata in DeviceModule.java located at app/src/main/java/com/f2prateek/dfg/DeviceModule.java. Here's what an example for the Nexus 5 would look like.

@Provides(type = SET) Device provideNexus5() {
    return new Device.Builder().setId("nexus_5")
        .setName("Nexus 5")
        .setUrl("http://www.google.com/nexus/5/")
        .setPhysicalSize(5.43f)
        .setDensity("XXHDPI")
        .setLandOffset(436, 306)
        .setPortOffset(306, 436)
        .setPortSize(1080, 1920)
        .setRealSize(1080, 1920)
        .addProductId("hammerhead")
        .build();
  }

You can see what the metadata fields mean at Device.java

Building

Simply execute ./gradlew clean build.

Build Status

Android Arsenal

Extension points exported contracts — how you extend this code

AppContainer (Interface)
An indirection which allows controlling the root container used for each activity. [4 implementers]
app/src/main/java/com/f2prateek/dfg/ui/AppContainer.java
ActivityHierarchyServer (Interface)
A "view server" adaptation which automatically hooks itself up to all activities. [2 implementers]
app/src/main/java/com/f2prateek/dfg/ui/ActivityHierarchyServer.java
Callback (Interface)
(no doc)
app/src/main/java/com/f2prateek/dfg/core/DeviceFrameGenerator.java
DebugAction (Interface)
(no doc)
app/src/debug/java/com/f2prateek/dfg/ui/debug/ContextualDebugActions.java

Core symbols most depended-on inside this repo

build
called by 34
app/src/main/java/com/f2prateek/dfg/model/Device.java
get
called by 33
app/src/main/java/com/f2prateek/dfg/ui/AppContainer.java
find
called by 27
app/src/main/java/com/f2prateek/dfg/DeviceProvider.java
setId
called by 25
app/src/main/java/com/f2prateek/dfg/model/Device.java
setName
called by 25
app/src/main/java/com/f2prateek/dfg/model/Device.java
setUrl
called by 25
app/src/main/java/com/f2prateek/dfg/model/Device.java
setPhysicalSize
called by 25
app/src/main/java/com/f2prateek/dfg/model/Device.java
setDensity
called by 25
app/src/main/java/com/f2prateek/dfg/model/Device.java

Shape

Method 309
Class 46
Function 27
Interface 5
Enum 2

Languages

Java93%
TypeScript7%

Modules by API surface

app/src/debug/java/com/f2prateek/dfg/ui/SocketActivityHierarchyServer.java37 symbols
app/src/main/java/com/f2prateek/dfg/model/Device.java29 symbols
app/src/main/java/com/f2prateek/dfg/DeviceModule.java26 symbols
app/src/debug/java/com/f2prateek/dfg/ui/debug/DebugAppContainer.java16 symbols
app/src/main/java/com/f2prateek/dfg/ui/activities/MainActivity.java15 symbols
website/static/prettify.js14 symbols
app/src/main/java/com/f2prateek/dfg/core/DeviceFrameGenerator.java14 symbols
app/src/main/java/com/f2prateek/dfg/ui/fragments/DeviceFragment.java13 symbols
app/src/main/java/com/f2prateek/dfg/Utils.java13 symbols
app/src/main/java/com/f2prateek/dfg/DFGApplicationModule.java13 symbols
app/src/main/java/com/f2prateek/dfg/Events.java12 symbols
app/src/debug/java/com/f2prateek/dfg/ui/debug/ContextualDebugActions.java12 symbols

For agents

$ claude mcp add device-frame-generator \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact

Ask about this repo answers extend the page