Skip to content

Instantly share code, notes, and snippets.

View ismailgungor's full-sized avatar
🎯
Focusing

İsmail GÜNGÖR ismailgungor

🎯
Focusing
  • adesso Turkey
View GitHub Profile
@Module
class IntentModule {
@Provides
fun provideIntentHelper(context: Context): IntentHelper {
return IntentHelper(context)
}
}
@Module
class AppModule(val context: Context) {
@Provides
fun provideContext(): Context{
return context
}
}
/**
* Responsible to manage intent process
*
* @author ismailgungor
* @since 1.0
*/
class IntentHelper(private val context: Context) {
/**
* This method provides an intent which opens Main Activity
interface HandlerCallback {
fun onCompleted()
}
/**
* Responsible to manage Handler Process
*
* @author ismailgungor
* @since 1.0
*/
class HandlerProcessManagement {
companion object {
const val DEFAULT_HANDLER_DURATION = 2000L
interface SplashActivityContract {
interface View : BaseView{
fun finishActivity()
}
interface Presenter: BasePresenter<View>{
//Silence is golden
interface BaseView {
fun bindViews()
fun showProgress() {}
fun hideProgress() {}
}
interface BasePresenter<T : BaseView> {
fun setView(view: T)
fun create()
}
class MainActivity : AppCompatActivity() {
private lateinit var ivEvent: ImageView
private lateinit var ivOwner: ImageView
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_main)
ivEvent = findViewById(R.id.iv_event)
class GlideImageHelper(context: Context) : IImageProcess {
private val mGlideInstance = Glide.with(context)
override fun loadUrl(url: String, targetView: ImageView) {
mGlideInstance.load(url).into(targetView)
}
override fun loadUri(uri: Uri, targetView: ImageView) {
mGlideInstance.load(uri).into(targetView)