-
Notifications
You must be signed in to change notification settings - Fork 551
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add feedback section to Event Details
- Loading branch information
1 parent
3d3a586
commit 5266df7
Showing
10 changed files
with
163 additions
and
5 deletions.
There are no files selected for viewing
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
17 changes: 17 additions & 0 deletions
17
app/src/main/java/org/fossasia/openevent/general/event/feedback/Feedback.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,17 @@ | ||
package org.fossasia.openevent.general.event.feedback | ||
|
||
import com.fasterxml.jackson.annotation.JsonProperty | ||
import com.github.jasminb.jsonapi.LongIdHandler | ||
import com.github.jasminb.jsonapi.annotations.Id | ||
import com.github.jasminb.jsonapi.annotations.Type | ||
|
||
@Type("feedback") | ||
data class Feedback( | ||
@Id(LongIdHandler::class) | ||
val id: Long, | ||
val rating: String?, | ||
val comment: String?, | ||
@JsonProperty("deleted-at") | ||
val deletedAt: String? | ||
|
||
) |
16 changes: 16 additions & 0 deletions
16
app/src/main/java/org/fossasia/openevent/general/event/feedback/FeedbackApi.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,16 @@ | ||
package org.fossasia.openevent.general.event.feedback | ||
|
||
import io.reactivex.Single | ||
import retrofit2.http.GET | ||
import retrofit2.http.Path | ||
import retrofit2.http.Query | ||
|
||
interface FeedbackApi { | ||
|
||
@GET("events/{eventId}/feedbacks") | ||
fun getEventFeedback( | ||
@Path("eventId") eventId: Long, | ||
@Query("sort") sort: String = "rating", | ||
@Query("filter") eventName: String = "[]" | ||
): Single<List<Feedback>> | ||
} |
31 changes: 31 additions & 0 deletions
31
app/src/main/java/org/fossasia/openevent/general/event/feedback/FeedbackRecyclerAdapter.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,31 @@ | ||
package org.fossasia.openevent.general.event.feedback | ||
|
||
import android.view.LayoutInflater | ||
import android.view.ViewGroup | ||
import androidx.recyclerview.widget.RecyclerView | ||
import org.fossasia.openevent.general.R | ||
|
||
class FeedbackRecyclerAdapter : RecyclerView.Adapter<FeedbackViewHolder>() { | ||
val feedbackList = ArrayList<Feedback>() | ||
|
||
fun addAll(feedbackList: List<Feedback>) { | ||
if (feedbackList.isNotEmpty()) | ||
this.feedbackList.clear() | ||
this.feedbackList.addAll(feedbackList) | ||
} | ||
|
||
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): FeedbackViewHolder { | ||
val view = LayoutInflater.from(parent.context).inflate(android.R.layout.simple_list_item_1, parent, false) | ||
return FeedbackViewHolder(view) | ||
} | ||
|
||
override fun onBindViewHolder(holder: FeedbackViewHolder, position: Int) { | ||
val feedback = feedbackList[position] | ||
|
||
holder.bind(feedback) | ||
} | ||
|
||
override fun getItemCount(): Int { | ||
return feedbackList.size | ||
} | ||
} |
10 changes: 10 additions & 0 deletions
10
app/src/main/java/org/fossasia/openevent/general/event/feedback/FeedbackViewHolder.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,10 @@ | ||
package org.fossasia.openevent.general.event.feedback | ||
|
||
import android.view.View | ||
import androidx.recyclerview.widget.RecyclerView | ||
|
||
class FeedbackViewHolder(itemView: View) : RecyclerView.ViewHolder(itemView) { | ||
|
||
fun bind(feedback: Feedback) { | ||
} | ||
} |
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