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
// Custom Type Adapters for Moshi | |
val userMoshi = Moshi.Builder().add(CustomDateAdapter()).add(T).build() | |
//add Moshi builder in Converter Facrory | |
val retrofit = Retrofit.Builder() | |
.baseUrl("https://dl.dropboxusercontent.com/") | |
.addConverterFactory(MoshiConverterFactory.create(userMoshi)) | |
.addCallAdapterFactory(RxJava2CallAdapterFactory.create()) | |
.build() |
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
1. A Custom ScrollView Class to listen to scroll changes | |
class ParallaxScrollView : ScrollView { | |
private var scrollViewListener: ScrollViewListener? = null | |
interface ScrollViewListener { | |
fun onScrollChanged(scrollView: TestScrollView, x: Int, y: Int, oldx: Int, oldy: Int) | |
} |
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
class RoundedImageView @JvmOverloads constructor( | |
context: Context, | |
attrs: AttributeSet? = null, | |
defStyleAttr: Int = 0 | |
) : AppCompatImageView( | |
context, attrs, defStyleAttr | |
) { | |
private var rectF: RectF? = null | |
private val path = Path() |
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
public class RoundedRelativeLayout extends RelativeLayout { | |
private RectF rectF; | |
private Path path = new Path(); | |
private float cornerRadius = 20; | |
public RoundedRelativeLayout(Context context) { | |
super(context); | |
} |