Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

25 changes: 24 additions & 1 deletion app/src/main/java/com/example/mymovieinfo/MainActivity.kt
Original file line number Diff line number Diff line change
@@ -1,15 +1,38 @@
package com.example.mymovieinfo

import android.annotation.SuppressLint
import android.app.SearchManager
import androidx.appcompat.app.AppCompatActivity
import android.os.Bundle
import java.io.IOException
import java.io.InputStream
import android.content.Context
import android.content.Intent
import android.view.View
import android.widget.Button
import android.widget.TextView
import android.widget.Toast

class MainActivity : AppCompatActivity() {
@SuppressLint("SetTextI18n")
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_main)

val year = findViewById<TextView>(R.id.txtYear)
val name = findViewById<TextView>(R.id.txtMovieName)
val result = findViewById<TextView>(R.id.txtResults)


val btnFindMyMovie = findViewById<Button>(R.id.btnFindMyMovie)
btnFindMyMovie.setOnClickListener {
// your code to perform when the user clicks on the button

result.text = "the $name was released in $year"
}
Comment on lines +21 to +31
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks like an incomplete feature.
Are you using these anywhere?
If not in use, remove them. Keep the codebase as small as possible to do the job you want to do. Unused code is clutter, and bad documentation, which increases technical debt.
Only complete features, which meet the team's Definition of Done, should be merged to Main/Master.

}





}
9 changes: 6 additions & 3 deletions app/src/main/java/com/example/mymovieinfo/dto/Movie.kt
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,12 @@ package com.example.mymovieinfo.dto

import com.google.gson.annotations.SerializedName

data class Movie(@SerializedName("rank")var rank: Int, @SerializedName("title")var title: String,
@SerializedName("country") var country: String, @SerializedName("boxOfficeGross")var boxOfficeGross: Double,
@SerializedName("openingWeekendGross")var openingWeekendGross: Double, @SerializedName("distributor")var distributor: String){
data class Movie(@SerializedName("rank")var rank: Int,
@SerializedName("title")var title: String,
@SerializedName("country") var country: String,
@SerializedName("boxOfficeGross")var boxOfficeGross: Double,
@SerializedName("openingWeekendGross")var openingWeekendGross: Double,
@SerializedName("distributor")var distributor: String){

override fun toString(): String {
return title
Expand Down
13 changes: 13 additions & 0 deletions app/src/main/java/com/example/mymovieinfo/dto/Specimen.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
package com.example.mymovieinfo.dto

data class Specimen(var movieTitle: String = "",
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Specimen?

var movieRank: Int = 0,
var movieCountry : String = "",
var movieBoxOfficeGross: String = "",
var movieOpeningWeekendGross : String = "",
var movieDistributor : String = "")
{
override fun toString(): String {
return movieTitle
}
}
Comment on lines +4 to +13
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks like an incomplete feature.
Are you using these anywhere? I don't see them used.
If not in use, remove them. Keep the codebase as small as possible to do the job you want to do. Unused code is clutter, and bad documentation, which increases technical debt.
Only complete features, which meet the team's Definition of Done, should be merged to Main/Master.

18 changes: 9 additions & 9 deletions app/src/main/res/layout/activity_main.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
tools:ignore="ExtraText">

<EditText
android:id="@+id/txt_MovieYear"
android:id="@+id/txtYear"
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

since this is pointing to an XML element in an XML file, underscores are OK.

android:layout_width="243dp"
android:layout_height="69dp"
android:layout_marginTop="81dp"
Expand All @@ -18,15 +18,15 @@
android:inputType="datetime"
android:text="@string/movie_year"
android:visibility="visible"
app:layout_constraintBottom_toTopOf="@+id/txt_Results"
app:layout_constraintBottom_toTopOf="@+id/txtResults"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
tools:ignore="LabelFor"
tools:visibility="visible" />

<EditText
android:id="@+id/txt_MovieName"
android:id="@+id/txtMovieName"
android:layout_width="244dp"
android:layout_height="74dp"
android:layout_marginBottom="37dp"
Expand All @@ -35,15 +35,15 @@
android:inputType="text"
android:text="@string/movie_name"
android:visibility="visible"
app:layout_constraintBottom_toTopOf="@+id/btn_FindMyMovie"
app:layout_constraintBottom_toTopOf="@+id/btnFindMyMovie"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/txt_MovieYear"
app:layout_constraintTop_toBottomOf="@+id/txtYear"
tools:ignore="LabelFor"
tools:visibility="visible" />

<Button
android:id="@+id/btn_FindMyMovie"
android:id="@+id/btnFindMyMovie"
style="@style/Widget.AppCompat.Button"
android:layout_width="169dp"
android:layout_height="0dp"
Expand All @@ -54,13 +54,13 @@
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/txt_MovieName"
app:layout_constraintTop_toBottomOf="@+id/txtMovieName"
app:rippleColor="#FFFFFF"
app:strokeColor="#4E4E4E"
tools:visibility="visible" />

<EditText
android:id="@+id/txt_Results"
android:id="@+id/txtResults"
android:layout_width="0dp"
android:layout_height="0dp"
android:layout_marginStart="73dp"
Expand All @@ -72,7 +72,7 @@
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/txt_MovieYear"
app:layout_constraintTop_toBottomOf="@+id/txtYear"
android:importantForAutofill="no"
tools:ignore="LabelFor" />

Expand Down
18 changes: 18 additions & 0 deletions app/src/main/res/xml/searchable.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<?xml version="1.0" encoding="utf-8"?>
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android">

<?xml version="1.0" encoding="utf-8"?>
<searchable xmlns:android="com.google.gson.annotations.SerializedName">
</searchable>

<application>
<activity android:name=".SearchableActivity" >
<intent-filter>
<action android:name="android.intent.action.SEARCH" />
</intent-filter>
<meta-data android:name="android.app.searchable"
android:resource="@xml/searchable"/>
</activity>
</application>

</PreferenceScreen>
Comment on lines +1 to +18
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks like an incomplete feature.
Are you using these anywhere? I don't see them used.
If not in use, remove them. Keep the codebase as small as possible to do the job you want to do. Unused code is clutter, and bad documentation, which increases technical debt.
Only complete features, which meet the team's Definition of Done, should be merged to Main/Master.