package dev.kaderli.magsend

import android.os.Bundle
import androidx.appcompat.app.AppCompatActivity
import androidx.appcompat.widget.Toolbar


abstract class BaseActivity : AppCompatActivity() {
  override fun onCreate(savedInstanceState: Bundle?) {
    super.onCreate(savedInstanceState)
    setContentView(getLayoutId())

    val toolbar: Toolbar = findViewById(R.id.toolbar)
    setSupportActionBar(toolbar)
    if (getLayoutId() != R.layout.activity_main) {
      supportActionBar?.setDisplayHomeAsUpEnabled(true)
    }

    supportActionBar?.title = title
  }

  protected abstract fun getLayoutId(): Int

}
