From 61ce9e028473aa8ef4fa014c1b53eabee4d90b20 Mon Sep 17 00:00:00 2001 From: Janak Amarasena Date: Tue, 5 Jun 2018 23:14:40 +0530 Subject: Added donation reminder configurations to custom flavor --- app/build.gradle | 20 +++++++++++++++++++- app/src/custom/res/values/strings.xml | 4 ++++ 2 files changed, 23 insertions(+), 1 deletion(-) create mode 100644 app/src/custom/res/values/strings.xml diff --git a/app/build.gradle b/app/build.gradle index 09858cd2..fea71f6e 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -42,7 +42,7 @@ android { } } - flavorDimensions "implementation" + flavorDimensions "mode","implementation" productFlavors { production { dimension "implementation" @@ -50,6 +50,24 @@ android { insecure { dimension "implementation" } + dafualt { + dimension "mode" + } + custom { + dimension "mode" + + //Build Config Fields for default donation details + + //This is the donation URL and should be set to the relevant donation page. + buildConfigField 'String', 'donation_url', '"https://leap.se/en/about-us/donate"' + //The field to enable donations in the app. + buildConfigField 'boolean', 'enable_donation', 'true' + //The field to enable donation reminder popup in the app if enable_donation is set to 'false' this will be disabled. + buildConfigField 'boolean', 'enable_donation_reminder', 'true' + //The duration in days to trigger the donation reminder + buildConfigField 'int', 'donation_reminder_duration', '30' + + } } buildTypes { diff --git a/app/src/custom/res/values/strings.xml b/app/src/custom/res/values/strings.xml new file mode 100644 index 00000000..b923b42b --- /dev/null +++ b/app/src/custom/res/values/strings.xml @@ -0,0 +1,4 @@ + + + Please donate today if you value secure communication that is easy for both the end-user and the service provider. + -- cgit v1.2.3 From 29d51a50b5c2c3b25c1a8b392b4c36f71b99d68e Mon Sep 17 00:00:00 2001 From: Janak Amarasena Date: Sun, 10 Jun 2018 09:50:20 +0530 Subject: Added custom package details --- app/build.gradle | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/app/build.gradle b/app/build.gradle index fea71f6e..d2255f42 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -55,6 +55,14 @@ android { } custom { dimension "mode" + //Change the package name as needed + applicationId "org.sample.custom" + //Set app name here + resValue "string", "app_name", "Bitmask Custom" + //Change the versionCode as needed + versionCode 1 + //Change the versionName as needed + versionName "1.0" //Build Config Fields for default donation details -- cgit v1.2.3 From 62f5710b081bb4b0e56c3640eac19021844147e7 Mon Sep 17 00:00:00 2001 From: Janak Amarasena Date: Sun, 10 Jun 2018 10:27:02 +0530 Subject: Added splash screen customisation --- app/src/custom/res/drawable/splash_page.xml | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 app/src/custom/res/drawable/splash_page.xml diff --git a/app/src/custom/res/drawable/splash_page.xml b/app/src/custom/res/drawable/splash_page.xml new file mode 100644 index 00000000..8fe99847 --- /dev/null +++ b/app/src/custom/res/drawable/splash_page.xml @@ -0,0 +1,17 @@ + + + + + + + + + + + + + + \ No newline at end of file -- cgit v1.2.3 From 3964908ff4fc7929da8ca436586280e7f49a98a6 Mon Sep 17 00:00:00 2001 From: Janak Amarasena Date: Sun, 10 Jun 2018 10:35:36 +0530 Subject: Added main screen background image customisation --- app/src/custom/res/drawable/ic_colorsquare.xml | 52 ++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100644 app/src/custom/res/drawable/ic_colorsquare.xml diff --git a/app/src/custom/res/drawable/ic_colorsquare.xml b/app/src/custom/res/drawable/ic_colorsquare.xml new file mode 100644 index 00000000..4b60e9dc --- /dev/null +++ b/app/src/custom/res/drawable/ic_colorsquare.xml @@ -0,0 +1,52 @@ + + + + + + + + + + + + + + + + + + + -- cgit v1.2.3 From 797e3e5c4050d4d9ade13453c966f5132ced9bae Mon Sep 17 00:00:00 2001 From: Janak Amarasena Date: Mon, 18 Jun 2018 00:33:53 +0530 Subject: Added custom package id validation --- app/build.gradle | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/app/build.gradle b/app/build.gradle index d2255f42..52ea901b 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -1,3 +1,4 @@ +import java.util.concurrent.ExecutionException import java.util.regex.Matcher import java.util.regex.Pattern @@ -366,3 +367,17 @@ def getCurrentFlavorForBetaOrRelease() { return ""; } } + +task checkApplicationIdForCustomFlavor (type: Exec ) { + def currFlavor = getCurrentFlavorForBetaOrRelease() + if(currFlavor.contains("custom")) { + android.applicationVariants.all { variant -> + def mergedFlavor = variant.mergedFlavor + if (variant.flavorName.toString().equalsIgnoreCase(currFlavor)) { + if (mergedFlavor.getApplicationId().equalsIgnoreCase("org.sample.custom")) { + throw new ExecutionException("ERROR: please change the applicationId(org.sample.custom) if you want to build a custom branded app!") + } + } + } + } +} -- cgit v1.2.3 From b28c9a884a0e0fd0af36e10c74d6554479b9b20b Mon Sep 17 00:00:00 2001 From: Janak Amarasena Date: Mon, 18 Jun 2018 01:15:52 +0530 Subject: Changed MainActivity label to take app name --- app/src/main/AndroidManifest.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index 4e1a9406..8b87d095 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -86,7 +86,7 @@ Date: Mon, 18 Jun 2018 01:16:47 +0530 Subject: Added custom app name validation --- app/build.gradle | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index 52ea901b..3eb948bb 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -3,6 +3,7 @@ import java.util.regex.Matcher import java.util.regex.Pattern apply plugin: 'com.android.application' +def appName = '' android { compileSdkVersion 27 @@ -57,9 +58,10 @@ android { custom { dimension "mode" //Change the package name as needed - applicationId "org.sample.custom" + applicationId "org.sample.customs" //Set app name here - resValue "string", "app_name", "Bitmask Custom" + appName = "Custom" + resValue "string", "app_name", appName //Change the versionCode as needed versionCode 1 //Change the versionName as needed @@ -381,3 +383,12 @@ task checkApplicationIdForCustomFlavor (type: Exec ) { } } } + +task checkAppNameForCustomFlavor (type: Exec ) { + def currFlavor = getCurrentFlavorForBetaOrRelease() + if(currFlavor.contains("custom")) { + if (appName.equalsIgnoreCase("custom")) { + throw new ExecutionException("ERROR: please change the appName(Custom) if you want to build a custom branded app!") + } + } +} \ No newline at end of file -- cgit v1.2.3 From d468147c8d7a99dbac48a68f8377444fc1a9fe30 Mon Sep 17 00:00:00 2001 From: Janak Amarasena Date: Mon, 18 Jun 2018 20:27:30 +0530 Subject: Minor updates according to received feedback --- app/build.gradle | 50 +++++++++++++++++++++++++++++++++----------------- 1 file changed, 33 insertions(+), 17 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index 3eb948bb..5133b862 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -52,13 +52,14 @@ android { insecure { dimension "implementation" } - dafualt { + defualt { dimension "mode" } + //Configurations for custom branded app. custom { dimension "mode" //Change the package name as needed - applicationId "org.sample.customs" + applicationId "org.sample.custom" //Set app name here appName = "Custom" resValue "string", "app_name", appName @@ -370,25 +371,40 @@ def getCurrentFlavorForBetaOrRelease() { } } -task checkApplicationIdForCustomFlavor (type: Exec ) { - def currFlavor = getCurrentFlavorForBetaOrRelease() - if(currFlavor.contains("custom")) { +def getCurrentFlavor() { + Gradle gradle = getGradle() + String tskReqStr = gradle.getStartParameter().getTaskRequests().toString() + + Pattern pattern; + + if (tskReqStr.contains("assemble")) + pattern = Pattern.compile("assemble(\\w+)(Beta|Release|Debug)") + else + pattern = Pattern.compile("generate(\\w+)(Beta|Release|Debug)") + + Matcher matcher = pattern.matcher(tskReqStr) + + if (matcher.find()) + return matcher.group(1).toLowerCase() + else { + return ""; + } +} + +task checkApplicationIdForCustomFlavor(type: Exec) { + def currFlavor = getCurrentFlavor() + if (currFlavor.contains("custom")) { android.applicationVariants.all { variant -> def mergedFlavor = variant.mergedFlavor - if (variant.flavorName.toString().equalsIgnoreCase(currFlavor)) { - if (mergedFlavor.getApplicationId().equalsIgnoreCase("org.sample.custom")) { - throw new ExecutionException("ERROR: please change the applicationId(org.sample.custom) if you want to build a custom branded app!") - } - } + if (variant.flavorName.toString().equalsIgnoreCase(currFlavor) && + mergedFlavor.getApplicationId().equalsIgnoreCase("org.sample.custom")) + throw new ExecutionException("ERROR: please change the applicationId(org.sample.custom) if you want to build a custom branded app!") } } } -task checkAppNameForCustomFlavor (type: Exec ) { - def currFlavor = getCurrentFlavorForBetaOrRelease() - if(currFlavor.contains("custom")) { - if (appName.equalsIgnoreCase("custom")) { - throw new ExecutionException("ERROR: please change the appName(Custom) if you want to build a custom branded app!") - } - } +task checkAppNameForCustomFlavor(type: Exec) { + def currFlavor = getCurrentFlavor() + if (currFlavor.contains("custom") && appName.equalsIgnoreCase("custom")) + throw new ExecutionException("ERROR: please change the appName(Custom) if you want to build a custom branded app!") } \ No newline at end of file -- cgit v1.2.3 From cd1c2ec77bd06dfff3399e08bff6481c27d9baf4 Mon Sep 17 00:00:00 2001 From: Janak Amarasena Date: Thu, 21 Jun 2018 00:37:07 +0530 Subject: Minor updates according to received feedback --- app/build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/build.gradle b/app/build.gradle index 5133b862..e8f8b78f 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -52,7 +52,7 @@ android { insecure { dimension "implementation" } - defualt { + normal { dimension "mode" } //Configurations for custom branded app. -- cgit v1.2.3 From e39762735faa8e66b6bb526c1775f13d0e91da4e Mon Sep 17 00:00:00 2001 From: Janak Amarasena Date: Sat, 23 Jun 2018 10:28:33 +0530 Subject: Added launcher icon customisation --- .../custom/res/drawable/ic_launcher_background.xml | 170 +++++++++++++++++++++ .../custom/res/drawable/ic_launcher_foreground.xml | 34 +++++ .../custom/res/mipmap-anydpi-v26/ic_launcher.xml | 5 + .../res/mipmap-anydpi-v26/ic_launcher_round.xml | 5 + app/src/custom/res/mipmap-hdpi/ic_launcher.png | Bin 0 -> 3056 bytes .../custom/res/mipmap-hdpi/ic_launcher_round.png | Bin 0 -> 5024 bytes app/src/custom/res/mipmap-mdpi/ic_launcher.png | Bin 0 -> 2096 bytes .../custom/res/mipmap-mdpi/ic_launcher_round.png | Bin 0 -> 2858 bytes app/src/custom/res/mipmap-xhdpi/ic_launcher.png | Bin 0 -> 4569 bytes .../custom/res/mipmap-xhdpi/ic_launcher_round.png | Bin 0 -> 7098 bytes app/src/custom/res/mipmap-xxhdpi/ic_launcher.png | Bin 0 -> 6464 bytes .../custom/res/mipmap-xxhdpi/ic_launcher_round.png | Bin 0 -> 10676 bytes app/src/custom/res/mipmap-xxxhdpi/ic_launcher.png | Bin 0 -> 9250 bytes .../res/mipmap-xxxhdpi/ic_launcher_round.png | Bin 0 -> 15523 bytes 14 files changed, 214 insertions(+) create mode 100644 app/src/custom/res/drawable/ic_launcher_background.xml create mode 100644 app/src/custom/res/drawable/ic_launcher_foreground.xml create mode 100644 app/src/custom/res/mipmap-anydpi-v26/ic_launcher.xml create mode 100644 app/src/custom/res/mipmap-anydpi-v26/ic_launcher_round.xml create mode 100644 app/src/custom/res/mipmap-hdpi/ic_launcher.png create mode 100644 app/src/custom/res/mipmap-hdpi/ic_launcher_round.png create mode 100644 app/src/custom/res/mipmap-mdpi/ic_launcher.png create mode 100644 app/src/custom/res/mipmap-mdpi/ic_launcher_round.png create mode 100644 app/src/custom/res/mipmap-xhdpi/ic_launcher.png create mode 100644 app/src/custom/res/mipmap-xhdpi/ic_launcher_round.png create mode 100644 app/src/custom/res/mipmap-xxhdpi/ic_launcher.png create mode 100644 app/src/custom/res/mipmap-xxhdpi/ic_launcher_round.png create mode 100644 app/src/custom/res/mipmap-xxxhdpi/ic_launcher.png create mode 100644 app/src/custom/res/mipmap-xxxhdpi/ic_launcher_round.png diff --git a/app/src/custom/res/drawable/ic_launcher_background.xml b/app/src/custom/res/drawable/ic_launcher_background.xml new file mode 100644 index 00000000..d5fccc53 --- /dev/null +++ b/app/src/custom/res/drawable/ic_launcher_background.xml @@ -0,0 +1,170 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/app/src/custom/res/drawable/ic_launcher_foreground.xml b/app/src/custom/res/drawable/ic_launcher_foreground.xml new file mode 100644 index 00000000..c7bd21db --- /dev/null +++ b/app/src/custom/res/drawable/ic_launcher_foreground.xml @@ -0,0 +1,34 @@ + + + + + + + + + + + diff --git a/app/src/custom/res/mipmap-anydpi-v26/ic_launcher.xml b/app/src/custom/res/mipmap-anydpi-v26/ic_launcher.xml new file mode 100644 index 00000000..eca70cfe --- /dev/null +++ b/app/src/custom/res/mipmap-anydpi-v26/ic_launcher.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/app/src/custom/res/mipmap-anydpi-v26/ic_launcher_round.xml b/app/src/custom/res/mipmap-anydpi-v26/ic_launcher_round.xml new file mode 100644 index 00000000..eca70cfe --- /dev/null +++ b/app/src/custom/res/mipmap-anydpi-v26/ic_launcher_round.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/app/src/custom/res/mipmap-hdpi/ic_launcher.png b/app/src/custom/res/mipmap-hdpi/ic_launcher.png new file mode 100644 index 00000000..a2f59082 Binary files /dev/null and b/app/src/custom/res/mipmap-hdpi/ic_launcher.png differ diff --git a/app/src/custom/res/mipmap-hdpi/ic_launcher_round.png b/app/src/custom/res/mipmap-hdpi/ic_launcher_round.png new file mode 100644 index 00000000..1b523998 Binary files /dev/null and b/app/src/custom/res/mipmap-hdpi/ic_launcher_round.png differ diff --git a/app/src/custom/res/mipmap-mdpi/ic_launcher.png b/app/src/custom/res/mipmap-mdpi/ic_launcher.png new file mode 100644 index 00000000..ff10afd6 Binary files /dev/null and b/app/src/custom/res/mipmap-mdpi/ic_launcher.png differ diff --git a/app/src/custom/res/mipmap-mdpi/ic_launcher_round.png b/app/src/custom/res/mipmap-mdpi/ic_launcher_round.png new file mode 100644 index 00000000..115a4c76 Binary files /dev/null and b/app/src/custom/res/mipmap-mdpi/ic_launcher_round.png differ diff --git a/app/src/custom/res/mipmap-xhdpi/ic_launcher.png b/app/src/custom/res/mipmap-xhdpi/ic_launcher.png new file mode 100644 index 00000000..dcd3cd80 Binary files /dev/null and b/app/src/custom/res/mipmap-xhdpi/ic_launcher.png differ diff --git a/app/src/custom/res/mipmap-xhdpi/ic_launcher_round.png b/app/src/custom/res/mipmap-xhdpi/ic_launcher_round.png new file mode 100644 index 00000000..459ca609 Binary files /dev/null and b/app/src/custom/res/mipmap-xhdpi/ic_launcher_round.png differ diff --git a/app/src/custom/res/mipmap-xxhdpi/ic_launcher.png b/app/src/custom/res/mipmap-xxhdpi/ic_launcher.png new file mode 100644 index 00000000..8ca12fe0 Binary files /dev/null and b/app/src/custom/res/mipmap-xxhdpi/ic_launcher.png differ diff --git a/app/src/custom/res/mipmap-xxhdpi/ic_launcher_round.png b/app/src/custom/res/mipmap-xxhdpi/ic_launcher_round.png new file mode 100644 index 00000000..8e19b410 Binary files /dev/null and b/app/src/custom/res/mipmap-xxhdpi/ic_launcher_round.png differ diff --git a/app/src/custom/res/mipmap-xxxhdpi/ic_launcher.png b/app/src/custom/res/mipmap-xxxhdpi/ic_launcher.png new file mode 100644 index 00000000..b824ebdd Binary files /dev/null and b/app/src/custom/res/mipmap-xxxhdpi/ic_launcher.png differ diff --git a/app/src/custom/res/mipmap-xxxhdpi/ic_launcher_round.png b/app/src/custom/res/mipmap-xxxhdpi/ic_launcher_round.png new file mode 100644 index 00000000..4c19a13c Binary files /dev/null and b/app/src/custom/res/mipmap-xxxhdpi/ic_launcher_round.png differ -- cgit v1.2.3 From ea4c5ca2b27aeabd4a1b000ac2066be6023b2e45 Mon Sep 17 00:00:00 2001 From: Janak Amarasena Date: Sat, 23 Jun 2018 13:05:42 +0530 Subject: Added customisability to main colors --- app/src/custom/res/values/custom-theme.xml | 12 ++++++++++++ app/src/main/res/layout/a_main.xml | 3 ++- app/src/main/res/values/colors.xml | 3 +++ 3 files changed, 17 insertions(+), 1 deletion(-) create mode 100644 app/src/custom/res/values/custom-theme.xml diff --git a/app/src/custom/res/values/custom-theme.xml b/app/src/custom/res/values/custom-theme.xml new file mode 100644 index 00000000..4421adb9 --- /dev/null +++ b/app/src/custom/res/values/custom-theme.xml @@ -0,0 +1,12 @@ + + + + + #b39ddb + + #ac97d2 + + #ffffff + + #000000 + diff --git a/app/src/main/res/layout/a_main.xml b/app/src/main/res/layout/a_main.xml index bed05d18..21fdaa66 100644 --- a/app/src/main/res/layout/a_main.xml +++ b/app/src/main/res/layout/a_main.xml @@ -20,7 +20,8 @@ android:minHeight="?attr/actionBarSize" android:layout_width="match_parent" android:layout_height="wrap_content" - app:titleTextColor="@android:color/white" + app:titleTextColor="@color/colorActionBarTitleFont" + app:subtitleTextColor="@color/colorActionBarSubtitleFont" android:background="?attr/colorPrimary"> diff --git a/app/src/main/res/values/colors.xml b/app/src/main/res/values/colors.xml index 53ead009..40ab06c5 100644 --- a/app/src/main/res/values/colors.xml +++ b/app/src/main/res/values/colors.xml @@ -27,4 +27,7 @@ #ffffff + @color/white + @color/black800 + -- cgit v1.2.3