Coder Social home page Coder Social logo

Comments (9)

starry-shivam avatar starry-shivam commented on June 6, 2024 1

I think adding an argument (showCopyButton) will be enough for this case. It's best to do the simplest method now, and change to more advanced later if there comes a use-case for that

Sure! works for me :)

On other note, check the available Icons and think the ContentCopy one is the right one.

Yeah looks good! We can go ahead with this.

You can check it out here: https://github.com/mrghosti3/GreenStash/tree/note-copy

Feel free to create a PR if you think it's ready. I'll review it tomorrow since it's late night where I am.

from greenstash.

mrghosti3 avatar mrghosti3 commented on June 6, 2024 1

Okay, will create a PR later. Have a great evening.

from greenstash.

mrghosti3 avatar mrghosti3 commented on June 6, 2024

Could implement this feature quickly. The previous ones are a bit more difficult for me as I'm new to kotlin overall, used to older way (Java and XML) of developing Android apps.

from greenstash.

starry-shivam avatar starry-shivam commented on June 6, 2024

Sounds like a good idea. I think adding a copy button here, which is visible after expanding, would be a better idea than long-press, as long-press can collide with the card's collapse UI which happens on single tap.

IMG_20240406_222029_258

from greenstash.

mrghosti3 avatar mrghosti3 commented on June 6, 2024

How about adding a button on the left of the arrow? This could allow to skip needing to expand the note card.

from greenstash.

starry-shivam avatar starry-shivam commented on June 6, 2024

I don't think that would be great from a UX perspective because then it can only be an icon button, which would be very small and easily misclicked, leading to the expansion of the notes card instead of the text being copied. The other solution allows us to have an actual button with a decent size, which cannot be easily misinterpreted. I think something like (copyIcon "copy") using FilledTonalButton() would look much nicer.

from greenstash.

mrghosti3 avatar mrghosti3 commented on June 6, 2024

Understandable, then a copy button below text sounds like a good way to do. Gonna try and create it then.

ps. Also to clarify, it's a Filled tonal button with an icon or without?

from greenstash.

starry-shivam avatar starry-shivam commented on June 6, 2024

Great!

Also to clarify, it's a Filled tonal button with an icon or without

With, you can probably use something like Icons.Filled.Copy combined with ButtonDefaults.IconSpacing for placing icon and a text inside Row()

I think this could be implemented by preferably overloading or adding two additional parameters in ExpandableTextCard(), which is used to show notes. One is for deciding whether we should show a copy button (something like showCopyButton: Boolean), and the other is a callback (onCopyClicked(text)) which would allow us to handle copying of the text, this would allow us to implement the feature while also ensuring reusablility of common composables at the same time

from greenstash.

mrghosti3 avatar mrghosti3 commented on June 6, 2024

I think adding an argument (showCopyButton) will be enough for this case. It's best to do the simplest method now, and change to more advanced later if there comes a use-case for that.

On other note, check the available Icons and think the ContentCopy one is the right one.

You can check it out here: https://github.com/mrghosti3/GreenStash/tree/note-copy

from greenstash.

Related Issues (20)

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.