forked from tukcomCD2024/ISP
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Feat : Add a WeekWeatherAdapter tukcomCD2024#102
File : subdivide the sub-files of the folder and organize them into folders
- Loading branch information
Showing
90 changed files
with
436 additions
and
254 deletions.
There are no files selected for viewing
4 changes: 2 additions & 2 deletions
4
...recyclerview/OneWayAirplaneListAdapter.kt → ...ing/airplane/OneWayAirplaneListAdapter.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...ter/recyclerview/RecentAirplaneAdapter.kt → ...booking/airplane/RecentAirplaneAdapter.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
...yclerview/RoundTripAirplaneListAdapter.kt → .../airplane/RoundTripAirplaneListAdapter.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 1 addition & 2 deletions
3
...dapter/recyclerview/RecentHotelAdapter.kt → ...rview/booking/hotel/RecentHotelAdapter.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...apter/recyclerview/DaysScheduleAdapter.kt → ...yclerview/schedule/DaysScheduleAdapter.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...r/recyclerview/DaysScheduleEditAdapter.kt → ...rview/schedule/DaysScheduleEditAdapter.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 3 additions & 3 deletions
6
...cyclerview/RecentAddedCalendarsAdapter.kt → ...w/schedule/RecentAddedCalendarsAdapter.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
41 changes: 41 additions & 0 deletions
41
...Trip/app/src/main/java/com/project/how/adapter/recyclerview/weather/WeekWeatherAdapter.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
package com.project.how.adapter.recyclerview.weather | ||
|
||
import android.view.LayoutInflater | ||
import android.view.ViewGroup | ||
import androidx.recyclerview.widget.RecyclerView | ||
import com.bumptech.glide.Glide | ||
import com.project.how.R | ||
import com.project.how.data_class.dto.weather.GetWeeklyWeathersResponseElement | ||
import com.project.how.databinding.WeekWeatherItemBinding | ||
|
||
class WeekWeatherAdapter(private val data : List<GetWeeklyWeathersResponseElement>) | ||
: RecyclerView.Adapter<WeekWeatherAdapter.ViewHolder>() { | ||
|
||
inner class ViewHolder(val binding: WeekWeatherItemBinding) : RecyclerView.ViewHolder(binding.root){ | ||
fun bind(data: GetWeeklyWeathersResponseElement){ | ||
binding.week.text = data.date | ||
binding.temp.text = data.temp | ||
Glide.with(binding.root) | ||
.load(data.iconUrl) | ||
.error(R.drawable.icon_question) | ||
.into(binding.image) | ||
} | ||
} | ||
|
||
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): ViewHolder = ViewHolder( | ||
WeekWeatherItemBinding.inflate( | ||
LayoutInflater.from(parent.context), | ||
parent, | ||
false | ||
) | ||
) | ||
|
||
override fun getItemViewType(position: Int): Int = position | ||
override fun getItemCount(): Int = data.size | ||
|
||
override fun onBindViewHolder(holder: ViewHolder, position: Int) { | ||
val data = data[position] | ||
holder.bind(data) | ||
} | ||
|
||
} |
2 changes: 1 addition & 1 deletion
2
...class/dto/GenerateSkyscannerUrlRequest.kt → .../airplane/GenerateSkyscannerUrlRequest.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...lass/dto/GenerateSkyscannerUrlResponse.kt → ...airplane/GenerateSkyscannerUrlResponse.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
.../data_class/dto/GetFlightOffersRequest.kt → ...ooking/airplane/GetFlightOffersRequest.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...data_class/dto/GetFlightOffersResponse.kt → ...oking/airplane/GetFlightOffersResponse.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...w/data_class/dto/GetLikeFlightResponse.kt → ...booking/airplane/GetLikeFlightResponse.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
.../project/how/data_class/dto/LikeFlight.kt → ..._class/dto/booking/airplane/LikeFlight.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...ct/how/data_class/dto/LikeOneWayFlight.kt → .../dto/booking/airplane/LikeOneWayFlight.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...ta_class/dto/GetCountryLocationRequest.kt → .../dto/country/GetCountryLocationRequest.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...a_class/dto/GetCountryLocationResponse.kt → ...dto/country/GetCountryLocationResponse.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...how/data_class/dto/AuthRecreateRequest.kt → ...a_class/dto/member/AuthRecreateRequest.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...ect/how/data_class/dto/GetInfoResponse.kt → .../data_class/dto/member/GetInfoResponse.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...roject/how/data_class/dto/LoginRequest.kt → ...how/data_class/dto/member/LoginRequest.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...oject/how/data_class/dto/SignUpRequest.kt → ...ow/data_class/dto/member/SignUpRequest.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...ta_class/dto/CreateScheduleListRequest.kt → ...dto/schedule/CreateScheduleListRequest.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...w/data_class/dto/CreateScheduleRequest.kt → ...ass/dto/schedule/CreateScheduleRequest.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
.../data_class/dto/CreateScheduleResponse.kt → ...ss/dto/schedule/CreateScheduleResponse.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
..._class/dto/GetFastestSchedulesResponse.kt → ...o/schedule/GetFastestSchedulesResponse.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...ta_class/dto/GetLatestScheduleResponse.kt → ...dto/schedule/GetLatestScheduleResponse.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...data_class/dto/GetScheduleListResponse.kt → ...s/dto/schedule/GetScheduleListResponse.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...ject/how/data_class/dto/ScheduleDetail.kt → ...data_class/dto/schedule/ScheduleDetail.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 8 additions & 0 deletions
8
...wAboutTrip/app/src/main/java/com/project/how/data_class/dto/weather/GetWeathersRequest.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
package com.project.how.data_class.dto.weather | ||
|
||
import com.google.gson.annotations.SerializedName | ||
|
||
data class GetWeathersRequest( | ||
@SerializedName("country") | ||
val country : String | ||
) |
14 changes: 14 additions & 0 deletions
14
...rip/app/src/main/java/com/project/how/data_class/dto/weather/GetWeeklyWeathersResponse.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
package com.project.how.data_class.dto.weather | ||
|
||
import com.google.gson.annotations.SerializedName | ||
|
||
typealias GetWeeklyWeathersResponse = ArrayList<GetWeeklyWeathersResponseElement> | ||
|
||
data class GetWeeklyWeathersResponseElement ( | ||
@SerializedName("date") | ||
val date: String, | ||
@SerializedName("temp") | ||
val temp: String, | ||
@SerializedName("iconUrl") | ||
val iconUrl: String | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.