diff --git a/app/build.gradle b/app/build.gradle index cfdcf99..0ef5e83 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -13,8 +13,8 @@ android { applicationId "pl.marianjureczko.poszukiwacz" minSdkVersion 23 targetSdkVersion 34 - versionCode 3 - versionName "0.3" + versionCode 5 + versionName "0.5" testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" manifestPlaceholders = [facebookToken: FACEBOOK_TOKEN] } @@ -129,7 +129,7 @@ dependencies { implementation 'androidx.hilt:hilt-navigation-compose:1.1.0-alpha01' implementation 'com.google.accompanist:accompanist-permissions:0.30.1' implementation 'commons-io:commons-io:2.11.0' - implementation 'com.mapbox.maps:android:10.8.1' + implementation 'com.mapbox.maps:android:10.18.0' implementation 'com.facebook.android:facebook-share:latest.release' implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-android:1.6.4' implementation 'androidx.lifecycle:lifecycle-runtime-ktx:2.5.1' diff --git a/app/src/kalinowice/assets/kalinowice_07.mp4 b/app/src/kalinowice/assets/kalinowice_07.mp4 index f584521..bd2eb50 100644 Binary files a/app/src/kalinowice/assets/kalinowice_07.mp4 and b/app/src/kalinowice/assets/kalinowice_07.mp4 differ diff --git a/app/src/kalinowice/assets/kalinowice_11.mp4 b/app/src/kalinowice/assets/kalinowice_11.mp4 index 05320b6..31b9049 100644 Binary files a/app/src/kalinowice/assets/kalinowice_11.mp4 and b/app/src/kalinowice/assets/kalinowice_11.mp4 differ diff --git a/app/src/main/java/pl/marianjureczko/poszukiwacz/activity/facebook/n/FacebookScreen.kt b/app/src/main/java/pl/marianjureczko/poszukiwacz/activity/facebook/n/FacebookScreen.kt index 5d8c983..84b6181 100644 --- a/app/src/main/java/pl/marianjureczko/poszukiwacz/activity/facebook/n/FacebookScreen.kt +++ b/app/src/main/java/pl/marianjureczko/poszukiwacz/activity/facebook/n/FacebookScreen.kt @@ -1,6 +1,7 @@ package pl.marianjureczko.poszukiwacz.activity.facebook.n import android.annotation.SuppressLint +import android.content.ActivityNotFoundException import android.content.Context import android.content.Intent import android.graphics.Bitmap @@ -117,9 +118,10 @@ private fun ShareOnFacebookButton(model: FacebookReportModel) { Box { val context = LocalContext.current val sharingErrorMsg = stringResource(R.string.facebook_share_error) + val noFacebookErrorMsg = stringResource(id = R.string.facebook_share_impossible) LargeButton(R.string.share_button) { ReportGenerator().create(context, model) { bitmap -> - FacebookShareHelper.shareBitmapOnFacebook(context, bitmap, sharingErrorMsg) + FacebookShareHelper.shareBitmapOnFacebook(context, bitmap, sharingErrorMsg, noFacebookErrorMsg) } } FacebookImage(Modifier.align(AbsoluteAlignment.CenterLeft)) @@ -185,8 +187,7 @@ fun FacebookElement(it: ElementDescription, viewModel: FacebookViewModel, onRota modifier = Modifier .padding(1.dp) .height(60.dp) - .clickable { onRotatePhoto(it.index) } - , + .clickable { onRotatePhoto(it.index) }, contentScale = ContentScale.Inside ) } @@ -196,10 +197,14 @@ fun FacebookElement(it: ElementDescription, viewModel: FacebookViewModel, onRota object FacebookShareHelper { - fun shareBitmapOnFacebook(context: Context, bitmap: Bitmap, errorMsg: String) { + fun shareBitmapOnFacebook(context: Context, bitmap: Bitmap, errorMsg: String, noFacebookErrorMsg: String) { val uri = bitmapToUri(context, bitmap) if (uri != null) { - shareContent(context, uri) + try { + shareContent(context, uri) + } catch (ex: ActivityNotFoundException) { + Toast.makeText(context, noFacebookErrorMsg, Toast.LENGTH_LONG).show() + } } else { Toast.makeText(context, errorMsg, Toast.LENGTH_LONG).show() }