Notify icon indicating copy to clipboard operation
Notify copied to clipboard

Create a Text Editor

Open aritra-tech opened this issue 1 year ago • 15 comments

Create a Text Editor in AddNoteScreen where there will be buttons for Bold, Italic, Strikethrough, etc.

aritra-tech avatar Aug 16 '23 09:08 aritra-tech

Can you please assign this to me?

githubashutoshsoni avatar Oct 02 '23 05:10 githubashutoshsoni

Sure @githubashutoshsoni All the best.

aritra-tech avatar Oct 02 '23 05:10 aritra-tech

@aritra-tech we have handful of libraries for compose yet they are not very customizing. can you suggest some library that does this or we need to build our own custom compose library for rich edit text? I checked out the below it does most of the job but BaseEditText does not have onValueChange function that can return the result

compose rich editor

githubashutoshsoni avatar Oct 04 '23 02:10 githubashutoshsoni

I suggest not to use a third party library.

aritra-tech avatar Oct 04 '23 02:10 aritra-tech

Okay, I've got it working. Can you please merge single tap to top to develop branch since I got this completed as well. I will update this once I you do a quick merge to develop branch so there are no conflicts.

githubashutoshsoni avatar Oct 04 '23 03:10 githubashutoshsoni

I have requested some changes in the PR that you have created please check it out. Once it's fixed I will merge it out.

aritra-tech avatar Oct 04 '23 03:10 aritra-tech

Hey @githubashutoshsoni any updates?

aritra-tech avatar Oct 10 '23 16:10 aritra-tech

I haven't resolved the issue yet. The creation of a new note functions correctly, but editing an existing note seems to be malfunctioning. Could you please review it in this pull request? #141

  RichTextStyleRow(
                modifier = Modifier.fillMaxWidth(),
                state = basicRichTextState,
            )

            RichTextEditor(
                state = basicRichTextState,
                modifier = Modifier
                    .fillMaxSize(),
                textStyle = TextStyle(
                    fontSize = 18.sp,
                    fontFamily = FontFamily(Font(R.font.poppins_light)),
                ),
                keyboardOptions = KeyboardOptions.Default.copy(
                    capitalization = KeyboardCapitalization.Sentences,
                    keyboardType = KeyboardType.Text,
                ),

                maxLines = Int.MAX_VALUE,
                placeholder = {
                    Text(
                        stringResource(R.string.notes),
                        fontSize = 20.sp,
                        fontWeight = FontWeight.W500,
                        color = Color.Gray,
                        fontFamily = FontFamily(Font(R.font.poppins_light))
                    )
                },
            )
            description = basicRichTextState.annotatedString.text
            if (isNew) {
                characterCount = title.length + description.length
            } else {
                addEditViewModel.updateDescription(description)
            } 

githubashutoshsoni avatar Oct 11 '23 03:10 githubashutoshsoni

Hey @githubashutoshsoni can you please fix the changes that I have told you regarding the PR that you have raised.

aritra-tech avatar Oct 15 '23 05:10 aritra-tech

@aritra-tech i am back assign it to me and also have you uploaded any post about changes in v1.5.1 on LinkedIn

Ismail-AD avatar Oct 21 '23 11:10 Ismail-AD

Yeah sure All the best 👋

aritra-tech avatar Oct 21 '23 12:10 aritra-tech

I have tried it today the thing is it will change all the text style rather the upcoming typed text and the library of RICH text compose will change the total structure of your description text field function which i don't want to do !!!!

Ismail-AD avatar Oct 22 '23 15:10 Ismail-AD

Which library did you use? This one - https://github.com/MohamedRejeb/Compose-Rich-Editor

aritra-tech avatar Oct 22 '23 15:10 aritra-tech

yes this one But the library of RICH text compose will change the total structure of your description text field function which i don't want to do !!!!

Ismail-AD avatar Oct 22 '23 15:10 Ismail-AD

Okay got your point.

aritra-tech avatar Oct 22 '23 15:10 aritra-tech