Initial Web APIs implementation

Introduce a toggle in Settings > Advanced to let user use Web APIs.
Currently implemented for search suggestions and results only.

Signed-off-by: Aayush Gupta <aayushgupta219@gmail.com>
This commit is contained in:
Aayush Gupta
2023-10-02 14:05:30 +05:30
parent 4134e1f4f4
commit fd097fbba1
7 changed files with 44 additions and 4 deletions

View File

@@ -44,6 +44,7 @@ import com.aurora.store.MainActivity
import com.aurora.store.R
import com.aurora.store.util.Log
import com.aurora.store.util.Preferences
import com.aurora.store.util.Preferences.PREFERENCE_ADVANCED_USE_WEB_API
import kotlin.system.exitProcess
val Context.inflater: LayoutInflater
@@ -176,3 +177,7 @@ fun Context.accentColor(): Int {
}
return ContextCompat.getColor(this, color)
}
fun Context.shouldUseWebAPI(): Boolean {
return Preferences.getBoolean(this, PREFERENCE_ADVANCED_USE_WEB_API)
}