Creating Chatting Application in Android Studio Using Kotlin | GeeksforGeeks

Поделиться
HTML-код
  • Опубликовано: 21 авг 2024
  • In this video, we're going to discuss how to create a Chat Application in Android Studio using Kotlin. The application will consist of a Sign Up / Login Page and will allow you to chat with other users without any hassle. So, let's get started now.
    Check Out the Related Articles:
    Complete Kotlin Tutorial [www.geeksforge...]
    Complete Android Tutorial [www.geeksforge...]
    Apply For Video Internship Program - script.geeksfo...
    Our courses: practice.geeks...
    This video is contributed by Abhay Maurya.
    Please Like, Comment, and Share the Video with your friends.
    #android ​#project #kotlin #androidstudio #appdevelopment
    Install our Android App:
    play.google.co...
    If you wish, translate into the local language and help us reach millions of other geeks:
    www.youtube.com...
    Follow us on our Social Media Handles -
    Twitter- / geeksforgeeks
    LinkedIn- / geeksforgeeks
    Facebook- / geeksforgeeks.org
    Instagram- www.instagram....
    Reddit- / geeksforgeeks
    Telegram- t.me/s/geeksfo...
    Also, Subscribe if you haven't already! :)

Комментарии • 336

  • @rondolfopresilla6876
    @rondolfopresilla6876 Год назад +5

    Hi sir, thanks for the video. Just to let others know that one year after you published it I was able to get it to work. For some bizarre reason, the chat layout design did not work as expected and all components were all over the place, but after a quick search I was able to get it to work as well. Thanks again.

    • @karthikprabhu23223
      @karthikprabhu23223 Год назад

      Hello, How did u overcome this problem? Could we connect on LinkedIn Or GitHub regarding this?

    • @skootz24
      @skootz24 Год назад +1

      @@karthikprabhu23223 For me the fix was to start the project as an "Empty Views Activity" instead of just an "Empty Activity". and whenever a new empty activity is made I use Empty Views Activity instead.
      That seems to get stuff working, though please be aware that I am new and inexperienced, so not sure what the difference is and if I may be messing something up later on.

    • @karthikprabhu23223
      @karthikprabhu23223 Год назад

      @@skootz24 Thank you for replying. 😃

    • @abhishekydv55
      @abhishekydv55 5 месяцев назад

      bro can you share the source code with us plz... it will be of great help

  • @gaelramos6584
    @gaelramos6584 Год назад +7

    25:00 for newer versions it will appear the "apply" as an "id" just paste them in the plugin section at the top and if it repeats with an already previous id just delet the new one.

  • @brunonunes6532
    @brunonunes6532 2 года назад +8

    Thank you for such a great tutorial, i've been searching for a long time for this kind of content and i found yours. Rich and straight forward content.

  • @sknoman3949
    @sknoman3949 Год назад +3

    Thanks buddy, I watched the whole video and applied. Which works fine, do continue great tutorials.

    • @ashwinnair1035
      @ashwinnair1035 7 месяцев назад +1

      can you please share your code

  • @elijahdecalmer613
    @elijahdecalmer613 Год назад +6

    Thanks!

  • @theworldisbeautiful6583
    @theworldisbeautiful6583 2 года назад +10

    Thanks a lot for this detailed explanation. That is just the best tutorial in creating the chat in Android- step by step, everything is clear. I had some difficulties with the RecyclerView, because my Android Studio didn't except some part of the code in xml file, so I had just deleted a little bit and it started to work. Thanks a lot for this great video !!!!!!!!!!!!!!!!!!!!!!!!!

    • @sanjayan_n
      @sanjayan_n 2 года назад

      Could you please reply with the changes you made...

  • @Ameya890
    @Ameya890 3 года назад +19

    Thank you! Will try this ASAP

    • @Trigoter
      @Trigoter 3 года назад

      Firebaseauth at 29:50 is not working for me, help me.

    • @shagunchaturvedi2020
      @shagunchaturvedi2020 2 года назад

      @@Trigoter shut android studio and open again... May be it will work.

    • @saadkiani8784
      @saadkiani8784 Год назад

      Contacts are not showing
      Can you helpme

  • @ghaidaaal-ezzi8677
    @ghaidaaal-ezzi8677 Год назад +1

    I love your content it is very straight forward the best for programmers personality they want to see things working after long hours of coding!

  • @ruapakbhardwaj19345
    @ruapakbhardwaj19345 Год назад +2

    i have an erron in build.gradle error is all buildscript {} blocks must appear before any plugins {} blocks in the script please help.

  • @GOSPELTHRONE
    @GOSPELTHRONE Год назад +1

    Thanks so much, the app work exact as yours.. looking forward to more video on improving it's functionality and most especially attaching files

    • @ashwinnair1035
      @ashwinnair1035 7 месяцев назад

      Can you please share your code

  • @ahmetylmaz9909
    @ahmetylmaz9909 3 года назад +3

    Thats so nice video. I did this application with you.

  • @kevinsolanki6232
    @kevinsolanki6232 2 года назад +2

    Completed. Thank you so much sir😌🙏🏻🙏🏻💙

    • @BadBoy-sc3xv
      @BadBoy-sc3xv 2 года назад +1

      did you get same gradle as same as in video

    • @kevinsolanki6232
      @kevinsolanki6232 2 года назад

      @@BadBoy-sc3xv no. It was totally different. I guess it's updated that's why. So I added this in Gradle (project) file :
      buildscript{
      repositories {
      jcenter()
      }
      dependencies{
      classpath 'com.google.gms:google-services:4.3.13'
      }
      }

    • @ashwinnair1035
      @ashwinnair1035 7 месяцев назад

      can you please share your code

  • @surajverma-ly3px
    @surajverma-ly3px 6 месяцев назад +4

    I have successfully completed this project

    • @maisakurajima9194
      @maisakurajima9194 5 месяцев назад

      Hi, did u used Android Studio Iguana?

    • @jauharansari3113
      @jauharansari3113 5 месяцев назад

      bro you got the name of all users present in Realtime database in your Recycler View?
      i don't get the user in my recyclerView .
      can you explain me please?

    • @surajverma-ly3px
      @surajverma-ly3px 5 месяцев назад

      @@maisakurajima9194 kotlin

    • @user-um6wt8td9z
      @user-um6wt8td9z 5 месяцев назад +1

      Hi can i massage you to send a source code

    • @surajverma-ly3px
      @surajverma-ly3px 5 месяцев назад

      @@user-um6wt8td9z yes

  • @baselkayali3374
    @baselkayali3374 Год назад

    Absolutely is amazing your explaining and everything is simple Many thanks for Abhay Maurya.

  • @codewith_ayushluthra5248
    @codewith_ayushluthra5248 Год назад +2

    Completed Thanks ❤❤

  • @steep6444
    @steep6444 2 года назад +2

    24:43 i haven't found a build gradle and dependencies can u help me ?

  • @ashwanisingh7990
    @ashwanisingh7990 Год назад +1

    When you reopen application, it automatically log out, so we have to sign in everytime.
    That is annoying, can someone suggest how to fix it, or what snippet do i have to use to stay signed in

  • @ranahishamfoad6164
    @ranahishamfoad6164 2 года назад +18

    It would be better to share the source code link.

  • @fridaee
    @fridaee Год назад +11

    The firebase gradle thing was hard for me, but I fixed it with this:
    // Top-level build file where you can add configuration options common to all sub-projects/modules.
    buildscript {
    repositories {
    google()
    mavenCentral()
    }
    dependencies {
    classpath 'com.google.gms:google-services:4.3.14'
    }
    }
    plugins {
    id 'com.android.application' version '7.3.1' apply false
    id 'com.android.library' version '7.3.1' apply false
    id 'org.jetbrains.kotlin.android' version '1.7.20' apply false
    }

  • @swapnalijoshi8808
    @swapnalijoshi8808 2 месяца назад

    Thank you so much sir 🙏

  • @CoffeewithSahil1304
    @CoffeewithSahil1304 18 дней назад

    Thank you so much ✨️

  • @wissamhassani9625
    @wissamhassani9625 Год назад +1

    Just finished the app!!!! Great stuff!!!!!

    • @nastenkaoo
      @nastenkaoo Год назад +1

      does it work properly?

    • @karthikprabhu23223
      @karthikprabhu23223 Год назад

      Does the project run successfully? Could you share the GitHub repo?

    • @ashwinnair1035
      @ashwinnair1035 7 месяцев назад

      can you please share your code

  • @gulkhitababbasi5391
    @gulkhitababbasi5391 2 года назад +1

    Thank u very very much sir

  • @saadkiani8784
    @saadkiani8784 Год назад +3

    Contacts are mot showing 1:24:50

  • @codingpathshala559
    @codingpathshala559 Год назад +1

    24:26 , in the new android studio, there is a difference in the build.gradle , there are no such dependencies , Then where to paste that classpath ? Pls reply me ASAP .

  • @pradeepkumarreddykondreddy7048
    @pradeepkumarreddykondreddy7048 Год назад +1

    In this app, do you load the users existing contacts from the android system ? And also do you listen for contacts changes in android system ?

  • @walidkhalil3451
    @walidkhalil3451 2 года назад +2

    So instructive, keep it up!

  • @kee3379
    @kee3379 Год назад +1

    Can we download the created app 9n android studio to our phone 📱

  • @hammadhassan978
    @hammadhassan978 2 года назад +4

    i want your gradle(app) file. will u share the picture of the dependencies?

  • @tanvitripathi5743
    @tanvitripathi5743 2 года назад +1

    Thanks for this effort

  • @asaelrddz
    @asaelrddz 2 года назад +5

    THANK YOU SO MUCH FOR SHARE THIS CONTENT, ITS JUST AMAZING! ❤️

  • @androidsurfers7572
    @androidsurfers7572 2 года назад +1

    Simply awesome

  • @codewithsas6690
    @codewithsas6690 2 года назад

    Thancx a lot sir, lot of things learned

  • @nastenkaoo
    @nastenkaoo Год назад

    you are great, it works properly

  • @lastminutegyan9975
    @lastminutegyan9975 2 года назад +2

    I am following the same code as you are doing but my values are not getting stored in realtime firebase. My Authentication is working fine but values are not getting stored. Can you please help on this. I am stuck because of this.

    • @priyaraja1624
      @priyaraja1624 Год назад

      Yes, you are resolve this problem, i'm also stuck this step.please can you help me ?

  • @duncanmoiyo6069
    @duncanmoiyo6069 2 года назад

    the best tutorial ever

  • @kaushikkaransingh3240
    @kaushikkaransingh3240 3 года назад +1

    Really wanted this tutorial 🔥

  • @ZaydMohammed-uc9nt
    @ZaydMohammed-uc9nt Год назад +2

    Sir, Im having trouble on creating the Signup part...it keeps telling me Some error occured(From our command) but when I check I did everything you did...What the problem?

    • @justtocomment2416
      @justtocomment2416 Год назад +1

      I had a similar issue, the password must be with letters and numbers ? or there is a minimum required length, so try a more complex password maybe

    • @ZaydMohammed-uc9nt
      @ZaydMohammed-uc9nt Год назад +1

      @@justtocomment2416 Sir, I did that also and still didn't work.

    • @codingpathshala559
      @codingpathshala559 Год назад

      Same problem , pls help .

    • @umidjonsalimov6182
      @umidjonsalimov6182 11 месяцев назад

      I guess, you are testing the app on other device, you should enter the firebase and turn on auth. from that device, that you test the app.

  • @shadabarzoo2258
    @shadabarzoo2258 Год назад

    in signin page else part is running if is not running

  • @ScienceForUs
    @ScienceForUs 2 года назад

    I will be going to make this app. Thanks yar.

  • @souravsarkar6107
    @souravsarkar6107 2 года назад

    Great Understanding Video you made thank you

  • @wertuxhd6201
    @wertuxhd6201 2 года назад +7

    I have finished the video and coding.. Fixed all the errors until the end. But first app was crushing so I simply added push() to the code. Now no crash but the messages wont pop up. If someone knows the solution please.

    • @saadkiani8784
      @saadkiani8784 Год назад

      Contacts are not showing can you help me

    • @saadkiani8784
      @saadkiani8784 Год назад

      Can't retrieve contact from data base

  • @doctorpizza8518
    @doctorpizza8518 2 года назад +3

    1:34:48 don't mind me, just putting a bookmark for myself

  • @AjayKumar-fw6ui
    @AjayKumar-fw6ui 2 года назад +1

    When I signed in my app it crashes pls help

  • @hamzamunir4227
    @hamzamunir4227 Год назад

    Great sir👍

  • @heko9614
    @heko9614 2 года назад

    Thank You, nice tutorial

  • @user-hm6uc8bz8q
    @user-hm6uc8bz8q 4 месяца назад

    cool video)

  • @SonuKumar-px9dy
    @SonuKumar-px9dy 2 года назад +1

    sir i got only one type of messages mean reciverroom or senderroom how to handle such problem pls

  • @nishapaliyar3838
    @nishapaliyar3838 Год назад +1

    I have an error Caused by: kotlin.UninitializedPropertyAccessException: lateinit property btnSignUp has not been initialized

    • @syedmohammadhamzahusain998
      @syedmohammadhamzahusain998 Год назад

      You probably didn't declare "btnSignUp" in your activity page...
      private lateinit var signup_btn: Button
      type the above ststement in your signup_page.kt
      then declare it using FindViewById function...
      hope this might be helpful🙂

  • @luisdomiciano
    @luisdomiciano 8 месяцев назад +1

    Amazing

  • @kshyamasagarminz697
    @kshyamasagarminz697 2 года назад +4

    I followed the exact same process, but could not see the data in Realtime Database
    . 1:10:53

    • @DenBredeYmer
      @DenBredeYmer 2 года назад

      I have the same problem, did u find a solution?

    • @shreeyashgijare4039
      @shreeyashgijare4039 2 года назад

      Check your child nodes Names

    • @matwit91
      @matwit91 2 года назад

      I have the same issue

  • @surajverma-ly3px
    @surajverma-ly3px 6 месяцев назад

    Thank you sir ji ,

  • @user-vg3rd7he4v
    @user-vg3rd7he4v 2 года назад +2

    Login Problem : using trim, realtime problem : Only using USA region not Singapore

  • @asm9450
    @asm9450 2 года назад +2

    First of all thank you for this amazing chatapplication got to learn new concepts. I followed the steps as shown but I don't know why as soon as I login the window takes some time and the app crashes. Although I have installed all the dependencies.
    Can you please help me out

    • @manasijadhav39
      @manasijadhav39 2 года назад

      Hey, try checking in the 'Login.kt' under OnClickListener in val intent you might have typed 'btnsignup' instead of 'Signup'. I made the same blunder.

  • @qaphelanimthembu8514
    @qaphelanimthembu8514 2 года назад +2

    @ 1:01:45 How do you reference the adapter? It just doesn't work. It appears red and it says unresolved reference. Do I need any dependencies for this? Please help.

    • @ankitsoni9479
      @ankitsoni9479 2 года назад

      I had the same problem but then I rechecked
      And found that I made this file in wrong path ..please recheck tha path

  • @rohithjuluru9481
    @rohithjuluru9481 2 года назад +2

    1:10:42 When I try to sign up ,it crashes. In authentication, I can see my users but in database, I cannot. Is there anything I can do to make it right.

    • @charlesschen1292
      @charlesschen1292 2 года назад

      Hi i got the same problem did you get the solution?

  • @msganesh5373
    @msganesh5373 2 года назад +1

    haii i'm facing this error
    java.lang.ClassCastException: android.widget.RelativeLayout cannot be cast to android.widget.Button ,
    please help me

  • @user-wb5dw2so8w
    @user-wb5dw2so8w 2 года назад

    Thank you very much, my sir

  • @praveenaade1214
    @praveenaade1214 3 года назад +4

    Please do one project Retrofit and room database using MVVM

  • @dumbguy1073
    @dumbguy1073 Год назад

    Amazing Tutorial!!

  • @st.libertos
    @st.libertos 2 года назад

    Thank you very much!

  • @LovePahadUttrakhand
    @LovePahadUttrakhand Год назад +2

    Sir can I know what is the bandwidth?

  • @Tough_Sol_Art
    @Tough_Sol_Art 2 года назад

    Thanks to you sir for this stuff

  • @polarcat9234
    @polarcat9234 2 года назад

    Thank you so much

  • @marianikolaou9580
    @marianikolaou9580 2 года назад +1

    Amazing!

  • @TeamPlaying11
    @TeamPlaying11 Год назад

    Thanks for sharing

  • @fatihkoc1520
    @fatihkoc1520 2 года назад +2

    İsnt it better with using viewBinding and fragment components

  • @wilsonptamegajr2312
    @wilsonptamegajr2312 2 года назад +9

    Great Tutorial!!! But I got a sticky question: "How do I implement a security rule so no user with access to the firebase realtime through console could change any value on the database?" For example, how to avoid that someone could change a message text through firebase console?

    • @The__Leo69
      @The__Leo69 2 года назад +3

      By storing encrypted messages.

  • @sodagarali4442
    @sodagarali4442 Год назад

    Thank u very much

  • @mehrabpranto1452
    @mehrabpranto1452 4 месяца назад

    log out button and that menu is not showing in my app

  • @nomadrachit
    @nomadrachit 11 месяцев назад

    Thank you.

  • @motivationkiaag1601
    @motivationkiaag1601 Год назад +2

    Any one please help me ,
    I am created app by watching whole video it work perfectly but it give one issue,
    Issue is that when two people chat then sender can send only one message, not more than one.
    If sender want to send message again that people then there edittext message will clear and message add on data base but but not reflect on UI .

    • @syedmohammadhamzahusain998
      @syedmohammadhamzahusain998 Год назад

      watch the video from 2:12:00 cause i guess you forgot to add message.notifyDataSetChanged
      hope this might work
      good luck...

    • @avibecalledgulu
      @avibecalledgulu Год назад

      @@syedmohammadhamzahusain998 Hi, i am having this issue. I can send messages from person A to person B however when i try to reply as person B the app crashes. How can i fix this issue

    • @maisakurajima9194
      @maisakurajima9194 5 месяцев назад

      ​@@syedmohammadhamzahusain998 do u have the source code?

  • @vynibinisarmiento
    @vynibinisarmiento Год назад

    Thank You for this Sir!

  • @matwit91
    @matwit91 2 года назад +2

    24:35 I have some issues with gradle top level build file, when I opened mine file, it looks different than yours. I don't have buildscript, dependancies and all project, what should I do?

    • @matwit91
      @matwit91 2 года назад +1

      I did it xd

    • @srivallisangareddy3599
      @srivallisangareddy3599 2 года назад +3

      Copy buildscript and dependencies from firebase and don't copy all projects
      Paste buildscript and dependencies above plugins

    • @nandangureja8975
      @nandangureja8975 2 года назад

      @@matwit91 Can you let me know , m facing the same issue

    • @rolandbogdan8502
      @rolandbogdan8502 2 года назад

      pls help me how did you solve that

    • @mohamed_gamal6308
      @mohamed_gamal6308 2 года назад +1

      @@rolandbogdan8502 Copy buildscript and dependencies from firebase and don't copy all projects
      Paste buildscript and dependencies above plugins
      from Srivalli answer

  • @samsh4021
    @samsh4021 2 года назад

    You are the best

  • @nubcops220
    @nubcops220 2 года назад +1

    Does it work for people with different internets?

  • @alisaquibraza6870
    @alisaquibraza6870 2 года назад +1

    why use relative layout when you have constraint Layout?

  • @filipatanasovski8621
    @filipatanasovski8621 2 года назад +1

    I am trying to this tutorial on 5/3/2022 and i have troubles with
    build.gradle(chatApplication)....any help?

    • @rohansharma3249
      @rohansharma3249 2 года назад +1

      I am having the same issues

    • @ugursener1709
      @ugursener1709 2 года назад

      i don't know what your exact problem but it works when i add those;
      To Gradle Project level add this lines
      buildscript {
      dependencies {
      // Add this line
      classpath 'com.google.gms:google-services:4.3.10'
      }
      }
      To Gradle App level;
      plugins {
      ...
      id 'com.google.gms.google-services'
      }
      dependencies {
      implementation 'com.google.firebase:firebase-auth-ktx:21.0.3'
      implementation 'com.google.firebase:firebase-database-ktx:20.0.5'
      implementation("androidx.recyclerview:recyclerview:1.2.1") // recycler
      implementation("androidx.recyclerview:recyclerview-selection:1.1.0")
      implementation platform('com.google.firebase:firebase-bom:30.0.1') implementation 'com.google.firebase:firebase-analytics-ktx'
      }
      hope you fix it.

  • @darrinreed8027
    @darrinreed8027 2 года назад +2

    Do you go over draw over other apps on this? I'm looking to be able to have user click a button that overlays on other apps to send a message that way.

  • @SaifEddineLAYOUNI
    @SaifEddineLAYOUNI Год назад +1

    can you provide for us the manifest file because i dont know how relate each interfaces between them

  • @user-zn7qx2ib5p
    @user-zn7qx2ib5p Год назад

    When I'm adding to the Realtime Database from Android Studio, there it shows the JAVA version instead of KOTLIN. What should I do? Do I continue to add JAVA only?

  • @lanajauhar5461
    @lanajauhar5461 2 года назад +3

    Sorry sir. I have followed your tutorial, but the textview cannot display the sender and the recipient, what is the solution?

  • @flocktogether8173
    @flocktogether8173 2 года назад +1

    If there was rating for this video it would be 5/5

  • @mdshahreyar5050
    @mdshahreyar5050 3 дня назад

    log out option is not coming

  • @pranav9815
    @pranav9815 Год назад

    Please help me out I am facing too much issues creating this app, I have to add it in my resume

  • @johnportelance3851
    @johnportelance3851 Год назад +1

    can you make a group chat, that is chatters can join specific groups for shared chat?

  • @user-oz3qs6nj8o
    @user-oz3qs6nj8o 4 месяца назад

    any chance of creating both one to one chats and also mainly have group chats, where 3,4,5 or evne 10 members can chat all together at the same time? please anyone let me know if you ever see this kind of chat app functionality and where to find it. thanks everyone, and great video by the way lol.

  • @who_thekaushik
    @who_thekaushik Год назад

    i am having a issue in sign up and login . on signup page its showing authentication failed but on the firebase user is registering . and also login is not happing . authenticating failed is the error. can you give me a hint

  • @geeker_yela
    @geeker_yela 2 года назад

    Help!!
    When connected to Firebase, the button setOnClickListener failed to jump to the sign up page. What should I do?

  • @s.d.a906
    @s.d.a906 2 года назад

    Great!!!

  • @Hassan-re8kh
    @Hassan-re8kh 2 года назад

    can comeone tell me why only one layout is inflated all messages are in receive layout? even when Im the sender

  • @srikumarma
    @srikumarma 2 года назад

    It's working for me 💥

    • @abhishekydv55
      @abhishekydv55 5 месяцев назад

      bro please share the source code with me

  • @nishantpedgulkar7749
    @nishantpedgulkar7749 10 месяцев назад

    Bro when we are using @signup and @login it is showing ambiguous error and app is not starting in phone from start it is crashing can you give the solution pls .

  • @intensive.code13
    @intensive.code13 2 года назад +2

    Can you make this same app in Java ?

  • @marianikolaou9580
    @marianikolaou9580 2 года назад

    Thanks

  • @yusufcetin9732
    @yusufcetin9732 2 года назад

    hello Can you put theis app google play ? is that any securty ıssues about these app ? I am not going t copy these but I am trying to make these kind of application .I just want to learn that If i do this kind of app google play accept this ?
    thanks !

  • @harshakar274
    @harshakar274 3 месяца назад

    can you please provide git hub repo , or any drive link of this project?

  • @vikuvlog108
    @vikuvlog108 3 года назад

    Awesome work.....
    Please upload React js project also

  • @shashanksp9168
    @shashanksp9168 Год назад +1

    app crashing after i press on any name in chatACtivity what might be the error
    here is the code from messageAdapter class
    class MessageAdapter(val context: Context, private val messageList:ArrayList) :
    RecyclerView.Adapter() {
    val ITEM_RECEIVE = 1
    val ITEM_SEND = 2
    override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): ViewHolder {
    if(viewType == 1){
    val view: View = LayoutInflater.from(context).inflate(R.layout.receive,parent,false)
    return ReceiveViewHolder(view)
    }else{
    val view: View = LayoutInflater.from(context).inflate(R.layout.sent,parent,false)
    return SentViewHolder(view)
    }
    }
    override fun onBindViewHolder(holder: ViewHolder, position: Int) {
    val currentMessage = messageList[position]
    if(holder.javaClass == SentViewHolder::class.java){
    val viewHolder = holder as SentViewHolder
    holder.sentMessage.text = currentMessage.message
    }else{
    val viewHolder = holder as ReceiveViewHolder
    holder.receiveMessage.text = currentMessage.message
    }
    }
    override fun getItemViewType(position: Int): Int {
    val currentMessage = messageList[position]
    return if(FirebaseAuth.getInstance().currentUser?.uid.equals(currentMessage.senderId)){
    ITEM_SEND
    }else{
    ITEM_RECEIVE
    }
    }
    override fun getItemCount(): Int {
    return messageList.size
    }
    class SentViewHolder(itemView: View) :RecyclerView.ViewHolder(itemView){
    val sentMessage = itemView.findViewById(R.id.txt_sent_message)!!
    }
    class ReceiveViewHolder(itemView: View) :RecyclerView.ViewHolder(itemView){
    val receiveMessage = itemView.findViewById(R.id.txt_receive_message)!!
    }

  • @bikeshkumar949
    @bikeshkumar949 3 года назад +1

    Awesome, Please make screen recording app

    • @Trigoter
      @Trigoter 3 года назад

      Firebaseauth at 29:50 is not working for me, help me.