Awesome
<h1 align="center">AdBlockerAdvise</h1> <h4 align="center">Android Library</h4> <p align="center"> <a target="_blank" href="https://android-arsenal.com/api?level=8"><img src="https://img.shields.io/badge/API-8%2B-orange.svg"></a> <a target="_blank" href="https://travis-ci.org/javiersantos/AdBlockerAdvise"><img src="https://travis-ci.org/javiersantos/AdBlockerAdvise.svg?branch=master"></a> <a target="_blank" href="http://android-arsenal.com/details/1/2175"><img src="https://img.shields.io/badge/Android%20Arsenal-AdBlockerAdvise-blue.svg"></a> </p> <p align="center">Android Library that checks if there is an Ad Blocker enabled and shows a customizable Material dialog.</p>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();
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.