Drop support for kitkat; Bump minSdk to 21
This has been dead for a while already, remove the code and bump minSdk to a version that actually works Signed-off-by: Aayush Gupta <aayushgupta219@gmail.com>
This commit is contained in:
@@ -21,19 +21,10 @@ package com.aurora.extensions
|
||||
|
||||
import android.app.Activity
|
||||
import android.content.Intent
|
||||
import android.os.Build
|
||||
import android.os.Bundle
|
||||
import androidx.appcompat.app.AppCompatActivity
|
||||
|
||||
|
||||
fun AppCompatActivity.close() {
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
|
||||
finishAfterTransition()
|
||||
} else {
|
||||
finish()
|
||||
}
|
||||
}
|
||||
|
||||
fun AppCompatActivity.restart() {
|
||||
val intent = intent
|
||||
overridePendingTransition(0, 0)
|
||||
|
||||
@@ -25,10 +25,6 @@ import android.os.Build
|
||||
import java.util.*
|
||||
|
||||
|
||||
fun isLAndAbove(): Boolean {
|
||||
return Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP
|
||||
}
|
||||
|
||||
fun isMAndAbove(): Boolean {
|
||||
return Build.VERSION.SDK_INT >= Build.VERSION_CODES.M
|
||||
}
|
||||
|
||||
@@ -121,7 +121,7 @@ private fun AppCompatActivity.setLightConfigurationO() {
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
|
||||
setLightStatusBar()
|
||||
setLightNavigationBar()
|
||||
} else if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
|
||||
} else {
|
||||
window.statusBarColor = ColorUtils.setAlphaComponent(Color.BLACK, 120)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -23,7 +23,6 @@ package com.aurora.store.data.installer
|
||||
import android.content.Context
|
||||
import android.content.pm.PackageInstaller
|
||||
import android.content.pm.PackageManager
|
||||
import com.aurora.extensions.isLAndAbove
|
||||
import com.aurora.extensions.isOAndAbove
|
||||
import com.aurora.store.BuildConfig
|
||||
import com.aurora.store.R
|
||||
@@ -112,7 +111,7 @@ open class AppInstaller private constructor(var context: Context) {
|
||||
val installer = if (hasRootAccess()) {
|
||||
RootInstaller(context)
|
||||
} else {
|
||||
getDefaultInstaller(context)
|
||||
SessionInstaller(context)
|
||||
}
|
||||
choiceAndInstaller[prefValue] = installer
|
||||
installer
|
||||
@@ -121,7 +120,7 @@ open class AppInstaller private constructor(var context: Context) {
|
||||
val installer = if (hasAuroraService(context)) {
|
||||
ServiceInstaller(context)
|
||||
} else {
|
||||
getDefaultInstaller(context)
|
||||
SessionInstaller(context)
|
||||
}
|
||||
choiceAndInstaller[prefValue] = installer
|
||||
installer
|
||||
@@ -130,7 +129,7 @@ open class AppInstaller private constructor(var context: Context) {
|
||||
val installer = if (hasAppManager(context)) {
|
||||
AMInstaller(context)
|
||||
} else {
|
||||
getDefaultInstaller(context)
|
||||
SessionInstaller(context)
|
||||
}
|
||||
choiceAndInstaller[prefValue] = installer
|
||||
installer
|
||||
@@ -140,27 +139,19 @@ open class AppInstaller private constructor(var context: Context) {
|
||||
val installer = if (hasShizuku(context) && hasShizukuPerm()) {
|
||||
ShizukuInstaller(context)
|
||||
} else {
|
||||
getDefaultInstaller(context)
|
||||
SessionInstaller(context)
|
||||
}
|
||||
choiceAndInstaller[prefValue] = installer
|
||||
installer
|
||||
} else {
|
||||
getDefaultInstaller(context)
|
||||
SessionInstaller(context)
|
||||
}
|
||||
}
|
||||
else -> {
|
||||
val installer = getDefaultInstaller(context)
|
||||
val installer = SessionInstaller(context)
|
||||
choiceAndInstaller[prefValue] = installer
|
||||
installer
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private fun getDefaultInstaller(context: Context): InstallerBase {
|
||||
return if (isLAndAbove()) {
|
||||
SessionInstaller(context)
|
||||
} else {
|
||||
NativeInstaller(context)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -22,9 +22,7 @@ package com.aurora.store.data.installer
|
||||
import android.app.Service
|
||||
import android.content.Intent
|
||||
import android.content.pm.PackageInstaller
|
||||
import android.os.Build
|
||||
import android.os.IBinder
|
||||
import androidx.annotation.RequiresApi
|
||||
import com.aurora.store.R
|
||||
import com.aurora.store.data.event.InstallerEvent
|
||||
import com.aurora.store.util.Log
|
||||
@@ -32,7 +30,6 @@ import org.greenrobot.eventbus.EventBus
|
||||
|
||||
class InstallerService : Service() {
|
||||
|
||||
@RequiresApi(api = Build.VERSION_CODES.LOLLIPOP)
|
||||
override fun onStartCommand(intent: Intent, flags: Int, startId: Int): Int {
|
||||
val status = intent.getIntExtra(PackageInstaller.EXTRA_STATUS, -69)
|
||||
val packageName = intent.getStringExtra(PackageInstaller.EXTRA_PACKAGE_NAME)
|
||||
|
||||
@@ -20,7 +20,6 @@
|
||||
package com.aurora.store.data.installer
|
||||
|
||||
import android.content.Context
|
||||
import com.aurora.extensions.isLAndAbove
|
||||
import com.aurora.store.R
|
||||
import com.aurora.store.data.event.InstallerEvent
|
||||
import com.aurora.store.util.Log
|
||||
@@ -45,10 +44,7 @@ class RootInstaller(context: Context) : InstallerBase(context) {
|
||||
}
|
||||
}
|
||||
}.let {
|
||||
if (isLAndAbove())
|
||||
xInstall(packageName, it)
|
||||
else
|
||||
xInstallLegacy(packageName, it)
|
||||
xInstall(packageName, it)
|
||||
}
|
||||
} else {
|
||||
postError(
|
||||
@@ -138,14 +134,6 @@ class RootInstaller(context: Context) : InstallerBase(context) {
|
||||
}
|
||||
}
|
||||
|
||||
private fun xInstallLegacy(packageName: String, files: List<File>) {
|
||||
if (Shell.getShell().isRoot) {
|
||||
Shell.cmd("pm install -i com.android.vending --user 0 \"${files[0].name}\"").exec()
|
||||
} else {
|
||||
removeFromInstallQueue(packageName)
|
||||
}
|
||||
}
|
||||
|
||||
private fun parseError(result: Shell.Result): String {
|
||||
return result.err.joinToString(separator = "\n")
|
||||
}
|
||||
|
||||
@@ -55,7 +55,6 @@ class ServiceInstaller(context: Context) : InstallerBase(context) {
|
||||
const val PRIVILEGED_EXTENSION_SERVICE_INTENT = "com.aurora.services.IPrivilegedService"
|
||||
}
|
||||
|
||||
@RequiresApi(Build.VERSION_CODES.LOLLIPOP)
|
||||
override fun install(packageName: String, files: List<Any>) {
|
||||
|
||||
when {
|
||||
@@ -175,7 +174,6 @@ class ServiceInstaller(context: Context) : InstallerBase(context) {
|
||||
}
|
||||
}
|
||||
|
||||
@RequiresApi(Build.VERSION_CODES.LOLLIPOP)
|
||||
private fun xInstall(packageName: String, uriList: List<Uri>, fileList: List<String>) {
|
||||
executor.execute {
|
||||
val readyWithAction = AtomicBoolean(false)
|
||||
|
||||
@@ -33,7 +33,6 @@ import com.aurora.store.util.Log
|
||||
|
||||
class SessionInstaller(context: Context) : SessionInstallerBase(context) {
|
||||
|
||||
@RequiresApi(Build.VERSION_CODES.LOLLIPOP)
|
||||
override fun install(packageName: String, files: List<Any>) {
|
||||
if (isAlreadyQueued(packageName)) {
|
||||
Log.i("$packageName already queued")
|
||||
|
||||
@@ -35,7 +35,6 @@ import java.io.File
|
||||
|
||||
abstract class SessionInstallerBase(context: Context) : InstallerBase(context) {
|
||||
|
||||
@RequiresApi(Build.VERSION_CODES.LOLLIPOP)
|
||||
protected fun xInstall(
|
||||
sessionId: Int,
|
||||
session: PackageInstaller.Session,
|
||||
|
||||
@@ -1,134 +0,0 @@
|
||||
/*
|
||||
* Aurora Store
|
||||
* Copyright (C) 2021, Rahul Kumar Patel <whyorean@gmail.com>
|
||||
*
|
||||
* Aurora Store is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* Aurora Store is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with Aurora Store. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
package com.aurora.store.data.network
|
||||
|
||||
import com.aurora.gplayapi.data.models.PlayResponse
|
||||
import com.aurora.gplayapi.network.IHttpClient
|
||||
import com.aurora.store.BuildConfig
|
||||
import com.aurora.store.util.Log
|
||||
import com.github.kittinunf.fuel.Fuel
|
||||
import com.github.kittinunf.fuel.core.*
|
||||
import java.nio.charset.Charset
|
||||
import kotlinx.coroutines.flow.MutableStateFlow
|
||||
import kotlinx.coroutines.flow.StateFlow
|
||||
import kotlinx.coroutines.flow.asStateFlow
|
||||
|
||||
object FuelClient : IHttpClient {
|
||||
|
||||
private val _responseCode = MutableStateFlow(0)
|
||||
override val responseCode: StateFlow<Int>
|
||||
get() = _responseCode.asStateFlow()
|
||||
|
||||
override fun get(url: String, headers: Map<String, String>): PlayResponse {
|
||||
return get(url, headers, hashMapOf())
|
||||
}
|
||||
|
||||
override fun get(
|
||||
url: String,
|
||||
headers: Map<String, String>,
|
||||
params: Map<String, String>
|
||||
): PlayResponse {
|
||||
val parameters = params
|
||||
.map { it.key to it.value }
|
||||
.toList()
|
||||
val (request, response, _) = Fuel.get(url, parameters)
|
||||
.header(headers)
|
||||
.response()
|
||||
return buildPlayResponse(response, request)
|
||||
}
|
||||
|
||||
override fun getAuth(url: String): PlayResponse {
|
||||
val (request, response, _) = Fuel.get(url)
|
||||
.appendHeader(
|
||||
"User-Agent",
|
||||
"${BuildConfig.APPLICATION_ID}-${BuildConfig.VERSION_NAME}-${BuildConfig.VERSION_CODE}"
|
||||
)
|
||||
.response()
|
||||
return buildPlayResponse(response, request)
|
||||
}
|
||||
|
||||
override fun get(
|
||||
url: String,
|
||||
headers: Map<String, String>,
|
||||
paramString: String
|
||||
): PlayResponse {
|
||||
val (request, response, _) = Fuel.get(url + paramString)
|
||||
.header(headers)
|
||||
.response()
|
||||
return buildPlayResponse(response, request)
|
||||
}
|
||||
|
||||
override fun post(url: String, headers: Map<String, String>, body: ByteArray): PlayResponse {
|
||||
val (request, response, _) = Fuel.post(url)
|
||||
.header(headers)
|
||||
.appendHeader(Headers.CONTENT_TYPE, "application/x-protobuf")
|
||||
.body(body, Charset.defaultCharset())
|
||||
.response()
|
||||
return buildPlayResponse(response, request)
|
||||
}
|
||||
|
||||
override fun post(
|
||||
url: String,
|
||||
headers: Map<String, String>,
|
||||
params: Map<String, String>
|
||||
): PlayResponse {
|
||||
val parameters = params
|
||||
.map { it.key to it.value }
|
||||
.toList()
|
||||
val (request, response, _) = Fuel.post(url, parameters)
|
||||
.header(headers)
|
||||
.response()
|
||||
return buildPlayResponse(response, request)
|
||||
}
|
||||
|
||||
override fun postAuth(url: String, body: ByteArray): PlayResponse {
|
||||
val (request, response, _) = Fuel.post(url)
|
||||
.appendHeader(
|
||||
"User-Agent",
|
||||
"${BuildConfig.APPLICATION_ID}-${BuildConfig.VERSION_NAME}-${BuildConfig.VERSION_CODE}"
|
||||
)
|
||||
.body(body)
|
||||
.response()
|
||||
return buildPlayResponse(response, request)
|
||||
}
|
||||
|
||||
@JvmStatic
|
||||
private fun buildPlayResponse(response: Response, request: Request): PlayResponse {
|
||||
// Reset response code as flow doesn't sends the same value twice
|
||||
_responseCode.value = 0
|
||||
|
||||
return PlayResponse().apply {
|
||||
isSuccessful = response.isSuccessful
|
||||
code = response.statusCode
|
||||
|
||||
if (response.isSuccessful) {
|
||||
responseBytes = response.body().toByteArray()
|
||||
}
|
||||
|
||||
if (response.isClientError || response.isServerError) {
|
||||
errorBytes = response.responseMessage.toByteArray()
|
||||
errorString = String(errorBytes)
|
||||
}
|
||||
}.also {
|
||||
_responseCode.value = response.statusCode
|
||||
Log.i("FUEL [${request.method}:${response.statusCode}] ${response.url}")
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -19,16 +19,11 @@
|
||||
|
||||
package com.aurora.store.data.network
|
||||
|
||||
import android.os.Build
|
||||
import com.aurora.gplayapi.network.IHttpClient
|
||||
|
||||
object HttpClient {
|
||||
|
||||
fun getPreferredClient(): IHttpClient {
|
||||
return if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
|
||||
OkHttpClient
|
||||
} else {
|
||||
FuelClient
|
||||
}
|
||||
return OkHttpClient
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -71,19 +71,7 @@ class NativeDeviceInfoProvider(context: Context) : ContextWrapper(context) {
|
||||
|
||||
|
||||
//Supported Platforms
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
|
||||
setProperty("Platforms", Build.SUPPORTED_ABIS.joinToString(separator = ","))
|
||||
} else {
|
||||
val platform = mutableListOf<String>()
|
||||
if (!TextUtils.isEmpty(Build.CPU_ABI)) {
|
||||
platform.add(Build.CPU_ABI)
|
||||
}
|
||||
if (!TextUtils.isEmpty(Build.CPU_ABI2)) {
|
||||
platform.add(Build.CPU_ABI2)
|
||||
}
|
||||
|
||||
setProperty("Platforms", platform.joinToString(separator = ","))
|
||||
}
|
||||
setProperty("Platforms", Build.SUPPORTED_ABIS.joinToString(separator = ","))
|
||||
//Supported Features
|
||||
setProperty("Features", getFeatures().joinToString(separator = ","))
|
||||
//Shared Locales
|
||||
@@ -140,13 +128,7 @@ class NativeDeviceInfoProvider(context: Context) : ContextWrapper(context) {
|
||||
|
||||
private fun getLocales(): List<String> {
|
||||
val localeList: MutableList<String> = ArrayList()
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
|
||||
localeList.addAll(listOf(*applicationContext.assets.locales))
|
||||
} else {
|
||||
for (locale in Locale.getAvailableLocales()) {
|
||||
localeList.add(locale.toString())
|
||||
}
|
||||
}
|
||||
localeList.addAll(listOf(*applicationContext.assets.locales))
|
||||
val locales: MutableList<String> = ArrayList()
|
||||
for (locale in localeList) {
|
||||
if (TextUtils.isEmpty(locale)) {
|
||||
@@ -182,4 +164,4 @@ class NativeDeviceInfoProvider(context: Context) : ContextWrapper(context) {
|
||||
properties["Build.ID"] = "ABC.123"
|
||||
return properties
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -24,7 +24,6 @@ import android.app.*
|
||||
import android.content.Context
|
||||
import android.content.Intent
|
||||
import android.graphics.Color
|
||||
import android.os.Build
|
||||
import android.os.IBinder
|
||||
import android.util.ArrayMap
|
||||
import androidx.core.app.NotificationCompat
|
||||
@@ -32,7 +31,6 @@ import androidx.core.app.NotificationManagerCompat
|
||||
import androidx.core.content.ContextCompat
|
||||
import com.aurora.Constants
|
||||
import com.aurora.extensions.getStyledAttributeColor
|
||||
import com.aurora.extensions.isLAndAbove
|
||||
import com.aurora.extensions.isMAndAbove
|
||||
import com.aurora.gplayapi.data.models.App
|
||||
import com.aurora.store.R
|
||||
@@ -54,7 +52,6 @@ import com.tonyodev.fetch2.*
|
||||
import org.greenrobot.eventbus.EventBus
|
||||
import org.greenrobot.eventbus.Subscribe
|
||||
import java.lang.reflect.Modifier
|
||||
import java.util.*
|
||||
|
||||
class NotificationService : Service() {
|
||||
|
||||
@@ -272,12 +269,10 @@ class NotificationService : Service() {
|
||||
}
|
||||
}
|
||||
|
||||
if (isLAndAbove()) {
|
||||
when (status) {
|
||||
Status.DOWNLOADING -> builder.setCategory(Notification.CATEGORY_PROGRESS)
|
||||
Status.FAILED, Status.CANCELLED -> builder.setCategory(Notification.CATEGORY_ERROR)
|
||||
else -> builder.setCategory(Notification.CATEGORY_STATUS)
|
||||
}
|
||||
when (status) {
|
||||
Status.DOWNLOADING -> builder.setCategory(Notification.CATEGORY_PROGRESS)
|
||||
Status.FAILED, Status.CANCELLED -> builder.setCategory(Notification.CATEGORY_ERROR)
|
||||
else -> builder.setCategory(Notification.CATEGORY_STATUS)
|
||||
}
|
||||
|
||||
if (NotificationManagerCompat.from(this).areNotificationsEnabled()) {
|
||||
|
||||
@@ -24,7 +24,6 @@ import android.content.pm.PackageInfo
|
||||
import android.content.pm.PackageManager
|
||||
import android.os.Build
|
||||
import androidx.annotation.RequiresApi
|
||||
import com.aurora.extensions.isLAndAbove
|
||||
import com.aurora.store.util.PackageUtil.getPackageInfo
|
||||
import java.io.File
|
||||
import java.io.FileOutputStream
|
||||
@@ -54,16 +53,12 @@ class ApkCopier(private val context: Context, private val packageName: String) {
|
||||
/*Add base APK*/
|
||||
fileList.add(baseApk)
|
||||
|
||||
if (isLAndAbove()) {
|
||||
val splitSourceDirs = packageInfo.applicationInfo.splitSourceDirs
|
||||
if (splitSourceDirs != null && splitSourceDirs.isNotEmpty()) {
|
||||
/*Add Split APKs*/
|
||||
fileList.addAll(getSplitAPKs(packageInfo))
|
||||
}
|
||||
bundleAllAPKs(fileList)
|
||||
} else {
|
||||
bundleAllAPKs(fileList)
|
||||
val splitSourceDirs = packageInfo.applicationInfo.splitSourceDirs
|
||||
if (splitSourceDirs != null && splitSourceDirs.isNotEmpty()) {
|
||||
/*Add Split APKs*/
|
||||
fileList.addAll(getSplitAPKs(packageInfo))
|
||||
}
|
||||
bundleAllAPKs(fileList)
|
||||
}
|
||||
|
||||
private fun getBaseApk(packageInfo: PackageInfo?): File? {
|
||||
@@ -74,7 +69,6 @@ class ApkCopier(private val context: Context, private val packageName: String) {
|
||||
}
|
||||
}
|
||||
|
||||
@RequiresApi(Build.VERSION_CODES.LOLLIPOP)
|
||||
private fun getSplitAPKs(packageInfo: PackageInfo): MutableList<File> {
|
||||
val fileList: MutableList<File> = ArrayList()
|
||||
val splitSourceDirs = packageInfo.applicationInfo.splitSourceDirs
|
||||
|
||||
@@ -137,16 +137,14 @@ object CommonUtil {
|
||||
}
|
||||
|
||||
fun cleanupInstallationSessions(context: Context) {
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
|
||||
val packageInstaller = context.packageManager.packageInstaller
|
||||
for (sessionInfo in packageInstaller.mySessions) {
|
||||
try {
|
||||
val sessionId = sessionInfo.sessionId
|
||||
packageInstaller.abandonSession(sessionInfo.sessionId)
|
||||
Log.i("Abandoned session id -> %d", sessionId)
|
||||
} catch (e: Exception) {
|
||||
val packageInstaller = context.packageManager.packageInstaller
|
||||
for (sessionInfo in packageInstaller.mySessions) {
|
||||
try {
|
||||
val sessionId = sessionInfo.sessionId
|
||||
packageInstaller.abandonSession(sessionInfo.sessionId)
|
||||
Log.i("Abandoned session id -> %d", sessionId)
|
||||
} catch (e: Exception) {
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -22,7 +22,6 @@ package com.aurora.store.util
|
||||
import android.app.ActivityOptions
|
||||
import android.content.Context
|
||||
import android.content.Intent
|
||||
import android.os.Build
|
||||
import androidx.appcompat.app.AppCompatActivity
|
||||
import com.aurora.Constants
|
||||
import com.aurora.gplayapi.data.models.App
|
||||
@@ -45,12 +44,8 @@ object NavigationUtil {
|
||||
).apply {
|
||||
putExtra(Constants.STRING_EXTRA, gson.toJson(app))
|
||||
}
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
|
||||
val options = ActivityOptions.makeSceneTransitionAnimation(context as AppCompatActivity)
|
||||
context.startActivity(intent, options.toBundle())
|
||||
} else {
|
||||
context.startActivity(intent)
|
||||
}
|
||||
val options = ActivityOptions.makeSceneTransitionAnimation(context as AppCompatActivity)
|
||||
context.startActivity(intent, options.toBundle())
|
||||
}
|
||||
|
||||
fun openDevAppsActivity(context: Context, app: App) {
|
||||
@@ -60,12 +55,8 @@ object NavigationUtil {
|
||||
).apply {
|
||||
putExtra(Constants.STRING_APP, gson.toJson(app))
|
||||
}
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
|
||||
val options = ActivityOptions.makeSceneTransitionAnimation(context as AppCompatActivity)
|
||||
context.startActivity(intent, options.toBundle())
|
||||
} else {
|
||||
context.startActivity(intent)
|
||||
}
|
||||
val options = ActivityOptions.makeSceneTransitionAnimation(context as AppCompatActivity)
|
||||
context.startActivity(intent, options.toBundle())
|
||||
}
|
||||
|
||||
fun openExodusActivity(context: Context, app: App, report: Report) {
|
||||
@@ -76,12 +67,8 @@ object NavigationUtil {
|
||||
putExtra(Constants.STRING_APP, gson.toJson(app))
|
||||
putExtra(Constants.STRING_EXTRA, gson.toJson(report))
|
||||
}
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
|
||||
val options = ActivityOptions.makeSceneTransitionAnimation(context as AppCompatActivity)
|
||||
context.startActivity(intent, options.toBundle())
|
||||
} else {
|
||||
context.startActivity(intent)
|
||||
}
|
||||
val options = ActivityOptions.makeSceneTransitionAnimation(context as AppCompatActivity)
|
||||
context.startActivity(intent, options.toBundle())
|
||||
}
|
||||
|
||||
fun openSearchActivity(context: Context) {
|
||||
@@ -89,11 +76,7 @@ object NavigationUtil {
|
||||
context,
|
||||
SearchResultsActivity::class.java
|
||||
)
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
|
||||
val options = ActivityOptions.makeSceneTransitionAnimation(context as AppCompatActivity)
|
||||
context.startActivity(intent, options.toBundle())
|
||||
} else {
|
||||
context.startActivity(intent)
|
||||
}
|
||||
val options = ActivityOptions.makeSceneTransitionAnimation(context as AppCompatActivity)
|
||||
context.startActivity(intent, options.toBundle())
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -89,13 +89,8 @@ object PackageUtil {
|
||||
}
|
||||
|
||||
fun getLaunchIntent(context: Context, packageName: String?): Intent? {
|
||||
val isTv = Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP && isTv(context)
|
||||
val intent = if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
|
||||
if (isTv) {
|
||||
context.packageManager.getLeanbackLaunchIntentForPackage(packageName!!)
|
||||
} else {
|
||||
context.packageManager.getLaunchIntentForPackage(packageName!!)
|
||||
}
|
||||
val intent = if (isTv(context)) {
|
||||
context.packageManager.getLeanbackLaunchIntentForPackage(packageName!!)
|
||||
} else {
|
||||
context.packageManager.getLaunchIntentForPackage(packageName!!)
|
||||
}
|
||||
@@ -103,7 +98,7 @@ object PackageUtil {
|
||||
return if (intent == null) {
|
||||
null
|
||||
} else {
|
||||
intent.addCategory(if (isTv) Intent.CATEGORY_LEANBACK_LAUNCHER else Intent.CATEGORY_LAUNCHER)
|
||||
intent.addCategory(if (isTv(context)) Intent.CATEGORY_LEANBACK_LAUNCHER else Intent.CATEGORY_LAUNCHER)
|
||||
intent
|
||||
}
|
||||
}
|
||||
|
||||
@@ -21,7 +21,6 @@ package com.aurora.store.util
|
||||
|
||||
import android.content.Context
|
||||
import android.os.Environment
|
||||
import com.aurora.extensions.isLAndAbove
|
||||
import com.aurora.gplayapi.data.models.App
|
||||
import com.aurora.gplayapi.data.models.File
|
||||
import java.util.UUID
|
||||
@@ -33,13 +32,10 @@ fun Context.getInternalBaseDirectory(): String {
|
||||
object PathUtil {
|
||||
|
||||
private fun getDownloadDirectory(context: Context): String {
|
||||
return if (isLAndAbove()) {
|
||||
if (context.isExternalStorageEnable())
|
||||
getExternalPath()
|
||||
else
|
||||
context.getInternalBaseDirectory()
|
||||
} else {
|
||||
return if (context.isExternalStorageEnable()) {
|
||||
getExternalPath()
|
||||
} else {
|
||||
context.getInternalBaseDirectory()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -51,7 +51,6 @@ class RatingView : RelativeLayout {
|
||||
) {
|
||||
}
|
||||
|
||||
@RequiresApi(Build.VERSION_CODES.LOLLIPOP)
|
||||
constructor(
|
||||
context: Context?,
|
||||
attrs: AttributeSet?,
|
||||
@@ -68,4 +67,4 @@ class RatingView : RelativeLayout {
|
||||
B.avgRating.max = max
|
||||
B.avgRating.progress = rating
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -47,7 +47,6 @@ class DevInfoLayout : RelativeLayout {
|
||||
init(context, attrs)
|
||||
}
|
||||
|
||||
@RequiresApi(Build.VERSION_CODES.LOLLIPOP)
|
||||
constructor(
|
||||
context: Context,
|
||||
attrs: AttributeSet?,
|
||||
@@ -80,4 +79,4 @@ class DevInfoLayout : RelativeLayout {
|
||||
B.txtSubtitle.text = text
|
||||
invalidate()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -18,6 +18,7 @@
|
||||
*/
|
||||
package com.aurora.store.view.custom.layouts
|
||||
|
||||
import android.annotation.SuppressLint
|
||||
import android.annotation.TargetApi
|
||||
import android.content.Context
|
||||
import android.content.pm.PackageManager
|
||||
@@ -50,7 +51,6 @@ class PermissionGroup : LinearLayout {
|
||||
init()
|
||||
}
|
||||
|
||||
@TargetApi(Build.VERSION_CODES.LOLLIPOP)
|
||||
constructor(context: Context?, attrs: AttributeSet?, defStyleAttr: Int) : super(
|
||||
context,
|
||||
attrs,
|
||||
@@ -59,7 +59,6 @@ class PermissionGroup : LinearLayout {
|
||||
init()
|
||||
}
|
||||
|
||||
@TargetApi(Build.VERSION_CODES.LOLLIPOP)
|
||||
constructor(
|
||||
context: Context?,
|
||||
attrs: AttributeSet?,
|
||||
|
||||
@@ -27,7 +27,6 @@ import android.widget.RelativeLayout
|
||||
import androidx.annotation.RequiresApi
|
||||
import androidx.core.content.ContextCompat
|
||||
import com.aurora.extensions.getString
|
||||
import com.aurora.extensions.isLAndAbove
|
||||
import com.aurora.extensions.runOnUiThread
|
||||
import com.aurora.store.R
|
||||
import com.aurora.store.State
|
||||
@@ -55,7 +54,6 @@ class ActionButton : RelativeLayout {
|
||||
init(context, attrs)
|
||||
}
|
||||
|
||||
@RequiresApi(Build.VERSION_CODES.LOLLIPOP)
|
||||
constructor(
|
||||
context: Context,
|
||||
attrs: AttributeSet?,
|
||||
@@ -101,9 +99,7 @@ class ActionButton : RelativeLayout {
|
||||
B.btn.text = btnTxt
|
||||
B.btn.setTextColor(stateColor)
|
||||
B.img.setImageDrawable(ContextCompat.getDrawable(context, stateIcon))
|
||||
if (isLAndAbove()) {
|
||||
B.img.imageTintList = ColorStateList.valueOf(stateColor)
|
||||
}
|
||||
B.img.imageTintList = ColorStateList.valueOf(stateColor)
|
||||
|
||||
typedArray.recycle()
|
||||
}
|
||||
@@ -146,4 +142,4 @@ class ActionButton : RelativeLayout {
|
||||
fun addOnClickListener(onClickListener: OnClickListener?) {
|
||||
B.btn.setOnClickListener(onClickListener)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -49,7 +49,6 @@ class StateButton : RelativeLayout {
|
||||
init(context, attrs)
|
||||
}
|
||||
|
||||
@RequiresApi(Build.VERSION_CODES.LOLLIPOP)
|
||||
constructor(
|
||||
context: Context,
|
||||
attrs: AttributeSet?,
|
||||
@@ -86,4 +85,4 @@ class StateButton : RelativeLayout {
|
||||
fun addOnClickListener(onClickListener: OnClickListener) {
|
||||
B.btn.setOnClickListener(onClickListener)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -50,7 +50,6 @@ class UpdateButton : RelativeLayout {
|
||||
init(context)
|
||||
}
|
||||
|
||||
@RequiresApi(Build.VERSION_CODES.LOLLIPOP)
|
||||
constructor(
|
||||
context: Context,
|
||||
attrs: AttributeSet?,
|
||||
|
||||
@@ -82,7 +82,6 @@ public class AuroraProgressView extends View {
|
||||
init(context, attrs, defStyleAttr, R.style.AuroraProgressView);
|
||||
}
|
||||
|
||||
@TargetApi(Build.VERSION_CODES.LOLLIPOP)
|
||||
public AuroraProgressView(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes) {
|
||||
super(context, attrs, defStyleAttr, defStyleRes);
|
||||
init(context, attrs, defStyleAttr, R.style.AuroraProgressView);
|
||||
@@ -362,7 +361,6 @@ public class AuroraProgressView extends View {
|
||||
}
|
||||
}
|
||||
|
||||
@TargetApi(Build.VERSION_CODES.LOLLIPOP)
|
||||
@Override
|
||||
public void drawableHotspotChanged(float x, float y) {
|
||||
super.drawableHotspotChanged(x, y);
|
||||
|
||||
@@ -71,11 +71,7 @@ class AccentView : RelativeLayout {
|
||||
context.theme
|
||||
)
|
||||
} else {
|
||||
if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.LOLLIPOP) {
|
||||
B.img.backgroundTintList = ColorStateList.valueOf(Color.parseColor(accent.accent))
|
||||
} else {
|
||||
B.img.setBackgroundColor(Color.parseColor(accent.accent))
|
||||
}
|
||||
B.img.backgroundTintList = ColorStateList.valueOf(Color.parseColor(accent.accent))
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -27,7 +27,6 @@ import com.aurora.store.R
|
||||
import com.aurora.store.data.model.Link
|
||||
import com.aurora.store.databinding.ActivityAboutBinding
|
||||
import com.aurora.extensions.browse
|
||||
import com.aurora.extensions.close
|
||||
import com.aurora.extensions.copyToClipBoard
|
||||
import com.aurora.extensions.load
|
||||
import com.aurora.store.view.epoxy.views.preference.LinkViewModel_
|
||||
@@ -63,7 +62,7 @@ class AboutActivity : BaseActivity() {
|
||||
private fun attachToolbar() {
|
||||
B.layoutToolbarAction.txtTitle.text = getString(R.string.title_about)
|
||||
B.layoutToolbarAction.imgActionPrimary.setOnClickListener {
|
||||
close()
|
||||
finishAfterTransition()
|
||||
}
|
||||
}
|
||||
|
||||
@@ -126,4 +125,4 @@ class AboutActivity : BaseActivity() {
|
||||
else -> copyToClipBoard(url)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -25,7 +25,6 @@ import android.view.View
|
||||
import androidx.activity.result.contract.ActivityResultContracts
|
||||
import androidx.lifecycle.ViewModelProvider
|
||||
import com.aurora.extensions.browse
|
||||
import com.aurora.extensions.close
|
||||
import com.aurora.extensions.getEmptyActivityAnimation
|
||||
import com.aurora.extensions.load
|
||||
import com.aurora.gplayapi.data.models.AuthData
|
||||
@@ -178,7 +177,7 @@ class AccountActivity : BaseActivity() {
|
||||
private fun attachToolbar() {
|
||||
B.layoutToolbarAction.txtTitle.text = getString(R.string.title_account_manager)
|
||||
B.layoutToolbarAction.imgActionPrimary.setOnClickListener {
|
||||
close()
|
||||
finishAfterTransition()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -27,10 +27,7 @@ import android.webkit.WebSettings
|
||||
import android.webkit.WebView
|
||||
import android.webkit.WebViewClient
|
||||
import android.widget.Toast
|
||||
import androidx.appcompat.app.AppCompatActivity
|
||||
import com.aurora.Constants
|
||||
import com.aurora.extensions.close
|
||||
import com.aurora.extensions.isLAndAbove
|
||||
import com.aurora.store.R
|
||||
import com.aurora.store.data.event.BusEvent
|
||||
import com.aurora.store.databinding.ActivityGoogleBinding
|
||||
@@ -68,11 +65,9 @@ class GoogleActivity : BaseActivity() {
|
||||
|
||||
@SuppressLint("SetJavaScriptEnabled")
|
||||
private fun setupWebView() {
|
||||
if (isLAndAbove()) {
|
||||
cookieManager.removeAllCookies(null)
|
||||
cookieManager.acceptThirdPartyCookies(B.webview)
|
||||
cookieManager.setAcceptThirdPartyCookies(B.webview, true)
|
||||
}
|
||||
cookieManager.removeAllCookies(null)
|
||||
cookieManager.acceptThirdPartyCookies(B.webview)
|
||||
cookieManager.setAcceptThirdPartyCookies(B.webview, true)
|
||||
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
|
||||
B.webview.settings.safeBrowsingEnabled = false
|
||||
@@ -127,7 +122,7 @@ class GoogleActivity : BaseActivity() {
|
||||
|
||||
//Close Activity
|
||||
setResult(RESULT_OK)
|
||||
close()
|
||||
finishAfterTransition()
|
||||
} fail {
|
||||
Toast.makeText(this, getString(R.string.toast_aas_token_failed), Toast.LENGTH_LONG)
|
||||
.show()
|
||||
@@ -135,7 +130,7 @@ class GoogleActivity : BaseActivity() {
|
||||
|
||||
//Close Activity
|
||||
setResult(RESULT_CANCELED)
|
||||
close()
|
||||
finishAfterTransition()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -56,88 +56,51 @@ abstract class BaseActivity : AppCompatActivity(), NetworkProvider.NetworkListen
|
||||
}
|
||||
|
||||
fun openDetailsActivity(app: App) {
|
||||
val intent = Intent(
|
||||
this,
|
||||
AppDetailsActivity::class.java
|
||||
)
|
||||
val intent = Intent(this, AppDetailsActivity::class.java)
|
||||
intent.putExtra(Constants.STRING_EXTRA, gson.toJson(app))
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
|
||||
val options =
|
||||
ActivityOptions.makeSceneTransitionAnimation(this)
|
||||
startActivity(intent, options.toBundle())
|
||||
} else {
|
||||
startActivity(intent)
|
||||
}
|
||||
val options = ActivityOptions.makeSceneTransitionAnimation(this)
|
||||
startActivity(intent, options.toBundle())
|
||||
}
|
||||
|
||||
fun openDetailsMoreActivity(app: App) {
|
||||
val intent = Intent(
|
||||
this,
|
||||
DetailsMoreActivity::class.java
|
||||
)
|
||||
val intent = Intent(this, DetailsMoreActivity::class.java)
|
||||
intent.putExtra(Constants.STRING_EXTRA, gson.toJson(app))
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
|
||||
val options =
|
||||
ActivityOptions.makeSceneTransitionAnimation(this)
|
||||
startActivity(intent, options.toBundle())
|
||||
} else {
|
||||
startActivity(intent)
|
||||
}
|
||||
val options = ActivityOptions.makeSceneTransitionAnimation(this)
|
||||
startActivity(intent, options.toBundle())
|
||||
}
|
||||
|
||||
fun openDetailsReviewActivity(app: App) {
|
||||
val intent = Intent(
|
||||
this,
|
||||
DetailsReviewActivity::class.java
|
||||
)
|
||||
val intent = Intent(this, DetailsReviewActivity::class.java)
|
||||
intent.putExtra(Constants.STRING_EXTRA, gson.toJson(app))
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
|
||||
val options =
|
||||
ActivityOptions.makeSceneTransitionAnimation(this)
|
||||
startActivity(intent, options.toBundle())
|
||||
} else {
|
||||
startActivity(intent)
|
||||
}
|
||||
val options = ActivityOptions.makeSceneTransitionAnimation(this)
|
||||
startActivity(intent, options.toBundle())
|
||||
}
|
||||
|
||||
fun openStreamBrowseActivity(browseUrl: String, title: String = "") {
|
||||
val intent = if (browseUrl.lowercase().contains("expanded"))
|
||||
val intent = if (browseUrl.lowercase().contains("expanded")) {
|
||||
Intent(this, ExpandedStreamBrowseActivity::class.java)
|
||||
else if (browseUrl.lowercase().contains("developer"))
|
||||
} else if (browseUrl.lowercase().contains("developer")) {
|
||||
Intent(this, DevProfileActivity::class.java)
|
||||
else
|
||||
} else {
|
||||
Intent(this, StreamBrowseActivity::class.java)
|
||||
}
|
||||
intent.putExtra(Constants.BROWSE_EXTRA, browseUrl)
|
||||
intent.putExtra(Constants.STRING_EXTRA, title)
|
||||
startActivity(
|
||||
intent,
|
||||
getEmptyActivityBundle()
|
||||
)
|
||||
startActivity(intent, getEmptyActivityBundle())
|
||||
}
|
||||
|
||||
fun openScreenshotActivity(app: App, position: Int) {
|
||||
val intent = Intent(
|
||||
this,
|
||||
ScreenshotActivity::class.java
|
||||
).apply {
|
||||
val intent = Intent(this, ScreenshotActivity::class.java).apply {
|
||||
putExtra(Constants.STRING_EXTRA, gson.toJson(app.screenshots))
|
||||
putExtra(Constants.INT_EXTRA, position)
|
||||
}
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
|
||||
val options =
|
||||
ActivityOptions.makeSceneTransitionAnimation(this)
|
||||
startActivity(intent, options.toBundle())
|
||||
} else {
|
||||
startActivity(intent)
|
||||
}
|
||||
val options = ActivityOptions.makeSceneTransitionAnimation(this)
|
||||
startActivity(intent, options.toBundle())
|
||||
}
|
||||
|
||||
fun openGoogleActivity() {
|
||||
val intent = Intent(this, GoogleActivity::class.java)
|
||||
startActivity(
|
||||
intent,
|
||||
getEmptyActivityBundle()
|
||||
)
|
||||
startActivity(intent, getEmptyActivityBundle())
|
||||
}
|
||||
|
||||
fun askToReadTOS() {
|
||||
|
||||
@@ -21,7 +21,6 @@ package com.aurora.store.view.ui.commons
|
||||
|
||||
import android.app.ActivityOptions
|
||||
import android.content.Intent
|
||||
import android.os.Build
|
||||
import androidx.fragment.app.Fragment
|
||||
import com.aurora.Constants
|
||||
import com.aurora.extensions.getEmptyActivityBundle
|
||||
@@ -42,24 +41,16 @@ open class BaseFragment : Fragment() {
|
||||
fun openDetailsActivity(app: App) {
|
||||
val intent = Intent(context, AppDetailsActivity::class.java)
|
||||
intent.putExtra(Constants.STRING_EXTRA, Gson().toJson(app))
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
|
||||
val options = ActivityOptions.makeSceneTransitionAnimation(requireActivity())
|
||||
startActivity(intent, options.toBundle())
|
||||
} else {
|
||||
startActivity(intent)
|
||||
}
|
||||
val options = ActivityOptions.makeSceneTransitionAnimation(requireActivity())
|
||||
startActivity(intent, options.toBundle())
|
||||
}
|
||||
|
||||
fun openCategoryBrowseActivity(category: Category) {
|
||||
val intent = Intent(context, CategoryBrowseActivity::class.java)
|
||||
intent.putExtra(Constants.STRING_EXTRA, category.title)
|
||||
intent.putExtra(Constants.BROWSE_EXTRA, category.browseUrl)
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
|
||||
val options = ActivityOptions.makeSceneTransitionAnimation(requireActivity())
|
||||
startActivity(intent, options.toBundle())
|
||||
} else {
|
||||
startActivity(intent)
|
||||
}
|
||||
val options = ActivityOptions.makeSceneTransitionAnimation(requireActivity())
|
||||
startActivity(intent, options.toBundle())
|
||||
}
|
||||
|
||||
fun openStreamBrowseActivity(browseUrl: String, title: String = "") {
|
||||
|
||||
@@ -25,7 +25,6 @@ import com.aurora.store.R
|
||||
import com.aurora.store.data.model.Black
|
||||
import com.aurora.store.data.providers.BlacklistProvider
|
||||
import com.aurora.store.databinding.ActivityGenericRecyclerBinding
|
||||
import com.aurora.extensions.close
|
||||
import com.aurora.store.view.epoxy.views.BlackListViewModel_
|
||||
import com.aurora.store.view.epoxy.views.shimmer.AppListViewShimmerModel_
|
||||
import com.aurora.store.viewmodel.all.BlacklistViewModel
|
||||
@@ -77,7 +76,7 @@ class BlacklistActivity : BaseActivity() {
|
||||
private fun attachToolbar() {
|
||||
B.layoutToolbarAction.txtTitle.text = getString(R.string.title_blacklist_manager)
|
||||
B.layoutToolbarAction.imgActionPrimary.setOnClickListener {
|
||||
close()
|
||||
finishAfterTransition()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -23,7 +23,6 @@ import android.os.Bundle
|
||||
import android.widget.Toast
|
||||
import androidx.lifecycle.ViewModelProvider
|
||||
import com.aurora.Constants
|
||||
import com.aurora.extensions.close
|
||||
import com.aurora.gplayapi.data.models.App
|
||||
import com.aurora.gplayapi.data.models.StreamBundle
|
||||
import com.aurora.gplayapi.data.models.StreamCluster
|
||||
@@ -88,7 +87,7 @@ class CategoryBrowseActivity : BaseActivity(), GenericCarouselController.Callbac
|
||||
|
||||
private fun attachToolbar() {
|
||||
B.layoutToolbarAction.imgActionPrimary.setOnClickListener {
|
||||
close()
|
||||
finishAfterTransition()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -25,7 +25,6 @@ import com.airbnb.epoxy.EpoxyModel
|
||||
import com.aurora.Constants
|
||||
import com.aurora.gplayapi.data.models.App
|
||||
import com.aurora.store.databinding.ActivityGenericRecyclerBinding
|
||||
import com.aurora.extensions.close
|
||||
import com.aurora.store.view.epoxy.groups.CarouselHorizontalModel_
|
||||
import com.aurora.store.view.epoxy.views.EditorHeadViewModel_
|
||||
import com.aurora.store.view.epoxy.views.HorizontalDividerViewModel_
|
||||
@@ -82,7 +81,7 @@ class EditorStreamBrowseActivity : BaseActivity() {
|
||||
|
||||
private fun attachToolbar() {
|
||||
B.layoutToolbarAction.imgActionPrimary.setOnClickListener {
|
||||
close()
|
||||
finishAfterTransition()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -25,7 +25,6 @@ import com.airbnb.epoxy.EpoxyModel
|
||||
import com.aurora.Constants
|
||||
import com.aurora.gplayapi.data.models.StreamCluster
|
||||
import com.aurora.store.databinding.ActivityGenericRecyclerBinding
|
||||
import com.aurora.extensions.close
|
||||
import com.aurora.store.view.custom.recycler.EndlessRecyclerOnScrollListener
|
||||
import com.aurora.store.view.epoxy.groups.CarouselHorizontalModel_
|
||||
import com.aurora.store.view.epoxy.views.AppProgressViewModel_
|
||||
@@ -97,7 +96,7 @@ class ExpandedStreamBrowseActivity : BaseActivity() {
|
||||
|
||||
private fun attachToolbar() {
|
||||
B.layoutToolbarAction.imgActionPrimary.setOnClickListener {
|
||||
close()
|
||||
finishAfterTransition()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -24,7 +24,6 @@ import androidx.lifecycle.ViewModelProvider
|
||||
import com.aurora.Constants
|
||||
import com.aurora.gplayapi.data.models.StreamCluster
|
||||
import com.aurora.store.databinding.ActivityGenericRecyclerBinding
|
||||
import com.aurora.extensions.close
|
||||
import com.aurora.store.view.custom.recycler.EndlessRecyclerOnScrollListener
|
||||
import com.aurora.store.view.epoxy.views.AppProgressViewModel_
|
||||
import com.aurora.store.view.epoxy.views.app.AppListViewModel_
|
||||
@@ -90,7 +89,7 @@ class StreamBrowseActivity : BaseActivity() {
|
||||
|
||||
private fun attachToolbar() {
|
||||
B.layoutToolbarAction.imgActionPrimary.setOnClickListener {
|
||||
close()
|
||||
finishAfterTransition()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -228,7 +228,7 @@ class AppDetailsActivity : BaseDetailsActivity() {
|
||||
val packageName = intent.data!!.getQueryParameter("id")
|
||||
val packageVersion = intent.data!!.getQueryParameter("v")
|
||||
if (packageName.isNullOrEmpty()) {
|
||||
close()
|
||||
finishAfterTransition()
|
||||
} else {
|
||||
isExternal = true
|
||||
app = App(packageName)
|
||||
@@ -246,7 +246,7 @@ class AppDetailsActivity : BaseDetailsActivity() {
|
||||
inflatePartialApp()
|
||||
fetchCompleteApp()
|
||||
} else {
|
||||
close()
|
||||
finishAfterTransition()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -28,7 +28,6 @@ import com.aurora.store.data.model.Report
|
||||
import com.aurora.store.data.providers.ExodusDataProvider
|
||||
import com.aurora.store.databinding.ActivityGenericRecyclerBinding
|
||||
import com.aurora.extensions.browse
|
||||
import com.aurora.extensions.close
|
||||
import com.aurora.store.view.epoxy.views.HeaderViewModel_
|
||||
import com.aurora.store.view.epoxy.views.details.ExodusViewModel_
|
||||
import com.aurora.store.view.ui.commons.BaseActivity
|
||||
@@ -78,7 +77,7 @@ class DetailsExodusActivity : BaseActivity() {
|
||||
|
||||
private fun attachToolbar() {
|
||||
B.layoutToolbarAction.toolbar.setOnClickListener {
|
||||
close()
|
||||
finishAfterTransition()
|
||||
}
|
||||
B.layoutToolbarAction.txtTitle.text = app.displayName
|
||||
}
|
||||
|
||||
@@ -28,7 +28,6 @@ import com.aurora.gplayapi.helpers.AppDetailsHelper
|
||||
import com.aurora.store.R
|
||||
import com.aurora.store.data.providers.AuthProvider
|
||||
import com.aurora.store.databinding.ActivityDetailsMoreBinding
|
||||
import com.aurora.extensions.close
|
||||
import com.aurora.store.view.epoxy.views.HeaderViewModel_
|
||||
import com.aurora.store.view.epoxy.views.app.NoAppAltViewModel_
|
||||
import com.aurora.store.view.epoxy.views.details.AppDependentViewModel_
|
||||
@@ -77,7 +76,7 @@ class DetailsMoreActivity : BaseActivity() {
|
||||
|
||||
private fun attachToolbar() {
|
||||
B.layoutToolbarActionMore.toolbar.setOnClickListener {
|
||||
close()
|
||||
finishAfterTransition()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -22,7 +22,6 @@ package com.aurora.store.view.ui.details
|
||||
import android.os.Bundle
|
||||
import androidx.lifecycle.ViewModelProvider
|
||||
import com.aurora.Constants
|
||||
import com.aurora.extensions.close
|
||||
import com.aurora.gplayapi.data.models.App
|
||||
import com.aurora.gplayapi.data.models.Review
|
||||
import com.aurora.gplayapi.data.models.ReviewCluster
|
||||
@@ -91,7 +90,7 @@ class DetailsReviewActivity : BaseActivity() {
|
||||
|
||||
private fun attachToolbar() {
|
||||
B.layoutToolbarActionReview.toolbar.setOnClickListener {
|
||||
close()
|
||||
finishAfterTransition()
|
||||
}
|
||||
B.layoutToolbarActionReview.txtTitle.text = app.displayName
|
||||
}
|
||||
|
||||
@@ -27,7 +27,6 @@ import com.aurora.Constants
|
||||
import com.aurora.gplayapi.data.models.App
|
||||
import com.aurora.gplayapi.data.models.SearchBundle
|
||||
import com.aurora.store.databinding.ActivityGenericRecyclerBinding
|
||||
import com.aurora.extensions.close
|
||||
import com.aurora.store.view.custom.recycler.EndlessRecyclerOnScrollListener
|
||||
import com.aurora.store.view.epoxy.views.app.AppListViewModel_
|
||||
import com.aurora.store.view.epoxy.views.AppProgressViewModel_
|
||||
@@ -87,7 +86,7 @@ class DevAppsActivity : BaseActivity() {
|
||||
|
||||
private fun attachToolbar() {
|
||||
B.layoutToolbarAction.toolbar.setOnClickListener {
|
||||
close()
|
||||
finishAfterTransition()
|
||||
}
|
||||
B.layoutToolbarAction.txtTitle.text = app.developerName
|
||||
}
|
||||
|
||||
@@ -31,7 +31,6 @@ import com.aurora.store.R
|
||||
import com.aurora.store.data.ViewState
|
||||
import com.aurora.store.data.providers.AuthProvider
|
||||
import com.aurora.store.databinding.ActivityDevProfileBinding
|
||||
import com.aurora.extensions.close
|
||||
import com.aurora.extensions.load
|
||||
import com.aurora.store.view.epoxy.controller.DeveloperCarouselController
|
||||
import com.aurora.store.view.epoxy.controller.GenericCarouselController
|
||||
@@ -100,7 +99,7 @@ class DevProfileActivity : BaseActivity(), GenericCarouselController.Callbacks {
|
||||
if (intent.scheme != null && (intent.scheme == "http" || intent.scheme == "https")) {
|
||||
val devId = intent.data!!.getQueryParameter("id")
|
||||
if (devId.isNullOrEmpty()) {
|
||||
close()
|
||||
finishAfterTransition()
|
||||
} else {
|
||||
VM.getStreamBundle(devId)
|
||||
}
|
||||
@@ -113,13 +112,13 @@ class DevProfileActivity : BaseActivity(), GenericCarouselController.Callbacks {
|
||||
}
|
||||
}
|
||||
} else {
|
||||
close()
|
||||
finishAfterTransition()
|
||||
}
|
||||
}
|
||||
|
||||
private fun attachToolbar() {
|
||||
B.layoutToolbarAction.toolbar.setOnClickListener {
|
||||
close()
|
||||
finishAfterTransition()
|
||||
}
|
||||
B.layoutToolbarAction.txtTitle.text = getString(R.string.details_dev_profile)
|
||||
}
|
||||
|
||||
@@ -3,7 +3,6 @@ package com.aurora.store.view.ui.details
|
||||
import android.content.Intent
|
||||
import android.os.Bundle
|
||||
import androidx.appcompat.app.AppCompatActivity
|
||||
import com.aurora.extensions.close
|
||||
import com.aurora.store.R
|
||||
|
||||
class EmptyAppDetailsActivity: AppCompatActivity(R.layout.activity_details) {
|
||||
@@ -19,7 +18,7 @@ class EmptyAppDetailsActivity: AppCompatActivity(R.layout.activity_details) {
|
||||
|
||||
if (intent != null && validSchemes.any { it == intent.scheme }) {
|
||||
if (intent.data!!.getQueryParameter("id").isNullOrEmpty()) {
|
||||
close()
|
||||
finishAfterTransition()
|
||||
} else {
|
||||
// Construct a new intent manually to avoid accepting extras from external apps
|
||||
Intent(this, AppDetailsActivity::class.java).also { extIntent ->
|
||||
|
||||
@@ -27,7 +27,6 @@ import androidx.recyclerview.widget.RecyclerView
|
||||
import com.aurora.Constants
|
||||
import com.aurora.gplayapi.data.models.Artwork
|
||||
import com.aurora.store.databinding.ActivityScreenshotBinding
|
||||
import com.aurora.extensions.close
|
||||
import com.aurora.store.view.epoxy.views.details.LargeScreenshotViewModel_
|
||||
import com.aurora.store.view.ui.commons.BaseActivity
|
||||
import com.google.gson.reflect.TypeToken
|
||||
@@ -54,7 +53,7 @@ class ScreenshotActivity : BaseActivity() {
|
||||
artworks = gson.fromJson(rawArtWorks, object : TypeToken<List<Artwork?>?>() {}.type)
|
||||
updateController(artworks, position)
|
||||
} else {
|
||||
close()
|
||||
finishAfterTransition()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -130,52 +130,50 @@ class AccentFragment : BaseFragment() {
|
||||
}
|
||||
|
||||
private fun animate(view: View) {
|
||||
if (Build.VERSION.SDK_INT >= 21) {
|
||||
if (B.themeSwitchImage.isVisible()) {
|
||||
return;
|
||||
}
|
||||
try {
|
||||
val pos = IntArray(2)
|
||||
view.getLocationInWindow(pos)
|
||||
val w: Int = B.root.measuredWidth
|
||||
val h: Int = B.root.measuredHeight
|
||||
if (B.themeSwitchImage.isVisible()) {
|
||||
return;
|
||||
}
|
||||
try {
|
||||
val pos = IntArray(2)
|
||||
view.getLocationInWindow(pos)
|
||||
val w: Int = B.root.measuredWidth
|
||||
val h: Int = B.root.measuredHeight
|
||||
|
||||
val bitmap = Bitmap.createBitmap(
|
||||
B.root.measuredWidth,
|
||||
B.root.measuredHeight,
|
||||
Bitmap.Config.ARGB_8888
|
||||
)
|
||||
val bitmap = Bitmap.createBitmap(
|
||||
B.root.measuredWidth,
|
||||
B.root.measuredHeight,
|
||||
Bitmap.Config.ARGB_8888
|
||||
)
|
||||
|
||||
val canvas = Canvas(bitmap)
|
||||
B.root.draw(canvas)
|
||||
B.themeSwitchImage.setImageBitmap(bitmap)
|
||||
B.themeSwitchImage.show()
|
||||
val canvas = Canvas(bitmap)
|
||||
B.root.draw(canvas)
|
||||
B.themeSwitchImage.setImageBitmap(bitmap)
|
||||
B.themeSwitchImage.show()
|
||||
|
||||
val finalRadius = sqrt(
|
||||
((w - pos[0]) * (w - pos[0]) + (h - pos[1]) * (h - pos[1])).toDouble()
|
||||
).coerceAtLeast(
|
||||
sqrt((pos[0] * pos[0] + (h - pos[1]) * (h - pos[1])).toDouble())
|
||||
).toFloat()
|
||||
val finalRadius = sqrt(
|
||||
((w - pos[0]) * (w - pos[0]) + (h - pos[1]) * (h - pos[1])).toDouble()
|
||||
).coerceAtLeast(
|
||||
sqrt((pos[0] * pos[0] + (h - pos[1]) * (h - pos[1])).toDouble())
|
||||
).toFloat()
|
||||
|
||||
val anim: Animator = ViewAnimationUtils.createCircularReveal(
|
||||
B.root,
|
||||
pos[0],
|
||||
pos[1],
|
||||
0f,
|
||||
finalRadius
|
||||
)
|
||||
val anim: Animator = ViewAnimationUtils.createCircularReveal(
|
||||
B.root,
|
||||
pos[0],
|
||||
pos[1],
|
||||
0f,
|
||||
finalRadius
|
||||
)
|
||||
|
||||
anim.duration = 450
|
||||
anim.interpolator = CubicBezierInterpolator.EASE_IN_OUT_QUAD
|
||||
anim.addListener(object : AnimatorListenerAdapter() {
|
||||
override fun onAnimationEnd(animation: Animator) {
|
||||
B.themeSwitchImage.setImageDrawable(null)
|
||||
B.themeSwitchImage.hide()
|
||||
}
|
||||
})
|
||||
anim.start()
|
||||
} catch (ignore: Throwable) {
|
||||
}
|
||||
anim.duration = 450
|
||||
anim.interpolator = CubicBezierInterpolator.EASE_IN_OUT_QUAD
|
||||
anim.addListener(object : AnimatorListenerAdapter() {
|
||||
override fun onAnimationEnd(animation: Animator) {
|
||||
B.themeSwitchImage.setImageDrawable(null)
|
||||
B.themeSwitchImage.hide()
|
||||
}
|
||||
})
|
||||
anim.start()
|
||||
} catch (ignore: Throwable) {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -116,52 +116,50 @@ class ThemeFragment : BaseFragment() {
|
||||
}
|
||||
|
||||
private fun animate(view: View) {
|
||||
if (Build.VERSION.SDK_INT >= 21) {
|
||||
if (B.themeSwitchImage.isVisible()) {
|
||||
return;
|
||||
}
|
||||
try {
|
||||
val pos = IntArray(2)
|
||||
view.getLocationInWindow(pos)
|
||||
val w: Int = B.root.measuredWidth
|
||||
val h: Int = B.root.measuredHeight
|
||||
if (B.themeSwitchImage.isVisible()) {
|
||||
return;
|
||||
}
|
||||
try {
|
||||
val pos = IntArray(2)
|
||||
view.getLocationInWindow(pos)
|
||||
val w: Int = B.root.measuredWidth
|
||||
val h: Int = B.root.measuredHeight
|
||||
|
||||
val bitmap = Bitmap.createBitmap(
|
||||
B.root.measuredWidth,
|
||||
B.root.measuredHeight,
|
||||
Bitmap.Config.ARGB_8888
|
||||
)
|
||||
val bitmap = Bitmap.createBitmap(
|
||||
B.root.measuredWidth,
|
||||
B.root.measuredHeight,
|
||||
Bitmap.Config.ARGB_8888
|
||||
)
|
||||
|
||||
val canvas = Canvas(bitmap)
|
||||
B.root.draw(canvas)
|
||||
B.themeSwitchImage.setImageBitmap(bitmap)
|
||||
B.themeSwitchImage.show()
|
||||
val canvas = Canvas(bitmap)
|
||||
B.root.draw(canvas)
|
||||
B.themeSwitchImage.setImageBitmap(bitmap)
|
||||
B.themeSwitchImage.show()
|
||||
|
||||
val finalRadius = sqrt(
|
||||
((w - pos[0]) * (w - pos[0]) + (h - pos[1]) * (h - pos[1])).toDouble()
|
||||
).coerceAtLeast(
|
||||
sqrt((pos[0] * pos[0] + (h - pos[1]) * (h - pos[1])).toDouble())
|
||||
).toFloat()
|
||||
val finalRadius = sqrt(
|
||||
((w - pos[0]) * (w - pos[0]) + (h - pos[1]) * (h - pos[1])).toDouble()
|
||||
).coerceAtLeast(
|
||||
sqrt((pos[0] * pos[0] + (h - pos[1]) * (h - pos[1])).toDouble())
|
||||
).toFloat()
|
||||
|
||||
val anim: Animator = ViewAnimationUtils.createCircularReveal(
|
||||
B.root,
|
||||
pos[0],
|
||||
pos[1],
|
||||
0f,
|
||||
finalRadius
|
||||
)
|
||||
val anim: Animator = ViewAnimationUtils.createCircularReveal(
|
||||
B.root,
|
||||
pos[0],
|
||||
pos[1],
|
||||
0f,
|
||||
finalRadius
|
||||
)
|
||||
|
||||
anim.duration = 450
|
||||
anim.interpolator = CubicBezierInterpolator.EASE_IN_OUT_QUAD
|
||||
anim.addListener(object : AnimatorListenerAdapter() {
|
||||
override fun onAnimationEnd(animation: Animator) {
|
||||
B.themeSwitchImage.setImageDrawable(null)
|
||||
B.themeSwitchImage.hide()
|
||||
}
|
||||
})
|
||||
anim.start()
|
||||
} catch (ignore: Throwable) {
|
||||
}
|
||||
anim.duration = 450
|
||||
anim.interpolator = CubicBezierInterpolator.EASE_IN_OUT_QUAD
|
||||
anim.addListener(object : AnimatorListenerAdapter() {
|
||||
override fun onAnimationEnd(animation: Animator) {
|
||||
B.themeSwitchImage.setImageDrawable(null)
|
||||
B.themeSwitchImage.hide()
|
||||
}
|
||||
})
|
||||
anim.start()
|
||||
} catch (ignore: Throwable) {
|
||||
}
|
||||
}
|
||||
|
||||
@@ -177,4 +175,4 @@ class ThemeFragment : BaseFragment() {
|
||||
object : TypeToken<MutableList<Theme?>?>() {}.type
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -24,7 +24,6 @@ import androidx.lifecycle.ViewModelProvider
|
||||
import com.aurora.gplayapi.data.models.App
|
||||
import com.aurora.store.R
|
||||
import com.aurora.store.databinding.ActivityGenericRecyclerBinding
|
||||
import com.aurora.extensions.close
|
||||
import com.aurora.store.view.custom.recycler.EndlessRecyclerOnScrollListener
|
||||
import com.aurora.store.view.epoxy.views.app.AppListViewModel_
|
||||
import com.aurora.store.view.epoxy.views.AppProgressViewModel_
|
||||
@@ -71,7 +70,7 @@ class AppSalesActivity : BaseActivity() {
|
||||
private fun attachToolbar() {
|
||||
B.layoutToolbarAction.txtTitle.text = getString(R.string.title_apps_sale)
|
||||
B.layoutToolbarAction.imgActionPrimary.setOnClickListener {
|
||||
close()
|
||||
finishAfterTransition()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -34,7 +34,6 @@ import androidx.lifecycle.ViewModelProvider
|
||||
import androidx.lifecycle.lifecycleScope
|
||||
import androidx.lifecycle.repeatOnLifecycle
|
||||
import com.aurora.Constants
|
||||
import com.aurora.extensions.close
|
||||
import com.aurora.extensions.open
|
||||
import com.aurora.gplayapi.data.models.App
|
||||
import com.aurora.gplayapi.data.models.SearchBundle
|
||||
@@ -167,7 +166,7 @@ class SearchResultsActivity : BaseActivity(), OnSharedPreferenceChangeListener {
|
||||
searchView = B.layoutViewToolbar.inputSearch
|
||||
|
||||
B.layoutViewToolbar.imgActionPrimary.setOnClickListener {
|
||||
close()
|
||||
finishAfterTransition()
|
||||
}
|
||||
B.layoutViewToolbar.imgActionSecondary.setOnClickListener {
|
||||
open(DownloadActivity::class.java)
|
||||
|
||||
@@ -29,7 +29,6 @@ import android.widget.TextView
|
||||
import androidx.lifecycle.ViewModelProvider
|
||||
import com.aurora.Constants
|
||||
import com.aurora.extensions.browse
|
||||
import com.aurora.extensions.close
|
||||
import com.aurora.extensions.getEmptyActivityBundle
|
||||
import com.aurora.extensions.open
|
||||
import com.aurora.extensions.showKeyboard
|
||||
@@ -91,7 +90,7 @@ class SearchSuggestionActivity : BaseActivity() {
|
||||
searchView = B.layoutToolbarSearch.inputSearch
|
||||
|
||||
B.layoutToolbarSearch.imgActionPrimary.setOnClickListener {
|
||||
close()
|
||||
finishAfterTransition()
|
||||
}
|
||||
B.layoutToolbarSearch.imgActionSecondary.setOnClickListener {
|
||||
open(DownloadActivity::class.java)
|
||||
|
||||
Reference in New Issue
Block a user