Skip to content

Commit

Permalink
Merge pull request #3 from Sav22999/beta
Browse files Browse the repository at this point in the history
1.4.1
  • Loading branch information
Sav22999 authored Oct 12, 2021
2 parents e7a0422 + 4af73e1 commit 1ab47a9
Show file tree
Hide file tree
Showing 13 changed files with 103 additions and 8 deletions.
Binary file added app/FDGH/release/app-FDGH-release.aab
Binary file not shown.
Binary file added app/GPS/release/app-GPS-release.aab
Binary file not shown.
20 changes: 18 additions & 2 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,29 @@ android {
applicationId 'com.saverio.wordoftheday_en'
minSdkVersion 16
targetSdkVersion 30
versionCode 14
versionName '1.4'
versionCode 15
versionName '1.4.1'
multiDexEnabled true

testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}

buildFeatures {
viewBinding true
}

flavorDimensions "source_store"
productFlavors {
GPS {
dimension "source_store"
buildConfigField "String", "SOURCE_STORE", "\"GPS\""
}
FDGH {
dimension "source_store"
buildConfigField "String", "SOURCE_STORE", "\"FD-GH\""
}
}

buildTypes {
release {
minifyEnabled false
Expand Down
Binary file not shown.
18 changes: 18 additions & 0 deletions app/release/output-metadata.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"version": 2,
"artifactType": {
"type": "APK",
"kind": "Directory"
},
"applicationId": "com.saverio.wordoftheday_en",
"variantName": "release",
"elements": [
{
"type": "SINGLE",
"filters": [],
"versionCode": 14,
"versionName": "1.4",
"outputFile": "app-release.apk"
}
]
}
13 changes: 12 additions & 1 deletion app/src/main/java/com/saverio/wordoftheday_en/MainActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ import androidx.appcompat.app.AppCompatActivity
import androidx.constraintlayout.widget.ConstraintLayout
import androidx.core.view.isGone
import androidx.lifecycle.Observer
import com.saverio.wordoftheday_en.BuildConfig.SOURCE_STORE
import com.saverio.wordoftheday_en.MainActivity.Companion.SOURCE_STORE
//import com.google.android.gms.ads.*
import java.text.SimpleDateFormat
import java.time.LocalDate
Expand All @@ -31,6 +33,10 @@ class MainActivity : AppCompatActivity() {
var attempts = 0
val maxAttempts = 5

companion object {
const val SOURCE_STORE: String = BuildConfig.SOURCE_STORE
}

override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_main)
Expand Down Expand Up @@ -98,14 +104,19 @@ class MainActivity : AppCompatActivity() {
}
copyButton.isGone = false

var url = "https://play.google.com/store/apps/details?id=com.saverio.wordoftheday_en"
if (SOURCE_STORE == "FD-GH") {
url = "https://f-droid.org/packages/com.saverio.wordoftheday_en"
}

val shareButton: ImageView = findViewById(R.id.shareButton)
shareButton.setOnClickListener {
shareText(
getString(R.string.the_word_of_the_day_is).replace(
"{{*{{word}}*}}",
word.toString()
)
.replace("{{*{{link}}*}}", "https://bit.ly/2XWj2Mb")
.replace("{{*{{link}}*}}", url)
)
}
shareButton.isGone = false
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,10 @@ class NotificationReceiver : BroadcastReceiver() {
override fun onReceive(context: Context, intent: Intent) {
this.context = context

var loadWord = LoadWord()
loadWord.loadWord(context, attempts, maxAttempts, pattern, notificationReceiver = this)
if (getPushNotifications(context)) {
var loadWord = LoadWord()
loadWord.loadWord(context, attempts, maxAttempts, pattern, notificationReceiver = this)
}
}

fun sendNow(title: String, text: String, number: Int) {
Expand Down
4 changes: 2 additions & 2 deletions app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@
<string name="switch_ads_settings">Show advertisements</string>
<string name="switch_ads_settings_details">In this way you will support the developer freely</string>

<string name="switch_notification_settings">Show push notifications</string>
<string name="switch_notification_settings_details">You will receive a push notification every day at 07:00 am.\nThis could not work caused by OS battery optimisation</string>
<string name="switch_notification_settings">Show notifications</string>
<string name="switch_notification_settings_details">You will receive a notification every day at 07:00 am.\nThis could not work caused by OS battery optimisation</string>

<!-- Messages -->
<string name="loading_word">Loading the word of the day…</string>
Expand Down
1 change: 1 addition & 0 deletions fastlane/metadata/android/en-US/changelogs/15.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Published on F-Droid 🤩
2 changes: 1 addition & 1 deletion fastlane/metadata/android/en-US/full_description.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<b>Every day</b> the app offers <b>a new word to learn</b>, so you will have a vast vocabulary 😍
You can read the definition of the word 📚, its origin / etymology 🗺️, its pronounciation / phonetics (RP-IPA) 🔊.
You can read the definition of the word 📚, its origin / etymology 🗺️, its pronunciation / phonetics (RP-IPA) 🔊.

<b>You can copy or share it as well!</b> 📲

Expand Down
Binary file removed images/screenshots/feather.png
Binary file not shown.
Binary file removed images/screenshots/phone2.png
Binary file not shown.
47 changes: 47 additions & 0 deletions server/api/index.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
<?php
global $localhost_db, $username_db, $password_db, $database_wordoftheday_api;
header("Content-Type:application/json");
if ($c = new mysqli($localhost_db, $username_db, $password_db, $database_wordoftheday_api)) {
$c->set_charset("utf8");
//GET data
$year = date('Y');
$month = date("m");
$day = date("d");

$today_date = "YEAR(`date`) = " . $year . " AND MONTH(`date`) = " . $month . " AND DAY(`date`) = " . $day;

$sql = "SELECT * FROM wordoftheday_en WHERE ${today_date}";

$response = null;

$r = $c->query($sql);
if ($r->num_rows == 1) {
$row = $r->fetch_array();
$response["date"] = $row["date"];
$response["word"] = ucfirst($row["word"]);
$response["definition"] = ucfirst($row["definition"]);
$response["type"] = $row["type"];
$response["phonetics"] = $row["phonetics"];
$response["etymology"] = ucfirst($row["etymology"]);
$response["source"] = $row["source"];
} else {
$response["date"] = "null";
$response["word"] = "";
$response["definition"] = "";
$response["type"] = "";
$response["phonetics"] = "";
$response["etymology"] = "";
$response["source"] = "";
}

echo json_encode($response);
} else {
echo_null();
}

function echo_null()
{
echo json_encode(null);
}

?>

0 comments on commit 1ab47a9

Please sign in to comment.