Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

부산대 Android 김민혁 5주차 STEP1 #89

Open
wants to merge 72 commits into
base: kyleidea1
Choose a base branch
from

Conversation

kyleidea1
Copy link

@kyleidea1 kyleidea1 commented Jul 26, 2024

<질문>
제 코드 상에서는 Hilt를 이용해 주입받을 객체들을 선정하고, 앱의 데이터베이스만 Application 객체에 주입받았는데요,
원래는 데이터베이스 뿐만 아니라 Retorfit 객체와 KakaoRepository 객체가 선언되어 있었는데, API 통신을 하는 부분은 검색창인 SearchActivity에서만 필요해서, SearchActivity로 옮겼습니다.

Hilt를 이용해서 의존서을 주입받을 때, 다음 중 어떤 코드가 더 효율적인 지 궁금합니다.

  1. Application 객체에 API 통신을 위한 retrofit, kakaorepository 객체를 받아서, 사용하는 액티비티에서 받아온다
  2. 처음부터 API 통신을 위한 객체들은 API 통신을 하는 액티비티에 받아온다

MyStoryG and others added 30 commits June 25, 2024 01:19
- Added a new view 'activity_search.xml' which includes a simple search bar layout using SearchView.
- Added SearchMainActivity which is activity for activity_search.xml
These data would be results of searching.
Added information related to local database.
- Renamed DBHelper to PlaceDBHelper
- Added PlaceDBHelper class with methods to create the PlaceTable and insert initial place data
- Implemented the SearchHistoryDBHelper class to manage search history in a new SearchHistoryTable
- Added methods to insert, delete, and retrieve search history entries

Closes #789
- Moved the Place data class from PlaceDBHelper to its own file for better code organization.
…history

- Implemented SearchHistoryRecyclerViewAdapter to manage and display search history items in a RecyclerView.
- Added ViewHolder class for binding search history items and handling item clicks and deletions.
- Updated onBindViewHolder to handle click events for item selection and deletion, including updating the RecyclerView.
…esults

- Updated the filtering logic in SearchActivity to correctly filter search results based on the entered query.
- reset previous commits by hard option to find error. recommit normally operating files(activity_search.xml, AndroidManifest.xml, DBHelper.kt, SearchMainActivity.kt)
- Extracted PlaceDBHelper for managing the PlaceTable database operations.
- Extracted SearchHistoryDBHelper for managing the SearchHistoryTable database operations.
- Deleted DBHelper.kt which previously contained combined functionality.
- Updated visibility attribute of RecyclerView with ID 'recycler_view' to 'visible' to ensure search results are displayed correctly.
- Adjusted visibility attribute of TextView with ID 'no_results' to 'gone' to hide the message when search results are present.
- To fix visibility bug of no_result.
- Added Place, PlaceMeta, RegionInfo, and ResultSearchKeyword data classes
- Represents the structure of data received from Kakao Local API
- Created KakaoLocalApi interface defining API endpoints
- Implemented searchKeyword function to fetch search results from Kakao API
…o API

- Implemented KakaoRepository class to handle API requests and responses
- Includes searchKeyword function to fetch search results asynchronously
kyleidea1 and others added 30 commits July 12, 2024 14:46
- Updated readme for STEP1 of android-map-location
- MapActivity displays clicked item's location
* Initial commit

* docs: add project overview of STEP1 to README

* feat(view): Add activity_search.xml view for SearchView

- Added a new view 'activity_search.xml' which includes a simple search bar layout using SearchView.

* feat(view): Add SearchMainActivity.kt

- Added SearchMainActivity which is activity for activity_search.xml

* feat(view): Add DBHelper.kt which is local storage of places.

* feat: Added 9 data into Place.db

These data would be results of searching.

* docs: Modified README.md

Added information related to local database.

* feat: Create STEP1 branch and move existing work to it

* docs: Modified README.md for STEP2

* feat(db): add SearchHistoryDBHelper and initial place data

- Renamed DBHelper to PlaceDBHelper
- Added PlaceDBHelper class with methods to create the PlaceTable and insert initial place data
- Implemented the SearchHistoryDBHelper class to manage search history in a new SearchHistoryTable
- Added methods to insert, delete, and retrieve search history entries

Closes #789

* refactor(db): extract Place data class to separate file

- Moved the Place data class from PlaceDBHelper to its own file for better code organization.

* feat(ui): add SearchHistoryRecyclerViewAdapter for displaying search history

