Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions app/app/src/debug/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
android:name="com.google.firebase.iid.FirebaseInstanceIdReceiver"
android:exported="true"
android:permission="@null"
tools:ignore="SystemPermissionTypo"
tools:replace="android:permission">
<intent-filter>
<action android:name="com.google.android.c2dm.intent.RECEIVE" />
Expand Down
6 changes: 0 additions & 6 deletions app/app/src/debug/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,4 @@
<string name="DEEP_LINK_DOMAIN_HOST_OLD" translatable="false">hedvigdevelop.page.link</string>
<string name="DEEP_LINK_DOMAIN_HOST" translatable="false">dev.hedvigit.com</string>
<string name="DEEP_LINK_DOMAIN_HOST_NEW" translatable="false">link.dev.hedvigit.com</string>

<string name="OCTOPUS_GRAPHQL_URL" translatable="false">https://apollo-router.dev.hedvigit.com</string>
<string name="WEB_BASE_URL" translatable="false">https://www.dev.hedvigit.com</string>
<string name="ODYSSEY_URL" translatable="false">https://odyssey.dev.hedvigit.com</string>
<string name="BOT_SERVICE" translatable="false">https://gateway.dev.hedvigit.com/bot-service</string>
<string name="CLAIMS_SERVICE" translatable="false">https://gateway.dev.hedvigit.com/claims</string>
</resources>
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ import android.content.Intent
import android.content.pm.LabeledIntent
import android.content.pm.PackageManager
import android.content.pm.ResolveInfo
import android.net.Uri
import android.provider.Settings
import android.widget.Toast
import androidx.core.net.toUri
import com.hedvig.android.logger.LogPriority
import com.hedvig.android.logger.logcat
import com.hedvig.android.navigation.activity.ExternalNavigator
Expand All @@ -27,7 +27,7 @@ internal class ExternalNavigatorImpl(
override fun openAppSettings() {
val permissionActivity = Intent(
Settings.ACTION_APPLICATION_DETAILS_SETTINGS,
Uri.parse("package:$buildConfigApplicationId"),
"package:$buildConfigApplicationId".toUri(),
)
if (activity.packageManager.resolveActivity(permissionActivity, 0) != null) {
activity.startActivity(permissionActivity)
Expand All @@ -45,7 +45,7 @@ internal class ExternalNavigatorImpl(
activity.startActivity(
Intent(
Intent.ACTION_DIAL,
Uri.parse("tel:$number"),
"tel:$number".toUri(),
),
)
} catch (exception: Throwable) {
Expand Down Expand Up @@ -79,10 +79,10 @@ private fun Context.tryOpenPlayStore() {
@SuppressLint("QueryPermissionsNeeded")
private fun Context.canOpenPlayStore() = playStoreIntent().resolveActivity(packageManager) != null

private fun Context.playStoreIntent() = Intent(Intent.ACTION_VIEW, Uri.parse("market://details?id=$packageName"))
private fun Context.playStoreIntent() = Intent(Intent.ACTION_VIEW, "market://details?id=$packageName".toUri())

private fun Context.openPlayStore() {
val intent = Intent(Intent.ACTION_VIEW, Uri.parse("market://details?id=$packageName"))
val intent = Intent(Intent.ACTION_VIEW, "market://details?id=$packageName".toUri())
intent.flags = (
Intent.FLAG_ACTIVITY_NO_HISTORY
or Intent.FLAG_ACTIVITY_MULTIPLE_TASK
Expand All @@ -92,7 +92,7 @@ private fun Context.openPlayStore() {
}

private fun Activity.openEmail(title: String) {
val emailIntent = Intent(Intent.ACTION_VIEW, Uri.parse("mailto:"))
val emailIntent = Intent(Intent.ACTION_VIEW, "mailto:".toUri())

val resInfo = packageManager.queryIntentActivities(emailIntent, 0)
if (resInfo.isNotEmpty()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ package com.hedvig.android.app.urihandler

import android.content.Context
import android.content.Intent
import android.net.Uri
import androidx.compose.ui.platform.UriHandler
import androidx.core.net.toUri
import com.hedvig.android.core.tracking.ErrorSource
import com.hedvig.android.core.tracking.logError
import com.hedvig.android.logger.LogPriority
Expand All @@ -22,7 +22,7 @@ internal class SafeAndroidUriHandler(private val context: Context) : UriHandler
return
}
try {
context.startActivity(Intent(Intent.ACTION_VIEW, Uri.parse(uri)))
context.startActivity(Intent(Intent.ACTION_VIEW, uri.toUri()))
} catch (e: Exception) {
if (e is CancellationException) {
throw e
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package com.hedvig.android.feature.chat.model

import android.net.Uri
import androidx.core.net.toUri
import com.benasher44.uuid.Uuid
import com.hedvig.android.data.chat.database.ChatMessageEntity
import com.hedvig.android.data.chat.database.ChatMessageEntity.FailedToSendType.MEDIA
Expand Down Expand Up @@ -267,11 +268,11 @@ internal fun ChatMessageEntity.toChatMessage(): CbmChatMessage? {
}

failedToSend == PHOTO && url != null -> {
CbmChatMessage.FailedToBeSent.ChatMessagePhoto(id.toString(), sentAt, Uri.parse(url))
CbmChatMessage.FailedToBeSent.ChatMessagePhoto(id.toString(), sentAt, url!!.toUri())
}

failedToSend == MEDIA && url != null -> {
CbmChatMessage.FailedToBeSent.ChatMessageMedia(id.toString(), sentAt, Uri.parse(url))
CbmChatMessage.FailedToBeSent.ChatMessageMedia(id.toString(), sentAt, url!!.toUri())
}

else -> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ import androidx.compose.ui.tooling.preview.PreviewParameter
import androidx.compose.ui.tooling.preview.datasource.CollectionPreviewParameterProvider
import androidx.compose.ui.unit.IntSize
import androidx.compose.ui.unit.dp
import androidx.core.graphics.createBitmap
import androidx.core.graphics.set
import androidx.lifecycle.compose.collectAsStateWithLifecycle
import com.google.zxing.BarcodeFormat
import com.google.zxing.common.BitMatrix
Expand Down Expand Up @@ -267,11 +269,11 @@ internal fun QRCode(
size.width,
size.height,
)
val bitmap = Bitmap.createBitmap(size.width, size.height, Bitmap.Config.RGB_565)
val bitmap = createBitmap(size.width, size.height, Bitmap.Config.RGB_565)
for (x in 0 until size.width) {
for (y in 0 until size.height) {
val color = if (bitMatrix.get(x, y)) android.graphics.Color.BLACK else android.graphics.Color.WHITE
bitmap.setPixel(x, y, color)
bitmap[x, y] = color
}
}
BitmapPainter(bitmap.asImageBitmap())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -337,8 +337,8 @@ private val cardReminderExitTransition = fadeOut() + shrinkVertically(
fun ReminderCardEnableNotifications(
snoozeNotificationPermissionReminder: () -> Unit,
requestNotificationPermission: () -> Unit,
minLines: Int = 1,
modifier: Modifier = Modifier,
minLines: Int = 1,
) {
val message = getMemberReminderMessage(MemberReminder.EnableNotifications())
HedvigNotificationCard(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@ class HedvigLintConventionPlugin : Plugin<Project> {
.resolve("lint-baseline-$moduleName.xml")
val lintXmlPath: File = rootProject.projectDir.resolve("hedvig-lint").resolve("lint.xml")
var didConfigureLint = false
// The KMP-android variant registers no runnable Android Lint task (only `lintKotlin*`, which is
// ktlint), so this lint configuration is inert: `./gradlew lint` does not lint these modules and
// nothing produces or consumes their baseline file. Any lint-baseline-<module>.xml for a KMP-android
// module is therefore not enforced and cannot be regenerated via `updateLintBaseline`.
pluginManager.withPlugin(libs.plugins.androidLibraryMultiplatform.get().pluginId) {
configure<KotlinMultiplatformAndroidComponentsExtension> {
finalizeDsl {
Expand Down Expand Up @@ -56,5 +60,4 @@ private fun Lint.configure(lintXmlFile: File, lintBaselineFile: File) {
baseline = lintBaselineFile
lintConfig = lintXmlFile
xmlReport = true
disable.add("androidx.media3.common.util.UnstableApi")
}
36 changes: 0 additions & 36 deletions hedvig-lint/lint-baseline/lint-baseline-core-locale.xml
Original file line number Diff line number Diff line change
@@ -1,40 +1,4 @@
<?xml version="1.0" encoding="UTF-8"?>
<issues format="6" by="lint 8.12.0" type="baseline" client="gradle" dependencies="false" name="AGP (8.12.0)" variant="all" version="8.12.0">

<issue
id="UnknownIssueId"
message="Unknown issue id &quot;androidx.media3.common.util.UnstableApi&quot;">
<location
file="build.gradle.kts"/>
</issue>

<issue
id="UnknownIssueId"
message="Unknown issue id &quot;androidx.media3.common.util.UnstableApi&quot;">
<location
file="build.gradle.kts"/>
</issue>

<issue
id="UnknownIssueId"
message="Unknown issue id &quot;UnsafeOptInUsageError&quot;"
errorLine1=" &lt;issue id=&quot;UnsafeOptInUsageError&quot;>"
errorLine2=" ^">
<location
file="$HOME/StudioProjects/android-graphql-test/hedvig-lint/lint.xml"
line="14"
column="3"/>
</issue>

<issue
id="UnknownIssueId"
message="Unknown issue id &quot;UnsafeOptInUsageError&quot;"
errorLine1=" &lt;issue id=&quot;UnsafeOptInUsageError&quot;>"
errorLine2=" ^">
<location
file="$HOME/StudioProjects/android-graphql-test/hedvig-lint/lint.xml"
line="14"
column="3"/>
</issue>

</issues>
14 changes: 0 additions & 14 deletions hedvig-lint/lint-baseline/lint-baseline-core-rive.xml
Original file line number Diff line number Diff line change
@@ -1,18 +1,4 @@
<?xml version="1.0" encoding="UTF-8"?>
<issues format="6" by="lint 9.0.0" type="baseline" client="gradle" dependencies="false" name="AGP (9.0.0)" variant="all" version="9.0.0">

<issue
id="UnknownIssueId"
message="Unknown issue id &quot;androidx.media3.common.util.UnstableApi&quot;">
<location
file="build.gradle.kts"/>
</issue>

<issue
id="UnknownIssueId"
message="Unknown issue id &quot;androidx.media3.common.util.UnstableApi&quot;">
<location
file="build.gradle.kts"/>
</issue>

</issues>
36 changes: 0 additions & 36 deletions hedvig-lint/lint-baseline/lint-baseline-data-claim-intent.xml
Original file line number Diff line number Diff line change
@@ -1,40 +1,4 @@
<?xml version="1.0" encoding="UTF-8"?>
<issues format="6" by="lint 9.1.1" type="baseline" client="gradle" dependencies="false" name="AGP (9.1.1)" variant="all" version="9.1.1">

<issue
id="UnknownIssueId"
message="Unknown issue id &quot;androidx.media3.common.util.UnstableApi&quot;">
<location
file="build.gradle.kts"/>
</issue>

<issue
id="UnknownIssueId"
message="Unknown issue id &quot;androidx.media3.common.util.UnstableApi&quot;">
<location
file="build.gradle.kts"/>
</issue>

<issue
id="UnknownIssueId"
message="Unknown issue id &quot;UnsafeOptInUsageError&quot;"
errorLine1=" &lt;issue id=&quot;UnsafeOptInUsageError&quot;>"
errorLine2=" ^">
<location
file="$HOME/hedvig/apps/android_copy_2/hedvig-lint/lint.xml"
line="14"
column="3"/>
</issue>

<issue
id="UnknownIssueId"
message="Unknown issue id &quot;UnsafeOptInUsageError&quot;"
errorLine1=" &lt;issue id=&quot;UnsafeOptInUsageError&quot;>"
errorLine2=" ^">
<location
file="$HOME/hedvig/apps/android_copy_2/hedvig-lint/lint.xml"
line="14"
column="3"/>
</issue>

</issues>
36 changes: 0 additions & 36 deletions hedvig-lint/lint-baseline/lint-baseline-data-coinsured.xml
Original file line number Diff line number Diff line change
@@ -1,40 +1,4 @@
<?xml version="1.0" encoding="UTF-8"?>
<issues format="6" by="lint 9.0.0" type="baseline" client="gradle" dependencies="false" name="AGP (9.0.0)" variant="all" version="9.0.0">

<issue
id="UnknownIssueId"
message="Unknown issue id &quot;androidx.media3.common.util.UnstableApi&quot;">
<location
file="build.gradle.kts"/>
</issue>

<issue
id="UnknownIssueId"
message="Unknown issue id &quot;androidx.media3.common.util.UnstableApi&quot;">
<location
file="build.gradle.kts"/>
</issue>

<issue
id="UnknownIssueId"
message="Unknown issue id &quot;UnsafeOptInUsageError&quot;"
errorLine1=" &lt;issue id=&quot;UnsafeOptInUsageError&quot;>"
errorLine2=" ^">
<location
file="$HOME/hedvig/android-clone/hedvig-lint/lint.xml"
line="14"
column="3"/>
</issue>

<issue
id="UnknownIssueId"
message="Unknown issue id &quot;UnsafeOptInUsageError&quot;"
errorLine1=" &lt;issue id=&quot;UnsafeOptInUsageError&quot;>"
errorLine2=" ^">
<location
file="$HOME/hedvig/android-clone/hedvig-lint/lint.xml"
line="14"
column="3"/>
</issue>

</issues>
Original file line number Diff line number Diff line change
@@ -1,40 +1,4 @@
<?xml version="1.0" encoding="UTF-8"?>
<issues format="6" by="lint 8.8.2" type="baseline" client="gradle" dependencies="false" name="AGP (8.8.2)" variant="all" version="8.8.2">

<issue
id="UnknownIssueId"
message="Unknown issue id &quot;androidx.media3.common.util.UnstableApi&quot;">
<location
file="build.gradle.kts"/>
</issue>

<issue
id="UnknownIssueId"
message="Unknown issue id &quot;androidx.media3.common.util.UnstableApi&quot;">
<location
file="build.gradle.kts"/>
</issue>

<issue
id="UnknownIssueId"
message="Unknown issue id &quot;UnsafeOptInUsageError&quot;"
errorLine1=" &lt;issue id=&quot;UnsafeOptInUsageError&quot;>"
errorLine2=" ^">
<location
file="$HOME/StudioProjects/Hedvig04092024/hedvig-lint/lint.xml"
line="14"
column="3"/>
</issue>

<issue
id="UnknownIssueId"
message="Unknown issue id &quot;UnsafeOptInUsageError&quot;"
errorLine1=" &lt;issue id=&quot;UnsafeOptInUsageError&quot;>"
errorLine2=" ^">
<location
file="$HOME/StudioProjects/Hedvig04092024/hedvig-lint/lint.xml"
line="14"
column="3"/>
</issue>

</issues>
47 changes: 0 additions & 47 deletions hedvig-lint/lint-baseline/lint-baseline-feature-chip-id.xml
Original file line number Diff line number Diff line change
@@ -1,51 +1,4 @@
<?xml version="1.0" encoding="UTF-8"?>
<issues format="6" by="lint 9.0.0" type="baseline" client="gradle" dependencies="false" name="AGP (9.0.0)" variant="all" version="9.0.0">

<issue
id="UnknownIssueId"
message="Unknown issue id &quot;androidx.media3.common.util.UnstableApi&quot;">
<location
file="build.gradle.kts"/>
</issue>

<issue
id="UnknownIssueId"
message="Unknown issue id &quot;androidx.media3.common.util.UnstableApi&quot;">
<location
file="build.gradle.kts"/>
</issue>

<issue
id="UnknownIssueId"
message="Unknown issue id &quot;UnsafeOptInUsageError&quot;"
errorLine1=" &lt;issue id=&quot;UnsafeOptInUsageError&quot;>"
errorLine2=" ^">
<location
file="$HOME/StudioProjects/android-graphql-test/hedvig-lint/lint.xml"
line="14"
column="3"/>
</issue>

<issue
id="UnknownIssueId"
message="Unknown issue id &quot;UnsafeOptInUsageError&quot;"
errorLine1=" &lt;issue id=&quot;UnsafeOptInUsageError&quot;>"
errorLine2=" ^">
<location
file="$HOME/StudioProjects/android-graphql-test/hedvig-lint/lint.xml"
line="14"
column="3"/>
</issue>

<issue
id="UnknownIssueId"
message="Unknown issue id &quot;UnsafeOptInUsageError&quot;"
errorLine1=" &lt;issue id=&quot;UnsafeOptInUsageError&quot;>"
errorLine2=" ^">
<location
file="$HOME/StudioProjects/android-graphql-test/hedvig-lint/lint.xml"
line="14"
column="3"/>
</issue>

</issues>
Loading
Loading