-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #7 from ItamiOMW/reports-feature
Reports feature
- Loading branch information
Showing
33 changed files
with
1,865 additions
and
150 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
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 |
---|---|---|
|
@@ -43,4 +43,4 @@ class MainActivity : ComponentActivity() { | |
} | ||
} | ||
} | ||
} | ||
} |
20 changes: 20 additions & 0 deletions
20
app/src/main/java/com/itami/calorie_tracker/core/presentation/components/UpdateEffect.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,20 @@ | ||
package com.itami.calorie_tracker.core.presentation.components | ||
|
||
import androidx.compose.runtime.* | ||
import kotlinx.coroutines.CoroutineScope | ||
|
||
/** | ||
* The same as [LaunchedEffect], but skips first invocation. | ||
*/ | ||
@Composable | ||
fun UpdateEffect(key: Any, block: suspend CoroutineScope.() -> Unit) { | ||
var isTriggered by remember { mutableStateOf(false) } | ||
|
||
LaunchedEffect(key) { | ||
if (isTriggered) { | ||
block() | ||
} else { | ||
isTriggered = true | ||
} | ||
} | ||
} |
Oops, something went wrong.