Skip to content

Commit

Permalink
refactor: Reorganize files according to clean architecture
Browse files Browse the repository at this point in the history
  • Loading branch information
jooiss committed Jul 22, 2024
1 parent 324d73e commit 80757f5
Show file tree
Hide file tree
Showing 18 changed files with 25 additions and 29 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ import androidx.test.espresso.intent.matcher.IntentMatchers
import androidx.test.espresso.matcher.ViewMatchers
import androidx.test.ext.junit.runners.AndroidJUnit4
import androidx.test.rule.ActivityTestRule
import campus.tech.kakao.map.presentation.MapActivity
import campus.tech.kakao.map.presentation.PlaceActivity
import campus.tech.kakao.map.ui.MapActivity
import campus.tech.kakao.map.ui.PlaceActivity
import org.junit.Rule
import org.junit.Test
import org.junit.runner.RunWith
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import android.content.Intent
import androidx.appcompat.app.AppCompatActivity
import androidx.test.ext.junit.runners.AndroidJUnit4
import androidx.test.rule.ActivityTestRule
import campus.tech.kakao.map.presentation.MapActivity
import campus.tech.kakao.map.ui.MapActivity
import campus.tech.kakao.map.ui.ModalBottomSheet
import org.junit.Assert.*
import org.junit.Before
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ import androidx.test.espresso.matcher.ViewMatchers.hasMinimumChildCount
import androidx.test.espresso.matcher.ViewMatchers.withId
import androidx.test.ext.junit.runners.AndroidJUnit4
import androidx.test.rule.ActivityTestRule
import campus.tech.kakao.map.presentation.MapActivity
import campus.tech.kakao.map.presentation.PlaceActivity
import campus.tech.kakao.map.ui.MapActivity
import campus.tech.kakao.map.ui.PlaceActivity
import org.junit.Rule
import org.junit.Test
import org.junit.runner.RunWith
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ import android.view.View
import androidx.recyclerview.widget.RecyclerView
import androidx.test.core.app.ActivityScenario
import androidx.test.ext.junit.runners.AndroidJUnit4
import campus.tech.kakao.map.data.PlaceDataModel
import campus.tech.kakao.map.domain.PlaceDataModel
import campus.tech.kakao.map.data.PlaceDatabaseAccess
import campus.tech.kakao.map.presentation.PlaceActivity
import campus.tech.kakao.map.ui.PlaceActivity
import org.junit.Before
import org.junit.Test
import org.junit.runner.RunWith
Expand Down
6 changes: 3 additions & 3 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<uses-permission android:name="android.permission.INTERNET" />

<application
android:name=".presentation.KaKaoMapApplication"
android:name=".ui.KakaoMapApplication"
android:allowBackup="true"
android:dataExtractionRules="@xml/data_extraction_rules"
android:fullBackupContent="@xml/backup_rules"
Expand All @@ -17,7 +17,7 @@
android:theme="@style/Theme.Map"
tools:targetApi="31">
<activity
android:name=".presentation.MapActivity"
android:name=".ui.MapActivity"
android:exported="true">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
Expand All @@ -26,7 +26,7 @@
</intent-filter>
</activity>
<activity
android:name=".presentation.PlaceActivity"
android:name=".ui.PlaceActivity"
android:exported="true" />
</application>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package campus.tech.kakao.map.data
import android.content.ContentValues
import android.content.Context
import android.database.Cursor
import campus.tech.kakao.map.domain.PlaceDataModel

