diff --git a/receiver/src/main/AndroidManifest.xml b/receiver/src/main/AndroidManifest.xml index e2f6ea6c..c4c0eac4 100644 --- a/receiver/src/main/AndroidManifest.xml +++ b/receiver/src/main/AndroidManifest.xml @@ -8,6 +8,17 @@ android:label="@string/app_name" android:roundIcon="@mipmap/ic_launcher_round" android:supportsRtl="true" - android:theme="@style/Theme.Activities" /> + android:theme="@style/Theme.Activities"> + + + + + + + + + \ No newline at end of file diff --git a/receiver/src/main/java/otus/gpb/homework/activities/receiver/ReceiverActivity.kt b/receiver/src/main/java/otus/gpb/homework/activities/receiver/ReceiverActivity.kt index b3fe360c..53fab1d4 100644 --- a/receiver/src/main/java/otus/gpb/homework/activities/receiver/ReceiverActivity.kt +++ b/receiver/src/main/java/otus/gpb/homework/activities/receiver/ReceiverActivity.kt @@ -1,6 +1,8 @@ package otus.gpb.homework.activities.receiver import android.os.Bundle +import android.widget.ImageView +import android.widget.TextView import androidx.appcompat.app.AppCompatActivity class ReceiverActivity : AppCompatActivity() { @@ -8,5 +10,26 @@ class ReceiverActivity : AppCompatActivity() { override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) setContentView(R.layout.activity_receiver) + + val intent = intent.getBundleExtra("movie_bundle") + + val title = intent?.getString("title") + val year = intent?.getString("year") + val description = intent?.getString("description") + + val titleTextView = findViewById(R.id.titleTextView) + val yearTextView = findViewById(R.id.yearTextView) + val descriptionTextView = findViewById(R.id.descriptionTextView) + val imageView = findViewById(R.id.posterImageView) + + titleTextView.text = title + yearTextView.text = year + descriptionTextView.text = description + + when (title) { + "Славные парни" -> imageView.setImageResource(R.drawable.niceguys) + "Интерстеллар" -> imageView.setImageResource(R.drawable.interstellar) + else -> {} + } } } diff --git a/sender/build.gradle b/sender/build.gradle index 9854ad15..64bd41cc 100644 --- a/sender/build.gradle +++ b/sender/build.gradle @@ -40,4 +40,5 @@ dependencies { implementation 'androidx.appcompat:appcompat:1.6.1' implementation 'com.google.android.material:material:1.12.0' implementation 'androidx.constraintlayout:constraintlayout:2.1.4' + implementation 'androidx.activity:activity:1.11.0' } \ No newline at end of file diff --git a/sender/src/main/AndroidManifest.xml b/sender/src/main/AndroidManifest.xml index 1bddc002..a8408d0f 100644 --- a/sender/src/main/AndroidManifest.xml +++ b/sender/src/main/AndroidManifest.xml @@ -7,6 +7,11 @@ android:label="@string/app_name" android:roundIcon="@mipmap/ic_launcher_round" android:supportsRtl="true" - android:theme="@style/Theme.Activities" /> + android:theme="@style/Theme.Activities"> + + + \ No newline at end of file diff --git a/sender/src/main/java/otus/gpb/homework/activities/sender/SenderActivity.kt b/sender/src/main/java/otus/gpb/homework/activities/sender/SenderActivity.kt new file mode 100644 index 00000000..e2e628d7 --- /dev/null +++ b/sender/src/main/java/otus/gpb/homework/activities/sender/SenderActivity.kt @@ -0,0 +1,72 @@ +package otus.gpb.homework.activities.sender + +import android.content.Intent +import android.icu.util.ULocale +import android.os.Bundle +import android.widget.Button +import androidx.activity.enableEdgeToEdge +import androidx.appcompat.app.AppCompatActivity +import androidx.core.view.ViewCompat +import androidx.core.view.WindowInsetsCompat +import otus.gpb.homework.activities.receiver.R +import androidx.core.net.toUri +import java.util.Locale + +class SenderActivity : AppCompatActivity() { + override fun onCreate(savedInstanceState: Bundle?) { + super.onCreate(savedInstanceState) + enableEdgeToEdge() + setContentView(R.layout.activity_sender) + ViewCompat.setOnApplyWindowInsetsListener(findViewById(R.id.main)) { v, insets -> + val systemBars = insets.getInsets(WindowInsetsCompat.Type.systemBars()) + v.setPadding(systemBars.left, systemBars.top, systemBars.right, systemBars.bottom) + insets + } + + val googleMapsBtn = findViewById