Skip to content

Commit

Permalink
Merge branch 'main' into feature/#27-signup-ui
Browse files Browse the repository at this point in the history
  • Loading branch information
blueme0 authored Jan 11, 2024
2 parents dd993f2 + ce1abaa commit 388a38a
Show file tree
Hide file tree
Showing 75 changed files with 2,137 additions and 175 deletions.
1 change: 1 addition & 0 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
plugins {
id("teumteum.android.application")
id("teumteum.android.androidHilt")
alias(libs.plugins.androidKotlin)
}
dependencies {
implementation(project(":core:base"))
Expand Down
11 changes: 7 additions & 4 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

<uses-permission android:name="android.permission.VIBRATE" />
<uses-permission android:name="com.google.android.gms.permission.AD_ID" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
Expand All @@ -15,6 +16,7 @@
android:enableOnBackInvokedCallback="true"
android:fullBackupContent="@xml/backup_rules"
android:icon="@mipmap/ic_launcher"
android:requestLegacyExternalStorage="true"
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
Expand All @@ -24,15 +26,15 @@
<activity
android:name=".presentation.MainActivity"
android:exported="true">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name=".presentation.group.GroupListActivity"
android:exported="false" />
<activity android:name=".presentation.onboarding.OnBoardingActivity"
android:exported="true">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name=".presentation.signin.SignInActivity"
android:exported="false" />
Expand All @@ -41,6 +43,7 @@
<activity android:name=".presentation.signup.intro.CardIntroActivity"
android:exported="false" />
<activity android:name=".presentation.signup.SignUpActivity"
<activity android:name=".presentation.group.search.SearchActivity"
android:exported="false" />
</application>

Expand Down
24 changes: 24 additions & 0 deletions app/src/main/java/com/teumteum/teumteum/WebviewFragment.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
package com.teumteum.teumteum

import android.os.Bundle
import androidx.fragment.app.Fragment
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import androidx.lifecycle.lifecycleScope
import com.teumteum.base.BindingFragment
import com.teumteum.teumteum.databinding.FragmentWebviewBinding


class WebviewFragment :
BindingFragment<FragmentWebviewBinding>(R.layout.fragment_webview){

override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
super.onViewCreated(view, savedInstanceState)

}

companion object {

}
}
22 changes: 22 additions & 0 deletions app/src/main/java/com/teumteum/teumteum/di/NetworkStatus.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
package com.teumteum.teumteum.di

import android.content.Context
import android.net.ConnectivityManager
import android.net.NetworkInfo

object NetworkStatus {
const val TYPE_WIFI = 1
const val TYPE_MOBILE = 2
const val TYPE_NOT_CONNECTED = 3

fun getConnectivityStatus(context: Context): Int {
val manager = context.getSystemService(Context.CONNECTIVITY_SERVICE) as ConnectivityManager
val networkInfo: NetworkInfo? = manager.activeNetworkInfo

return when {
networkInfo?.type == ConnectivityManager.TYPE_MOBILE -> TYPE_MOBILE
networkInfo?.type == ConnectivityManager.TYPE_WIFI -> TYPE_WIFI
else -> TYPE_NOT_CONNECTED
}
}
}
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
package com.teumteum.teumteum.di

import com.teumteum.data.repository.GroupRepositoryImpl
import com.teumteum.data.repository.HomeRepositoryImpl
import com.teumteum.data.repository.SampleRepositoryImpl
import com.teumteum.domain.repository.GroupRepository
import com.teumteum.domain.repository.HomeRepository
import com.teumteum.domain.repository.SampleRepository
import dagger.Binds
import dagger.Module
import dagger.Provides
import dagger.hilt.InstallIn
import dagger.hilt.components.SingletonComponent
import javax.inject.Singleton
Expand All @@ -21,4 +24,8 @@ interface RepositoryModule {
@Singleton
@Binds
fun bindHomeRepository(homeRepositoryImpl: HomeRepositoryImpl): HomeRepository

@Singleton
@Binds
fun provideGroupRepository(groupRepositoryImpl: GroupRepositoryImpl): GroupRepository
}
6 changes: 6 additions & 0 deletions app/src/main/java/com/teumteum/teumteum/di/ServiceModule.kt
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package com.teumteum.teumteum.di


import com.teumteum.data.service.GroupService
import com.teumteum.data.service.HomeService
import com.teumteum.data.service.SampleService
import dagger.Module
Expand All @@ -22,4 +23,9 @@ object ServiceModule {
@Provides
fun provideHomeService(teumteumRetrofit: Retrofit) =
teumteumRetrofit.create(HomeService::class.java)

@Singleton
@Provides
fun provideGroupService(retrofit: Retrofit) =
retrofit.create(GroupService::class.java)
}
Original file line number Diff line number Diff line change
@@ -1,56 +1,33 @@
package com.teumteum.teumteum.presentation

import android.os.Bundle
import androidx.fragment.app.commit
import android.view.View
import androidx.navigation.fragment.NavHostFragment
import androidx.navigation.ui.NavigationUI
import androidx.navigation.ui.setupWithNavController
import com.teumteum.base.BindingActivity
import com.teumteum.teumteum.R
import com.teumteum.teumteum.databinding.ActivityMainBinding
import com.teumteum.teumteum.presentation.home.HomeFragment
import com.teumteum.teumteum.presentation.mypage.MyPageFragment
import com.teumteum.teumteum.presentation.teumteum.TeumTeumFragment
import dagger.hilt.android.AndroidEntryPoint

@AndroidEntryPoint
class MainActivity : BindingActivity<ActivityMainBinding>(R.layout.activity_main) {

override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)

initView()
setUpListener()
}

private fun initView() {
val initialFragment = HomeFragment()
supportFragmentManager.commit {
add(R.id.fl_main, initialFragment)
}
val navHostFragment = supportFragmentManager.findFragmentById(R.id.fl_main) as NavHostFragment
val navController = navHostFragment.navController
binding.btmNavi.setupWithNavController(navController)
}

