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
package com.kekyazilim.annotationreflectionexample
import android.support.v7.app.AppCompatActivity
import android.os.Bundle
import android.widget.Button
import android.widget.TextView
import com.kekyazilim.annotationreflectionexample.translator.kotlin.KBindTranslateView
import com.kekyazilim.annotationreflectionexample.translator.kotlin.KViewTranslator
package com.kekyazilim.annotationreflectionexample.translator.kotlin
import android.app.Activity
import android.widget.TextView
import com.kekyazilim.annotationreflectionexample.translator.fakes.FakeTranslatorJson
import java.util.*
object KViewTranslator {
class Cafe {
fun getProduct(name:String): Product{
val cooker = Cooker()
return cooker.prepareProduct(name)
}
}
class Cafe(val cooker: Cooker) {
fun getProduct(name:String): Product{
return cooker.prepareProduct(name)
}
}
class Barmen: Personnel {
override fun prepareProduct(name: String): Product {
// To Do something to get ingredients object by using name
.
.
.
return Product(ingredients)
}
}
class Cooker : Personnel {
override fun prepareProduct(name: String): Product {
// To Do something to get ingredients object by using name
.
.
.
return Product(ingredients)
}
}
interface Personnel {
fun prepareProduct(name: String): Product
}
class Cafe(val personnel: Personnel) {
fun getProduct(name:String): Product{
return personnel.prepareProduct(name)
}
}
class MainActivity : AppCompatActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_main)
val cooker = Cooker()
val cafeOld = Cafe(cooker)
cafeOld.getProduct("makarna")
/**
* Responsible to manage image process
* @author ismailgungor
* @since 1.0
*/
interface IImageProcess {
/**
* This method loads image to target with by using url
*