-
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.
- Loading branch information
1 parent
ead4416
commit 0051513
Showing
8 changed files
with
214 additions
and
43 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
package com.example.games | ||
|
||
|
||
import androidx.appcompat.app.AppCompatActivity | ||
import android.os.Bundle | ||
import com.bumptech.glide.Glide | ||
import com.bumptech.glide.load.resource.drawable.DrawableTransitionOptions | ||
import com.example.games.databinding.ActivityDetail2Binding | ||
|
||
class DetailActivity2 : AppCompatActivity() { | ||
|
||
private lateinit var binding: ActivityDetail2Binding | ||
|
||
override fun onCreate(savedInstanceState: Bundle?) { | ||
super.onCreate(savedInstanceState) | ||
binding = ActivityDetail2Binding.inflate(layoutInflater) | ||
setContentView(binding.root) | ||
|
||
val data = intent.getParcelableExtra<PostResponse>("data") | ||
if (data!=null){ | ||
binding.textView3.text = data.title | ||
binding.tvDev.text = data.developer | ||
binding.tvDescription.text = data.short_description | ||
binding.tvPlatform.text = "Platform : ${data.platform}" | ||
binding.tvRelase.text = "Release Date : ${data.release_date}" | ||
binding.tvGenre.text = "Genre : ${data.genre}" | ||
binding.apply { | ||
Glide.with(this@DetailActivity2) | ||
.load(data.thumbnail) | ||
.transition(DrawableTransitionOptions.withCrossFade()) | ||
.centerCrop() | ||
.into(imageView2) | ||
} | ||
binding.apply { | ||
Glide.with(this@DetailActivity2) | ||
.load(data.thumbnail) | ||
.transition(DrawableTransitionOptions.withCrossFade()) | ||
.centerCrop() | ||
.circleCrop() | ||
.into(ivProfile) | ||
} | ||
|
||
} | ||
} | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,17 @@ | ||
package com.example.games | ||
|
||
import android.os.Parcelable | ||
import kotlinx.android.parcel.Parcelize | ||
|
||
|
||
@Parcelize | ||
data class PostResponse( | ||
val id: Int, | ||
val title: String, | ||
val developer: String, | ||
val thumbnail: String | ||
) | ||
val thumbnail: String, | ||
val short_description: String, | ||
val platform: String, | ||
val release_date: String, | ||
val genre: String | ||
):Parcelable |
17 changes: 0 additions & 17 deletions
17
app/src/main/java/com/example/games/detail/DetailActivity.kt
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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,145 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" | ||
xmlns:app="http://schemas.android.com/apk/res-auto" | ||
xmlns:tools="http://schemas.android.com/tools" | ||
android:layout_width="match_parent" | ||
android:layout_height="match_parent" | ||
android:backgroundTint="@color/rvback" | ||
android:background="@color/rvback" | ||
tools:context=".DetailActivity2"> | ||
|
||
<ImageView | ||
android:id="@+id/imageView2" | ||
android:layout_width="415dp" | ||
android:layout_height="174dp" | ||
app:layout_constraintBottom_toBottomOf="parent" | ||
app:layout_constraintEnd_toEndOf="parent" | ||
app:layout_constraintStart_toStartOf="parent" | ||
app:layout_constraintTop_toTopOf="parent" | ||
app:layout_constraintVertical_bias="0.0" | ||
tools:srcCompat="@tools:sample/avatars" /> | ||
|
||
<TextView | ||
android:id="@+id/textView3" | ||
android:layout_width="wrap_content" | ||
android:layout_height="wrap_content" | ||
android:text="TextView" | ||
android:textColor="#FFFFFF" | ||
android:textSize="24sp" | ||
android:textStyle="bold" | ||
app:layout_constraintBottom_toBottomOf="parent" | ||
app:layout_constraintEnd_toEndOf="parent" | ||
app:layout_constraintHorizontal_bias="0.131" | ||
app:layout_constraintStart_toStartOf="parent" | ||
app:layout_constraintTop_toTopOf="parent" | ||
app:layout_constraintVertical_bias="0.396" /> | ||
|
||
<TextView | ||
android:id="@+id/tvDev" | ||
android:layout_width="wrap_content" | ||
android:layout_height="wrap_content" | ||
android:text="TextView" | ||
android:textColor="#B6B6B6" | ||
app:layout_constraintBottom_toBottomOf="parent" | ||
app:layout_constraintEnd_toEndOf="@+id/textView3" | ||
app:layout_constraintHorizontal_bias="0.0" | ||
app:layout_constraintStart_toStartOf="@+id/textView3" | ||
app:layout_constraintTop_toBottomOf="@+id/textView3" | ||
app:layout_constraintVertical_bias="0.0" /> | ||
|
||
<ImageView | ||
android:id="@+id/ivProfile" | ||
android:layout_width="156dp" | ||
android:layout_height="166dp" | ||
app:layout_constraintBottom_toBottomOf="parent" | ||
app:layout_constraintEnd_toEndOf="parent" | ||
app:layout_constraintHorizontal_bias="0.109" | ||
app:layout_constraintStart_toStartOf="parent" | ||
app:layout_constraintTop_toTopOf="parent" | ||
app:layout_constraintVertical_bias="0.176" | ||
tools:srcCompat="@tools:sample/avatars" /> | ||
|
||
<androidx.cardview.widget.CardView | ||
android:id="@+id/cardView" | ||
android:layout_width="394dp" | ||
android:layout_height="252dp" | ||
android:layout_marginStart="2dp" | ||
android:layout_marginTop="32dp" | ||
android:backgroundTint="@color/cvback" | ||
app:cardCornerRadius="15dp" | ||
app:layout_constraintBottom_toBottomOf="parent" | ||
app:layout_constraintEnd_toEndOf="parent" | ||
app:layout_constraintHorizontal_bias="0.4" | ||
app:layout_constraintStart_toStartOf="parent" | ||
app:layout_constraintTop_toTopOf="parent" | ||
app:layout_constraintVertical_bias="0.728"> | ||
|
||
<androidx.constraintlayout.widget.ConstraintLayout | ||
android:layout_width="match_parent" | ||
android:layout_height="match_parent"> | ||
|
||
<TextView | ||
android:id="@+id/tvDescription" | ||
android:layout_width="335dp" | ||
android:layout_height="wrap_content" | ||
android:text="TextView" | ||
android:textColor="#B6B6B6" | ||
app:layout_constraintBottom_toBottomOf="parent" | ||
app:layout_constraintEnd_toEndOf="parent" | ||
app:layout_constraintHorizontal_bias="0.271" | ||
app:layout_constraintStart_toStartOf="parent" | ||
app:layout_constraintTop_toTopOf="parent" | ||
app:layout_constraintVertical_bias="0.214" /> | ||
|
||
<TextView | ||
android:id="@+id/tvPlatform" | ||
android:layout_width="wrap_content" | ||
android:layout_height="wrap_content" | ||
android:text="TextView" | ||
android:textColor="#B6B6B6" | ||
app:layout_constraintBottom_toBottomOf="parent" | ||
app:layout_constraintStart_toStartOf="@+id/tvDescription" | ||
app:layout_constraintTop_toBottomOf="@+id/tvDescription" | ||
app:layout_constraintVertical_bias="0.08" /> | ||
|
||
<TextView | ||
android:id="@+id/textView4" | ||
android:layout_width="wrap_content" | ||
android:layout_height="wrap_content" | ||
android:text="About Game" | ||
android:textColor="#B6B6B6" | ||
android:textSize="20sp" | ||
android:textStyle="bold" | ||
app:layout_constraintBottom_toTopOf="@+id/tvDescription" | ||
app:layout_constraintEnd_toEndOf="parent" | ||
app:layout_constraintHorizontal_bias="0.047" | ||
app:layout_constraintStart_toStartOf="parent" | ||
app:layout_constraintTop_toTopOf="parent" | ||
app:layout_constraintVertical_bias="0.551" /> | ||
|
||
<TextView | ||
android:id="@+id/tvRelase" | ||
android:layout_width="wrap_content" | ||
android:layout_height="wrap_content" | ||
android:text="TextView" | ||
android:textColor="#B6B6B6" | ||
app:layout_constraintBottom_toBottomOf="parent" | ||
app:layout_constraintStart_toStartOf="@+id/tvPlatform" | ||
app:layout_constraintTop_toBottomOf="@+id/tvPlatform" | ||
app:layout_constraintVertical_bias="0.121" /> | ||
|
||
<TextView | ||
android:id="@+id/tvGenre" | ||
android:layout_width="wrap_content" | ||
android:layout_height="wrap_content" | ||
android:text="TextView" | ||
android:textColor="#B6B6B6" | ||
app:layout_constraintBottom_toBottomOf="parent" | ||
app:layout_constraintStart_toStartOf="@+id/tvRelase" | ||
app:layout_constraintTop_toBottomOf="@+id/tvRelase" | ||
app:layout_constraintVertical_bias="0.195" /> | ||
</androidx.constraintlayout.widget.ConstraintLayout> | ||
|
||
</androidx.cardview.widget.CardView> | ||
|
||
</androidx.constraintlayout.widget.ConstraintLayout> |