-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'PrimalHQ:main' into add-translation-swedish
- Loading branch information
Showing
45 changed files
with
1,050 additions
and
868 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,5 @@ | ||
## Changes | ||
- Stability improvements across the app. | ||
- Improved btc address validation. | ||
- Improved ui performance when uploading photos. | ||
- Improved edge-cases handling of Google's in-app purchase flow. | ||
- Implemented opening note1 and npub1 directly from search query. | ||
- Implemented fixed top bar on threads screens. | ||
- New welcome screen; | ||
- New login screen; | ||
- App now follows dark theme system settings until user manually changes theme; | ||
- Implemented new api for edge to edge screen support - improved screen transitions with full screen colors; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
31 changes: 31 additions & 0 deletions
31
app/src/main/kotlin/net/primal/android/auth/compose/OnboardingButton.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
package net.primal.android.auth.compose | ||
|
||
import androidx.compose.foundation.layout.fillMaxWidth | ||
import androidx.compose.foundation.layout.widthIn | ||
import androidx.compose.runtime.Composable | ||
import androidx.compose.ui.Modifier | ||
import androidx.compose.ui.graphics.Color | ||
import androidx.compose.ui.unit.dp | ||
import net.primal.android.core.compose.button.PrimalLoadingButton | ||
|
||
@Composable | ||
fun OnboardingButton( | ||
modifier: Modifier = Modifier, | ||
text: String, | ||
onClick: () -> Unit, | ||
enabled: Boolean = true, | ||
loading: Boolean = false, | ||
) { | ||
PrimalLoadingButton( | ||
modifier = modifier | ||
.widthIn(240.dp, MAX_COMPONENT_WIDTH.dp) | ||
.fillMaxWidth(), | ||
containerColor = Color.Black, | ||
disabledContainerColor = Color.Black.copy(alpha = 0.20f), | ||
contentColor = Color.White, | ||
enabled = enabled, | ||
loading = loading, | ||
onClick = onClick, | ||
text = text, | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
package net.primal.android.auth.compose | ||
|
||
const val MAX_COMPONENT_WIDTH = 320 | ||
const val ONE_HALF = 0.5f | ||
const val TWO_FIFTHS = 0.4f |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
26 changes: 26 additions & 0 deletions
26
app/src/main/kotlin/net/primal/android/auth/login/LoginHandler.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
package net.primal.android.auth.login | ||
|
||
import javax.inject.Inject | ||
import net.primal.android.auth.AuthRepository | ||
import net.primal.android.feed.repository.FeedRepository | ||
import net.primal.android.settings.muted.repository.MutedUserRepository | ||
import net.primal.android.settings.repository.SettingsRepository | ||
import net.primal.android.user.repository.UserRepository | ||
|
||
class LoginHandler @Inject constructor( | ||
private val settingsRepository: SettingsRepository, | ||
private val authRepository: AuthRepository, | ||
private val userRepository: UserRepository, | ||
private val mutedUserRepository: MutedUserRepository, | ||
private val feedRepository: FeedRepository, | ||
) { | ||
|
||
suspend fun loginAndReturnDefaultFeed(nostrKey: String): String { | ||
val userId = authRepository.login(nostrKey = nostrKey) | ||
userRepository.fetchAndUpdateUserAccount(userId = userId) | ||
settingsRepository.fetchAndPersistAppSettings(userId = userId) | ||
mutedUserRepository.fetchAndPersistMuteList(userId = userId) | ||
val defaultFeed = feedRepository.defaultFeed() | ||
return defaultFeed?.directive ?: userId | ||
} | ||
} |
Oops, something went wrong.