class PlaceDatabaseAccess(context: Context, databaseName: String) {
private val dbHelper = PlaceDatabaseHelper(context, databaseName)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@ package campus.tech.kakao.map.data

import android.util.Log
import campus.tech.kakao.map.BuildConfig
import campus.tech.kakao.map.domain.RetrofitInstance
import campus.tech.kakao.map.domain.RetrofitLocalKeywordService
import campus.tech.kakao.map.domain.PlaceDataModel
import retrofit2.Call
import retrofit2.Callback
import retrofit2.Response
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package campus.tech.kakao.map.domain
package campus.tech.kakao.map.data

import retrofit2.Retrofit
import retrofit2.converter.gson.GsonConverterFactory
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package campus.tech.kakao.map.domain
package campus.tech.kakao.map.data

import campus.tech.kakao.map.data.SearchResult
import retrofit2.Call
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package campus.tech.kakao.map.domain
package campus.tech.kakao.map.data

import campus.tech.kakao.map.data.SearchResult
import retrofit2.Call
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package campus.tech.kakao.map.data
package campus.tech.kakao.map.domain

data class PlaceDataModel(
val name: String,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
package campus.tech.kakao.map.presentation
package campus.tech.kakao.map.ui

import android.app.Application
import campus.tech.kakao.map.BuildConfig
import com.kakao.vectormap.KakaoMapSdk

class KaKaoMapApplication : Application() {
class KakaoMapApplication : Application() {
override fun onCreate() {
super.onCreate()
KakaoMapSdk.init(this, BuildConfig.KAKAO_API_KEY)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package campus.tech.kakao.map.presentation
package campus.tech.kakao.map.ui

import android.content.Intent
import android.content.SharedPreferences
Expand All @@ -9,7 +9,6 @@ import android.widget.ImageButton
import android.widget.TextView
import android.widget.Toast
import androidx.appcompat.app.AppCompatActivity
import campus.tech.kakao.map.ui.ModalBottomSheet
import campus.tech.kakao.map.R
import com.kakao.vectormap.KakaoMap
import com.kakao.vectormap.KakaoMapReadyCallback
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package campus.tech.kakao.map.presentation
package campus.tech.kakao.map.ui

import android.content.Intent
import android.os.Bundle
Expand All @@ -12,12 +12,10 @@ import android.widget.TextView
import androidx.appcompat.app.AppCompatActivity
import androidx.recyclerview.widget.LinearLayoutManager
import androidx.recyclerview.widget.RecyclerView
import campus.tech.kakao.map.data.PlaceDataModel
import campus.tech.kakao.map.domain.PlaceDataModel
import campus.tech.kakao.map.data.PlaceDatabaseAccess
import campus.tech.kakao.map.ui.PlaceRecyclerViewAdapter
import campus.tech.kakao.map.data.PlaceRepository
import campus.tech.kakao.map.R
import campus.tech.kakao.map.ui.SearchRecyclerViewAdapter

class PlaceActivity : AppCompatActivity() {
lateinit var etSearch: EditText
Expand All @@ -34,7 +32,6 @@ class PlaceActivity : AppCompatActivity() {
public override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.search_layout)

etSearch = findViewById<EditText>(R.id.etSearch)
btnErase = findViewById<ImageButton>(R.id.btnErase)
tvNoData = findViewById<TextView>(R.id.tvNoData)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import android.view.ViewGroup
import android.widget.TextView
import androidx.recyclerview.widget.RecyclerView
import campus.tech.kakao.map.R
import campus.tech.kakao.map.data.PlaceDataModel
import campus.tech.kakao.map.domain.PlaceDataModel

class PlaceRecyclerViewAdapter(
private val places: MutableList<PlaceDataModel>,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import androidx.recyclerview.widget.DiffUtil
import androidx.recyclerview.widget.ListAdapter
import androidx.recyclerview.widget.RecyclerView
import campus.tech.kakao.map.R
import campus.tech.kakao.map.data.PlaceDataModel
import campus.tech.kakao.map.domain.PlaceDataModel

class SearchRecyclerViewAdapter(
private val places: MutableList<PlaceDataModel>,
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/layout/map_layout.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
android:id="@+id/main"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".presentation.MapActivity">
tools:context=".ui.MapActivity">


<com.kakao.vectormap.MapView
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/layout/search_layout.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
android:id="@+id/main"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".presentation.PlaceActivity">
tools:context=".ui.PlaceActivity">

<LinearLayout
android:id="@+id/llSearch"
Expand Down

0 comments on commit 80757f5

Please sign in to comment.