Skip to content

Commit

Permalink
Moves coil code into new library (#1870)
Browse files Browse the repository at this point in the history
  • Loading branch information
fstanis authored Dec 15, 2023
1 parent 580ae97 commit 2052438
Show file tree
Hide file tree
Showing 128 changed files with 1,243 additions and 671 deletions.
18 changes: 9 additions & 9 deletions auth/composables/api/current.api
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
package com.google.android.horologist.auth.composables.chips {

public final class AccountChipKt {
method @androidx.compose.runtime.Composable public static void AccountChip(com.google.android.horologist.auth.composables.model.AccountUiModel account, kotlin.jvm.functions.Function0<kotlin.Unit> onClick, optional androidx.compose.ui.Modifier modifier, optional com.google.android.horologist.compose.material.Paintable? defaultAvatar, optional boolean largeAvatar, optional androidx.wear.compose.material.ChipColors colors, optional boolean enabled);
method @androidx.compose.runtime.Composable public static void AccountChip(String email, kotlin.jvm.functions.Function0<kotlin.Unit> onClick, optional androidx.compose.ui.Modifier modifier, optional com.google.android.horologist.compose.material.Paintable? avatar, optional com.google.android.horologist.compose.material.Paintable? defaultAvatar, optional boolean largeAvatar, optional androidx.wear.compose.material.ChipColors colors, optional boolean enabled);
method @androidx.compose.runtime.Composable public static void AccountChip(com.google.android.horologist.auth.composables.model.AccountUiModel account, kotlin.jvm.functions.Function0<kotlin.Unit> onClick, optional androidx.compose.ui.Modifier modifier, optional com.google.android.horologist.images.base.paintable.Paintable? defaultAvatar, optional boolean largeAvatar, optional androidx.wear.compose.material.ChipColors colors, optional boolean enabled);
method @androidx.compose.runtime.Composable public static void AccountChip(String email, kotlin.jvm.functions.Function0<kotlin.Unit> onClick, optional androidx.compose.ui.Modifier modifier, optional com.google.android.horologist.images.base.paintable.Paintable? avatar, optional com.google.android.horologist.images.base.paintable.Paintable? defaultAvatar, optional boolean largeAvatar, optional androidx.wear.compose.material.ChipColors colors, optional boolean enabled);
}

public final class CreateAccountChipKt {
Expand All @@ -27,7 +27,7 @@ package com.google.android.horologist.auth.composables.chips {
package com.google.android.horologist.auth.composables.dialogs {

public final class SignedInConfirmationDialogKt {
method @androidx.compose.runtime.Composable public static void SignedInConfirmationDialog(kotlin.jvm.functions.Function0<kotlin.Unit> onDismissOrTimeout, optional androidx.compose.ui.Modifier modifier, optional String? name, optional String? email, optional com.google.android.horologist.compose.material.Paintable? avatar, optional java.time.Duration duration);
method @androidx.compose.runtime.Composable public static void SignedInConfirmationDialog(kotlin.jvm.functions.Function0<kotlin.Unit> onDismissOrTimeout, optional androidx.compose.ui.Modifier modifier, optional String? name, optional String? email, optional com.google.android.horologist.images.base.paintable.Paintable? avatar, optional java.time.Duration duration);
method @androidx.compose.runtime.Composable public static void SignedInConfirmationDialog(kotlin.jvm.functions.Function0<kotlin.Unit> onDismissOrTimeout, optional androidx.compose.ui.Modifier modifier, com.google.android.horologist.auth.composables.model.AccountUiModel accountUiModel, optional java.time.Duration duration);
}

Expand All @@ -36,15 +36,15 @@ package com.google.android.horologist.auth.composables.dialogs {
package com.google.android.horologist.auth.composables.model {

public final class AccountUiModel {
ctor public AccountUiModel(String email, optional String? name, optional com.google.android.horologist.compose.material.Paintable? avatar);
ctor public AccountUiModel(String email, optional String? name, optional com.google.android.horologist.images.base.paintable.Paintable? avatar);
method public String component1();
method public String? component2();
method public com.google.android.horologist.compose.material.Paintable? component3();
method public com.google.android.horologist.auth.composables.model.AccountUiModel copy(String email, String? name, com.google.android.horologist.compose.material.Paintable? avatar);
method public com.google.android.horologist.compose.material.Paintable? getAvatar();
method public com.google.android.horologist.images.base.paintable.Paintable? component3();
method public com.google.android.horologist.auth.composables.model.AccountUiModel copy(String email, String? name, com.google.android.horologist.images.base.paintable.Paintable? avatar);
method public com.google.android.horologist.images.base.paintable.Paintable? getAvatar();
method public String getEmail();
method public String? getName();
property public final com.google.android.horologist.compose.material.Paintable? avatar;
property public final com.google.android.horologist.images.base.paintable.Paintable? avatar;
property public final String email;
property public final String? name;
}
Expand All @@ -63,7 +63,7 @@ package com.google.android.horologist.auth.composables.screens {
}

public final class SelectAccountScreenKt {
method @androidx.compose.runtime.Composable public static void SelectAccountScreen(java.util.List<com.google.android.horologist.auth.composables.model.AccountUiModel> accounts, kotlin.jvm.functions.Function2<? super java.lang.Integer,? super com.google.android.horologist.auth.composables.model.AccountUiModel,kotlin.Unit> onAccountClicked, com.google.android.horologist.compose.layout.ScalingLazyColumnState columnState, optional androidx.compose.ui.Modifier modifier, optional String title, optional com.google.android.horologist.compose.material.Paintable? defaultAvatar);
method @androidx.compose.runtime.Composable public static void SelectAccountScreen(java.util.List<com.google.android.horologist.auth.composables.model.AccountUiModel> accounts, kotlin.jvm.functions.Function2<? super java.lang.Integer,? super com.google.android.horologist.auth.composables.model.AccountUiModel,kotlin.Unit> onAccountClicked, com.google.android.horologist.compose.layout.ScalingLazyColumnState columnState, optional androidx.compose.ui.Modifier modifier, optional String title, optional com.google.android.horologist.images.base.paintable.Paintable? defaultAvatar);
}

public final class SignInPlaceholderScreenKt {
Expand Down
3 changes: 1 addition & 2 deletions auth/composables/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -104,9 +104,8 @@ dependencies {
api(libs.compose.ui)

implementation(projects.composeMaterial)
implementation(projects.images.coil)

implementation(libs.coil)
implementation(libs.coil.base)
implementation(libs.compose.foundation.foundation)
implementation(libs.compose.foundation.foundation.layout)
implementation(libs.compose.material.iconscore)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ import androidx.wear.compose.material.ChipDefaults
import androidx.wear.compose.material.MaterialTheme
import com.google.android.horologist.auth.composables.model.AccountUiModel
import com.google.android.horologist.compose.material.Chip
import com.google.android.horologist.compose.material.ImageVectorPaintable.Companion.asPaintable
import com.google.android.horologist.compose.material.Paintable
import com.google.android.horologist.images.base.paintable.ImageVectorPaintable.Companion.asPaintable
import com.google.android.horologist.images.base.paintable.Paintable

/**
* A [Chip] to display the [AccountUiModel]'s email address and avatar.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ import androidx.wear.compose.material.ChipDefaults
import androidx.wear.compose.material.Icon
import com.google.android.horologist.auth.composables.R
import com.google.android.horologist.compose.material.Chip
import com.google.android.horologist.compose.material.ImageVectorPaintable.Companion.asPaintable
import com.google.android.horologist.compose.material.util.DECORATIVE_ELEMENT_CONTENT_DESCRIPTION
import com.google.android.horologist.images.base.paintable.ImageVectorPaintable.Companion.asPaintable

/**
* An opinionated [Chip] to represent the "Create account" action.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import androidx.wear.compose.material.ChipColors
import androidx.wear.compose.material.ChipDefaults
import com.google.android.horologist.auth.composables.R
import com.google.android.horologist.compose.material.Chip
import com.google.android.horologist.compose.material.ImageVectorPaintable.Companion.asPaintable
import com.google.android.horologist.images.base.paintable.ImageVectorPaintable.Companion.asPaintable

/**
* An opinionated [Chip] to represent the "Guest mode" action.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import androidx.wear.compose.material.ChipColors
import androidx.wear.compose.material.ChipDefaults
import com.google.android.horologist.auth.composables.R
import com.google.android.horologist.compose.material.Chip
import com.google.android.horologist.compose.material.ImageVectorPaintable.Companion.asPaintable
import com.google.android.horologist.images.base.paintable.ImageVectorPaintable.Companion.asPaintable

/**
* An opinionated [Chip] to represent the "Other options to authentication" action.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import androidx.wear.compose.material.ChipColors
import androidx.wear.compose.material.ChipDefaults
import com.google.android.horologist.auth.composables.R
import com.google.android.horologist.compose.material.Chip
import com.google.android.horologist.compose.material.ImageVectorPaintable.Companion.asPaintable
import com.google.android.horologist.images.base.paintable.ImageVectorPaintable.Companion.asPaintable

/**
* An opinionated [Chip] to represent the "Sign in" action.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ import androidx.wear.compose.material.dialog.DialogDefaults
import com.google.android.horologist.auth.composables.R
import com.google.android.horologist.auth.composables.model.AccountUiModel
import com.google.android.horologist.compose.material.Confirmation
import com.google.android.horologist.compose.material.Paintable
import com.google.android.horologist.compose.material.util.DECORATIVE_ELEMENT_CONTENT_DESCRIPTION
import com.google.android.horologist.images.base.paintable.Paintable
import java.time.Duration

private const val AVATAR_BACKGROUND_COLOR = 0xFF4ECDE6
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

package com.google.android.horologist.auth.composables.model

import com.google.android.horologist.compose.material.Paintable
import com.google.android.horologist.images.base.paintable.Paintable

/**
* A UI model to represent an account.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,9 @@ import com.google.android.horologist.auth.composables.chips.AccountChip
import com.google.android.horologist.auth.composables.model.AccountUiModel
import com.google.android.horologist.compose.layout.ScalingLazyColumn
import com.google.android.horologist.compose.layout.ScalingLazyColumnState
import com.google.android.horologist.compose.material.ImageVectorPaintable.Companion.asPaintable
import com.google.android.horologist.compose.material.Paintable
import com.google.android.horologist.compose.material.Title
import com.google.android.horologist.images.base.paintable.ImageVectorPaintable.Companion.asPaintable
import com.google.android.horologist.images.base.paintable.Paintable

private const val HORIZONTAL_PADDING_SCREEN_PERCENTAGE = 0.052

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,14 @@

package com.google.android.horologist.auth.composables.dialogs

import android.R
import androidx.compose.foundation.background
import androidx.compose.foundation.layout.Box
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.Color
import com.google.android.horologist.compose.material.DrawableResPaintable
import com.google.android.horologist.compose.tools.coil.FakeImageLoader
import com.google.android.horologist.images.base.paintable.DrawableResPaintable
import com.google.android.horologist.images.coil.FakeImageLoader
import com.google.android.horologist.screenshots.ScreenshotBaseTest
import com.google.android.horologist.screenshots.ScreenshotTestRule.Companion.screenshotTestRuleParams
import org.junit.Test
Expand All @@ -47,7 +48,7 @@ class SignedInConfirmationDialogTest : ScreenshotBaseTest(
onDismissOrTimeout = {},
name = "Maggie",
email = "[email protected]",
avatar = DrawableResPaintable(android.R.mipmap.sym_def_app_icon),
avatar = DrawableResPaintable(R.mipmap.sym_def_app_icon),
)
}
}
Expand All @@ -62,7 +63,7 @@ class SignedInConfirmationDialogTest : ScreenshotBaseTest(
SignedInConfirmationDialog(
onDismissOrTimeout = {},
email = "[email protected]",
avatar = DrawableResPaintable(android.R.mipmap.sym_def_app_icon),
avatar = DrawableResPaintable(R.mipmap.sym_def_app_icon),
)
}
}
Expand All @@ -77,7 +78,7 @@ class SignedInConfirmationDialogTest : ScreenshotBaseTest(
onDismissOrTimeout = {},
name = "",
email = "[email protected]",
avatar = DrawableResPaintable(android.R.mipmap.sym_def_app_icon),
avatar = DrawableResPaintable(R.mipmap.sym_def_app_icon),
)
}
}
Expand All @@ -101,7 +102,7 @@ class SignedInConfirmationDialogTest : ScreenshotBaseTest(
SignedInConfirmationDialog(
onDismissOrTimeout = {},
name = "Maggie",
avatar = DrawableResPaintable(android.R.mipmap.sym_def_app_icon),
avatar = DrawableResPaintable(R.mipmap.sym_def_app_icon),
)
}
}
Expand All @@ -123,7 +124,7 @@ class SignedInConfirmationDialogTest : ScreenshotBaseTest(
onDismissOrTimeout = {},
name = "Wolfeschlegelsteinhausenbergerdorff",
email = "[email protected]",
avatar = DrawableResPaintable(android.R.mipmap.sym_def_app_icon),
avatar = DrawableResPaintable(R.mipmap.sym_def_app_icon),
)
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.filled.Face
import com.google.android.horologist.auth.composables.model.AccountUiModel
import com.google.android.horologist.compose.layout.ScalingLazyColumnDefaults
import com.google.android.horologist.compose.material.ImageVectorPaintable.Companion.asPaintable
import com.google.android.horologist.images.base.paintable.ImageVectorPaintable.Companion.asPaintable
import com.google.android.horologist.screenshots.ScreenshotBaseTest
import com.google.android.horologist.screenshots.ScreenshotTestRule.Companion.screenshotTestRuleParams
import org.junit.Test
Expand Down
1 change: 1 addition & 0 deletions auth/ui/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@ dependencies {
api(libs.wearcompose.foundation)

implementation(projects.composeMaterial)
implementation(projects.images.coil)

implementation(libs.androidx.activity)
implementation(libs.androidx.activity.compose)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ package com.google.android.horologist.auth.ui.googlesignin.mapper

import com.google.android.gms.auth.api.signin.GoogleSignInAccount
import com.google.android.horologist.auth.composables.model.AccountUiModel
import com.google.android.horologist.compose.material.CoilPaintable
import com.google.android.horologist.images.coil.CoilPaintable

/**
* Functions to map models from Google Sign In into a [AccountUiModel].
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ package com.google.android.horologist.auth.ui.mapper

import com.google.android.horologist.auth.composables.model.AccountUiModel
import com.google.android.horologist.auth.data.common.model.AuthUser
import com.google.android.horologist.compose.material.CoilPaintable
import com.google.android.horologist.images.coil.CoilPaintable

/**
* Functions to map models from other layers and / or packages into a [AccountUiModel].
Expand Down
Loading

0 comments on commit 2052438

Please sign in to comment.