tianzhuqiao / form

Form: form builder in Kotlin for Android
Apache License 2.0
15 stars 6 forks source link

add FormFragment. #2

Open Robin-AF opened 2 years ago

Robin-AF commented 2 years ago

For my integration I needed the base to be a Fragment instead of an Activity. Now users can use the Fragment instead of Activity in case they want to :)

tianzhuqiao commented 2 years ago

Thanks @Robin-AF, do you mind to provide some example to use the code?

Robin-AF commented 2 years ago

Hi @tianzhuqiao yes, currently you need to have an activity and inherit from FormActivity like so:

class MainActivity : FormActivity() {

But because it's common in Android to use fragments it might be useful to be able to inherit from a fragment like so:

class MainActivity : FormFragment() {

This allows users to still create a form when they are in a Fragment instead of a Activity.

tianzhuqiao commented 2 years ago

Great, make sense. And in your commit, do you mind to add some demo code in the demo App? I think it will be very helpful.