-
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
385e9cc
commit f0a5490
Showing
23 changed files
with
397 additions
and
31 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
22 changes: 22 additions & 0 deletions
22
app/src/main/java/com/henryudorji/theater/adapters/ViewpagerAdapter.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,22 @@ | ||
package com.henryudorji.theater.adapters | ||
|
||
import androidx.fragment.app.Fragment | ||
import androidx.fragment.app.FragmentPagerAdapter | ||
import androidx.viewpager2.adapter.FragmentStateAdapter | ||
|
||
// | ||
// Created by hash on 5/2/2021. | ||
// | ||
class ViewpagerAdapter( | ||
fragment: Fragment, | ||
private val fragments: MutableList<Fragment> | ||
): FragmentStateAdapter(fragment) { | ||
|
||
override fun getItemCount(): Int { | ||
return fragments.size | ||
} | ||
|
||
override fun createFragment(position: Int): Fragment { | ||
return fragments[position] | ||
} | ||
} |
9 changes: 0 additions & 9 deletions
9
app/src/main/java/com/henryudorji/theater/base/BaseFragment.kt
This file was deleted.
Oops, something went wrong.
7 changes: 7 additions & 0 deletions
7
app/src/main/java/com/henryudorji/theater/data/remote/ServiceApi.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,7 @@ | ||
package com.henryudorji.theater.data.remote | ||
|
||
// | ||
// Created by hash on 5/2/2021. | ||
// | ||
interface ServiceApi { | ||
} |
7 changes: 7 additions & 0 deletions
7
app/src/main/java/com/henryudorji/theater/data/remote/ServiceGenerator.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,7 @@ | ||
package com.henryudorji.theater.data.remote | ||
|
||
// | ||
// Created by hash on 5/2/2021. | ||
// | ||
class ServiceGenerator { | ||
} |
46 changes: 46 additions & 0 deletions
46
app/src/main/java/com/henryudorji/theater/ui/fragments/HomeFragment.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,46 @@ | ||
package com.henryudorji.theater.ui.fragments | ||
|
||
import android.os.Bundle | ||
import android.view.View | ||
import androidx.fragment.app.Fragment | ||
import com.google.android.material.tabs.TabLayoutMediator | ||
import com.henryudorji.theater.R | ||
import com.henryudorji.theater.adapters.ViewpagerAdapter | ||
import com.henryudorji.theater.databinding.FragmentHomeBinding | ||
|
||
// | ||
// Created by hash on 5/2/2021. | ||
// | ||
class HomeFragment: Fragment(R.layout.fragment_home) { | ||
private lateinit var binding: FragmentHomeBinding | ||
private lateinit var viewpagerAdapter: ViewpagerAdapter | ||
private lateinit var fragments: MutableList<Fragment> | ||
private var tabLayoutMediator: TabLayoutMediator? = null | ||
|
||
override fun onViewCreated(view: View, savedInstanceState: Bundle?) { | ||
super.onViewCreated(view, savedInstanceState) | ||
binding = FragmentHomeBinding.bind(view) | ||
|
||
initViews() | ||
} | ||
|
||
private fun initViews() { | ||
fragments = mutableListOf( | ||
MoviesFragment(), | ||
TvSeriesFragment(), | ||
TrendingFragment() | ||
) | ||
viewpagerAdapter = ViewpagerAdapter(this, fragments) | ||
binding.viewpager.adapter = viewpagerAdapter | ||
|
||
TabLayoutMediator(binding.tabs, binding.viewpager) {tab, position -> | ||
when(position) { | ||
0 -> tab.text = "MOVIES" | ||
1 -> tab.text = "TV SERIES" | ||
2 -> tab.text = "TRENDING" | ||
} | ||
binding.viewpager.currentItem = tab.position | ||
}.attach() | ||
} | ||
|
||
} |
20 changes: 20 additions & 0 deletions
20
app/src/main/java/com/henryudorji/theater/ui/fragments/MovieDetailFragment.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,20 @@ | ||
package com.henryudorji.theater.ui.fragments | ||
|
||
import android.os.Bundle | ||
import android.view.View | ||
import androidx.fragment.app.Fragment | ||
import com.henryudorji.theater.R | ||
import com.henryudorji.theater.databinding.FragmentHomeBinding | ||
import com.henryudorji.theater.databinding.FragmentMovieDetailBinding | ||
|
||
// | ||
// Created by hash on 5/2/2021. | ||
// | ||
class MovieDetailFragment: Fragment(R.layout.fragment_movie_detail) { | ||
private lateinit var binding: FragmentMovieDetailBinding | ||
|
||
override fun onViewCreated(view: View, savedInstanceState: Bundle?) { | ||
super.onViewCreated(view, savedInstanceState) | ||
binding = FragmentMovieDetailBinding.bind(view) | ||
} | ||
} |
21 changes: 21 additions & 0 deletions
21
app/src/main/java/com/henryudorji/theater/ui/fragments/MovieListFragment.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,21 @@ | ||
package com.henryudorji.theater.ui.fragments | ||
|
||
import android.os.Bundle | ||
import android.view.View | ||
import androidx.fragment.app.Fragment | ||
import com.henryudorji.theater.R | ||
import com.henryudorji.theater.databinding.FragmentHomeBinding | ||
import com.henryudorji.theater.databinding.FragmentMovieDetailBinding | ||
import com.henryudorji.theater.databinding.FragmentMovieListBinding | ||
|
||
// | ||
// Created by hash on 5/2/2021. | ||
// | ||
class MovieListFragment: Fragment(R.layout.fragment_movie_list) { | ||
private lateinit var binding: FragmentMovieListBinding | ||
|
||
override fun onViewCreated(view: View, savedInstanceState: Bundle?) { | ||
super.onViewCreated(view, savedInstanceState) | ||
binding = FragmentMovieListBinding.bind(view) | ||
} | ||
} |
20 changes: 20 additions & 0 deletions
20
app/src/main/java/com/henryudorji/theater/ui/fragments/MoviesFragment.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,20 @@ | ||
package com.henryudorji.theater.ui.fragments | ||
|
||
import android.os.Bundle | ||
import android.view.View | ||
import androidx.fragment.app.Fragment | ||
import com.henryudorji.theater.R | ||
import com.henryudorji.theater.databinding.FragmentHomeBinding | ||
import com.henryudorji.theater.databinding.FragmentMovieDetailBinding | ||
|
||
// | ||
// Created by hash on 5/2/2021. | ||
// | ||
class MoviesFragment: Fragment(R.layout.fragment_home_detail) { | ||
private lateinit var binding: FragmentMovieDetailBinding | ||
|
||
override fun onViewCreated(view: View, savedInstanceState: Bundle?) { | ||
super.onViewCreated(view, savedInstanceState) | ||
binding = FragmentMovieDetailBinding.bind(view) | ||
} | ||
} |
20 changes: 20 additions & 0 deletions
20
app/src/main/java/com/henryudorji/theater/ui/fragments/TrendingFragment.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,20 @@ | ||
package com.henryudorji.theater.ui.fragments | ||
|
||
import android.os.Bundle | ||
import android.view.View | ||
import androidx.fragment.app.Fragment | ||
import com.henryudorji.theater.R | ||
import com.henryudorji.theater.databinding.FragmentHomeBinding | ||
import com.henryudorji.theater.databinding.FragmentMovieDetailBinding | ||
|
||
// | ||
// Created by hash on 5/2/2021. | ||
// | ||
class TrendingFragment: Fragment(R.layout.fragment_home_detail) { | ||
private lateinit var binding: FragmentMovieDetailBinding | ||
|
||
override fun onViewCreated(view: View, savedInstanceState: Bundle?) { | ||
super.onViewCreated(view, savedInstanceState) | ||
binding = FragmentMovieDetailBinding.bind(view) | ||
} | ||
} |
20 changes: 20 additions & 0 deletions
20
app/src/main/java/com/henryudorji/theater/ui/fragments/TvSeriesFragment.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,20 @@ | ||
package com.henryudorji.theater.ui.fragments | ||
|
||
import android.os.Bundle | ||
import android.view.View | ||
import androidx.fragment.app.Fragment | ||
import com.henryudorji.theater.R | ||
import com.henryudorji.theater.databinding.FragmentHomeBinding | ||
import com.henryudorji.theater.databinding.FragmentMovieDetailBinding | ||
|
||
// | ||
// Created by hash on 5/2/2021. | ||
// | ||
class TvSeriesFragment: Fragment(R.layout.fragment_home_detail) { | ||
private lateinit var binding: FragmentMovieDetailBinding | ||
|
||
override fun onViewCreated(view: View, savedInstanceState: Bundle?) { | ||
super.onViewCreated(view, savedInstanceState) | ||
binding = FragmentMovieDetailBinding.bind(view) | ||
} | ||
} |
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,9 @@ | ||
package com.henryudorji.theater.utils | ||
|
||
// | ||
// Created by hash on 5/2/2021. | ||
// | ||
class Resource( | ||
|
||
) { | ||
} |
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 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<shape xmlns:android="http://schemas.android.com/apk/res/android" | ||
android:shape="rectangle"> | ||
|
||
<solid android:color="@color/app_background_color"/> | ||
<corners android:radius="@dimen/_5sdp"/> | ||
<stroke android:width="@dimen/_1sdp" | ||
android:color="@color/red"/> | ||
|
||
</shape> |
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,5 @@ | ||
<vector android:height="24dp" android:tint="@color/white" | ||
android:viewportHeight="24" android:viewportWidth="24" | ||
android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android"> | ||
<path android:fillColor="@android:color/white" android:pathData="M15.5,14h-0.79l-0.28,-0.27C15.41,12.59 16,11.11 16,9.5 16,5.91 13.09,3 9.5,3S3,5.91 3,9.5 5.91,16 9.5,16c1.61,0 3.09,-0.59 4.23,-1.57l0.27,0.28v0.79l5,4.99L20.49,19l-4.99,-5zM9.5,14C7.01,14 5,11.99 5,9.5S7.01,5 9.5,5 14,7.01 14,9.5 11.99,14 9.5,14z"/> | ||
</vector> |
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,18 +1,28 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" | ||
<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" | ||
tools:context=".MainActivity"> | ||
|
||
<TextView | ||
android:layout_width="wrap_content" | ||
android:layout_height="wrap_content" | ||
android:text="Hello World!" | ||
app:layout_constraintBottom_toBottomOf="parent" | ||
app:layout_constraintLeft_toLeftOf="parent" | ||
app:layout_constraintRight_toRightOf="parent" | ||
app:layout_constraintTop_toTopOf="parent" /> | ||
<FrameLayout | ||
android:layout_width="match_parent" | ||
android:layout_height="match_parent"> | ||
|
||
<fragment | ||
android:id="@+id/navHostFragment" | ||
android:name="androidx.navigation.fragment.NavHostFragment" | ||
android:layout_width="match_parent" | ||
android:layout_height="match_parent" | ||
app:defaultNavHost="true" | ||
app:layout_constraintBottom_toBottomOf="parent" | ||
app:layout_constraintEnd_toEndOf="parent" | ||
app:layout_constraintStart_toStartOf="parent" | ||
app:layout_constraintTop_toBottomOf="parent" | ||
app:navGraph="@navigation/nav_graph" /> | ||
|
||
</FrameLayout> | ||
|
||
</androidx.constraintlayout.widget.ConstraintLayout> |
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,59 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<androidx.constraintlayout.widget.ConstraintLayout | ||
xmlns:android="http://schemas.android.com/apk/res/android" | ||
android:layout_width="match_parent" | ||
android:layout_height="match_parent" | ||
android:background="@color/app_background_color" | ||
xmlns:app="http://schemas.android.com/apk/res-auto"> | ||
|
||
<com.google.android.material.appbar.AppBarLayout | ||
android:id="@+id/appBar" | ||
android:layout_width="match_parent" | ||
android:layout_height="wrap_content" | ||
android:orientation="vertical" | ||
android:background="@color/app_background_color" | ||
app:layout_constraintTop_toTopOf="parent" | ||
app:layout_constraintStart_toStartOf="parent" | ||
app:layout_constraintEnd_toEndOf="parent"> | ||
|
||
<EditText | ||
android:layout_width="match_parent" | ||
android:layout_height="wrap_content" | ||
android:id="@+id/searchEdit" | ||
android:hint="Search..." | ||
android:inputType="text" | ||
android:fontFamily="@font/raleway_regular" | ||
android:textColorHint="@color/white" | ||
android:textColor="@color/white" | ||
android:padding="@dimen/_10sdp" | ||
android:drawableEnd="@drawable/ic_search" | ||
android:layout_marginTop="@dimen/_10sdp" | ||
android:layout_marginStart="@dimen/_10sdp" | ||
android:layout_marginEnd="@dimen/_10sdp" | ||
android:background="@drawable/edit_bg"/> | ||
|
||
|
||
<com.google.android.material.tabs.TabLayout | ||
android:id="@+id/tabs" | ||
android:layout_width="wrap_content" | ||
android:layout_height="wrap_content" | ||
app:tabGravity="start" | ||
app:tabMode="scrollable" | ||
app:tabIndicatorFullWidth="false" | ||
app:tabContentStart="0dp" | ||
app:tabTextAppearance="@style/TabTextStyle" | ||
app:tabIndicatorColor="@color/red" | ||
app:tabTextColor="@color/gray" | ||
app:tabSelectedTextColor="@color/white" | ||
android:background="@color/app_background_color"/> | ||
</com.google.android.material.appbar.AppBarLayout> | ||
|
||
<androidx.viewpager2.widget.ViewPager2 | ||
android:id="@+id/viewpager" | ||
android:layout_width="match_parent" | ||
android:layout_height="0dp" | ||
app:layout_constraintTop_toBottomOf="@id/appBar" | ||
app:layout_constraintStart_toStartOf="parent" | ||
app:layout_constraintEnd_toEndOf="parent" | ||
app:layout_constraintBottom_toBottomOf="parent"/> | ||
</androidx.constraintlayout.widget.ConstraintLayout> |
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,15 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" | ||
android:layout_width="match_parent" | ||
android:layout_height="match_parent" | ||
xmlns:app="http://schemas.android.com/apk/res-auto" | ||
android:background="@color/app_background_color"> | ||
|
||
<androidx.recyclerview.widget.RecyclerView | ||
android:layout_width="match_parent" | ||
android:layout_height="wrap_content" | ||
android:id="@+id/genreRecyclerView" | ||
app:layout_constraintTop_toTopOf="parent" | ||
app:layout_constraintStart_toStartOf="parent" | ||
app:layout_constraintEnd_toEndOf="parent"/> | ||
</androidx.constraintlayout.widget.ConstraintLayout> |
Oops, something went wrong.