Skip to content

javiersantos/AdBlockerAdvise

Repository files navigation

AdBlockerAdvise

Android Library

Android Library that checks if there is an Ad Blocker enabled and shows a customizable Material dialog.

How to include

Add the repository to your project build.gradle:

repositories {
    maven {
        url "https://jitpack.io"
    }
}

And add the library to your module build.gradle:

dependencies {
    compile 'com.github.javiersantos:AdBlockerAdvise:1.2'
}

Usage

Activity

AdBlockerAdviseDialog adBlockerAdvise = new AdBlockerAdviseDialog(this);
adBlockerAdvise.start();

Customization

Use the builder and add following.

Custom title and content

adBlockerAdvise.setTitle("Don't use an Ad Blocker!");
adBlockerAdvise.setContent("The developer will be happier if you disable them.");
adBlockerAdvise.start();

Display dialog only once

By default, AdBlockerAdviseDialog will show a dialog every time it detects an enabled Ad Blocker, but it can be set to only appear once.

adBlockerAdvise.showOnlyOnce(true);
adBlockerAdvise.start();

Other features

Retrieve if an Ad Blocker is enabled

boolean isAdBlocker = AdBlockerAdvise.isAdBlockerActivated();

AdBlockerAdvise

License

Copyright 2015-2016 Javier Santos

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.

About

Android Library that checks if there is an Ad Blocker enabled and shows a customizable dialog. API 8+ required.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages