diff --git a/app/src/androidTest/java/com/infinity/omos/ui/onboarding/ForgotPasswordFragmentTest.kt b/app/src/androidTest/java/com/infinity/omos/ui/onboarding/ForgotPasswordFragmentTest.kt index d08ee79a..78db211d 100644 --- a/app/src/androidTest/java/com/infinity/omos/ui/onboarding/ForgotPasswordFragmentTest.kt +++ b/app/src/androidTest/java/com/infinity/omos/ui/onboarding/ForgotPasswordFragmentTest.kt @@ -5,7 +5,7 @@ import androidx.test.espresso.action.ViewActions.click import androidx.test.espresso.assertion.ViewAssertions.matches import androidx.test.espresso.matcher.ViewMatchers.* import androidx.test.ext.junit.rules.ActivityScenarioRule -import com.infinity.omos.OnboardingActivity +import com.infinity.omos.ui.MainActivity import com.infinity.omos.R import com.infinity.omos.ui.custom.OmosViewActions import com.infinity.omos.ui.custom.OmosViewMatchers @@ -22,7 +22,7 @@ import org.junit.rules.RuleChain class ForgotPasswordFragmentTest { private val hiltRule = HiltAndroidRule(this) - private val activityTestRule = ActivityScenarioRule(OnboardingActivity::class.java) + private val activityTestRule = ActivityScenarioRule(MainActivity::class.java) @get:Rule val rule: RuleChain = RuleChain diff --git a/app/src/androidTest/java/com/infinity/omos/ui/onboarding/LoginFragmentTest.kt b/app/src/androidTest/java/com/infinity/omos/ui/onboarding/LoginFragmentTest.kt index f348e051..e4b7b1fe 100644 --- a/app/src/androidTest/java/com/infinity/omos/ui/onboarding/LoginFragmentTest.kt +++ b/app/src/androidTest/java/com/infinity/omos/ui/onboarding/LoginFragmentTest.kt @@ -6,7 +6,7 @@ import androidx.test.espresso.assertion.ViewAssertions.matches import androidx.test.espresso.matcher.ViewMatchers.isEnabled import androidx.test.espresso.matcher.ViewMatchers.withId import androidx.test.ext.junit.rules.ActivityScenarioRule -import com.infinity.omos.OnboardingActivity +import com.infinity.omos.ui.MainActivity import com.infinity.omos.R import com.infinity.omos.ui.custom.OmosViewActions import com.infinity.omos.ui.custom.OmosViewMatchers @@ -20,7 +20,7 @@ import org.junit.rules.RuleChain class LoginFragmentTest { private val hiltRule = HiltAndroidRule(this) - private val activityTestRule = ActivityScenarioRule(OnboardingActivity::class.java) + private val activityTestRule = ActivityScenarioRule(MainActivity::class.java) @get:Rule val rule: RuleChain = RuleChain diff --git a/app/src/androidTest/java/com/infinity/omos/ui/onboarding/NicknameFragmentTest.kt b/app/src/androidTest/java/com/infinity/omos/ui/onboarding/NicknameFragmentTest.kt index b78066de..22f8e60c 100644 --- a/app/src/androidTest/java/com/infinity/omos/ui/onboarding/NicknameFragmentTest.kt +++ b/app/src/androidTest/java/com/infinity/omos/ui/onboarding/NicknameFragmentTest.kt @@ -6,7 +6,7 @@ import androidx.test.espresso.assertion.ViewAssertions.matches import androidx.test.espresso.matcher.ViewMatchers.isEnabled import androidx.test.espresso.matcher.ViewMatchers.withId import androidx.test.ext.junit.rules.ActivityScenarioRule -import com.infinity.omos.OnboardingActivity +import com.infinity.omos.ui.MainActivity import com.infinity.omos.R import com.infinity.omos.ui.custom.OmosViewActions import com.infinity.omos.util.SUCCESS_AUTH_CODE @@ -21,7 +21,7 @@ import org.junit.rules.RuleChain class NicknameFragmentTest { private val hiltRule = HiltAndroidRule(this) - private val activityTestRule = ActivityScenarioRule(OnboardingActivity::class.java) + private val activityTestRule = ActivityScenarioRule(MainActivity::class.java) @get:Rule val rule: RuleChain = RuleChain diff --git a/app/src/androidTest/java/com/infinity/omos/ui/onboarding/SignUpFragmentTest.kt b/app/src/androidTest/java/com/infinity/omos/ui/onboarding/SignUpFragmentTest.kt index 7586c64c..1570bef8 100644 --- a/app/src/androidTest/java/com/infinity/omos/ui/onboarding/SignUpFragmentTest.kt +++ b/app/src/androidTest/java/com/infinity/omos/ui/onboarding/SignUpFragmentTest.kt @@ -6,7 +6,7 @@ import androidx.test.espresso.assertion.ViewAssertions import androidx.test.espresso.matcher.ViewMatchers import androidx.test.espresso.matcher.ViewMatchers.withId import androidx.test.ext.junit.rules.ActivityScenarioRule -import com.infinity.omos.OnboardingActivity +import com.infinity.omos.ui.MainActivity import com.infinity.omos.R import com.infinity.omos.ui.custom.OmosViewActions import com.infinity.omos.ui.custom.OmosViewMatchers @@ -23,7 +23,7 @@ import org.junit.rules.RuleChain class SignUpFragmentTest { private val hiltRule = HiltAndroidRule(this) - private val activityTestRule = ActivityScenarioRule(OnboardingActivity::class.java) + private val activityTestRule = ActivityScenarioRule(MainActivity::class.java) @get:Rule val rule: RuleChain = RuleChain diff --git a/app/src/androidTest/java/com/infinity/omos/ui/setting/change/password/ChangePasswordFragmentTest.kt b/app/src/androidTest/java/com/infinity/omos/ui/setting/change/password/ChangePasswordFragmentTest.kt index c810fc04..2e6b0d36 100644 --- a/app/src/androidTest/java/com/infinity/omos/ui/setting/change/password/ChangePasswordFragmentTest.kt +++ b/app/src/androidTest/java/com/infinity/omos/ui/setting/change/password/ChangePasswordFragmentTest.kt @@ -6,7 +6,7 @@ import androidx.test.espresso.assertion.ViewAssertions.matches import androidx.test.espresso.matcher.ViewMatchers.isEnabled import androidx.test.espresso.matcher.ViewMatchers.withId import androidx.test.ext.junit.rules.ActivityScenarioRule -import com.infinity.omos.OnboardingActivity +import com.infinity.omos.ui.MainActivity import com.infinity.omos.R import com.infinity.omos.ui.custom.OmosViewActions import com.infinity.omos.ui.custom.OmosViewMatchers @@ -22,7 +22,7 @@ import org.junit.rules.RuleChain class ChangePasswordFragmentTest { private val hiltRule = HiltAndroidRule(this) - private val activityTestRule = ActivityScenarioRule(OnboardingActivity::class.java) + private val activityTestRule = ActivityScenarioRule(MainActivity::class.java) @get:Rule val rule: RuleChain = RuleChain diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index 0696d855..067fef42 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -17,7 +17,7 @@ android:theme="@style/Theme.Omos.Splash" android:usesCleartextTraffic="true"> @@ -160,7 +160,7 @@ android:exported="false" android:screenOrientation="portrait" /> diff --git a/app/src/main/java/com/infinity/omos/OnboardingActivity.kt b/app/src/main/java/com/infinity/omos/OnboardingActivity.kt deleted file mode 100644 index a97eaf18..00000000 --- a/app/src/main/java/com/infinity/omos/OnboardingActivity.kt +++ /dev/null @@ -1,19 +0,0 @@ -package com.infinity.omos - -import androidx.appcompat.app.AppCompatActivity -import android.os.Bundle -import androidx.core.splashscreen.SplashScreen.Companion.installSplashScreen -import dagger.hilt.android.AndroidEntryPoint - -/** - * onboarding Navigation component 적용을 위한 Activity - * 추후 MainActivity로 변경 예정 - */ -@AndroidEntryPoint -class OnboardingActivity : AppCompatActivity() { - override fun onCreate(savedInstanceState: Bundle?) { - installSplashScreen() - super.onCreate(savedInstanceState) - setContentView(R.layout.activity_onboarding) - } -} \ No newline at end of file diff --git a/app/src/main/java/com/infinity/omos/SplashActivity.kt b/app/src/main/java/com/infinity/omos/SplashActivity.kt index 5fe8d9b9..84a0729a 100644 --- a/app/src/main/java/com/infinity/omos/SplashActivity.kt +++ b/app/src/main/java/com/infinity/omos/SplashActivity.kt @@ -10,7 +10,8 @@ import android.widget.Toast import androidx.appcompat.app.AppCompatActivity import com.infinity.omos.etc.Constant import com.infinity.omos.repository.OnBoardingRepository -import com.infinity.omos.ui.main.MainActivity +import com.infinity.omos.ui.MainActivity +import com.infinity.omos.ui.main.FakeMainActivity import com.kakao.sdk.user.UserApiClient @@ -62,11 +63,11 @@ class SplashActivity : AppCompatActivity() { // 이메일 로그인 상태 확인 if (OmosApplication.prefs.getInt("userId") == -1) { Log.d("SplashActivity", "토큰 불러오기 실패") - val intent = Intent(activity, OnboardingActivity::class.java) + val intent = Intent(activity, MainActivity::class.java) activity.startActivity(intent) } else { Log.d("SplashActivity", "토큰 불러오기 성공") - val intent = Intent(activity, MainActivity::class.java) + val intent = Intent(activity, FakeMainActivity::class.java) activity.startActivity(intent) } } else if (tokenInfo != null) { @@ -83,11 +84,11 @@ class SplashActivity : AppCompatActivity() { } } - val intent = Intent(activity, OnboardingActivity::class.java) + val intent = Intent(activity, MainActivity::class.java) activity.startActivity(intent) } else { Log.d("SplashActivity", "토큰 불러오기 성공") - val intent = Intent(activity, MainActivity::class.java) + val intent = Intent(activity, FakeMainActivity::class.java) activity.startActivity(intent) } } diff --git a/app/src/main/java/com/infinity/omos/adapters/AlbumDetailListAdapter.kt b/app/src/main/java/com/infinity/omos/adapters/AlbumDetailListAdapter.kt index af044988..0c7412a6 100644 --- a/app/src/main/java/com/infinity/omos/adapters/AlbumDetailListAdapter.kt +++ b/app/src/main/java/com/infinity/omos/adapters/AlbumDetailListAdapter.kt @@ -8,7 +8,7 @@ import android.view.ViewGroup import androidx.recyclerview.widget.DiffUtil import androidx.recyclerview.widget.ListAdapter import androidx.recyclerview.widget.RecyclerView -import com.infinity.omos.ui.main.MainActivity.Companion.isWrite +import com.infinity.omos.ui.main.FakeMainActivity.Companion.isWrite import com.infinity.omos.ui.record.MusicRecordActivity import com.infinity.omos.ui.write.SelectCategoryActivity import com.infinity.omos.data.music.Music diff --git a/app/src/main/java/com/infinity/omos/adapters/AlbumListAdapter.kt b/app/src/main/java/com/infinity/omos/adapters/AlbumListAdapter.kt index 25ef5645..64509b7a 100644 --- a/app/src/main/java/com/infinity/omos/adapters/AlbumListAdapter.kt +++ b/app/src/main/java/com/infinity/omos/adapters/AlbumListAdapter.kt @@ -10,7 +10,7 @@ import androidx.recyclerview.widget.ListAdapter import androidx.recyclerview.widget.RecyclerView import com.infinity.omos.ui.search.DetailAlbumActivity import com.infinity.omos.ui.search.DetailArtistActivity -import com.infinity.omos.ui.main.MainActivity +import com.infinity.omos.ui.main.FakeMainActivity import com.infinity.omos.R import com.infinity.omos.data.Album import com.infinity.omos.databinding.ListAlbumItemBinding @@ -73,9 +73,9 @@ class AlbumListAdapter internal constructor(private val context: Context): binding.tvAlbumTitle.text = album.albumTitle // keyword 색상 변경 - var start = album.albumTitle.lowercase().indexOf(MainActivity.keyword.lowercase()) + var start = album.albumTitle.lowercase().indexOf(FakeMainActivity.keyword.lowercase()) if (start != -1 && context.javaClass != DetailArtistActivity::class.java){ - GlobalFunction.changeTextColor(context, binding.tvAlbumTitle, start, start + MainActivity.keyword.length, R.color.orange) + GlobalFunction.changeTextColor(context, binding.tvAlbumTitle, start, start + FakeMainActivity.keyword.length, R.color.orange) } binding.executePendingBindings() //데이터가 수정되면 즉각 바인딩 diff --git a/app/src/main/java/com/infinity/omos/adapters/ArtistListAdapter.kt b/app/src/main/java/com/infinity/omos/adapters/ArtistListAdapter.kt index 4c90c89b..95ac7782 100644 --- a/app/src/main/java/com/infinity/omos/adapters/ArtistListAdapter.kt +++ b/app/src/main/java/com/infinity/omos/adapters/ArtistListAdapter.kt @@ -9,7 +9,7 @@ import androidx.recyclerview.widget.DiffUtil import androidx.recyclerview.widget.ListAdapter import androidx.recyclerview.widget.RecyclerView import com.infinity.omos.ui.search.DetailArtistActivity -import com.infinity.omos.ui.main.MainActivity +import com.infinity.omos.ui.main.FakeMainActivity import com.infinity.omos.R import com.infinity.omos.data.Artists import com.infinity.omos.databinding.ListArtistItemBinding @@ -69,9 +69,9 @@ class ArtistListAdapter internal constructor(private val context: Context): binding.tvArtistName.text = artist.artistName // keyword 색상 변경 - var start = artist.artistName.lowercase().indexOf(MainActivity.keyword.lowercase()) + var start = artist.artistName.lowercase().indexOf(FakeMainActivity.keyword.lowercase()) if (start != -1){ - GlobalFunction.changeTextColor(context, binding.tvArtistName, start, start + MainActivity.keyword.length, R.color.orange) + GlobalFunction.changeTextColor(context, binding.tvArtistName, start, start + FakeMainActivity.keyword.length, R.color.orange) } binding.executePendingBindings() //데이터가 수정되면 즉각 바인딩 diff --git a/app/src/main/java/com/infinity/omos/adapters/ArtistMusicListAdapter.kt b/app/src/main/java/com/infinity/omos/adapters/ArtistMusicListAdapter.kt index ee2edbe3..abd1d13b 100644 --- a/app/src/main/java/com/infinity/omos/adapters/ArtistMusicListAdapter.kt +++ b/app/src/main/java/com/infinity/omos/adapters/ArtistMusicListAdapter.kt @@ -8,7 +8,7 @@ import android.view.ViewGroup import androidx.recyclerview.widget.DiffUtil import androidx.recyclerview.widget.ListAdapter import androidx.recyclerview.widget.RecyclerView -import com.infinity.omos.ui.main.MainActivity.Companion.isWrite +import com.infinity.omos.ui.main.FakeMainActivity.Companion.isWrite import com.infinity.omos.ui.record.MusicRecordActivity import com.infinity.omos.ui.write.SelectCategoryActivity import com.infinity.omos.data.ArtistMusic diff --git a/app/src/main/java/com/infinity/omos/adapters/MusicListAdapter.kt b/app/src/main/java/com/infinity/omos/adapters/MusicListAdapter.kt index a921b89f..0124d964 100644 --- a/app/src/main/java/com/infinity/omos/adapters/MusicListAdapter.kt +++ b/app/src/main/java/com/infinity/omos/adapters/MusicListAdapter.kt @@ -8,8 +8,8 @@ import android.view.ViewGroup import androidx.recyclerview.widget.DiffUtil import androidx.recyclerview.widget.ListAdapter import androidx.recyclerview.widget.RecyclerView -import com.infinity.omos.ui.main.MainActivity.Companion.isWrite -import com.infinity.omos.ui.main.MainActivity.Companion.keyword +import com.infinity.omos.ui.main.FakeMainActivity.Companion.isWrite +import com.infinity.omos.ui.main.FakeMainActivity.Companion.keyword import com.infinity.omos.ui.record.MusicRecordActivity import com.infinity.omos.R import com.infinity.omos.ui.write.SelectCategoryActivity diff --git a/app/src/main/java/com/infinity/omos/adapters/SearchListAdapter.kt b/app/src/main/java/com/infinity/omos/adapters/SearchListAdapter.kt index 52d9ef36..3f6bab5a 100644 --- a/app/src/main/java/com/infinity/omos/adapters/SearchListAdapter.kt +++ b/app/src/main/java/com/infinity/omos/adapters/SearchListAdapter.kt @@ -5,7 +5,7 @@ import android.view.LayoutInflater import android.view.View import android.view.ViewGroup import androidx.recyclerview.widget.RecyclerView -import com.infinity.omos.ui.main.MainActivity +import com.infinity.omos.ui.main.FakeMainActivity import com.infinity.omos.R import com.infinity.omos.data.SearchMusic import com.infinity.omos.databinding.ListSearchItemBinding @@ -42,9 +42,9 @@ class SearchListAdapter internal constructor(private val context: Context) binding.tvMusicTitle.text = music.musicTitle // keyword 색상 변경 - var start = music.musicTitle.lowercase().indexOf(MainActivity.keyword.lowercase()) + var start = music.musicTitle.lowercase().indexOf(FakeMainActivity.keyword.lowercase()) if (start != -1){ - GlobalFunction.changeTextColor(context, binding.tvMusicTitle, start, start + MainActivity.keyword.length, R.color.orange) + GlobalFunction.changeTextColor(context, binding.tvMusicTitle, start, start + FakeMainActivity.keyword.length, R.color.orange) } val pos = adapterPosition diff --git a/app/src/main/java/com/infinity/omos/ui/MainActivity.kt b/app/src/main/java/com/infinity/omos/ui/MainActivity.kt new file mode 100644 index 00000000..9bd5fd0b --- /dev/null +++ b/app/src/main/java/com/infinity/omos/ui/MainActivity.kt @@ -0,0 +1,53 @@ +package com.infinity.omos.ui + +import androidx.appcompat.app.AppCompatActivity +import android.os.Bundle +import androidx.core.splashscreen.SplashScreen.Companion.installSplashScreen +import androidx.navigation.NavController +import androidx.navigation.fragment.NavHostFragment +import com.infinity.omos.R +import dagger.hilt.android.AndroidEntryPoint + +/** + * onboarding Navigation component 적용을 위한 Activity + * 추후 MainActivity로 변경 예정 + */ +@AndroidEntryPoint +class MainActivity : AppCompatActivity() { + + override fun onCreate(savedInstanceState: Bundle?) { + installSplashScreen() + super.onCreate(savedInstanceState) + setContentView(R.layout.activity_main) + + // setBottomNav() + } +/* + private fun setBottomNav() { + val navHostFragment = + supportFragmentManager.findFragmentById(R.id.nav_host_fragment) as NavHostFragment + val navController = navHostFragment.navController + binding.bottomNav.setupWithNavController(navController) + + setTopLevelDestinations(navController) + + binding.fab.setOnClickListener { + navController.navigate(R.id.add_moment_navigation) + } + } + + private fun setTopLevelDestinations(navController: NavController) { + val appBarConfiguration = AppBarConfiguration( + setOf( + R.id.home_fragment, + R.id.globe_fragment + ) + ) + + navController.addOnDestinationChangedListener { _, destination, _ -> + val isTopDest = appBarConfiguration.topLevelDestinations.contains(destination.id) + binding.bottomAppBar.isVisible = isTopDest + if (isTopDest) binding.fab.show() else binding.fab.hide() + } + }*/ +} \ No newline at end of file diff --git a/app/src/main/java/com/infinity/omos/ui/dj/DjActivity.kt b/app/src/main/java/com/infinity/omos/ui/dj/DjActivity.kt index 5e2509ea..d7398785 100644 --- a/app/src/main/java/com/infinity/omos/ui/dj/DjActivity.kt +++ b/app/src/main/java/com/infinity/omos/ui/dj/DjActivity.kt @@ -15,7 +15,7 @@ import androidx.core.content.ContextCompat import androidx.core.content.res.ResourcesCompat import androidx.databinding.DataBindingUtil import androidx.recyclerview.widget.LinearLayoutManager -import com.infinity.omos.ui.main.MainActivity +import com.infinity.omos.ui.main.FakeMainActivity import com.infinity.omos.R import com.infinity.omos.adapters.MyRecordListAdapter import com.infinity.omos.databinding.ActivityDjBinding @@ -167,7 +167,7 @@ class DjActivity : AppCompatActivity() { intent4.addFlags(Intent.FLAG_RECEIVER_REPLACE_PENDING) sendBroadcast(intent4) - val intent = Intent(this, MainActivity::class.java) + val intent = Intent(this, FakeMainActivity::class.java) intent.flags = Intent.FLAG_ACTIVITY_SINGLE_TOP or Intent.FLAG_ACTIVITY_CLEAR_TOP startActivity(intent) Toast.makeText(this, "완료", Toast.LENGTH_SHORT).show() @@ -201,7 +201,7 @@ class DjActivity : AppCompatActivity() { intent4.addFlags(Intent.FLAG_RECEIVER_REPLACE_PENDING) sendBroadcast(intent4) - val intent = Intent(this, MainActivity::class.java) + val intent = Intent(this, FakeMainActivity::class.java) intent.flags = Intent.FLAG_ACTIVITY_SINGLE_TOP or Intent.FLAG_ACTIVITY_CLEAR_TOP startActivity(intent) Toast.makeText(this, "완료", Toast.LENGTH_SHORT).show() diff --git a/app/src/main/java/com/infinity/omos/ui/main/MainActivity.kt b/app/src/main/java/com/infinity/omos/ui/main/FakeMainActivity.kt similarity index 81% rename from app/src/main/java/com/infinity/omos/ui/main/MainActivity.kt rename to app/src/main/java/com/infinity/omos/ui/main/FakeMainActivity.kt index 663285a7..5230720e 100644 --- a/app/src/main/java/com/infinity/omos/ui/main/MainActivity.kt +++ b/app/src/main/java/com/infinity/omos/ui/main/FakeMainActivity.kt @@ -28,7 +28,7 @@ import com.infinity.omos.OmosApplication import com.infinity.omos.R import com.infinity.omos.adapters.SearchListAdapter import com.infinity.omos.adapters.ViewPagerAdapter -import com.infinity.omos.databinding.ActivityMainBinding +import com.infinity.omos.databinding.ActivityFakeMainBinding import com.infinity.omos.service.MyFirebaseMessagingService import com.infinity.omos.support.PermissionSupport import com.infinity.omos.ui.bottomnav.* @@ -38,13 +38,12 @@ import com.infinity.omos.utils.BackKeyHandler import com.infinity.omos.utils.InAppUpdate import com.infinity.omos.viewmodels.MainViewModel import dagger.hilt.android.AndroidEntryPoint -import kotlinx.android.synthetic.main.activity_main.* @AndroidEntryPoint -class MainActivity : AppCompatActivity() { +class FakeMainActivity : AppCompatActivity() { private val viewModel: MainViewModel by viewModels() - private lateinit var binding: ActivityMainBinding + private lateinit var binding: ActivityFakeMainBinding // Bottom Navigation private val fragmentToday by lazy { TodayFragment() } @@ -113,7 +112,7 @@ class MainActivity : AppCompatActivity() { override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) - binding = DataBindingUtil.setContentView(this, R.layout.activity_main) + binding = DataBindingUtil.setContentView(this, R.layout.activity_fake_main) binding.vm = viewModel binding.lifecycleOwner = this @@ -150,7 +149,7 @@ class MainActivity : AppCompatActivity() { } // EditText 초기화 - btn_remove.setOnClickListener { + binding.btnRemove.setOnClickListener { binding.etSearch.setText("") } @@ -225,13 +224,13 @@ class MainActivity : AppCompatActivity() { }) // 검색 완료 - et_search.setOnKeyListener { _, i, keyEvent -> + binding.etSearch.setOnKeyListener { _, i, keyEvent -> when (i) { KeyEvent.KEYCODE_ENTER -> { if (keyEvent.action != KeyEvent.ACTION_DOWN) { if (isMusicSearch) { - if (et_search.length() > 0) { - keyword = et_search.text.toString() + if (binding.etSearch.length() > 0) { + keyword = binding.etSearch.text.toString() var intent = Intent("SEARCH_UPDATE") intent.addFlags(Intent.FLAG_RECEIVER_REPLACE_PENDING) intent.putExtra("keyword", keyword) @@ -261,8 +260,8 @@ class MainActivity : AppCompatActivity() { window.decorView.systemUiVisibility = View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN } - toolbar.title = "" - setSupportActionBar(toolbar) // 툴바 사용 + binding.toolbar.title = "" + setSupportActionBar(binding.toolbar) // 툴바 사용 // OMOS 텍스트 이미지 추가 supportActionBar?.setDisplayHomeAsUpEnabled(true) @@ -271,10 +270,10 @@ class MainActivity : AppCompatActivity() { private fun initTabLayout() { val viewpagerFragmentAdapter = ViewPagerAdapter(this) - viewPager.adapter = viewpagerFragmentAdapter - viewPager.isUserInputEnabled = false + binding.viewPager.adapter = viewpagerFragmentAdapter + binding.viewPager.isUserInputEnabled = false val tabTitles = listOf("전체", "노래", "앨범", "아티스트") - TabLayoutMediator(tabLayout, viewPager) { tab, position -> + TabLayoutMediator(binding.tabLayout, binding.viewPager) { tab, position -> tab.text = tabTitles[position] }.attach() @@ -282,7 +281,7 @@ class MainActivity : AppCompatActivity() { val allFragment = viewpagerFragmentAdapter.getFragment() allFragment.setCurrentItem(object : AllFragment.OnItemClickListener { override fun setCurrentItem(position: Int) { - viewPager.currentItem = position + binding.viewPager.currentItem = position } }) } @@ -292,8 +291,8 @@ class MainActivity : AppCompatActivity() { binding.bottomNav.run { setOnItemSelectedListener { item -> when (item.itemId) { - R.id.menu_today -> { - toolbar.title = "" + R.id.today_fragment -> { + binding.toolbar.title = "" supportActionBar?.setDisplayHomeAsUpEnabled(true) stateWrite = false stateSearch = false @@ -303,11 +302,11 @@ class MainActivity : AppCompatActivity() { invalidateOptionsMenu() changeFragment("Today", fragmentToday) item.setIcon(R.drawable.ic_selected_today) - bottom_nav.menu.findItem(R.id.menu_myrecord).setIcon(R.drawable.ic_myrecord) - bottom_nav.menu.findItem(R.id.menu_allrecords) - .setIcon(R.drawable.ic_allrecords) - bottom_nav.menu.findItem(R.id.menu_mydj).setIcon(R.drawable.ic_mydj) - bottom_nav.menu.findItem(R.id.menu_mypage).setIcon(R.drawable.ic_mypage) + binding.bottomNav.menu.findItem(R.id.my_record_fragment).setIcon(R.drawable.ic_my_record) + binding.bottomNav.menu.findItem(R.id.all_records_fragment) + .setIcon(R.drawable.ic_all_records) + binding.bottomNav.menu.findItem(R.id.my_dj_fragment).setIcon(R.drawable.ic_my_dj) + binding.bottomNav.menu.findItem(R.id.my_page_fragment).setIcon(R.drawable.ic_my_page) if (binding.searchView.visibility == View.VISIBLE) { cancelSearch() @@ -316,8 +315,8 @@ class MainActivity : AppCompatActivity() { binding.lnToolbar.visibility = View.GONE binding.btnFloating.visibility = View.VISIBLE } - R.id.menu_myrecord -> { - toolbar.title = "MY 레코드" + R.id.my_record_fragment -> { + binding.toolbar.title = "MY 레코드" supportActionBar?.setDisplayHomeAsUpEnabled(false) stateWrite = true stateSearch = true @@ -332,18 +331,18 @@ class MainActivity : AppCompatActivity() { invalidateOptionsMenu() changeFragment("MyRecord", fragmentMyRecord) item.setIcon(R.drawable.ic_selected_myrecord) - bottom_nav.menu.findItem(R.id.menu_today).setIcon(R.drawable.ic_today) - bottom_nav.menu.findItem(R.id.menu_allrecords) - .setIcon(R.drawable.ic_allrecords) - bottom_nav.menu.findItem(R.id.menu_mydj).setIcon(R.drawable.ic_mydj) - bottom_nav.menu.findItem(R.id.menu_mypage).setIcon(R.drawable.ic_mypage) + binding.bottomNav.menu.findItem(R.id.today_fragment).setIcon(R.drawable.ic_today) + binding.bottomNav.menu.findItem(R.id.all_records_fragment) + .setIcon(R.drawable.ic_all_records) + binding.bottomNav.menu.findItem(R.id.my_dj_fragment).setIcon(R.drawable.ic_my_dj) + binding.bottomNav.menu.findItem(R.id.my_page_fragment).setIcon(R.drawable.ic_my_page) if (binding.searchView.visibility == View.VISIBLE) { cancelSearch() } } - R.id.menu_allrecords -> { - toolbar.title = "전체 레코드" + R.id.all_records_fragment -> { + binding.toolbar.title = "전체 레코드" supportActionBar?.setDisplayHomeAsUpEnabled(false) stateWrite = false stateSearch = true @@ -358,17 +357,17 @@ class MainActivity : AppCompatActivity() { invalidateOptionsMenu() changeFragment("AllRecords", fragmentAllRecords) item.setIcon(R.drawable.ic_selected_allrecords) - bottom_nav.menu.findItem(R.id.menu_today).setIcon(R.drawable.ic_today) - bottom_nav.menu.findItem(R.id.menu_myrecord).setIcon(R.drawable.ic_myrecord) - bottom_nav.menu.findItem(R.id.menu_mydj).setIcon(R.drawable.ic_mydj) - bottom_nav.menu.findItem(R.id.menu_mypage).setIcon(R.drawable.ic_mypage) + binding.bottomNav.menu.findItem(R.id.today_fragment).setIcon(R.drawable.ic_today) + binding.bottomNav.menu.findItem(R.id.my_record_fragment).setIcon(R.drawable.ic_my_record) + binding.bottomNav.menu.findItem(R.id.my_dj_fragment).setIcon(R.drawable.ic_my_dj) + binding.bottomNav.menu.findItem(R.id.my_page_fragment).setIcon(R.drawable.ic_my_page) if (binding.searchView.visibility == View.VISIBLE) { cancelSearch() } } - R.id.menu_mydj -> { - toolbar.title = "MY DJ" + R.id.my_dj_fragment -> { + binding.toolbar.title = "MY DJ" supportActionBar?.setDisplayHomeAsUpEnabled(false) stateWrite = false stateSearch = false @@ -383,18 +382,18 @@ class MainActivity : AppCompatActivity() { invalidateOptionsMenu() changeFragment("MyDJ", fragmentMyDj) item.setIcon(R.drawable.ic_selected_mydj) - bottom_nav.menu.findItem(R.id.menu_today).setIcon(R.drawable.ic_today) - bottom_nav.menu.findItem(R.id.menu_myrecord).setIcon(R.drawable.ic_myrecord) - bottom_nav.menu.findItem(R.id.menu_allrecords) - .setIcon(R.drawable.ic_allrecords) - bottom_nav.menu.findItem(R.id.menu_mypage).setIcon(R.drawable.ic_mypage) + binding.bottomNav.menu.findItem(R.id.today_fragment).setIcon(R.drawable.ic_today) + binding.bottomNav.menu.findItem(R.id.my_record_fragment).setIcon(R.drawable.ic_my_record) + binding.bottomNav.menu.findItem(R.id.all_records_fragment) + .setIcon(R.drawable.ic_all_records) + binding.bottomNav.menu.findItem(R.id.my_page_fragment).setIcon(R.drawable.ic_my_page) if (binding.searchView.visibility == View.VISIBLE) { cancelSearch() } } - R.id.menu_mypage -> { - toolbar.title = "MY 페이지" + R.id.my_page_fragment -> { + binding.toolbar.title = "MY 페이지" supportActionBar?.setDisplayHomeAsUpEnabled(false) stateWrite = false stateSearch = false @@ -409,11 +408,11 @@ class MainActivity : AppCompatActivity() { invalidateOptionsMenu() changeFragment("MyPage", fragmentMyPage) item.setIcon(R.drawable.ic_selected_mypage) - bottom_nav.menu.findItem(R.id.menu_today).setIcon(R.drawable.ic_today) - bottom_nav.menu.findItem(R.id.menu_myrecord).setIcon(R.drawable.ic_myrecord) - bottom_nav.menu.findItem(R.id.menu_allrecords) - .setIcon(R.drawable.ic_allrecords) - bottom_nav.menu.findItem(R.id.menu_mydj).setIcon(R.drawable.ic_mydj) + binding.bottomNav.menu.findItem(R.id.today_fragment).setIcon(R.drawable.ic_today) + binding.bottomNav.menu.findItem(R.id.my_record_fragment).setIcon(R.drawable.ic_my_record) + binding.bottomNav.menu.findItem(R.id.all_records_fragment) + .setIcon(R.drawable.ic_all_records) + binding.bottomNav.menu.findItem(R.id.my_dj_fragment).setIcon(R.drawable.ic_my_dj) if (binding.searchView.visibility == View.VISIBLE) { cancelSearch() @@ -422,7 +421,7 @@ class MainActivity : AppCompatActivity() { } true } - selectedItemId = R.id.menu_today // 초기 프래그먼트 + selectedItemId = R.id.today_fragment // 초기 프래그먼트 } } @@ -463,7 +462,7 @@ class MainActivity : AppCompatActivity() { override fun onOptionsItemSelected(item: MenuItem): Boolean { return when (item.itemId) { R.id.action_search -> { - if (binding.bottomNav.selectedItemId == R.id.menu_myrecord) { + if (binding.bottomNav.selectedItemId == R.id.my_record_fragment) { binding.lnToolbar.visibility = View.GONE binding.searchView.visibility = View.VISIBLE isMusicSearch = false @@ -473,7 +472,7 @@ class MainActivity : AppCompatActivity() { binding.bottomNav.visibility = View.GONE binding.searchView.visibility = View.VISIBLE - if (binding.bottomNav.selectedItemId != R.id.menu_mydj) { + if (binding.bottomNav.selectedItemId != R.id.my_dj_fragment) { binding.lnRanking.visibility = View.VISIBLE } @@ -482,11 +481,11 @@ class MainActivity : AppCompatActivity() { isWrite = false // editText 포커스 주기 - et_search.isFocusableInTouchMode = true - et_search.requestFocus() + binding.etSearch.isFocusableInTouchMode = true + binding.etSearch.requestFocus() val inputMethodManager = getSystemService(Context.INPUT_METHOD_SERVICE) as InputMethodManager - inputMethodManager.showSoftInput(et_search, 0) + inputMethodManager.showSoftInput(binding.etSearch, 0) true } @@ -500,11 +499,11 @@ class MainActivity : AppCompatActivity() { isMusicSearch = true // editText 포커스 주기 - et_search.isFocusableInTouchMode = true - et_search.requestFocus() + binding.etSearch.isFocusableInTouchMode = true + binding.etSearch.requestFocus() val inputMethodManager = getSystemService(Context.INPUT_METHOD_SERVICE) as InputMethodManager - inputMethodManager.showSoftInput(et_search, 0) + inputMethodManager.showSoftInput(binding.etSearch, 0) true } @@ -521,19 +520,19 @@ class MainActivity : AppCompatActivity() { binding.bottomNav.visibility = View.VISIBLE // today는 툴바 없음 - if (binding.bottomNav.selectedItemId != R.id.menu_today) { + if (binding.bottomNav.selectedItemId != R.id.today_fragment) { binding.lnToolbar.visibility = View.VISIBLE } else { binding.btnFloating.visibility = View.VISIBLE } - viewPager.currentItem = 0 - et_search.setText("") + binding.viewPager.currentItem = 0 + binding.etSearch.setText("") // 키보드 내리기 val inputMethodManager = getSystemService(Context.INPUT_METHOD_SERVICE) as InputMethodManager - inputMethodManager.hideSoftInputFromWindow(et_search.windowToken, 0) + inputMethodManager.hideSoftInputFromWindow(binding.etSearch.windowToken, 0) } // 뒤로가기 핸들러 diff --git a/app/src/main/java/com/infinity/omos/ui/main/MyRecordFragment.kt b/app/src/main/java/com/infinity/omos/ui/main/MyRecordFragment.kt index ca6a197f..163663b2 100644 --- a/app/src/main/java/com/infinity/omos/ui/main/MyRecordFragment.kt +++ b/app/src/main/java/com/infinity/omos/ui/main/MyRecordFragment.kt @@ -90,7 +90,7 @@ class MyRecordFragment : Fragment() { } // 검색 - (activity as MainActivity).setFilterListener(object : MainActivity.OnFilterListener{ + (activity as FakeMainActivity).setFilterListener(object : FakeMainActivity.OnFilterListener{ override fun onFilter(str: String) { mAdapter.filter.filter(str) } diff --git a/app/src/main/java/com/infinity/omos/ui/main/today/TodayViewModel.kt b/app/src/main/java/com/infinity/omos/ui/main/today/TodayViewModel.kt index 8a777979..7f220339 100644 --- a/app/src/main/java/com/infinity/omos/ui/main/today/TodayViewModel.kt +++ b/app/src/main/java/com/infinity/omos/ui/main/today/TodayViewModel.kt @@ -15,7 +15,6 @@ import dagger.hilt.android.lifecycle.HiltViewModel import kotlinx.coroutines.* import kotlinx.coroutines.flow.MutableStateFlow import kotlinx.coroutines.flow.asStateFlow -import timber.log.Timber import javax.inject.Inject @HiltViewModel diff --git a/app/src/main/java/com/infinity/omos/ui/onboarding/login/LoginFragment.kt b/app/src/main/java/com/infinity/omos/ui/onboarding/login/LoginFragment.kt index df112941..18263c2e 100644 --- a/app/src/main/java/com/infinity/omos/ui/onboarding/login/LoginFragment.kt +++ b/app/src/main/java/com/infinity/omos/ui/onboarding/login/LoginFragment.kt @@ -8,7 +8,7 @@ import android.view.View import android.view.ViewGroup import androidx.fragment.app.viewModels import androidx.navigation.fragment.findNavController -import com.infinity.omos.ui.main.MainActivity +import com.infinity.omos.ui.main.FakeMainActivity import com.infinity.omos.databinding.FragmentLoginBinding import com.infinity.omos.ui.onboarding.error.ErrorMessage import com.infinity.omos.ui.onboarding.base.OnboardingState @@ -102,7 +102,7 @@ class LoginFragment : Fragment() { viewModel.state.collect { state -> when (state) { OnboardingState.Success -> { - val intent = Intent(context, MainActivity::class.java).apply { + val intent = Intent(context, FakeMainActivity::class.java).apply { flags = Intent.FLAG_ACTIVITY_NEW_TASK or Intent.FLAG_ACTIVITY_CLEAR_TASK } startActivity(intent) diff --git a/app/src/main/java/com/infinity/omos/ui/search/AlbumFragment.kt b/app/src/main/java/com/infinity/omos/ui/search/AlbumFragment.kt index c9a22823..e1e08ceb 100644 --- a/app/src/main/java/com/infinity/omos/ui/search/AlbumFragment.kt +++ b/app/src/main/java/com/infinity/omos/ui/search/AlbumFragment.kt @@ -15,7 +15,7 @@ import androidx.fragment.app.viewModels import androidx.lifecycle.Observer import androidx.recyclerview.widget.LinearLayoutManager import androidx.recyclerview.widget.RecyclerView -import com.infinity.omos.ui.main.MainActivity.Companion.keyword +import com.infinity.omos.ui.main.FakeMainActivity.Companion.keyword import com.infinity.omos.R import com.infinity.omos.adapters.AlbumListAdapter import com.infinity.omos.databinding.FragmentAlbumBinding diff --git a/app/src/main/java/com/infinity/omos/ui/search/AllFragment.kt b/app/src/main/java/com/infinity/omos/ui/search/AllFragment.kt index d3acbb0e..fcb3ae97 100644 --- a/app/src/main/java/com/infinity/omos/ui/search/AllFragment.kt +++ b/app/src/main/java/com/infinity/omos/ui/search/AllFragment.kt @@ -13,7 +13,7 @@ import androidx.databinding.DataBindingUtil import androidx.fragment.app.Fragment import androidx.fragment.app.viewModels import androidx.recyclerview.widget.LinearLayoutManager -import com.infinity.omos.ui.main.MainActivity.Companion.keyword +import com.infinity.omos.ui.main.FakeMainActivity.Companion.keyword import com.infinity.omos.R import com.infinity.omos.adapters.AlbumListAdapter import com.infinity.omos.adapters.ArtistListAdapter diff --git a/app/src/main/java/com/infinity/omos/ui/search/ArtistFragment.kt b/app/src/main/java/com/infinity/omos/ui/search/ArtistFragment.kt index 3359e9cc..86196fed 100644 --- a/app/src/main/java/com/infinity/omos/ui/search/ArtistFragment.kt +++ b/app/src/main/java/com/infinity/omos/ui/search/ArtistFragment.kt @@ -15,7 +15,7 @@ import androidx.fragment.app.viewModels import androidx.lifecycle.Observer import androidx.recyclerview.widget.LinearLayoutManager import androidx.recyclerview.widget.RecyclerView -import com.infinity.omos.ui.main.MainActivity +import com.infinity.omos.ui.main.FakeMainActivity import com.infinity.omos.R import com.infinity.omos.adapters.ArtistListAdapter import com.infinity.omos.databinding.FragmentArtistBinding @@ -68,7 +68,7 @@ class ArtistFragment : Fragment() { } // 스크롤 시 앨범 업데이트 - viewModel.loadMoreArtist(MainActivity.keyword, pageSize, 0) + viewModel.loadMoreArtist(FakeMainActivity.keyword, pageSize, 0) viewModel.getArtist().observe(viewLifecycleOwner, Observer { artist -> artist?.let { isLoading = if (it.isEmpty()) { @@ -125,7 +125,7 @@ class ArtistFragment : Fragment() { if (!binding.recyclerView.canScrollVertically(1) && lastVisibleItemPosition == itemTotalCount && !isLoading && itemTotalCount > -1) { isLoading = true mAdapter.deleteLoading() - viewModel.loadMoreArtist(MainActivity.keyword, pageSize, ++page * pageSize) + viewModel.loadMoreArtist(FakeMainActivity.keyword, pageSize, ++page * pageSize) } } }) diff --git a/app/src/main/java/com/infinity/omos/ui/search/DetailArtistActivity.kt b/app/src/main/java/com/infinity/omos/ui/search/DetailArtistActivity.kt index 656945c8..f893e80f 100644 --- a/app/src/main/java/com/infinity/omos/ui/search/DetailArtistActivity.kt +++ b/app/src/main/java/com/infinity/omos/ui/search/DetailArtistActivity.kt @@ -11,7 +11,6 @@ import com.infinity.omos.R import com.infinity.omos.adapters.ArtistViewPagerAdapter import com.infinity.omos.databinding.ActivityArtistBinding import com.infinity.omos.viewmodels.ArtistViewModel -import kotlinx.android.synthetic.main.activity_main.* class DetailArtistActivity : AppCompatActivity() { @@ -46,17 +45,17 @@ class DetailArtistActivity : AppCompatActivity() { private fun initTabLayout(){ val viewpagerFragmentAdapter = ArtistViewPagerAdapter(this, artistId) - viewPager.adapter = viewpagerFragmentAdapter - viewPager.isUserInputEnabled = false + binding.viewPager.adapter = viewpagerFragmentAdapter + binding.viewPager.isUserInputEnabled = false val tabTitles = listOf("노래", "앨범") - TabLayoutMediator(tabLayout, viewPager) { tab, position -> + TabLayoutMediator(binding.tabLayout, binding.viewPager) { tab, position -> tab.text = tabTitles[position] }.attach() } private fun initToolBar(){ - toolbar.title = "" - setSupportActionBar(toolbar) // 툴바 사용 + binding.toolbar.title = "" + setSupportActionBar(binding.toolbar) // 툴바 사용 supportActionBar?.setDisplayHomeAsUpEnabled(true) } diff --git a/app/src/main/java/com/infinity/omos/ui/search/MusicFragment.kt b/app/src/main/java/com/infinity/omos/ui/search/MusicFragment.kt index 028954ec..170178ad 100644 --- a/app/src/main/java/com/infinity/omos/ui/search/MusicFragment.kt +++ b/app/src/main/java/com/infinity/omos/ui/search/MusicFragment.kt @@ -14,7 +14,7 @@ import androidx.fragment.app.Fragment import androidx.fragment.app.viewModels import androidx.recyclerview.widget.LinearLayoutManager import androidx.recyclerview.widget.RecyclerView -import com.infinity.omos.ui.main.MainActivity +import com.infinity.omos.ui.main.FakeMainActivity import com.infinity.omos.R import com.infinity.omos.adapters.MusicListAdapter import com.infinity.omos.databinding.FragmentMusicBinding @@ -66,7 +66,7 @@ class MusicFragment : Fragment() { } // 스크롤 시 앨범 업데이트 - viewModel.loadMoreMusic(MainActivity.keyword, pageSize, 0) + viewModel.loadMoreMusic(FakeMainActivity.keyword, pageSize, 0) viewModel.getMusic().observe(viewLifecycleOwner) { music -> music?.let { isLoading = if (it.isEmpty()) { @@ -123,7 +123,7 @@ class MusicFragment : Fragment() { if (!binding.recyclerView.canScrollVertically(1) && lastVisibleItemPosition == itemTotalCount && !isLoading && itemTotalCount > -1) { isLoading = true mAdapter.deleteLoading() - viewModel.loadMoreMusic(MainActivity.keyword, pageSize, ++page*pageSize) + viewModel.loadMoreMusic(FakeMainActivity.keyword, pageSize, ++page*pageSize) } } }) diff --git a/app/src/main/java/com/infinity/omos/ui/setting/DeleteAccountActivity.kt b/app/src/main/java/com/infinity/omos/ui/setting/DeleteAccountActivity.kt index 6840fd45..7f8c4639 100644 --- a/app/src/main/java/com/infinity/omos/ui/setting/DeleteAccountActivity.kt +++ b/app/src/main/java/com/infinity/omos/ui/setting/DeleteAccountActivity.kt @@ -13,7 +13,7 @@ import com.infinity.omos.etc.Constant import com.infinity.omos.ui.main.MyPageFragment import com.infinity.omos.utils.CustomDialog import com.infinity.omos.OmosApplication -import com.infinity.omos.OnboardingActivity +import com.infinity.omos.ui.MainActivity import com.infinity.omos.viewmodels.DeleteAccountViewModel class DeleteAccountActivity : AppCompatActivity() { @@ -38,7 +38,7 @@ class DeleteAccountActivity : AppCompatActivity() { Constant.ApiState.DONE -> { OmosApplication.prefs.setUserToken(null, null, -1) - val intent = Intent(this, OnboardingActivity::class.java) + val intent = Intent(this, MainActivity::class.java) intent.flags = Intent.FLAG_ACTIVITY_NEW_TASK or Intent.FLAG_ACTIVITY_CLEAR_TASK startActivity(intent) diff --git a/app/src/main/java/com/infinity/omos/ui/setting/SettingActivity.kt b/app/src/main/java/com/infinity/omos/ui/setting/SettingActivity.kt index f4e9897c..6a9f1742 100644 --- a/app/src/main/java/com/infinity/omos/ui/setting/SettingActivity.kt +++ b/app/src/main/java/com/infinity/omos/ui/setting/SettingActivity.kt @@ -16,7 +16,7 @@ import com.infinity.omos.databinding.ActivitySettingBinding import com.infinity.omos.etc.Constant import com.infinity.omos.utils.CustomDialog import com.infinity.omos.OmosApplication -import com.infinity.omos.OnboardingActivity +import com.infinity.omos.ui.MainActivity import com.infinity.omos.utils.MyReceiver import com.infinity.omos.viewmodels.SettingViewModel import com.kakao.sdk.user.UserApiClient @@ -69,7 +69,7 @@ class SettingActivity : AppCompatActivity() { viewModel.doLogout(userId) OmosApplication.prefs.setUserToken(null, null, -1) - val intent = Intent(this, OnboardingActivity::class.java) + val intent = Intent(this, MainActivity::class.java) intent.flags = Intent.FLAG_ACTIVITY_NEW_TASK or Intent.FLAG_ACTIVITY_CLEAR_TASK startActivity(intent) diff --git a/app/src/main/java/com/infinity/omos/ui/write/WriteLyricsActivity.kt b/app/src/main/java/com/infinity/omos/ui/write/WriteLyricsActivity.kt index 0549c7ed..5959738f 100644 --- a/app/src/main/java/com/infinity/omos/ui/write/WriteLyricsActivity.kt +++ b/app/src/main/java/com/infinity/omos/ui/write/WriteLyricsActivity.kt @@ -20,7 +20,7 @@ import androidx.databinding.DataBindingUtil import androidx.recyclerview.widget.LinearLayoutManager import com.bumptech.glide.Glide import com.infinity.omos.BuildConfig -import com.infinity.omos.ui.main.MainActivity +import com.infinity.omos.ui.main.FakeMainActivity import com.infinity.omos.R import com.infinity.omos.adapters.LyricsListAdapter import com.infinity.omos.data.SaveRecord @@ -214,7 +214,7 @@ class WriteLyricsActivity : AppCompatActivity() { intent2.addFlags(Intent.FLAG_RECEIVER_REPLACE_PENDING) sendBroadcast(intent2) - val intent = Intent(this, MainActivity::class.java) + val intent = Intent(this, FakeMainActivity::class.java) intent.putExtra("save", true) intent.flags = Intent.FLAG_ACTIVITY_CLEAR_TASK or Intent.FLAG_ACTIVITY_CLEAR_TOP or Intent.FLAG_ACTIVITY_SINGLE_TOP diff --git a/app/src/main/java/com/infinity/omos/ui/write/WriteRecordActivity.kt b/app/src/main/java/com/infinity/omos/ui/write/WriteRecordActivity.kt index cb77cfa9..d1e4e5be 100644 --- a/app/src/main/java/com/infinity/omos/ui/write/WriteRecordActivity.kt +++ b/app/src/main/java/com/infinity/omos/ui/write/WriteRecordActivity.kt @@ -21,7 +21,7 @@ import androidx.databinding.DataBindingUtil import androidx.lifecycle.Observer import com.bumptech.glide.Glide import com.infinity.omos.BuildConfig -import com.infinity.omos.ui.main.MainActivity +import com.infinity.omos.ui.main.FakeMainActivity import com.infinity.omos.R import com.infinity.omos.data.SaveRecord import com.infinity.omos.data.Update @@ -212,7 +212,7 @@ class WriteRecordActivity : AppCompatActivity() { intent2.addFlags(Intent.FLAG_RECEIVER_REPLACE_PENDING) sendBroadcast(intent2) - val intent = Intent(this, MainActivity::class.java) + val intent = Intent(this, FakeMainActivity::class.java) intent.putExtra("save", true) intent.flags = Intent.FLAG_ACTIVITY_CLEAR_TASK or Intent.FLAG_ACTIVITY_CLEAR_TOP or Intent.FLAG_ACTIVITY_SINGLE_TOP diff --git a/app/src/main/java/com/infinity/omos/utils/MyReceiver.kt b/app/src/main/java/com/infinity/omos/utils/MyReceiver.kt index 21d3861d..8bc5061e 100644 --- a/app/src/main/java/com/infinity/omos/utils/MyReceiver.kt +++ b/app/src/main/java/com/infinity/omos/utils/MyReceiver.kt @@ -10,7 +10,7 @@ import android.content.Intent import android.os.Build import androidx.core.app.NotificationCompat import androidx.core.content.ContextCompat -import com.infinity.omos.ui.main.MainActivity +import com.infinity.omos.ui.main.FakeMainActivity import com.infinity.omos.R import com.infinity.omos.etc.Constant.Companion.CHANNEL_ID import com.infinity.omos.etc.Constant.Companion.NOTI_ID @@ -30,7 +30,7 @@ class MyReceiver : BroadcastReceiver() { builder.setContentText("오늘 하루, 당신의 음악은 무엇이었나요?") builder.setAutoCancel(true) builder.color = ContextCompat.getColor(context, R.color.orange) - val notificationIntent = Intent(context, MainActivity::class.java) + val notificationIntent = Intent(context, FakeMainActivity::class.java) notificationIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK or Intent.FLAG_ACTIVITY_SINGLE_TOP) val pendingIntent = PendingIntent.getActivity(context, 0, notificationIntent, 0) builder.setContentIntent(pendingIntent) // 알림 클릭 시 이동 diff --git a/app/src/main/res/drawable/ic_allrecords.xml b/app/src/main/res/drawable/ic_all_records.xml similarity index 100% rename from app/src/main/res/drawable/ic_allrecords.xml rename to app/src/main/res/drawable/ic_all_records.xml diff --git a/app/src/main/res/drawable/ic_mydj.xml b/app/src/main/res/drawable/ic_my_dj.xml similarity index 100% rename from app/src/main/res/drawable/ic_mydj.xml rename to app/src/main/res/drawable/ic_my_dj.xml diff --git a/app/src/main/res/drawable/ic_mypage.xml b/app/src/main/res/drawable/ic_my_page.xml similarity index 100% rename from app/src/main/res/drawable/ic_mypage.xml rename to app/src/main/res/drawable/ic_my_page.xml diff --git a/app/src/main/res/drawable/ic_myrecord.xml b/app/src/main/res/drawable/ic_my_record.xml similarity index 100% rename from app/src/main/res/drawable/ic_myrecord.xml rename to app/src/main/res/drawable/ic_my_record.xml diff --git a/app/src/main/res/layout/activity_fake_main.xml b/app/src/main/res/layout/activity_fake_main.xml new file mode 100644 index 00000000..7e09fb5f --- /dev/null +++ b/app/src/main/res/layout/activity_fake_main.xml @@ -0,0 +1,244 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/layout/activity_main.xml b/app/src/main/res/layout/activity_main.xml index 6e07dee3..f0eee236 100644 --- a/app/src/main/res/layout/activity_main.xml +++ b/app/src/main/res/layout/activity_main.xml @@ -3,241 +3,35 @@ xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:tools="http://schemas.android.com/tools"> - - - - - - + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + app:layout_constraintStart_toStartOf="parent" + app:menu="@menu/menu_bottom_nav" /> diff --git a/app/src/main/res/layout/activity_onboarding.xml b/app/src/main/res/layout/activity_onboarding.xml deleted file mode 100644 index 901270fc..00000000 --- a/app/src/main/res/layout/activity_onboarding.xml +++ /dev/null @@ -1,21 +0,0 @@ - - - - - - - - - - \ No newline at end of file diff --git a/app/src/main/res/layout/fragment_today.xml b/app/src/main/res/layout/fragment_today.xml index 0b7490f0..f5f96565 100644 --- a/app/src/main/res/layout/fragment_today.xml +++ b/app/src/main/res/layout/fragment_today.xml @@ -4,6 +4,7 @@ xmlns:tools="http://schemas.android.com/tools"> + + app:isGone="@{!(vm.uiState instanceof UiState.Loading)}" + tools:visibility="gone"> + android:layout_gravity="center" + android:layout_marginTop="@dimen/normal_padding" /> diff --git a/app/src/main/res/menu/bottom_navigation_menu.xml b/app/src/main/res/menu/bottom_navigation_menu.xml deleted file mode 100644 index af1f0d5b..00000000 --- a/app/src/main/res/menu/bottom_navigation_menu.xml +++ /dev/null @@ -1,34 +0,0 @@ - - - - - - - - - - - - - - \ No newline at end of file diff --git a/app/src/main/res/menu/menu_bottom_nav.xml b/app/src/main/res/menu/menu_bottom_nav.xml new file mode 100644 index 00000000..0751ee29 --- /dev/null +++ b/app/src/main/res/menu/menu_bottom_nav.xml @@ -0,0 +1,29 @@ + + + + + + + + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/navigation/nav_graph.xml b/app/src/main/res/navigation/nav_graph.xml index eea001c2..1b323d25 100644 --- a/app/src/main/res/navigation/nav_graph.xml +++ b/app/src/main/res/navigation/nav_graph.xml @@ -7,6 +7,6 @@ + app:graph="@navigation/nav_on_boarding"/> \ No newline at end of file diff --git a/app/src/main/res/values/dimens.xml b/app/src/main/res/values/dimens.xml index d0595a0a..6b39acc1 100644 --- a/app/src/main/res/values/dimens.xml +++ b/app/src/main/res/values/dimens.xml @@ -1,8 +1,5 @@ - - //Custom BottomNavigationView TextSize - 10sp - 10sp + 12dp 16dp diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index d4c654a1..f8e793bf 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -1,10 +1,10 @@ omos - 투데이 - MY 레코드 - 전체 레코드 - MY DJ - MY 페이지 + 투데이 + MY 레코드 + 전체 레코드 + MY DJ + MY 페이지 이메일을 입력해주세요. 비밀번호를 입력해주세요. diff --git a/app/src/main/res/values/styles.xml b/app/src/main/res/values/styles.xml index a494275a..68069530 100644 --- a/app/src/main/res/values/styles.xml +++ b/app/src/main/res/values/styles.xml @@ -4,4 +4,8 @@ ?attr/colorOnSurface @color/bg_black + + \ No newline at end of file