Skip to content

Commit

Permalink
Update requests folder
Browse files Browse the repository at this point in the history
  • Loading branch information
jahirfiquitiva committed Sep 12, 2019
1 parent f8cafc4 commit 5ba1eb7
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 17 deletions.
13 changes: 7 additions & 6 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
-->

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
package="jahirfiquitiva.apps.blueprint.demo">
xmlns:tools="http://schemas.android.com/tools"
package="jahirfiquitiva.apps.blueprint.demo">

<!-- Permission required for donations -->
<uses-permission android:name="com.android.vending.BILLING" />
Expand All @@ -27,11 +27,12 @@
android:fullBackupContent="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:manageSpaceActivity="jahirfiquitiva.libs.blueprint.ui.activities.SettingsActivity"
android:networkSecurityConfig="@xml/network_security_config"
android:requestLegacyExternalStorage="true"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/MySplashScreen"
android:manageSpaceActivity="jahirfiquitiva.libs.blueprint.ui.activities.SettingsActivity"
android:networkSecurityConfig="@xml/network_security_config"
tools:ignore="UnusedAttribute">

<!-- TODO: Remove comment marks to enable Zooper
Expand Down Expand Up @@ -280,10 +281,10 @@
<provider
android:name=".MuzeiService"
android:authorities="${applicationId}.muzei"
android:label="@string/app_name"
android:description="@string/app_description"
android:icon="@drawable/ic_muzei_icon"
android:exported="true"
android:icon="@drawable/ic_muzei_icon"
android:label="@string/app_name"
android:permission="com.google.android.apps.muzei.api.ACCESS_PROVIDER"
tools:ignore="ExportedService">
<intent-filter>
Expand Down
2 changes: 1 addition & 1 deletion dependencies.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ ext.versions = [
kotlin : '1.3.50',
libs : '2.1',
// Dependencies
kuper : '1.7.0',
kuper : '1.7.1',
counterFab : '1.2.1',
fuel : '1.16.0',
oneSignal : '3.11.3'
Expand Down
13 changes: 7 additions & 6 deletions library/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@

<!--suppress AndroidDomInspection -->
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
package="jahirfiquitiva.libs.blueprint">
xmlns:tools="http://schemas.android.com/tools"
package="jahirfiquitiva.libs.blueprint">

<uses-permission android:name="com.android.vending.CHECK_LICENSE" />
<uses-permission
Expand All @@ -44,6 +44,7 @@

<application
android:allowBackup="true"
android:requestLegacyExternalStorage="true"
android:supportsRtl="true"
tools:ignore="AllowBackup,UnusedAttribute">

Expand Down Expand Up @@ -78,16 +79,16 @@
<!-- Icons -->
<activity
android:name=".ui.activities.BaseBlueprintActivity"
android:windowSoftInputMode="stateHidden|adjustResize|adjustPan"
android:exported="false" />
android:exported="false"
android:windowSoftInputMode="stateHidden|adjustResize|adjustPan" />

<activity
android:name=".ui.activities.BlueprintKuperActivity"
android:exported="false" />
<activity
android:name=".ui.activities.HelpActivity"
android:windowSoftInputMode="stateHidden|adjustResize|adjustPan"
android:exported="false" />
android:exported="false"
android:windowSoftInputMode="stateHidden|adjustResize|adjustPan" />
<activity
android:name=".ui.activities.CreditsActivity"
android:exported="false" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ import androidx.lifecycle.Observer
import androidx.lifecycle.ViewModel
import jahirfiquitiva.libs.archhelpers.tasks.QAsync
import jahirfiquitiva.libs.blueprint.R
import jahirfiquitiva.libs.blueprint.helpers.utils.BL
import jahirfiquitiva.libs.blueprint.helpers.utils.BPKonfigs
import jahirfiquitiva.libs.blueprint.quest.App
import jahirfiquitiva.libs.blueprint.quest.IconRequest
Expand Down Expand Up @@ -114,14 +115,21 @@ class RequestsViewModel : ViewModel() {
forceLoad: Boolean = false
) {

val externalFolder = try {
val externalStorage = try {
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.Q) {
@Suppress("DEPRECATION")
Environment.getExternalStorageDirectory()
} else {
@Suppress("DEPRECATION")
Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DOCUMENTS)
}
context.getExternalFilesDir(null) ?: Environment.getExternalStorageDirectory()
} catch (e: Exception) {
Environment.getExternalStorageDirectory()
null
}
val appStorage = context.getExternalFilesDir(null)
val defFolder =
if (appStorage?.absolutePath?.contains(context.packageName) == true) externalStorage
else appStorage

val list = IconRequest.get()?.apps.orEmpty()
if (list.isEmpty() || forceLoad) {
Expand All @@ -132,7 +140,7 @@ class RequestsViewModel : ViewModel() {
.toEmail(context.getString(R.string.email))
.withAPIHost(host.orEmpty())
.withAPIKey(apiKey)
.saveDir(File(context.getString(R.string.request_save_location, externalFolder)))
.saveDir(File(context.getString(R.string.request_save_location, defFolder)))
.filterXml(R.xml.appfilter)
.withTimeLimit(
context.int(R.integer.time_limit_in_minutes), BPKonfigs(context).prefs)
Expand Down

0 comments on commit 5ba1eb7

Please sign in to comment.