This is how I actually got all this stuff to work together. It'll attrophy over time but as of May 2013 it works. Maybe I'll keep it up to date.
Generally, this document is a a mashup of the following tutorials.
This is how I actually got all this stuff to work together. It'll attrophy over time but as of May 2013 it works. Maybe I'll keep it up to date.
Generally, this document is a a mashup of the following tutorials.
This is how I actually got all this stuff to work together. It'll attrophy over time but as of June 2013 it works. Maybe I'll keep it up to date.
Generally, this document is a a mashup of the following tutorials and pages...
package base.util; | |
import android.app.Activity; | |
import android.app.AlertDialog; | |
import android.content.DialogInterface; | |
import app.R; | |
import retrofit.RetrofitError; | |
import retrofit.mime.TypedByteArray; |
abstract class AnkoRecyclerViewAdapter<Model : Any, AnkoView : AnkoComponent<ViewGroup>, ViewHolder : RecyclerView.ViewHolder> : RecyclerView.Adapter<ViewHolder>() { | |
abstract val data: List<Model> // Data list | |
abstract val ankoView: AnkoView // Layout as AnkoComponent<ViewGroup> | |
abstract fun ViewHolder.setup(model: Model) // setup model from ViewHolder | |
abstract val onItemClickListenerUnit: (Model) -> Unit // Item Click Listener | |
override fun onBindViewHolder(holder: ViewHolder, position: Int) { | |
holder.setup(data[position]) | |
holder.itemView.setOnClickListener { |
class LoginActivity : AppCompatActivity() { | |
private val vm: LoginViewModel by viewModels() | |
private lateinit var binding: ActivityLoginBinding | |
override fun onCreate(savedInstanceState: Bundle?) { | |
super.onCreate(savedInstanceState) | |
binding = ActivityLoginBinding.inflate(layoutInflater) | |
setContentView(binding.root) |