Jetpack compose and AuthStatelistener firebase - kotlin

Hi i am trying to create an app in jetpack compose with MVVM architechture and with firebase.
I am now wondering where you would go about placing the AuthStatelistener in this case. I cant find anything about it on the web. The thing is that implementing that statelistnener does not work quz you do not use classes in Jetpack compose you use functions. and you cant call screens in the MainActivity. So how would you then check if the user is still signed in??? There is nothing about it on the web. There is a bunch of tutorials on the web about MVVM structure and ordinary xml layouts but nothing what i can find about jetpack compose?????

Related

Material UI for Jetpack Compose for Web

I wanted to try out the current state of Jetpack Compose for a simple web application (no Android App).
Starting off with the compose-jb/examples/web-landing example, I was wondering, is there already an implementation of Material Design / Material UI for Jetpack Compose for Web? And I dont mean combining Compose with React or anything, just Compose for Web.

How can I make a number picker in jetpack compose?

I am trying to make a number picker in jetpack compose just like the below
I searched something about number picker on the internet and I found this
https://github.com/ChargeMap/Compose-NumberPicker
I think he did it using a library here, but I couldn't figure out how to add that library if he used a library. Other than that, can I do this using jetpack compose without using a library and how?. Can you give an example?

Interoperability Renderer with Jetpack Compose

I currently have a GlSurfaceView that is sending messages through the JNI to a C library to render. I am curious if anyone has tried to figure out how to use a renderer in Jetpack Compose so that there is a onDrawFrame call similar to the GlSurfaceView.Renderer? I know that Jetpack Compose is using an altogether different component to do the rendering but other than using the AndroidView which will not meet my wants to put this on a desktop I am not sure what else to do.
Does anyone have any ideas?

Is there a way to turn an app into a website in React Native?

I built an application in React, is there a way that the same code will be used for a website?
I know Instagram is built on React and it also has a website, I wonder maybe you should add some link or something that it will open for me as a website?
Or maybe there is no such way and I have to build a website separately?
First off all, If you have written any code which is related to native functionality, then it can be challenging.
If you have only worked with views, images, and some of the basic functionality.
It can be done with react-native-web you can easily migrate your project to react-native-web.
If you project is created with expo they already provide react-native-web support.
Option 2: If you have some of the code you want to share and some is that you don't want to share or can't share.
You can use renderProp or customHooks pattern to reuse your logical code and seperate your view for react-native and react js apps.
If you want to reuse your views too, you can do those with primitives.
you can use styled-component primitives for that.
https://medium.com/react-native-training/sharing-code-between-react-web-and-react-native-applications-7f451af26378
You can get some idea here as well.

What is meant by Flutter's widgets aren't really adaptive

I have been trying my hands for POC on an idea and trying to find languages which can support Mobile app development (Android/IOS) via single source code.
I zeroed on React-Native and Flutter.
What I found that for React-Native you still have to write code which is platform specific. Components need to be written differently for IOS and Android.
Then I looked in FLutter and I found that - "Flutter's widgets, however, while there are more of them, aren't really adaptive".
I am not able to understand it and what it means.
It would be really helpful if someone can help me with example or guide me to good reference.
In Flutter you have different sets of Widget Collection:
Material Widgets: Android-style
Cupertino Widgets: iOS-style
And lots of Widgets which aren't bound to one of those styles.
With this you are able to create a application looking like any style on any of the available platform. Therefore you can also have iOS-style Widgets on Android and vice versa.
If you want to have iOS Widgets on iOS and Android Widgets on Android, you'll have to create some conditional rendering, which decides wether to render iOS or Android components.
Sidenote: The Material-style Widgets look also really good on iOS. Also you can use a ton of other Widgets to create an UI in your own style.