Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/lucasr/probe
[DEPRECATED] Dissect layout traversals on Android
https://github.com/lucasr/probe
Last synced: about 1 month ago
JSON representation
[DEPRECATED] Dissect layout traversals on Android
- Host: GitHub
- URL: https://github.com/lucasr/probe
- Owner: lucasr
- License: apache-2.0
- Archived: true
- Created: 2014-09-15T23:30:29.000Z (about 10 years ago)
- Default Branch: master
- Last Pushed: 2015-01-31T23:12:05.000Z (almost 10 years ago)
- Last Synced: 2024-04-15T02:45:35.660Z (8 months ago)
- Language: Java
- Homepage:
- Size: 464 KB
- Stars: 549
- Watchers: 33
- Forks: 58
- Open Issues: 6
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE.txt
Awesome Lists containing this project
- awesome - probe - [DEPRECATED] Dissect layout traversals on Android (etc)
- awesome - probe - [DEPRECATED] Dissect layout traversals on Android (etc)
README
Probe
=====Dissect layout traversals on Android.
![](images/sample.png)
Features
--------
- Intercept `View` methods.
- `onMeasure(int, int)`
- `onLayout(boolean, int, int, int, int)`
- `draw(Canvas)` and `onDraw(Canvas)`
- `requestLayout()`
- Override any of these methods on-the-fly.
- Layout debugging:
- `OvermeasureInterceptor`: Tints views according to the number of times they got measured in a single traversal.
- `LayoutBoundsInterceptor`: Equivalent to Android's "Show layout bounds" developer option. The main difference being that you can show bounds only for specific views.Usage
-----1. Add buildscript dependency:
```groovy
buildscript {
...
dependencies {
...
classpath 'org.lucasr.probe:gradle-plugin:0.1.3'
}
}
```2. Apply the plugin to your app’s `build.gradle`:
```groovy
apply plugin: 'org.lucasr.probe'
```3. Enable Probe on a build variant:
```groovy
probe {
buildVariants {
debug {
enabled = true
}
}
}
```4. Implement an `Interceptor`:
```java
public class DrawGreen extends Interceptor {
private final Paint mPaint;
public DrawGreen() {
mPaint = new Paint();
mPaint.setColor(Color.GREEN);
}
@Override
public void onDraw(View view, Canvas canvas) {
canvas.drawPaint(mPaint);
}
}
```2. Deploy your `Interceptor` with an (optional) `Filter`:
```java
public final class MainActivity extends Activity {
@Override
protected void onCreate(Bundle savedInstanceState) {
Probe.deploy(this, new DrawGreen(), new Filter.ViewId(R.id.view2));
super.onCreate(savedInstanceState);
setContentView(R.id.main_activity);
}
}
```Download
--------Download [the latest JAR][1] or grab via Gradle:
```groovy
compile 'org.lucasr.probe:probe:0.1.3'
```or Maven:
```xml
org.lucasr.probe
probe
0.1.3```
License
--------Copyright 2014 Lucas Rocha
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License athttp://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.[1]: https://oss.sonatype.org/service/local/artifact/maven/redirect?r=releases&g=org.lucasr.probe&a=probe&e=aar&v=LATEST