Giter Site home page Giter Site logo

Comments (6)

klinker24 avatar klinker24 commented on August 17, 2024

Sorry I don't understand what you mean by that. The pages are just defined by XML attributes, all it really is, is a Fragment. So yes, you can put whatever UI elements you want, into it.

from android-floatingtutorialactivity.

Paul75 avatar Paul75 commented on August 17, 2024

Hello,

Like that :

screenshot_20190130-233215

Can I send to result activity the two elements ?

Thanks

from android-floatingtutorialactivity.

klinker24 avatar klinker24 commented on August 17, 2024

Yes, it is just a normal intent that you are returning to the calling activity. It works the same way as any other activity that provides a result.

from android-floatingtutorialactivity.

Paul75 avatar Paul75 commented on August 17, 2024

yes but means I must do in onclicklistener on my ratingBar ? and on addTextChangedListener for the EditText ?
like :

findViewById<BaseRatingBar>(R.id.rating).setOnRatingChangeListener { baseRatingBar: BaseRatingBar, fl: Float ->
                    val resultData = Intent()
                    resultData.putExtra(RESULT_DATA_STARS, fl)
                    setResult(Activity.RESULT_OK, resultData)
                }

                findViewById<AppCompatEditText>(R.id.editComment).addTextChangedListener(object : TextWatcher {
                    override fun afterTextChanged(p0: Editable?) {
                        val resultData = Intent()
                        resultData.putExtra(RESULT_DATA_COMMENT, p0.toString())
                        setResult(Activity.RESULT_OK, resultData)
                    }

                    override fun beforeTextChanged(p0: CharSequence?, p1: Int, p2: Int, p3: Int) {
                    }

                    override fun onTextChanged(p0: CharSequence?, p1: Int, p2: Int, p3: Int) {
                    }
                })

Thanks

from android-floatingtutorialactivity.

klinker24 avatar klinker24 commented on August 17, 2024

You can only set the result once, and you need to include both pieces of data in the intent. I think that you should look up some information on getting the result from the activity. My library does not do it any differently than a generic Android Activity. It uses the exact same system.

https://developer.android.com/training/basics/intents/result

val resultData = Intent()
resultData.putExtra(RESULT_DATA_STARS, stars)
resultData.putExtra(RESULT_DATA_COMMENT, editComment.text.toString())
setResult(Activity.RESULT_OK, resultData)

from android-floatingtutorialactivity.

Paul75 avatar Paul75 commented on August 17, 2024

strenge that when I do in the my post works I retreive all the two element ...

from android-floatingtutorialactivity.

Related Issues (3)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.