Skip to content

Commit

Permalink
code fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
ifechukwu committed Dec 27, 2021
1 parent db03c99 commit 4f78a46
Show file tree
Hide file tree
Showing 8 changed files with 54 additions and 39 deletions.
11 changes: 7 additions & 4 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@ plugins {
}

android {
compileSdkVersion 30
buildToolsVersion "31.0.0 rc5"
compileSdkVersion 31
buildToolsVersion "32.0.0"

defaultConfig {
applicationId "com.henryudorji.theater"
minSdkVersion 21
targetSdkVersion 30
targetSdkVersion 31
versionCode 1
versionName "1.0"

Expand Down Expand Up @@ -58,7 +58,7 @@ android {
dependencies {

implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
implementation 'androidx.core:core-ktx:1.6.0'
implementation 'androidx.core:core-ktx:1.7.0'
implementation 'androidx.appcompat:appcompat:1.3.1'
implementation 'com.google.android.material:material:1.4.0'
implementation 'androidx.constraintlayout:constraintlayout:2.1.0'
Expand Down Expand Up @@ -127,6 +127,9 @@ dependencies {

//Fast Adapter
implementation "com.mikepenz:fastadapter:5.4.1"

//Show more text
implementation 'com.github.mahimrocky:ShowMoreText:1.0.2'
}
kapt {
correctErrorTypes true
Expand Down
3 changes: 2 additions & 1 deletion app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@
android:supportsRtl="true"
android:theme="@style/SplashTheme">
<activity android:name=".ui.MainActivity"
android:windowSoftInputMode="stateHidden">
android:windowSoftInputMode="stateHidden"
android:exported="true">
<intent-filter>
<action android:name="android.intent.action.MAIN" />

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -328,6 +328,7 @@ class MovieDetailFragment: BaseFragment<FragmentMovieDetailBinding, DetailsViewM

showAllReviewsText.setOnClickListener {
//@todo review
Snackbar.make(binding.root, "Feature coming soon", Snackbar.LENGTH_SHORT).show()
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,12 @@ class ReviewRvAdapter(): RecyclerView.Adapter<ReviewRvAdapter.ReviewViewHolder>(
.into(authorImage)
authorName.text = review.authorDetails.name
ratingText.text = review.authorDetails.rating.toString()
reviewContent.text = review.content
reviewContent.apply {
text = review.content
setShowingLine(5)
setShowMoreColor(resources.getColor(R.color.red, null))
setShowLessTextColor(resources.getColor(R.color.red, null))
}
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,9 @@ class TrailerVideoRvAdapter(val lifecycle: Lifecycle) : RecyclerView.Adapter<Tra
youtubePlayerView.addYouTubePlayerListener(object : AbstractYouTubePlayerListener() {
override fun onReady(youTubePlayer: YouTubePlayer) {
val videoId = video.key
youTubePlayer.loadVideo(videoId, 0f)
youTubePlayer.cueVideo(videoId, 0f)
}
})

}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -172,27 +172,30 @@ class HomeMoviesFragment: BaseFragment<FragmentHomeDetailBinding, HomeViewModel>
}

binding.showAllPopularText.setOnClickListener {
val bundle = Bundle().apply {
putString(MOVIE_CATEGORY, POPULAR)
putInt(FRAG_ID, MOVIE)
}
findNavController().navigate(R.id.action_homeFragment_to_movieListFragment, bundle)
// val bundle = Bundle().apply {
// putString(MOVIE_CATEGORY, POPULAR)
// putInt(FRAG_ID, MOVIE)
// }
// findNavController().navigate(R.id.action_homeFragment_to_movieListFragment, bundle)
Snackbar.make(binding.root, "Feature coming soon", Snackbar.LENGTH_SHORT).show()
}

binding.showAllUpcomingMoviesText.setOnClickListener {
val bundle = Bundle().apply {
putString(MOVIE_CATEGORY, UPCOMING)
putInt(FRAG_ID, MOVIE)
}
findNavController().navigate(R.id.action_homeFragment_to_movieListFragment, bundle)
// val bundle = Bundle().apply {
// putString(MOVIE_CATEGORY, UPCOMING)
// putInt(FRAG_ID, MOVIE)
// }
// findNavController().navigate(R.id.action_homeFragment_to_movieListFragment, bundle)
Snackbar.make(binding.root, "Feature coming soon", Snackbar.LENGTH_SHORT).show()
}

binding.showAllTopRatedMoviesText.setOnClickListener {
val bundle = Bundle().apply {
putString(MOVIE_CATEGORY, TOP_RATED)
putInt(FRAG_ID, MOVIE)
}
findNavController().navigate(R.id.action_homeFragment_to_movieListFragment, bundle)
// val bundle = Bundle().apply {
// putString(MOVIE_CATEGORY, TOP_RATED)
// putInt(FRAG_ID, MOVIE)
// }
// findNavController().navigate(R.id.action_homeFragment_to_movieListFragment, bundle)
Snackbar.make(binding.root, "Feature coming soon", Snackbar.LENGTH_SHORT).show()
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -171,28 +171,31 @@ class HomeTvSeriesFragment: BaseFragment<FragmentHomeDetailBinding, HomeViewMode


binding.showAllPopularText.setOnClickListener {
val bundle = Bundle().apply {
putString(MOVIE_CATEGORY, POPULAR)
putInt(FRAG_ID, TV_SERIES)
}
findNavController().navigate(R.id.action_homeFragment_to_movieListFragment, bundle)
// val bundle = Bundle().apply {
// putString(MOVIE_CATEGORY, POPULAR)
// putInt(FRAG_ID, TV_SERIES)
// }
// findNavController().navigate(R.id.action_homeFragment_to_movieListFragment, bundle)
Snackbar.make(binding.root, "Feature coming soon", Snackbar.LENGTH_SHORT).show()
}

//Latest is the same as Upcoming
binding.showAllUpcomingMoviesText.setOnClickListener {
val bundle = Bundle().apply {
putString(MOVIE_CATEGORY, ON_THE_AIR)
putInt(FRAG_ID, TV_SERIES)
}
findNavController().navigate(R.id.action_homeFragment_to_movieListFragment, bundle)
// val bundle = Bundle().apply {
// putString(MOVIE_CATEGORY, ON_THE_AIR)
// putInt(FRAG_ID, TV_SERIES)
// }
// findNavController().navigate(R.id.action_homeFragment_to_movieListFragment, bundle)
Snackbar.make(binding.root, "Feature coming soon", Snackbar.LENGTH_SHORT).show()
}

binding.showAllTopRatedMoviesText.setOnClickListener {
val bundle = Bundle().apply {
putString(MOVIE_CATEGORY, TOP_RATED)
putInt(FRAG_ID, TV_SERIES)
}
findNavController().navigate(R.id.action_homeFragment_to_movieListFragment, bundle)
// val bundle = Bundle().apply {
// putString(MOVIE_CATEGORY, TOP_RATED)
// putInt(FRAG_ID, TV_SERIES)
// }
// findNavController().navigate(R.id.action_homeFragment_to_movieListFragment, bundle)
Snackbar.make(binding.root, "Feature coming soon", Snackbar.LENGTH_SHORT).show()
}
}
}
2 changes: 1 addition & 1 deletion app/src/main/res/layout/rv_review_layout.xml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
app:layout_constraintEnd_toEndOf="parent"
/>

<TextView
<com.skyhope.showmoretextview.ShowMoreTextView
android:id="@+id/reviewContent"
android:layout_width="0dp"
android:layout_height="wrap_content"
Expand Down

0 comments on commit 4f78a46

Please sign in to comment.