Probe Gradle Plugin

Dissect layout traversals on Android.

Лицензия

Лицензия

Категории

Категории

Gradle Компиляция и сборка
Группа

Группа

org.lucasr.probe
Идентификатор

Идентификатор

gradle-plugin
Последняя версия

Последняя версия

0.1.3
Дата

Дата

Тип

Тип

jar
Описание

Описание

Probe Gradle Plugin
Dissect layout traversals on Android.
Ссылка на сайт

Ссылка на сайт

https://github.com/lucasr/probe/
Система контроля версий

Система контроля версий

https://github.com/lucasr/probe/

Скачать gradle-plugin

Как подключить последнюю версию

<!-- https://jarcasting.com/artifacts/org.lucasr.probe/gradle-plugin/ -->
<dependency>
    <groupId>org.lucasr.probe</groupId>
    <artifactId>gradle-plugin</artifactId>
    <version>0.1.3</version>
</dependency>
// https://jarcasting.com/artifacts/org.lucasr.probe/gradle-plugin/
implementation 'org.lucasr.probe:gradle-plugin:0.1.3'
// https://jarcasting.com/artifacts/org.lucasr.probe/gradle-plugin/
implementation ("org.lucasr.probe:gradle-plugin:0.1.3")
'org.lucasr.probe:gradle-plugin:jar:0.1.3'
<dependency org="org.lucasr.probe" name="gradle-plugin" rev="0.1.3">
  <artifact name="gradle-plugin" type="jar" />
</dependency>
@Grapes(
@Grab(group='org.lucasr.probe', module='gradle-plugin', version='0.1.3')
)
libraryDependencies += "org.lucasr.probe" % "gradle-plugin" % "0.1.3"
[org.lucasr.probe/gradle-plugin "0.1.3"]

Зависимости

compile (2)

Идентификатор библиотеки Тип Версия
com.squareup : javawriter jar 2.5.0
com.android.tools.build : gradle jar 0.13.+

Модули Проекта

Данный проект не имеет модулей.

Probe

Dissect layout traversals on Android.

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:
buildscript {
    ...
    dependencies {
        ...
        classpath 'org.lucasr.probe:gradle-plugin:0.1.3'
    }
}
  1. Apply the plugin to your app’s build.gradle:
apply plugin: 'org.lucasr.probe'
  1. Enable Probe on a build variant:
probe {
    buildVariants {
        debug {
            enabled = true
        }
    }
}
  1. Implement an Interceptor:
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);
    }
}
  1. Deploy your Interceptor with an (optional) Filter:
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 or grab via Gradle:

compile 'org.lucasr.probe:probe:0.1.3'

or Maven:

<dependency>
  <groupId>org.lucasr.probe</groupId>
  <artifactId>probe</artifactId>
  <version>0.1.3</version>
</dependency>

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 at

   http://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.

Версии библиотеки

Версия
0.1.3
0.1.2