From 8b527741d9fa77cad1c982d4820c935c912aef35 Mon Sep 17 00:00:00 2001 From: Om Maniya Date: Tue, 4 Jun 2024 19:04:27 +0530 Subject: [PATCH 1/2] Add: Create group feature in android app --- TalkIn/app/src/main/AndroidManifest.xml | 18 +++- .../example/talk_in/CreateGroupActivity.kt | 59 +++++++++++ .../example/talk_in/DisplayGroupAdapter.kt | 61 +++++++++++ .../main/java/com/example/talk_in/Group.kt | 17 ++++ .../com/example/talk_in/GroupChatActivity.kt | 74 ++++++++++++++ .../example/talk_in/GroupMemberSelection.kt | 67 ++++++++++++ .../talk_in/GroupMemberSelectionAdapter.kt | 95 ++++++++++++++++++ .../main/java/com/example/talk_in/Groups.kt | 73 ++++++++++++++ .../java/com/example/talk_in/MainActivity.kt | 7 +- .../res/drawable/icon_select_group_member.png | Bin 0 -> 1384 bytes .../app/src/main/res/drawable/plus_icon.png | Bin 0 -> 1766 bytes .../main/res/drawable/right_arrow_icon.png | Bin 0 -> 1972 bytes .../main/res/layout/activity_create_group.xml | 72 +++++++++++++ .../activity_group_member_selection.xml | 49 +++++++++ .../src/main/res/layout/activity_groups.xml | 85 ++++++++++++++++ .../app/src/main/res/layout/user_layout.xml | 9 ++ .../main/res/menu/bottom_navigation_menu.xml | 4 +- 17 files changed, 683 insertions(+), 7 deletions(-) create mode 100644 TalkIn/app/src/main/java/com/example/talk_in/CreateGroupActivity.kt create mode 100644 TalkIn/app/src/main/java/com/example/talk_in/DisplayGroupAdapter.kt create mode 100644 TalkIn/app/src/main/java/com/example/talk_in/Group.kt create mode 100644 TalkIn/app/src/main/java/com/example/talk_in/GroupChatActivity.kt create mode 100644 TalkIn/app/src/main/java/com/example/talk_in/GroupMemberSelection.kt create mode 100644 TalkIn/app/src/main/java/com/example/talk_in/GroupMemberSelectionAdapter.kt create mode 100644 TalkIn/app/src/main/java/com/example/talk_in/Groups.kt create mode 100644 TalkIn/app/src/main/res/drawable/icon_select_group_member.png create mode 100644 TalkIn/app/src/main/res/drawable/plus_icon.png create mode 100644 TalkIn/app/src/main/res/drawable/right_arrow_icon.png create mode 100644 TalkIn/app/src/main/res/layout/activity_create_group.xml create mode 100644 TalkIn/app/src/main/res/layout/activity_group_member_selection.xml create mode 100644 TalkIn/app/src/main/res/layout/activity_groups.xml diff --git a/TalkIn/app/src/main/AndroidManifest.xml b/TalkIn/app/src/main/AndroidManifest.xml index 64c7542..77c8d31 100644 --- a/TalkIn/app/src/main/AndroidManifest.xml +++ b/TalkIn/app/src/main/AndroidManifest.xml @@ -17,9 +17,21 @@ android:theme="@style/Theme.TalkIn" tools:targetApi="31"> + + + + - - diff --git a/TalkIn/app/src/main/java/com/example/talk_in/CreateGroupActivity.kt b/TalkIn/app/src/main/java/com/example/talk_in/CreateGroupActivity.kt new file mode 100644 index 0000000..aac6796 --- /dev/null +++ b/TalkIn/app/src/main/java/com/example/talk_in/CreateGroupActivity.kt @@ -0,0 +1,59 @@ +package com.example.talk_in + +import android.content.Intent +import android.os.Bundle +import android.text.TextUtils +import android.util.Log +import android.widget.Toast +import androidx.appcompat.app.AppCompatActivity +import com.example.talk_in.databinding.ActivityCreateGroupBinding +import com.google.firebase.database.DatabaseReference +import com.google.firebase.database.FirebaseDatabase + +class CreateGroupActivity : AppCompatActivity() { + private lateinit var mDbRef: DatabaseReference + private lateinit var binding: ActivityCreateGroupBinding + override fun onCreate(savedInstanceState: Bundle?) { + super.onCreate(savedInstanceState) + binding = ActivityCreateGroupBinding.inflate(layoutInflater) + setContentView(binding.root) + + val groupMembers: ArrayList? = intent.getStringArrayListExtra("GROUP_MEMBERS") + binding.confirmButton.setOnClickListener { + val groupName = binding.groupNameTextfield.text.toString().trim() + var groupDescription = binding.groupDescriptionField.text.toString().trim() + + if (TextUtils.isEmpty(groupName)) + Toast.makeText(this, "Please enter group name", Toast.LENGTH_SHORT).show() + else{ + if (TextUtils.isEmpty(groupDescription)) + groupDescription = "Hey, Welcome to " + groupName + createGroup(groupName, groupDescription, groupMembers!!) + } + } + } + private fun createGroup(groupName: String, groupDescription: String?, groupMembers: ArrayList) { + mDbRef = FirebaseDatabase.getInstance().reference + val groupId = mDbRef.child("groups").push().key ?: "" + + val group = Group(groupName, groupDescription, groupMembers, groupId) + + mDbRef.child("groups").child(groupId).setValue(group) + .addOnSuccessListener { + Toast.makeText(this, "Group created successfully", Toast.LENGTH_SHORT).show() + val intent = Intent(this@CreateGroupActivity, GroupChatActivity::class.java) + intent.putExtra("NAME", groupName) + intent.putExtra("GROUP_ID", groupId) + + finish() + startActivity(intent) + } + .addOnFailureListener { exception -> + Log.e("CreateGroupActivity", "Error creating group", exception) + Toast.makeText(this, "Failed to create group", Toast.LENGTH_SHORT).show() + val intent = Intent(this@CreateGroupActivity, Groups::class.java) + finish() + startActivity(intent) + } + } +} \ No newline at end of file diff --git a/TalkIn/app/src/main/java/com/example/talk_in/DisplayGroupAdapter.kt b/TalkIn/app/src/main/java/com/example/talk_in/DisplayGroupAdapter.kt new file mode 100644 index 0000000..94657dd --- /dev/null +++ b/TalkIn/app/src/main/java/com/example/talk_in/DisplayGroupAdapter.kt @@ -0,0 +1,61 @@ +package com.example.talk_in + +import android.content.Context +import android.content.Intent +import android.view.LayoutInflater +import android.view.View +import android.view.ViewGroup +import android.widget.TextView +import androidx.recyclerview.widget.RecyclerView +import com.google.firebase.database.* + +class DisplayGroupAdapter(val context: Context, val groupList: ArrayList) : + RecyclerView.Adapter() { + private lateinit var mDbRef: DatabaseReference + + override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): UserViewHolder { + mDbRef = FirebaseDatabase.getInstance().getReference() + + val view: View = + LayoutInflater.from(context).inflate(R.layout.user_layout, parent, false) + return UserViewHolder(view) + } + + override fun onBindViewHolder(holder: UserViewHolder, position: Int) { + val currentGroup = groupList[position] + + var name = currentGroup.groupName!!.toString().trim() + if (currentGroup.groupName?.length!! > 25) + name = name.substring(0, minOf(name.length, 25)) + "..." + + val groupDescriptionObj = mDbRef.child("groups").child(currentGroup.groupId!!).child("groupDescription") + groupDescriptionObj.addListenerForSingleValueEvent(object : ValueEventListener{ + override fun onDataChange(snapshot: DataSnapshot) { + val groupDescriptionValue = snapshot.getValue(String::class.java) + holder.groupDescription.text = groupDescriptionValue + } + + override fun onCancelled(error: DatabaseError) { + // Handle possible errors + } + }) + + + holder.groupName.text = name + holder.itemView.setOnClickListener { + val intent = Intent(context, GroupChatActivity::class.java) + intent.putExtra("NAME", currentGroup.groupName) + intent.putExtra("GROUP_ID", currentGroup.groupId) + context.startActivity(intent) + } + } + + override fun getItemCount(): Int { + return groupList.size + } + + class UserViewHolder(itemView: View) : RecyclerView.ViewHolder(itemView) { + val groupName: TextView = itemView.findViewById(R.id.txt_name) + val groupDescription: TextView = itemView.findViewById(R.id.txt_last_message) + } +} \ No newline at end of file diff --git a/TalkIn/app/src/main/java/com/example/talk_in/Group.kt b/TalkIn/app/src/main/java/com/example/talk_in/Group.kt new file mode 100644 index 0000000..1ffd0e5 --- /dev/null +++ b/TalkIn/app/src/main/java/com/example/talk_in/Group.kt @@ -0,0 +1,17 @@ +package com.example.talk_in + +class Group { + var groupName: String? = null + var groupDescription: String? = null + var groupId: String? = null + var groupMembers: ArrayList? = null + + constructor(){} + + constructor(groupName: String?, groupDescription: String?, groupMembers: ArrayList?, groupId: String?){ + this.groupName = groupName + this.groupDescription = groupDescription + this.groupMembers = groupMembers + this.groupId = groupId + } +} \ No newline at end of file diff --git a/TalkIn/app/src/main/java/com/example/talk_in/GroupChatActivity.kt b/TalkIn/app/src/main/java/com/example/talk_in/GroupChatActivity.kt new file mode 100644 index 0000000..ba67885 --- /dev/null +++ b/TalkIn/app/src/main/java/com/example/talk_in/GroupChatActivity.kt @@ -0,0 +1,74 @@ +package com.example.talk_in + +import android.content.Intent +import androidx.appcompat.app.AppCompatActivity +import android.os.Bundle +import android.util.Log +import android.view.MenuInflater +import android.view.View +import android.widget.ImageView +import android.widget.PopupMenu +import android.widget.TextView +import android.widget.Toast +import androidx.recyclerview.widget.RecyclerView + +class GroupChatActivity : AppCompatActivity() { + private lateinit var groupChatRecyclerView: RecyclerView + private lateinit var nameOfGroup: TextView + private lateinit var backbtnImage: ImageView + + override fun onCreate(savedInstanceState: Bundle?) { + super.onCreate(savedInstanceState) + setContentView(R.layout.activity_chat) + Log.d("GroupChatActivity", "onCreate() method called") + + val name = intent.getStringExtra("NAME") + val groupId = intent.getStringExtra("GROUP_ID") + supportActionBar?.hide() + + groupChatRecyclerView = findViewById(R.id.chatRecyclerView) + nameOfGroup = findViewById(R.id.nameOfUser) + backbtnImage = findViewById(R.id.backbtnImage) + + nameOfGroup.text = name + + backbtnImage.setOnClickListener { + val intent = Intent(this@GroupChatActivity, Groups::class.java) + finish() + startActivity(intent) + } + + val popupMenuBtn: ImageView = findViewById(R.id.popupMenuBtn) + popupMenuBtn.setOnClickListener { view -> + showPopupMenu(view) + } + } + + private fun showPopupMenu(view: View) { + val popupMenu = PopupMenu(this, view) + val inflater: MenuInflater = popupMenu.menuInflater + inflater.inflate(R.menu.user_chat_menu, popupMenu.menu) + popupMenu.setOnMenuItemClickListener { menuItem -> + when (menuItem.itemId) { + R.id.viewProfile -> { + Toast.makeText(this, "View Profile Clicked", Toast.LENGTH_SHORT).show() + true + } + R.id.sharedMedia -> { + Toast.makeText(this, "Shared Media Clicked", Toast.LENGTH_SHORT).show() + true + } + R.id.search -> { + Toast.makeText(this, "Search Clicked", Toast.LENGTH_SHORT).show() + true + } + R.id.locateNow -> { + Toast.makeText(this, "Locate Now Clicked", Toast.LENGTH_SHORT).show() + true + } + else -> false + } + } + popupMenu.show() + } +} \ No newline at end of file diff --git a/TalkIn/app/src/main/java/com/example/talk_in/GroupMemberSelection.kt b/TalkIn/app/src/main/java/com/example/talk_in/GroupMemberSelection.kt new file mode 100644 index 0000000..8dc92b8 --- /dev/null +++ b/TalkIn/app/src/main/java/com/example/talk_in/GroupMemberSelection.kt @@ -0,0 +1,67 @@ +package com.example.talk_in + +import GroupMemberSelectionAdapter +import android.content.Intent +import android.os.Bundle +import androidx.appcompat.app.AppCompatActivity +import androidx.recyclerview.widget.LinearLayoutManager +import com.example.talk_in.databinding.ActivityGroupMemberSelectionBinding +import com.google.firebase.auth.FirebaseAuth +import com.google.firebase.database.DataSnapshot +import com.google.firebase.database.DatabaseError +import com.google.firebase.database.DatabaseReference +import com.google.firebase.database.FirebaseDatabase +import com.google.firebase.database.ValueEventListener + +class GroupMemberSelection : AppCompatActivity() { + private lateinit var binding: ActivityGroupMemberSelectionBinding + private lateinit var userList: ArrayList + private lateinit var adapter: GroupMemberSelectionAdapter + private lateinit var mAuth: FirebaseAuth + private lateinit var mDbRef: DatabaseReference + + override fun onCreate(savedInstanceState: Bundle?) { + super.onCreate(savedInstanceState) + binding = ActivityGroupMemberSelectionBinding.inflate(layoutInflater) + setContentView(binding.root) + + mAuth = FirebaseAuth.getInstance() + mDbRef = FirebaseDatabase.getInstance().getReference() + + userList = ArrayList() + adapter = GroupMemberSelectionAdapter(this, userList) + + binding.userRecyclerView.layoutManager = LinearLayoutManager(this) + binding.userRecyclerView.adapter = adapter + + mDbRef.child("user").addValueEventListener(object : ValueEventListener { + override fun onDataChange(snapshot: DataSnapshot) { + userList.clear() + for (postSnapshot in snapshot.children) { + val currentUser = postSnapshot.getValue(User::class.java) + if (currentUser != null && mAuth.currentUser?.uid != currentUser.uid && currentUser.verified == true) { + userList.add(currentUser) + } + } + adapter.notifyDataSetChanged() + } + + override fun onCancelled(error: DatabaseError) { + // Handle possible errors. + } + }) + + binding.confirmButton.setOnClickListener { + // Get the list of selected users from the adapter + val selectedUsers = adapter.getSelectedUsers() + val uidOfUsers = ArrayList() + for (user in selectedUsers){ + uidOfUsers.add(user.uid.toString()) + } + val intent = Intent(this@GroupMemberSelection, CreateGroupActivity::class.java) + intent.putStringArrayListExtra("GROUP_MEMBERS", uidOfUsers) + finish() + startActivity(intent) + } + } +} \ No newline at end of file diff --git a/TalkIn/app/src/main/java/com/example/talk_in/GroupMemberSelectionAdapter.kt b/TalkIn/app/src/main/java/com/example/talk_in/GroupMemberSelectionAdapter.kt new file mode 100644 index 0000000..8d149dc --- /dev/null +++ b/TalkIn/app/src/main/java/com/example/talk_in/GroupMemberSelectionAdapter.kt @@ -0,0 +1,95 @@ +import android.content.Context +import android.graphics.BitmapFactory +import android.util.Log +import android.view.LayoutInflater +import android.view.View +import android.view.ViewGroup +import android.widget.ImageView +import android.widget.TextView +import androidx.core.graphics.drawable.RoundedBitmapDrawableFactory +import androidx.recyclerview.widget.RecyclerView +import com.example.talk_in.R +import com.example.talk_in.User +import com.google.firebase.storage.FirebaseStorage +import java.io.File +import java.io.IOException + +class GroupMemberSelectionAdapter(val context: Context, private val userList: ArrayList) : + RecyclerView.Adapter() { + + // Track selected users + private val selectedUsers: ArrayList = ArrayList() + + override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): UserViewHolder { + val view: View = LayoutInflater.from(context).inflate(R.layout.user_layout, parent, false) + return UserViewHolder(view) + } + + override fun onBindViewHolder(holder: UserViewHolder, position: Int) { + val currentUser = userList[position] + + var name = currentUser.name?.trim() ?: "" + if (name.length > 25) { + name = "${name.substring(0, 25)}..." + } + + holder.textName.text = name + + // Toggle the visibility of selection_icon and update selectedUsers list on item click + holder.itemView.setOnClickListener { + if (selectedUsers.contains(currentUser)) { + selectedUsers.remove(currentUser) + holder.selection_icon.visibility = View.GONE + } else { + selectedUsers.add(currentUser) + holder.selection_icon.visibility = View.VISIBLE + } + } + + var aboutUser = currentUser.aboutMe.toString().trim() + if (aboutUser.length > 30) { + aboutUser = "${aboutUser.substring(0,30)}..." + } + holder.aboutUserTextView.text = aboutUser + + currentUser.uid?.let { setProfileImage(it, holder) } + } + + override fun getItemCount(): Int { + return userList.size + } + + class UserViewHolder(itemView: View) : RecyclerView.ViewHolder(itemView) { + val textName: TextView = itemView.findViewById(R.id.txt_name) + val userProfileImage: ImageView = itemView.findViewById(R.id.user_profile_image) + val selection_icon: ImageView = itemView.findViewById(R.id.selection_icon) + val aboutUserTextView: TextView = itemView.findViewById(R.id.txt_last_message) + } + + private fun setProfileImage(uid: String, holder: UserViewHolder) { + val storageReference = FirebaseStorage.getInstance().reference.child("user_profile_images/$uid.jpg") + + try { + val localFile = File.createTempFile("tempfile", ".jpg") + storageReference.getFile(localFile) + .addOnSuccessListener { + val bitmap = BitmapFactory.decodeFile(localFile.absolutePath) + val circularBitmapDrawable = RoundedBitmapDrawableFactory.create(holder.itemView.resources, bitmap) + circularBitmapDrawable.isCircular = true + holder.userProfileImage.setImageDrawable(circularBitmapDrawable) + } + .addOnFailureListener { exception -> + Log.e("ProfileImage", "Failed to load profile image for UID: $uid", exception) + holder.userProfileImage.setImageResource(R.drawable.user_profile_icon) + } + } catch (e: IOException) { + Log.e("ProfileImage", "Error creating temp file for UID: $uid", e) + holder.userProfileImage.setImageResource(R.drawable.user_profile_icon) + } + } + + // Get the list of selected users + fun getSelectedUsers(): List { + return selectedUsers + } +} \ No newline at end of file diff --git a/TalkIn/app/src/main/java/com/example/talk_in/Groups.kt b/TalkIn/app/src/main/java/com/example/talk_in/Groups.kt new file mode 100644 index 0000000..293712e --- /dev/null +++ b/TalkIn/app/src/main/java/com/example/talk_in/Groups.kt @@ -0,0 +1,73 @@ +package com.example.talk_in + +import android.content.Intent +import android.os.Bundle +import androidx.appcompat.app.AppCompatActivity +import androidx.recyclerview.widget.LinearLayoutManager +import com.example.talk_in.databinding.ActivityGroupsBinding +import com.google.firebase.database.DataSnapshot +import com.google.firebase.database.DatabaseError +import com.google.firebase.database.DatabaseReference +import com.google.firebase.database.FirebaseDatabase +import com.google.firebase.database.ValueEventListener + +class Groups : AppCompatActivity() { + private lateinit var binding: ActivityGroupsBinding + private lateinit var adapter: DisplayGroupAdapter + private lateinit var groupList: ArrayList + private lateinit var mDbRef: DatabaseReference + + override fun onCreate(savedInstanceState: Bundle?) { + super.onCreate(savedInstanceState) + binding = ActivityGroupsBinding.inflate(layoutInflater) + setContentView(binding.root) + + mDbRef = FirebaseDatabase.getInstance().getReference() + + groupList = ArrayList() + adapter = DisplayGroupAdapter(this, groupList) + + binding.userRecyclerView.layoutManager = LinearLayoutManager(this) + binding.userRecyclerView.adapter = adapter + + mDbRef.child("groups").addValueEventListener(object : ValueEventListener { + override fun onDataChange(snapshot: DataSnapshot) { + groupList.clear() + for (postSnapshot in snapshot.children) { + val currentGroup = postSnapshot.getValue(Group::class.java) + groupList.add(currentGroup!!) + } + adapter.notifyDataSetChanged() + } + + override fun onCancelled(error: DatabaseError) { + // Handle possible errors + } + }) + + binding.addGroupBtn.setOnClickListener { + val intent = Intent(this@Groups, GroupMemberSelection::class.java) + startActivity(intent) + } + + binding.bottomNavigation.setOnItemSelectedListener { item -> + when (item.itemId) { + R.id.menu_chat -> { + val intent = Intent(this@Groups, MainActivity::class.java) + finish() + startActivity(intent) + true + } + R.id.menu_group -> true + R.id.menu_profile -> { + val intent = Intent(this, UserProfileScreen::class.java) + intent.putExtra("MODE", "CURRENT_USER") + finish() + startActivity(intent) + true + } + else -> false + } + } + } +} \ No newline at end of file diff --git a/TalkIn/app/src/main/java/com/example/talk_in/MainActivity.kt b/TalkIn/app/src/main/java/com/example/talk_in/MainActivity.kt index 9c32503..ebdedd9 100644 --- a/TalkIn/app/src/main/java/com/example/talk_in/MainActivity.kt +++ b/TalkIn/app/src/main/java/com/example/talk_in/MainActivity.kt @@ -85,7 +85,12 @@ class MainActivity : AppCompatActivity() { binding.bottomNavigation.setOnItemSelectedListener { item -> when (item.itemId) { R.id.menu_chat -> true - R.id.menu_send -> true + R.id.menu_group -> { + val intent = Intent(this, Groups::class.java) + finish() + startActivity(intent) + true + } R.id.menu_profile -> { val intent = Intent(this, UserProfileScreen::class.java) intent.putExtra("MODE", "CURRENT_USER") diff --git a/TalkIn/app/src/main/res/drawable/icon_select_group_member.png b/TalkIn/app/src/main/res/drawable/icon_select_group_member.png new file mode 100644 index 0000000000000000000000000000000000000000..ee5857d83a086d06516807dea26c5a193c7acbc9 GIT binary patch literal 1384 zcmV-u1(*7XP)fn5`+RpvdhBm&Y`W< z7HgCuG*(&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ug3faUDZTaHnER3 z6C!GLn{H4Fe literal 0 HcmV?d00001 diff --git a/TalkIn/app/src/main/res/drawable/plus_icon.png b/TalkIn/app/src/main/res/drawable/plus_icon.png new file mode 100644 index 0000000000000000000000000000000000000000..3ce3f1ed5040688a5d05ce2b11e23e1f44e00a13 GIT binary patch literal 1766 zcmV&aJ$O8{9!OtS!*0p?r~CIgrd zYjzuqE)aDBvIU^aOw`O_>*?baN863mM@Dp7R^u!tL8|~P0Z^EM9|mxVK_`fCq`_0y zq?^bXx&^@LcTSX1yuqM#0G`&X-vKl;a3CjQ+jq3$=xseZ%s2q{pgouFTQ@QBMgUWE z(3B3>0qn98?W*(Cb!F0#_5d(wxzDv4z)lA8GZB#iH;DM7;tTV3Z{508YUw~z0ABXF z9~UgE0D4}Fy#bsNihMob4E(LuP^dL<_}p&6e0CTO9so*YMEqXnb62P}Og{h&ve&wH zN@gE`T(yo&;1Oc})?Vw{0Zu=&(`vZz}s$n>BTYmDZrqDytchWaOkSf9GnHy+76{U z9g=2%eU57<2yg4F%T#91xIAm@U*EO-l&C?%=qx|xdW8u`jnQQ)OpF!56@K4PJBJKF z&wZYo08BDent5~yMa~=QIYAlJltIELs{k@&@Wlo5Q8cx1$bEm_xQt(}{%VBV$uc4i zg0Tn$?!RMD2H0zzl>i+uLWLqMsBu(75kp^kq8x=c@G3&lkP+?y;?)hF`osM<#oYz$ zL3=KM9maSEETkkHe9wLhtio!Pdw}WF#ns-p%#I5H-M4N6Xqs^fvd;7|O6cAG8~OrJ z`eSJh6Tf4=CewM(TkY+wL_G+At$XYS0C`!FWG++hSito3YARR4v<|w9T3y*5h8} zUfO+T^dJP;qA;O_G^TS{h7p!2=O6osa_Wrf4tL{jw}fWlfIB5b?g=-+ciH<=oo?jZcLmjO*jVWBO*l`vTCo zw6U9szs!y%6JdPTf1PpM>#z;t3j(g0ugWy8%5kB%gB%xtI!|2}gEt%HJt8AXU!Wo~ ziinIDFI7Tp}}gjSzuFwOlO~@f!?S{@&Df-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x`IPA1G?sPu=ZZOp|LrOr^vO zkyiH<7mvVTG0t0oz!BV8_R|=utuPgUsS3;!Zcb1f`pboIULesOOTG;`=K=yRx;aTP zSRyy&>+{Na02P_`bvgj$lHLnAs=6!{QJ#pjufBU`dwrK#W0eJ*KIG(MJVDsc;j$WVjXg21?lXJkf5SG0GyxI_bEl;TvTjdjiwtnOI@S}ys z6wV3@dU`ap3+Q&!Fh3CC)v?jg_W8afnKvyyxO*^tY4Oq~Rrb4Qp2sM^A3IgC*_Cqn z9HkP8ho1!YII+!RR79TY*);sqx$gLLQF0b2+FsYJqWkf=qO1rmsPfR^SfZo?Z(C`w zjjz<*lnGb|K<=<3?=}i=s9|jH+cZ>i;e_+g=8&g=YTJ68F)k{P_B0RgD|X4x#Bn0D zx&3R`UY5+miar8VIn`GrAFIl9nRM{^+!q@=xRwcC*JfT5sxWq;>;N_0(wmDwLec$~ zQtUgrHCghJULKw96OFIBMb+4ba1TlyHoi}s!crI#c+F64&8D&3#PhR&#;)Z{(^haT z=qgcGDzY4*3Z3!!yl@U>92i0L9aNI#fz&`( + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/TalkIn/app/src/main/res/layout/activity_group_member_selection.xml b/TalkIn/app/src/main/res/layout/activity_group_member_selection.xml new file mode 100644 index 0000000..386755c --- /dev/null +++ b/TalkIn/app/src/main/res/layout/activity_group_member_selection.xml @@ -0,0 +1,49 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/TalkIn/app/src/main/res/layout/activity_groups.xml b/TalkIn/app/src/main/res/layout/activity_groups.xml new file mode 100644 index 0000000..cb08d23 --- /dev/null +++ b/TalkIn/app/src/main/res/layout/activity_groups.xml @@ -0,0 +1,85 @@ + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/TalkIn/app/src/main/res/layout/user_layout.xml b/TalkIn/app/src/main/res/layout/user_layout.xml index 2e2c1d5..c281bbc 100644 --- a/TalkIn/app/src/main/res/layout/user_layout.xml +++ b/TalkIn/app/src/main/res/layout/user_layout.xml @@ -45,5 +45,14 @@ android:layout_below="@id/txt_name" android:layout_marginTop="40dp" android:background="#f2f2f2" /> + + \ No newline at end of file diff --git a/TalkIn/app/src/main/res/menu/bottom_navigation_menu.xml b/TalkIn/app/src/main/res/menu/bottom_navigation_menu.xml index f8a09b6..7650912 100644 --- a/TalkIn/app/src/main/res/menu/bottom_navigation_menu.xml +++ b/TalkIn/app/src/main/res/menu/bottom_navigation_menu.xml @@ -4,9 +4,9 @@ android:icon="@drawable/img_2" android:id="@+id/menu_chat" /> - Date: Tue, 4 Jun 2024 19:10:42 +0530 Subject: [PATCH 2/2] removed Action bar --- .../main/java/com/example/talk_in/CreateGroupActivity.kt | 2 ++ .../main/java/com/example/talk_in/GroupMemberSelection.kt | 2 ++ TalkIn/app/src/main/res/layout/activity_create_group.xml | 6 +++--- .../src/main/res/layout/activity_group_member_selection.xml | 2 +- 4 files changed, 8 insertions(+), 4 deletions(-) diff --git a/TalkIn/app/src/main/java/com/example/talk_in/CreateGroupActivity.kt b/TalkIn/app/src/main/java/com/example/talk_in/CreateGroupActivity.kt index aac6796..c27f0cd 100644 --- a/TalkIn/app/src/main/java/com/example/talk_in/CreateGroupActivity.kt +++ b/TalkIn/app/src/main/java/com/example/talk_in/CreateGroupActivity.kt @@ -18,6 +18,8 @@ class CreateGroupActivity : AppCompatActivity() { binding = ActivityCreateGroupBinding.inflate(layoutInflater) setContentView(binding.root) + supportActionBar?.hide() + val groupMembers: ArrayList? = intent.getStringArrayListExtra("GROUP_MEMBERS") binding.confirmButton.setOnClickListener { val groupName = binding.groupNameTextfield.text.toString().trim() diff --git a/TalkIn/app/src/main/java/com/example/talk_in/GroupMemberSelection.kt b/TalkIn/app/src/main/java/com/example/talk_in/GroupMemberSelection.kt index 8dc92b8..1ffbd3d 100644 --- a/TalkIn/app/src/main/java/com/example/talk_in/GroupMemberSelection.kt +++ b/TalkIn/app/src/main/java/com/example/talk_in/GroupMemberSelection.kt @@ -25,6 +25,8 @@ class GroupMemberSelection : AppCompatActivity() { binding = ActivityGroupMemberSelectionBinding.inflate(layoutInflater) setContentView(binding.root) + supportActionBar?.hide() + mAuth = FirebaseAuth.getInstance() mDbRef = FirebaseDatabase.getInstance().getReference() diff --git a/TalkIn/app/src/main/res/layout/activity_create_group.xml b/TalkIn/app/src/main/res/layout/activity_create_group.xml index 764250f..9f128ce 100644 --- a/TalkIn/app/src/main/res/layout/activity_create_group.xml +++ b/TalkIn/app/src/main/res/layout/activity_create_group.xml @@ -10,7 +10,7 @@ android:layout_height="wrap_content" android:background="@color/black" android:id="@+id/main_toolbar" - android:padding="10dp"> + android:padding="20dp"> diff --git a/TalkIn/app/src/main/res/layout/activity_group_member_selection.xml b/TalkIn/app/src/main/res/layout/activity_group_member_selection.xml index 386755c..430310d 100644 --- a/TalkIn/app/src/main/res/layout/activity_group_member_selection.xml +++ b/TalkIn/app/src/main/res/layout/activity_group_member_selection.xml @@ -10,7 +10,7 @@ android:layout_height="wrap_content" android:background="@color/black" android:id="@+id/main_toolbar" - android:padding="10dp"> + android:padding="20dp">