Skip to content

Commit

Permalink
all: less warnings is more (fixes #3749) (#3750)
Browse files Browse the repository at this point in the history
Co-authored-by: dogi <[email protected]>
  • Loading branch information
ewhang5 and dogi authored Jul 2, 2024
1 parent 22f7df3 commit e059ecb
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 8 deletions.
4 changes: 2 additions & 2 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ android {
applicationId "org.ole.planet.myplanet"
minSdkVersion 21
targetSdkVersion 34
versionCode 1642
versionName "0.16.42"
versionCode 1643
versionName "0.16.43"
ndkVersion '21.3.6528147'
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
vectorDrawables.useSupportLibrary = true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,9 @@ import android.view.View
import android.view.ViewGroup
import androidx.fragment.app.Fragment
import com.google.gson.JsonObject
import com.google.gson.JsonParser
import com.google.gson.JsonParser.parseString
import org.ole.planet.myplanet.R
import org.ole.planet.myplanet.databinding.FragmentHelpWantedBinding
import org.ole.planet.myplanet.ui.sync.SyncActivity
import org.ole.planet.myplanet.utilities.Constants.PREFS_NAME
import org.ole.planet.myplanet.utilities.JsonUtils.getString

Expand All @@ -23,7 +22,7 @@ class HelpWantedFragment : Fragment() {
override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View {
fragmentHelpWantedBinding = FragmentHelpWantedBinding.inflate(inflater, container, false)
settings = requireActivity().getSharedPreferences(PREFS_NAME, Context.MODE_PRIVATE)
if (settings.contains("user_admin")) manager = JsonParser().parse(settings.getString("user_admin", "")).asJsonObject
if (settings.contains("user_admin")) manager = parseString(settings.getString("user_admin", "")).asJsonObject
return fragmentHelpWantedBinding.root
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
package org.ole.planet.myplanet.utilities

import com.google.gson.JsonArray
import com.google.gson.JsonParser
import com.google.gson.JsonParser.parseString

object JsonParserUtils {
@JvmStatic
fun getStringAsJsonArray(s: String?): JsonArray {
val parser = JsonParser()
val arrayElement = parser.parse(s)
val arrayElement = parseString(s)
return arrayElement.asJsonArray
}
}

0 comments on commit e059ecb

Please sign in to comment.