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
package cloud.jablotron.apps.myjablotron2.jablotron.jablotron.widgets.internal | |
import androidx.compose.foundation.layout.Box | |
import androidx.compose.foundation.layout.fillMaxSize | |
import androidx.compose.runtime.Composable | |
import androidx.compose.ui.Alignment | |
import androidx.compose.ui.Modifier | |
import androidx.compose.ui.text.style.TextAlign | |
import app.cash.turbine.test | |
import cloud.jablotron.apps.myjablotron2.jablotron.jablotron.design.components.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
package cloud.jablotron.apps.myjablotron2.jablotron.jablotron.widgets.internal | |
import cloud.jablotron.apps.myjablotron2.jablotron.jablotron.widgets.WidgetUpdater | |
import cloud.jablotron.apps.myjablotron2.jablotron.jablotron.widgets.data.WidgetInstance | |
import cloud.jablotron.apps.myjablotron2.jablotron.jablotron.widgets.injection.WidgetsScope | |
import kotlinx.coroutines.flow.Flow | |
import kotlinx.coroutines.flow.distinctUntilChanged | |
import javax.inject.Inject | |
@WidgetsScope |
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
package cloud.jablotron.apps.myjablotron2.jablotron.jablotron.dashboard.ui.screens.dashboard | |
import cloud.jablotron.apps.myjablotron2.jablotron.jablotron.dashboard.data.local.model.device.Device | |
import cloud.jablotron.apps.myjablotron2.jablotron.jablotron.dashboard.domain.devices.GetDevicesUseCase | |
import cloud.jablotron.apps.myjablotron2.jablotron.jablotron.dashboard.util.RateLimiter | |
import cloud.jablotron.apps.myjablotron2.jablotron.jablotron.design.components.layout.data.RequestState | |
import cloud.jablotron.apps.myjablotron2.jablotron.jablotron.design.components.snackbar.SnackbarCommand | |
import cloud.jablotron.apps.myjablotron2.jablotron.jablotron.design.components.snackbar.SnackbarMessageType | |
import cloud.jablotron.apps.myjablotron2.jablotron.jablotron.design.viewmodel.BaseViewModel | |
import cloud.jablotron.apps.myjablotron2.jablotron.jablotron.moduleapi.navigation.BottomNavigationVisibilityManager |
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
package cloud.jablotron.apps.myjablotron2.jablotron.jablotron.design.data | |
import android.content.res.Resources | |
import androidx.annotation.PluralsRes | |
import androidx.annotation.StringRes | |
import androidx.compose.runtime.Composable | |
import androidx.compose.runtime.ReadOnlyComposable | |
import androidx.compose.ui.platform.LocalConfiguration | |
import androidx.compose.ui.platform.LocalContext |
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
struct ComposeView: UIViewControllerRepresentable { | |
func makeUIViewController(context: Context) -> UIViewController { | |
Main_iosKt.MainViewController() | |
} | |
func updateUIViewController(_ uiViewController: UIViewController, context: Context) {} | |
} | |
struct ContentView: View { |
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
class MainActivity : AppCompatActivity() { | |
override fun onCreate(savedInstanceState: Bundle?) { | |
super.onCreate(savedInstanceState) | |
setContent { | |
BadJokesCounter() | |
} | |
} | |
} |
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
// | |
android { | |
compileSdk = 33 | |
... | |
defaultConfig { | |
applicationId = "app.badjoke.counter" | |
minSdk = 28 |
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
import androidx.compose.material.Text | |
import androidx.compose.material.TopAppBar | |
import androidx.compose.runtime.Composable | |
import androidx.compose.runtime.collectAsState | |
import androidx.compose.runtime.getValue | |
import androidx.compose.runtime.mutableStateOf | |
import androidx.compose.runtime.remember | |
import androidx.compose.runtime.setValue |
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
@Composable | |
fun Profile() { | |
val user by userFlow.subscribeAsState(null) | |
val balance by balanceFlow.subscribeAsState(0L) | |
if (user == null) { | |
Text("Loading…") | |
} else { | |
Text("${user.name} - $balance") |
NewerOlder