forked from omni/OmniCards
feat: added card view with full brightness, and center no cards text
This commit is contained in:
@@ -2,6 +2,7 @@ package ru.omni_devel.cards
|
||||
|
||||
import android.content.Intent
|
||||
import android.os.Bundle
|
||||
import android.view.View
|
||||
import android.widget.Button
|
||||
import android.widget.LinearLayout
|
||||
import android.widget.TextView
|
||||
@@ -55,6 +56,7 @@ class MainActivity : AppCompatActivity() {
|
||||
|
||||
text.text = "Add a card to get started"
|
||||
text.layoutParams = params
|
||||
text.textAlignment = View.TEXT_ALIGNMENT_CENTER
|
||||
|
||||
cardsList.addView(text)
|
||||
} else {
|
||||
@@ -71,6 +73,14 @@ class MainActivity : AppCompatActivity() {
|
||||
button.layoutParams = params
|
||||
button.cornerRadius = (12 * resources.displayMetrics.density).toInt()
|
||||
|
||||
button.setOnClickListener {
|
||||
val intent = Intent(this, ShowCardActivity::class.java)
|
||||
|
||||
intent.putExtra("cardId", card.id)
|
||||
|
||||
startActivity(intent)
|
||||
}
|
||||
|
||||
cardsList.addView(button)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user