This file contains hidden or 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
package com.example.uicomponents | |
import android.content.Context | |
import android.os.Handler | |
import android.util.AttributeSet | |
import android.widget.TextView | |
class TypeWriteTextView(context: Context?, attrs: AttributeSet?) : TextView(context, attrs) { | |
private var textList: List<String> = emptyList() |
This file contains hidden or 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
class PageDotDecorator( | |
private val itemCount: Int, | |
private val context: Context? | |
) : RecyclerView.ItemDecoration() {} |
This file contains hidden or 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
// Inside ItemDecoration class | |
private val dotDeselected: Paint = Paint().apply { | |
style = Paint.Style.FILL | |
color = Color.GRAY | |
} | |
private val dotSelected = Paint().apply { | |
style = Paint.Style.FILL | |
color = Color.BLACK |
This file contains hidden or 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
//List of Coordinates each dots positioned | |
private val dots = mutableListOf<Pair<Float, Float>>() | |
companion object { | |
/** | |
* Draw Parameters | |
*/ | |
const val DOT_RADIUS = 3f | |
const val DOT_PADDING = 6f | |
} |
This file contains hidden or 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
override fun onDraw( | |
canvas: Canvas, | |
parent: RecyclerView, | |
state: RecyclerView.State | |
) { | |
//This is to calculate the positions of the circles, but only once when the decorator first initiate. | |
//This is here because we need the RecyclerView's width to calculate the position of each circles/dots. | |
if (!indicatorInitialized) { | |
setupIndicators(parent) |
This file contains hidden or 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
class PageDotDecorator( | |
private val itemCount: Int, | |
private val context: Context? | |
) : RecyclerView.ItemDecoration() { | |
companion object { | |
/** | |
* Draw Parameters | |
*/ | |
const val DOT_RADIUS = 3f |
This file contains hidden or 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
import android.content.Context | |
import android.net.ConnectivityManager | |
import android.net.Network | |
import android.net.NetworkCapabilities | |
import android.net.NetworkRequest | |
import android.os.Bundle | |
import android.widget.TextView | |
import androidx.appcompat.app.AppCompatActivity | |
import androidx.lifecycle.ViewModel | |
import androidx.lifecycle.ViewModelProvider |
This file contains hidden or 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
package com.some.package.routing | |
import android.content.Context | |
import android.content.Intent | |
import android.net.Uri | |
import android.os.Parcelable | |
import com.some.package.ui.BaseActivity | |
/** | |
* Routable implementation provides usage of navigation between activities |
This file contains hidden or 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
package com.some.package.router | |
import android.content.Context | |
import android.net.Uri | |
import android.os.Parcelable | |
import android.widget.Toast | |
import com.some.package.routing.Routable | |
import com.some.package.ui.moviedetail.presentation.MovieDetailActivity | |
import kotlinx.android.parcel.Parcelize |
This file contains hidden or 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
package com.some.package.base.routing | |
import android.content.Context | |
import android.net.Uri | |
import com.some.package.routing.Routable | |
import com.some.package.router.MovieDetailRouter | |
class Router { | |
companion object { |