Switch from toLowercase() to lowercase() method
Signed-off-by: Aayush Gupta <aayushgupta219@gmail.com>
This commit is contained in:
@@ -66,9 +66,9 @@ fun isMIUI(): Boolean {
|
||||
}
|
||||
|
||||
fun isHuawei(): Boolean {
|
||||
return Build.MANUFACTURER.toLowerCase(Locale.getDefault()).contains("huawei")
|
||||
|| Build.HARDWARE.toLowerCase(Locale.getDefault()).contains("kirin")
|
||||
|| Build.HARDWARE.toLowerCase(Locale.getDefault()).contains("hi3")
|
||||
return Build.MANUFACTURER.lowercase(Locale.getDefault()).contains("huawei")
|
||||
|| Build.HARDWARE.lowercase(Locale.getDefault()).contains("kirin")
|
||||
|| Build.HARDWARE.lowercase(Locale.getDefault()).contains("hi3")
|
||||
}
|
||||
|
||||
fun getMIUIVersion(): String {
|
||||
@@ -102,4 +102,4 @@ fun getSystemProperty(key: String): String {
|
||||
} catch (e: Exception) {
|
||||
""
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -32,7 +32,7 @@ class AC2DMTask {
|
||||
params["lang"] = Locale.getDefault().toString().replace("_", "-")
|
||||
params["google_play_services_version"] = PLAY_SERVICES_VERSION_CODE
|
||||
params["sdk_version"] = BUILD_VERSION_SDK
|
||||
params["device_country"] = Locale.getDefault().country.toLowerCase(Locale.US)
|
||||
params["device_country"] = Locale.getDefault().country.lowercase(Locale.US)
|
||||
params["Email"] = email
|
||||
params["service"] = "ac2dm"
|
||||
params["get_accountid"] = 1
|
||||
@@ -63,4 +63,4 @@ class AC2DMTask {
|
||||
private const val BUILD_VERSION_SDK = 28
|
||||
private const val PLAY_SERVICES_VERSION_CODE = 19629032
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -156,11 +156,11 @@ class PermissionGroup : LinearLayout {
|
||||
if (label.startsWith(it)) {
|
||||
return it.replace(it, "")
|
||||
.replace("_", " ")
|
||||
.toLowerCase(Locale.getDefault())
|
||||
.lowercase(Locale.getDefault())
|
||||
.capitalize(Locale.getDefault())
|
||||
}
|
||||
}
|
||||
|
||||
return label.capitalize(Locale.getDefault())
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -92,7 +92,7 @@ class DownloadView : RelativeLayout {
|
||||
}
|
||||
|
||||
B.txtStatus.text = download.status.name
|
||||
.toLowerCase(Locale.getDefault())
|
||||
.lowercase(Locale.getDefault())
|
||||
.capitalize(Locale.getDefault())
|
||||
|
||||
B.txtSize.text = StringBuilder()
|
||||
@@ -143,4 +143,4 @@ class DownloadView : RelativeLayout {
|
||||
fun clear() {
|
||||
B.imgDownload.clear()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -63,7 +63,7 @@ class InfoView : RelativeLayout {
|
||||
fun badge(info: Map.Entry<String, String>) {
|
||||
B.txtTitle.text = info.key
|
||||
.replace("_", " ")
|
||||
.toLowerCase(Locale.getDefault())
|
||||
.lowercase(Locale.getDefault())
|
||||
.capitalize(Locale.getDefault())
|
||||
B.txtSubtitle.text = info.value
|
||||
}
|
||||
@@ -71,4 +71,4 @@ class InfoView : RelativeLayout {
|
||||
@OnViewRecycled
|
||||
fun clear() {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -101,9 +101,9 @@ abstract class BaseActivity : AppCompatActivity(), NetworkProvider.NetworkListen
|
||||
}
|
||||
|
||||
fun openStreamBrowseActivity(browseUrl: String, title: String = "") {
|
||||
val intent = if (browseUrl.toLowerCase().contains("expanded"))
|
||||
val intent = if (browseUrl.lowercase().contains("expanded"))
|
||||
Intent(this, ExpandedStreamBrowseActivity::class.java)
|
||||
else if (browseUrl.toLowerCase().contains("developer"))
|
||||
else if (browseUrl.lowercase().contains("developer"))
|
||||
Intent(this, DevProfileActivity::class.java)
|
||||
else
|
||||
Intent(this, StreamBrowseActivity::class.java)
|
||||
@@ -181,4 +181,4 @@ abstract class BaseActivity : AppCompatActivity(), NetworkProvider.NetworkListen
|
||||
NetworkProvider.removeListener(this)
|
||||
super.onStop()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -63,9 +63,9 @@ open class BaseFragment : Fragment() {
|
||||
}
|
||||
|
||||
fun openStreamBrowseActivity(browseUrl: String, title: String = "") {
|
||||
val intent = if (browseUrl.toLowerCase().contains("expanded"))
|
||||
val intent = if (browseUrl.lowercase().contains("expanded"))
|
||||
Intent(requireContext(), ExpandedStreamBrowseActivity::class.java)
|
||||
else if (browseUrl.toLowerCase().contains("developer"))
|
||||
else if (browseUrl.lowercase().contains("developer"))
|
||||
Intent(requireContext(), DevProfileActivity::class.java)
|
||||
else
|
||||
Intent(requireContext(), StreamBrowseActivity::class.java)
|
||||
@@ -81,4 +81,4 @@ open class BaseFragment : Fragment() {
|
||||
intent.putExtra(Constants.STRING_EXTRA, title)
|
||||
startActivity(intent, requireContext().getEmptyActivityBundle())
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -71,7 +71,7 @@ class BlacklistViewModel(application: Application) : BaseAndroidViewModel(applic
|
||||
}
|
||||
blackList.add(black)
|
||||
}
|
||||
liveData.postValue(blackList.sortedBy { it.displayName.toLowerCase(Locale.getDefault()) })
|
||||
liveData.postValue(blackList.sortedBy { it.displayName.lowercase(Locale.getDefault()) })
|
||||
requestState = RequestState.Complete
|
||||
} catch (e: Exception) {
|
||||
e.printStackTrace()
|
||||
|
||||
@@ -44,7 +44,7 @@ class InstalledViewModel(application: Application) : BaseAppsViewModel(applicati
|
||||
viewModelScope.launch(Dispatchers.IO) {
|
||||
try {
|
||||
appList.flushAndAdd(getFilteredApps())
|
||||
liveData.postValue(appList.sortedBy { it.displayName.toLowerCase(Locale.getDefault()) })
|
||||
liveData.postValue(appList.sortedBy { it.displayName.lowercase(Locale.getDefault()) })
|
||||
requestState = RequestState.Complete
|
||||
} catch (e: Exception) {
|
||||
requestState = RequestState.Pending
|
||||
@@ -79,7 +79,7 @@ class InstalledViewModel(application: Application) : BaseAppsViewModel(applicati
|
||||
appList.flushAndAdd(updatedList)
|
||||
|
||||
//Post new update list
|
||||
liveData.postValue(appList.sortedBy { it.displayName.toLowerCase(Locale.getDefault()) })
|
||||
liveData.postValue(appList.sortedBy { it.displayName.lowercase(Locale.getDefault()) })
|
||||
}
|
||||
|
||||
override fun onCleared() {
|
||||
|
||||
@@ -70,7 +70,7 @@ class UpdatesViewModel(application: Application) : BaseAppsViewModel(application
|
||||
} else {
|
||||
false
|
||||
}
|
||||
}.sortedBy { it.displayName.toLowerCase(Locale.getDefault()) }.also { apps ->
|
||||
}.sortedBy { it.displayName.lowercase(Locale.getDefault()) }.also { apps ->
|
||||
updateFileMap.clear()
|
||||
|
||||
apps.forEach {
|
||||
|
||||
Reference in New Issue
Block a user