Skip to content

Commit

Permalink
Merge branch 'main' into beta
Browse files Browse the repository at this point in the history
  • Loading branch information
Sav22999 committed Oct 14, 2024
2 parents 3bb3fe7 + 278d934 commit 58b8541
Show file tree
Hide file tree
Showing 32 changed files with 523 additions and 100 deletions.
6 changes: 6 additions & 0 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# These are supported funding model platforms

ko_fi: saveriomorelli
liberapay: Sav22999
custom: ["https://www.paypal.me/saveriomorelli"]
github: [Sav22999]
2 changes: 1 addition & 1 deletion .idea/.name

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

40 changes: 40 additions & 0 deletions .idea/appInsightsSettings.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 10 additions & 0 deletions .idea/deploymentTargetSelector.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions .idea/gradle.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion .idea/kotlinc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 10 additions & 0 deletions .idea/migrations.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 13 additions & 0 deletions .idea/runConfigurations.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 5 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,29 +12,25 @@ This app is developed by Saverio Morelli, using the Android Studio IDE.
If you have any questions, please open an issue (you can add the label `question` there).

<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>

--------

<i>The app contains advertisements, in this way you can support the developer indirectly. Either way, you can freely disable those in Settings.</i>

### Where download the app

[<img src="images/googlePlayBadge.png" width="200px"></img>](https://play.google.com/store/apps/details?id=com.saverio.wordoftheday_en)
[<img src="images/googlePlayBadge.png" width="200px"></img>](https://play.google.com/store/apps/details?id=com.saverio.wordoftheday_en) [<img src="images/fDroidBadge.png" width="200px"></img>](https://f-droid.org/it/packages/com.saverio.wordoftheday_en/) [<img src="images/amazonAppStoreBadge.png" width="200px"></img>](https://www.amazon.com/Word-day-Learn-word-every/dp/B09HPVKZD1/)

You can download the app from the Google Play.

### Support me and my work

If you like this project, leave a *Star* ⭐ to receive updates on your *GitHub dashboard*.

You can leave also a ⭐⭐⭐⭐⭐ *stars* review on Google Play it's very important for me.
You can leave also a ⭐⭐⭐⭐⭐ *stars* review on Google Play or Amazon AppStore it's very important for me.

To support me, you can do a donation :smile: with **PayPal**, **LiberaPay** or **Ko-Fi**:

<a href="https://liberapay.com/Sav22999/donate"><img alt="Donate using Liberapay" src="https://liberapay.com/assets/widgets/donate.svg"></a> [<img src="images/paypal.svg" width="160px"></img>](https://paypal.me/pools/c/8yl6auiU6e) [<img src="https://cdn.ko-fi.com/cdn/kofi1.png?v=2" width="120px"></img>](https://ko-fi.com/R5R31UQ8G)
<a href="https://liberapay.com/Sav22999/donate"><img alt="Donate using Liberapay" src="https://liberapay.com/assets/widgets/donate.svg"></a> [<img src="images/paypal.svg" width="160px"></img>](https://paypal.me/saveriomorelli) [<img src="https://cdn.ko-fi.com/cdn/kofi1.png?v=2" width="120px"></img>](https://ko-fi.com/R5R31UQ8G)

### How contribute

Expand All @@ -45,4 +41,4 @@ If you want to help to develop this app, you can open an `Issue` an send feedbac
<img src="images/screenshots/1.png" width="200px"></img><img src="images/screenshots/2.png" width="200px"></img><img src="images/screenshots/3.png" width="200px"></img>


![Generic badge](https://img.shields.io/badge/built%20in-Android%20Studio-green.svg) ![Generic badge](https://img.shields.io/badge/developed%20in-Kotlin-blue.svg) ![GitHub last commit](https://img.shields.io/github/last-commit/Sav22999/sav-pdf-viewer-pro) [![Generic badge](https://img.shields.io/badge/developed%20by-Sav22999-lightgrey.svg)](https://saveriomorelli.com)
![Generic badge](https://img.shields.io/badge/built%20in-Android%20Studio-green.svg) ![Generic badge](https://img.shields.io/badge/developed%20in-Kotlin-blue.svg) ![GitHub last commit](https://img.shields.io/github/last-commit/Sav22999/sav-pdf-viewer-pro) [![Generic badge](https://img.shields.io/badge/developed%20by-Sav22999-lightgrey.svg)](https://saveriomorelli.com)
55 changes: 40 additions & 15 deletions app/build.gradle
Original file line number Diff line number Diff line change
@@ -1,15 +1,17 @@
plugins {
id 'com.android.application'
id 'kotlin-android'
id 'kotlin-kapt'
id 'com.google.devtools.ksp' version '1.9.0-1.0.12'
}

android {
compileSdkVersion 33
compileSdk 34

defaultConfig {
applicationId 'com.saverio.wordoftheday_en'
minSdkVersion 16
targetSdk 33
minSdkVersion 21
targetSdkVersion 34
versionCode 16
versionName '1.5'
multiDexEnabled true
Expand Down Expand Up @@ -40,30 +42,53 @@ android {
signingConfig signingConfigs.debug
}
}


compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
// Set both source and target compatibility to Java 17
sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11
}

kotlinOptions {
jvmTarget = '1.8'
// Set Kotlin target to Java 17
jvmTarget = "11"
}

// Enable the JVM toolchain to ensure consistent versioning
java {
toolchain {
languageVersion.set(JavaLanguageVersion.of(11)) // Use 17 if you're downgrading Java
}
}

namespace 'com.saverio.wordoftheday_en'
}

dependencies {

implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
implementation 'androidx.core:core-ktx:1.3.2'
implementation 'androidx.appcompat:appcompat:1.2.0'
implementation 'com.google.android.material:material:1.2.1'
implementation 'androidx.constraintlayout:constraintlayout:2.0.4'
implementation 'androidx.core:core-ktx:1.13.1'
implementation 'androidx.appcompat:appcompat:1.7.0'
implementation 'com.google.android.material:material:1.12.0'
implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
implementation 'androidx.activity:activity:1.9.2'
testImplementation 'junit:junit:4.13.1'
androidTestImplementation 'androidx.test.ext:junit:1.1.2'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0'
androidTestImplementation 'androidx.test.ext:junit:1.2.1'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.6.1'

implementation 'com.squareup.retrofit2:retrofit:2.9.0'
implementation 'com.squareup.retrofit2:converter-gson:2.9.0'

//implementation 'com.google.android.gms:play-services-ads:19.6.0'
// MultiDex support
implementation 'com.android.support:multidex:1.0.3'
}

// Room dependencies
def room_version = '2.6.1'
implementation "androidx.room:room-runtime:$room_version"
implementation "androidx.room:room-ktx:$room_version"
ksp "androidx.room:room-compiler:2.5.0"

// Optional for coroutines support
}


This file was deleted.

17 changes: 9 additions & 8 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools">

<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.SET_ALARM" />
<uses-permission android:name="com.android.alarm.permission.SET_ALARM" />

<application
android:allowBackup="true"
Expand All @@ -12,14 +13,14 @@
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/Theme.WordOfTheDay"
android:usesCleartextTraffic="true">
<activity android:name=".Settings"></activity>
<!--SplashScreen-->
android:usesCleartextTraffic="true"
tools:targetApi="m">
<activity android:name=".WordHistoryActivity" />
<activity android:name=".Settings" />
<activity
android:name=".SplashScreen"
android:configChanges="orientation|keyboardHidden|screenSize"
android:exported="true"
android:label="@string/app_name">
android:exported="true">
<intent-filter>
<action android:name="android.intent.action.MAIN" />

Expand All @@ -29,8 +30,8 @@
<activity
android:name=".MainActivity"
android:configChanges="orientation|screenSize"
android:exported="true"
android:launchMode="singleTask" />

<receiver android:name=".NotificationReceiver" />

<meta-data
Expand Down
27 changes: 27 additions & 0 deletions app/src/main/java/com/saverio/wordoftheday_en/LoadWord.kt
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ package com.saverio.wordoftheday_en
import android.annotation.SuppressLint
import android.content.Context
import android.util.Log
import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.launch
import retrofit2.Call
import retrofit2.Callback
import retrofit2.Response
Expand Down Expand Up @@ -80,6 +83,30 @@ class LoadWord {
)
}

val wordEntry = Word(
date = getTheCorrectFormatDate(context, model.date, pattern),
word = model.word,
definition = model.definition,
wordType = model.word_type,
phonetics = model.phonetics,
etymology = model.etymology,
source = model.source
)

// Store in Room
val wordDao = WordDatabase.getDatabase(context).wordDao()
CoroutineScope(Dispatchers.IO).launch {
val existingWordCount = wordDao.countWord(model.word)

if (existingWordCount == 0) {
// Only insert if the word does not exist
wordDao.insertWord(wordEntry)
Log.d("LoadWord", "Word inserted: ${model.word}")
} else {
Log.d("LoadWord", "Word already exists: ${model.word}")
}
}

if (notificationReceiver != null) {
//get notification number
var notificationNumber = context.getSharedPreferences(
Expand Down
Loading

0 comments on commit 58b8541

Please sign in to comment.