From 0d801c5c859761e235fafa0fc9997d958b124630 Mon Sep 17 00:00:00 2001
From: Tairi CHIBA <31642509+pakutoma@users.noreply.github.com>
Date: Sat, 1 May 2021 20:45:46 +0900
Subject: [PATCH] =?UTF-8?q?release:=202.3=20Hotfix=201=20=E3=83=AA?=
=?UTF-8?q?=E3=83=AA=E3=83=BC=E3=82=B9=20(#43)?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
* Fix: 従量制プランに対応 (#39)
* chore: リリース準備
* fix: ギガプラン暫定対応 (#42)
---
.idea/gradle.xml | 1 +
.idea/misc.xml | 10 +++++++---
.idea/modules.xml | 6 ++----
.idea/vcs.xml | 1 -
app/build.gradle | 4 ++--
.../pakutoma/iijmiocouponwidget/utility/CouponAPI.kt | 6 ++++--
.../utility/CouponDataJsonClasses.kt | 2 +-
.../iijmiocouponwidget/utility/CouponAPITest.kt | 2 +-
build.gradle | 2 +-
gradle/wrapper/gradle-wrapper.properties | 4 ++--
10 files changed, 21 insertions(+), 17 deletions(-)
diff --git a/.idea/gradle.xml b/.idea/gradle.xml
index 5cd135a..9bba60d 100644
--- a/.idea/gradle.xml
+++ b/.idea/gradle.xml
@@ -14,6 +14,7 @@
+
diff --git a/.idea/misc.xml b/.idea/misc.xml
index bd6c0e5..8b390aa 100644
--- a/.idea/misc.xml
+++ b/.idea/misc.xml
@@ -5,7 +5,7 @@
-
+
\ No newline at end of file
diff --git a/.idea/modules.xml b/.idea/modules.xml
index 30b162f..b20c9b7 100644
--- a/.idea/modules.xml
+++ b/.idea/modules.xml
@@ -2,10 +2,8 @@
-
-
-
-
+
+
\ No newline at end of file
diff --git a/.idea/vcs.xml b/.idea/vcs.xml
index 8306744..35eb1dd 100644
--- a/.idea/vcs.xml
+++ b/.idea/vcs.xml
@@ -2,6 +2,5 @@
-
\ No newline at end of file
diff --git a/app/build.gradle b/app/build.gradle
index a69bdff..2fc66c3 100644
--- a/app/build.gradle
+++ b/app/build.gradle
@@ -7,8 +7,8 @@ android {
defaultConfig {
applicationId "pakutoma.iijmiocouponwidget"
minSdkVersion 21
- versionCode 7
- versionName "2.3"
+ versionCode 8
+ versionName "2.3 Hotfix 1"
targetSdkVersion 30
}
buildTypes {
diff --git a/app/src/main/java/pakutoma/iijmiocouponwidget/utility/CouponAPI.kt b/app/src/main/java/pakutoma/iijmiocouponwidget/utility/CouponAPI.kt
index c9fef0d..608a266 100644
--- a/app/src/main/java/pakutoma/iijmiocouponwidget/utility/CouponAPI.kt
+++ b/app/src/main/java/pakutoma/iijmiocouponwidget/utility/CouponAPI.kt
@@ -96,6 +96,8 @@ class CouponAPI constructor(developerID: String, accessToken: String) {
-> convertNormalData(it)
"Eco Minimum", "Eco Standard", "Pay as you go"
-> convertEcoData(it)
+ null // TODO: remove null if api returns "giga plan"
+ -> convertNormalData(it)
else
-> throw UndefinedPlanException("Undefined plan name")
}
@@ -104,7 +106,7 @@ class CouponAPI constructor(developerID: String, accessToken: String) {
private fun convertNormalData(normalInfo: CouponInfoFromJson): PlanInfo {
val serviceCode = normalInfo.hddServiceCode
- val plan = normalInfo.plan
+ val plan = normalInfo.plan ?: "unknown plan"
val lineInfoList = ArrayList()
lineInfoList.addAll(normalInfo.hdoInfo?.map {
LineInfo(
@@ -133,7 +135,7 @@ class CouponAPI constructor(developerID: String, accessToken: String) {
private fun convertEcoData(ecoInfo: CouponInfoFromJson): PlanInfo {
val serviceCode = ecoInfo.hddServiceCode
- val plan = ecoInfo.plan
+ val plan = ecoInfo.plan ?: "unknown plan"
val remains = ecoInfo.remains!!
val lineInfoList = ArrayList()
lineInfoList.addAll(ecoInfo.hduInfo?.map {
diff --git a/app/src/main/java/pakutoma/iijmiocouponwidget/utility/CouponDataJsonClasses.kt b/app/src/main/java/pakutoma/iijmiocouponwidget/utility/CouponDataJsonClasses.kt
index a47df45..9d1a414 100644
--- a/app/src/main/java/pakutoma/iijmiocouponwidget/utility/CouponDataJsonClasses.kt
+++ b/app/src/main/java/pakutoma/iijmiocouponwidget/utility/CouponDataJsonClasses.kt
@@ -12,7 +12,7 @@ data class CouponDataFromJson(
data class CouponInfoFromJson(
val hddServiceCode: String,
- val plan: String,
+ val plan: String?,
val hdoInfo: List?,
val hduInfo: List?,
val coupon: List?,
diff --git a/app/src/test/java/pakutoma/iijmiocouponwidget/utility/CouponAPITest.kt b/app/src/test/java/pakutoma/iijmiocouponwidget/utility/CouponAPITest.kt
index 8c49936..7489851 100644
--- a/app/src/test/java/pakutoma/iijmiocouponwidget/utility/CouponAPITest.kt
+++ b/app/src/test/java/pakutoma/iijmiocouponwidget/utility/CouponAPITest.kt
@@ -9,7 +9,7 @@ import org.junit.Assert.*
* Created by PAKUTOMA on 2018/02/21.
*/
class CouponAPITest {
- private val accessToken = "HfXcx3zYSrG3ukkQtZjsQATkqX191aw1553251721"
+ private val accessToken = "fGVZ6pBQwQ8lEXiReGX26tIh2DEtaVy1619862654"
private val developerID = "IilCI1xrAgqKrXV9Zt4"
@Test
fun fetchCouponInfo() {
diff --git a/build.gradle b/build.gradle
index 36a9778..c623a25 100644
--- a/build.gradle
+++ b/build.gradle
@@ -7,7 +7,7 @@ buildscript {
google()
}
dependencies {
- classpath 'com.android.tools.build:gradle:3.3.2'
+ classpath 'com.android.tools.build:gradle:3.6.3'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
classpath "org.jetbrains.kotlin:kotlin-reflect:$kotlin_version"
diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties
index 7dcd8a5..56b2592 100644
--- a/gradle/wrapper/gradle-wrapper.properties
+++ b/gradle/wrapper/gradle-wrapper.properties
@@ -1,6 +1,6 @@
-#Thu Mar 21 15:51:22 JST 2019
+#Sun Oct 04 16:31:46 JST 2020
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
-distributionUrl=https\://services.gradle.org/distributions/gradle-4.10.1-all.zip
+distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.4-all.zip