Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Possibility to customize the (localized) dialog #10

Open
wants to merge 15 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,4 +55,9 @@ Add LICENSE
Null safety

## 2.0.1
Add types for returning value and add default values if invokeMethod will return null vavlue.
Add types for returning value and add default values if invokeMethod will return null vavlue.

## 2.1.0
- Add possibility to customize the dialog
- Add translation of the dialog
- Add possibility to manually choose the language of the dialog
47 changes: 46 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@

Bool variable "isForTest" for testing library, set true to activate setDebugGeography. (works only for Android)
In release build set false or delete this argument!

The dialog is available in the following languages: English, French, Spanish, Italian, German, Portuguese, Dutch, Russian, Chinese, Japanese, Korean.

### Usage

Expand Down Expand Up @@ -71,4 +73,47 @@ GdprDialog.instance.isRequestLocationInEea(String publisherId);

It will return bools:
- true = the user is located in the Eea
- false = the user is not located in the Eea
- false = the user is not located in the Eea


#### Customization of the dialog

### Usage

```
GdprDialog.instance.showDialog('pub-2111344032223404', 'https://plus1s.com/privacy-policy/',
isForTest: true,
testDeviceId: '',
style: GdprDialogStyle(
backgroundColor: Colors.black87,
dialogBorderRadius: 16,
primaryTextColor: Colors.white,
secondaryTextColor: Colors.grey[300],
buttonColor: Colors.deepOrangeAccent,
buttonTextColor: Colors.white,
linkColor: Colors.deepOrangeAccent,
buttonBorderRadius: 8,
buttonBorderSize: 0,
buttonBorderColor: null
),
).then((onValue) {
...
});
```

#### Manually set the language of the dialog

Use the language code en, de, es, fr, it, ja, ko, nl, pt, ru, zh.
Null for system default.

### Usage

```
GdprDialog.instance.showDialog('pub-2111344032223404', 'https://plus1s.com/privacy-policy/',
isForTest: true,
testDeviceId: '',
languageCode: 'it',
).then((onValue) {
...
});
```
17 changes: 14 additions & 3 deletions android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ rootProject.allprojects {
}

apply plugin: 'com.android.library'
apply plugin: 'kotlin-android'

android {
compileSdkVersion 29
Expand All @@ -32,11 +33,21 @@ android {
lintOptions {
disable 'InvalidPackage'
}

buildTypes {
release {
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
consumerProguardFiles 'proguard-rules.pro'
}
}
}

dependencies {
// implementation 'androidx.appcompat:appcompat:1.1.0'
implementation 'com.google.android.ads.consent:consent-library:1.0.8'
// implementation 'com.android.support:multidex:1.0.3'
implementation 'com.google.code.gson:gson:2.8.4'
implementation "androidx.core:core-ktx:+"
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
}
repositories {
mavenCentral()
}

28 changes: 28 additions & 0 deletions android/proguard-rules.pro
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
#
# Copyright (C) 2018 Google, Inc.
#
# 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.

# Add project specific ProGuard rules here.
# You can edit the include path and order by changing the proguardFiles
# directive in build.gradle.
#
# For more details, see
# http://developer.android.com/guide/developing/tools/proguard.html

-keep class com.google.ads.consent.** { <fields>; }

-keepattributes *Annotation*

-keepattributes Signature

Loading