Skip to content

Commit

Permalink
Merge pull request #326 from faisalcodes/master
Browse files Browse the repository at this point in the history
Preparing for patch release "2023.05.23.3"
  • Loading branch information
faisalcodes authored May 23, 2023
2 parents e5bf773 + 8a7ffbe commit d9ebb80
Show file tree
Hide file tree
Showing 5 changed files with 67 additions and 33 deletions.
4 changes: 2 additions & 2 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ android {
targetSdkVersion 33
// I don't know why I've used such a weird versioning scheme in the beginning,
// but I can't change it now as the app is already in the Play Store
versionCode 23_05_22_001
versionName "2023.05.22.1"
versionCode 23_05_23_003
versionName "2023.05.23.3"

resValue "string", "app_name", "QuranApp"

Expand Down
11 changes: 10 additions & 1 deletion app/proguard-rules.pro
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,13 @@
# Keep custom exceptions.
-keep public class * extends java.lang.Exception
# Keep all api models
-keep class com.quranapp.android.api.models.** { *; }
-keep class com.quranapp.android.api.models.** { *; }

# Keep generic signature of Call, Response (R8 full mode strips signatures from non-kept items).
-keep,allowobfuscation,allowshrinking interface retrofit2.Call
-keep,allowobfuscation,allowshrinking class retrofit2.Response

# With R8 full mode generic signatures are stripped for classes that are not
# kept. Suspend functions are wrapped in continuations where the type argument
# is used.
-keep,allowobfuscation,allowshrinking class kotlin.coroutines.Continuation
48 changes: 24 additions & 24 deletions app/src/main/assets/science/index.json
Original file line number Diff line number Diff line change
@@ -1,74 +1,74 @@
[
{
"id": 1,
"title": "Astronomy",
"referencesCount": 16,
"path": "astronomy.html",
"image": "ic_science_astronomy"
"path": "astronomy.html"
},
{
"id": 2,
"title": "Physics",
"referencesCount": 2,
"path": "physics.html",
"image": "ic_science_physics"
"path": "physics.html"
},
{
"id": 3,
"title": "Geography",
"referencesCount": 17,
"path": "geography.html",
"image": "ic_science_geography"
"path": "geography.html"
},
{
"id": 4,
"title": "Geology",
"referencesCount": 6,
"path": "geology.html",
"image": "ic_science_geology"
"path": "geology.html"
},
{
"id": 5,
"title": "Oceanography",
"referencesCount": 3,
"path": "oceanography.html",
"image": "ic_science_oceanography"
"path": "oceanography.html"
},
{
"id": 6,
"title": "Biology",
"referencesCount": 3,
"path": "biology.html",
"image": "ic_science_biology"
"path": "biology.html"
},
{
"id": 7,
"title": "Botany",
"referencesCount": 2,
"path": "botany.html",
"image": "ic_science_botany"
"path": "botany.html"
},
{
"id": 8,
"title": "Zoology",
"referencesCount": 7,
"path": "zoology.html",
"image": "ic_science_zoology"
"path": "zoology.html"
},
{
"id": 9,
"title": "Medicine",
"referencesCount": 2,
"path": "medicine.html",
"image": "ic_science_medicine"
"path": "medicine.html"
},
{
"id": 10,
"title": "Physiology",
"referencesCount": 1,
"path": "physiology.html",
"image": "ic_science_physiology"
"path": "physiology.html"
},
{
"id": 11,
"title": "Embryology",
"referencesCount": 28,
"path": "embryology.html",
"image": "ic_science_embryology"
"path": "embryology.html"
},
{
"id": 12,
"title": "General Science",
"referencesCount": 3,
"path": "general.html",
"image": "ic_science_general"
"path": "general.html"
}
]
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ class ActivityQuranScience : BaseActivity() {
override fun getLayoutResource() = R.layout.activity_exclusive_verses

override fun shouldInflateAsynchronously() = true

@SuppressLint("DiscouragedApi")
override fun onActivityInflated(activityView: View, savedInstanceState: Bundle?) {
val binding = ActivityExclusiveVersesBinding.bind(activityView)
Expand Down Expand Up @@ -46,12 +47,14 @@ class ActivityQuranScience : BaseActivity() {

for (i in 0 until jsonArray.length()) {
val obj = jsonArray.getJSONObject(i)
items.add(QuranScienceItem(
obj.getString("title"),
obj.getInt("referencesCount"),
obj.getString("path"),
resources.getIdentifier(obj.getString("image"), "drawable", packageName)
))
items.add(
QuranScienceItem(
obj.getString("title"),
obj.getInt("referencesCount"),
obj.getString("path"),
getDrawableRes(obj.getInt("id"))
)
)
}
}

Expand All @@ -60,6 +63,24 @@ class ActivityQuranScience : BaseActivity() {
binding.list.adapter = ADPQuranScience(items)
}

private fun getDrawableRes(id: Int): Int {
return when (id) {
1 -> R.drawable.ic_science_astronomy
2 -> R.drawable.ic_science_physics
3 -> R.drawable.ic_science_geography
4 -> R.drawable.ic_science_geology
5 -> R.drawable.ic_science_oceanography
6 -> R.drawable.ic_science_biology
7 -> R.drawable.ic_science_botany
8 -> R.drawable.ic_science_zoology
9 -> R.drawable.ic_science_medicine
10 -> R.drawable.ic_science_physiology
11 -> R.drawable.ic_science_embryology
12 -> R.drawable.ic_science_general
else -> 0
}
}

private fun showInfoDialog() {
PeaceDialog.newBuilder(this)
.setTitle("About this page")
Expand Down
4 changes: 4 additions & 0 deletions inventory/versions/app_updates.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,9 @@
{
"version": 230522001,
"updatePriority": 3
},
{
"version": 230523003,
"updatePriority": 3
}
]

0 comments on commit d9ebb80

Please sign in to comment.