- Implemented SearchHistoryRecyclerViewAdapter to manage and display search history items in a RecyclerView.
- Added ViewHolder class for binding search history items and handling item clicks and deletions.
- Updated onBindViewHolder to handle click events for item selection and deletion, including updating the RecyclerView.

* fix(SearchActivity): Fix filtering logic to correctly filter search results

- Updated the filtering logic in SearchActivity to correctly filter search results based on the entered query.
- reset previous commits by hard option to find error. recommit normally operating files(activity_search.xml, AndroidManifest.xml, DBHelper.kt, SearchMainActivity.kt)

* refactor: Split DBHelper into PlaceDBHelper and SearchHistoryDBHelper

- Extracted PlaceDBHelper for managing the PlaceTable database operations.
- Extracted SearchHistoryDBHelper for managing the SearchHistoryTable database operations.
- Deleted DBHelper.kt which previously contained combined functionality.

* Refactor XML layout to fix visibility bug in SearchActivity

- Updated visibility attribute of RecyclerView with ID 'recycler_view' to 'visible' to ensure search results are displayed correctly.
- Adjusted visibility attribute of TextView with ID 'no_results' to 'gone' to hide the message when search results are present.
- To fix visibility bug of no_result.

* Add: Extracted Korean strings into string resources and updated declarations accordingly

* Add: Extracted Korean strings into string resources and updated declarations accordingly

* Refactor: Changed variable names to enhance consistency

* docs: Modified README.md

* Initial commit

* Added missing files

* docs: Added README.md of android-search-STEP1

* 임시저장

* 임시저장

* feat: Add Kakao Local API dependencies to Gradle files

* feat(dto): Add DTO classes for Kakao API response

- Added Place, PlaceMeta, RegionInfo, and ResultSearchKeyword data classes
- Represents the structure of data received from Kakao Local API

* feat(network): Implement KakaoLocalApi interface for API communication

- Created KakaoLocalApi interface defining API endpoints
- Implemented searchKeyword function to fetch search results from Kakao API

* feat(repository): Create KakaoRepository for data retrieval from Kakao API

- Implemented KakaoRepository class to handle API requests and responses
- Includes searchKeyword function to fetch search results asynchronously

* feat: Added KyleMaps application class with Retrofit instance

- Created a new application class `KyleMaps` to initialize the Retrofit instance.
- Added KyleMaps into AndroidManifest.xml

* feat: added application icon image resources
- Added icon image assets and added into AndroidManifest.xml

* feat: added retrofit instance into KyleMaps.kt

* feat: remove activity_main_search

Removed activity_main_search to improve code maintainability and reduce unused resources.

* remove: PlaceDBHelper.kt

Removed PlaceDBHelper.kt as PlaceDB became useless

* feat: Added dto package and its elements

Replaced Place.kt and added PlaceMeta.kt, RegionInfo.kt, SearchActivity.kt

* chore: added dependencies to use Kakao APIs

* feat: Added KakaoRepository.kt

Added KakaoRepository.kt to get sources using Kakao API

* feat: Added KyleMaps.kt

Added KyleMaps.kt which is instance of Application class of entire application.

* feat: Added drawable resources

Added arrow_back.xml and ic_search.xml to use at map activity layout

* feat: Added MapActivity and its layout

Added MapActivity.kt and activity_map.xml
Modified AndroidManifest.xml

* feat: Modified activity_search.xml and DBHelpers

* docs: updated README.md

* finished STEP0

---------

Co-authored-by: MyStoryG <[email protected]>
- Does not appear until selecting an item in the result recycler view
- image source: location_marker.png, with a text refers name of the place
…n app restarted

- Focus same place as the last place before termination of application
- remember position using sharedPreference
- AuthenticationErrorActivity.kt
- activity_authentication_error.xml
- and images in these files
- bottom_sheet_background.xml, layout_map_bottom_sheet_dialog.xml
- Added variables related to bottom sheet
- Added finish() part in eventListner of searchButton in MapActivity
- Now MapActivities doesn't stack
# Conflicts:
#	app/src/main/java/campus/tech/kakao/map/SearchActivity.kt
- MapActivityTest.kt, SearchActivityTest.kt
- test for saveLatLng function
- MainActivity.kt
- SearchHistoryDBHelper.kt would be useless as replacement(sqlite to Room)
- Applied annotation to KyleMaps and removed constructor part
- Injected dependencies into SearchActivity.kt instead
-  Hilt provider functions
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants