Skip to content

Commit

Permalink
Merge pull request #119 from Yet-Zio/v1.1.3
Browse files Browse the repository at this point in the history
v1.1.3
  • Loading branch information
Yet-Zio committed Mar 30, 2024
2 parents 0aa4486 + ef40759 commit 3a44387
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 13 deletions.
6 changes: 3 additions & 3 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ android {
applicationId "yetzio.yetcalc"
minSdk 21
targetSdk 34
versionCode 13
versionName "1.1.2"
versionCode 14
versionName "1.1.3"

testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
Expand Down Expand Up @@ -66,7 +66,7 @@ dependencies {

implementation 'androidx.preference:preference-ktx:1.2.1'

implementation 'com.fasterxml.jackson.module:jackson-module-kotlin:2.16.1'
implementation 'com.fasterxml.jackson.module:jackson-module-kotlin:2.17.0'
implementation 'com.afollestad.material-dialogs:core:3.3.0'

implementation 'com.airbnb.android:paris:2.0.2'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -153,20 +153,20 @@ class CurrencyFragment : Fragment() {

private fun fetchApiResults(id: Int){
val lowerConv = convCur.lowercase()
// thanks to https://github.com/fawazahmed0/currency-api
API = "https://cdn.jsdelivr.net/gh/fawazahmed0/currency-api@1/latest/currencies/${baseCur.lowercase()}/$lowerConv.json"
// thanks to https://github.com/fawazahmed0/exchange-api
API = "https://cdn.jsdelivr.net/npm/@fawazahmed0/currency-api@latest/v1/currencies/${baseCur.lowercase()}.json"

if(dateText != null){
if(dateText!!.text.isNotEmpty() && dateText!!.text.isNotBlank()){
API = "https://cdn.jsdelivr.net/gh/fawazahmed0/currency-api@1/${pViewModel.current_date}/currencies/${baseCur.lowercase()}/$lowerConv.json"
API = "https://cdn.jsdelivr.net/npm/@fawazahmed0/currency-api@${pViewModel.current_date}/v1/currencies/${baseCur.lowercase()}.json"
}
}

mCoroutineScope.launch {
try{
val resDeferred = mCoroutineScope.async(Dispatchers.IO){
val apiresult = URL(API).readText()
val jsonObj = JSONObject(apiresult)
val jsonObj = JSONObject(apiresult).getJSONObject(baseCur.lowercase())

jsonObj.getDouble(lowerConv).toFloat()
}
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
@@ -1,7 +1,7 @@
<resources>
<string name="author_name">Yet Zio</string>
<string name="app_name">yetCalc</string>
<string name="VERSION_NUM">1.1.2</string>
<string name="VERSION_NUM">1.1.3</string>
<string name="app_descrp">Yet another calculator by Yet Zio</string>
<string name="ghbtext">View on GitHub</string>
<string name="app_details">Free and open source software\nLicensed under the BSD-3-Clause license.</string>
Expand Down Expand Up @@ -217,7 +217,7 @@
<string name="result">Result</string>
<string name="date">Date:</string>
<string name="datehint">YYYY-MM-DD</string>
<string name="datecurrhint">If you want to convert based on historical exchange rate data, specify a date below.\n<![CDATA[ <a href="https://github.com/fawazahmed0/currency-api">Possible dates</a>]]></string>
<string name="datecurrhint">If you want to convert based on historical exchange rate data, specify a date below.\n<![CDATA[ <a href="https://data.jsdelivr.com/v1/package/npm/@fawazahmed0/currency-api">Possible dates</a> listed in tags.]]></string>
<string name="nointInfoText">Currency conversion requires an Internet connection.</string>
<string name="nointTitle">No Internet Connection</string>
<string name="try_again">Try Again</string>
Expand Down
6 changes: 3 additions & 3 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
plugins {
id 'com.android.application' version '8.2.2' apply false
id 'com.android.library' version '8.2.2' apply false
id 'org.jetbrains.kotlin.android' version '1.9.22' apply false
id 'com.android.application' version '8.3.1' apply false
id 'com.android.library' version '8.3.1' apply false
id 'org.jetbrains.kotlin.android' version '1.9.23' apply false
}

task clean(type: Delete) {
Expand Down
3 changes: 3 additions & 0 deletions fastlane/metadata/android/en-US/changelogs/14.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Fixes:

- The Currency API endpoints have been migrated to the new API provided by fawazahmed0 at: https://github.com/fawazahmed0/exchange-api. This fixes the issues with the currency converter not working.
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionUrl=https://services.gradle.org/distributions/gradle-8.6-all.zip
distributionUrl=https://services.gradle.org/distributions/gradle-8.7-all.zip
distributionPath=wrapper/dists
zipStorePath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME

0 comments on commit 3a44387

Please sign in to comment.