private fun setUpListener() {
binding.btmNavi.setOnItemSelectedListener {
replaceFragment(it.itemId)
true
}
fun hideBottomNavi() {
binding.btmNavi.visibility = View.GONE
}

private fun replaceFragment(menuItemId: Int) {
try {
supportFragmentManager.commit {
replace(
R.id.fl_main, when (menuItemId) {
R.id.bottom_menu_home -> HomeFragment()
R.id.bottom_menu_teum_teum -> TeumTeumFragment()
R.id.bottom_menu_my_page -> MyPageFragment()
else -> throw IllegalArgumentException("${this@MainActivity::class.java.simpleName} unkown menuItemId")
}
)
}
} catch (e: IllegalArgumentException) {
supportFragmentManager.commit {
replace(R.id.fl_main, HomeFragment())
}
}
fun showBottomNavi() {
binding.btmNavi.visibility = View.VISIBLE
}

companion object {}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package com.teumteum.teumteum.presentation.group
import android.os.Bundle
import android.widget.Toast
import com.teumteum.base.BindingActivity
import com.teumteum.domain.entity.Group
import com.teumteum.domain.entity.Meeting
import com.teumteum.teumteum.R
import com.teumteum.teumteum.databinding.ActivityGroupListBinding

Expand All @@ -26,12 +26,12 @@ class GroupListActivity : BindingActivity<ActivityGroupListBinding>(R.layout.act
binding.rvGroupList.adapter = adapter
adapter.setItems(
listOf(
Group(1L, "모각작", "모여서 작업할 사람", "나는 소개", listOf("", ""), "1월 10일 오후 07:00"),
Group(2L, "모각작", "모여서 작업 안할 사람", "나는 소개", listOf("", ""), "1월 21일 오후 04:00"),
Group(3L, "모각작", "모여서 작업 하기 싫은 사람", "나는 소개", listOf("", ""), "1월 26일 오후 11:00"),
Group(4L, "모각작", "모여서 작업 하고 싶은 사람", "나는 소개", listOf("", ""), "2월 13일 오전 11:00"),
Group(5L, "모각작", "모일 사람", "나는 소개", listOf("", ""), "4월 06일 오후 04:00"),
Group(6L, "모각작", "안 모일 사람", "나는 소개", listOf("", ""), "11월 16일 오후 08:00"),
Meeting(1L, 1L,"모각작", "모여서 작업할 사람", "나는 소개", listOf("", ""), "1월 10일 오후 07:00"),
Meeting(2L, 2L,"모각작", "모여서 작업 안할 사람", "나는 소개", listOf("", ""), "1월 21일 오후 04:00"),
Meeting(3L, 3L,"모각작", "모여서 작업 하기 싫은 사람", "나는 소개", listOf("", ""), "1월 26일 오후 11:00"),
Meeting(4L, 4L,"모각작", "모여서 작업 하고 싶은 사람", "나는 소개", listOf("", ""), "2월 13일 오전 11:00"),
Meeting(5L, 5L,"모각작", "모일 사람", "나는 소개", listOf("", ""), "4월 06일 오후 04:00"),
Meeting(6L, 6L,"모각작", "안 모일 사람", "나는 소개", listOf("", ""), "11월 16일 오후 08:00"),
)
)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@ package com.teumteum.teumteum.presentation.group
import android.view.LayoutInflater
import android.view.ViewGroup
import androidx.recyclerview.widget.RecyclerView
import com.teumteum.domain.entity.Group
import com.teumteum.domain.entity.Meeting
import com.teumteum.teumteum.databinding.ItemGroupListBinding

class GroupListAdapter(private val itemClick: (Group) -> (Unit)) :
class GroupListAdapter(private val itemClick: (Meeting) -> (Unit)) :
RecyclerView.Adapter<GroupListAdapter.GroupListViewHolder>() {
private val groupList = mutableListOf<Group>()
private val groupList = mutableListOf<Meeting>()

override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): GroupListViewHolder {
val binding = ItemGroupListBinding.inflate(
Expand All @@ -25,17 +25,17 @@ class GroupListAdapter(private val itemClick: (Group) -> (Unit)) :

override fun getItemCount(): Int = groupList.size

fun setItems(newItems: List<Group>) {
fun setItems(newItems: List<Meeting>) {
groupList.clear()
groupList.addAll(newItems)
notifyDataSetChanged()
}

class GroupListViewHolder(
private val binding: ItemGroupListBinding,
private val itemClick: (Group) -> (Unit)
private val itemClick: (Meeting) -> (Unit)
) : RecyclerView.ViewHolder(binding.root) {
fun onBind(item: Group) {
fun onBind(item: Meeting) {
binding.tvGroupName.text = item.name
binding.tvTitleBadge.text = item.topic
binding.tvDate.text = item.date
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
package com.teumteum.teumteum.presentation.group.search

import android.view.LayoutInflater
import android.view.ViewGroup
import androidx.recyclerview.widget.RecyclerView
import com.teumteum.teumteum.databinding.ItemKeywordListBinding

class KeywordAdapter(private val itemClick: (String) -> (Unit)) :
RecyclerView.Adapter<KeywordAdapter.KeywordAdapter>() {
private val keywordList = mutableListOf<String>()
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): KeywordAdapter {
val binding = ItemKeywordListBinding.inflate(
LayoutInflater.from(parent.context),
parent,
false,
)
return KeywordAdapter(binding, itemClick)
}

override fun onBindViewHolder(holder: KeywordAdapter, position: Int) {
holder.onBind(keywordList[position])
}

override fun getItemCount(): Int = keywordList.size

fun setItems(newItems: List<String>) {
keywordList.clear()
keywordList.addAll(newItems)
notifyDataSetChanged()
}

class KeywordAdapter(
private val binding: ItemKeywordListBinding,
private val itemClick: (String) -> (Unit)
): RecyclerView.ViewHolder(binding.root) {
fun onBind(keyword: String) {
binding.tvKeyword.text = keyword

binding.root.setOnClickListener {
itemClick(keyword)
}
}
}
}
Loading

0 comments on commit 388a38a

Please sign in to comment.