diff --git a/app/src/main/java/org/dnss/sfs/git/wdg/noise/MainActivity.kt b/app/src/main/java/org/dnss/sfs/git/wdg/noise/MainActivity.kt index c1920a1..a78ec0e 100644 --- a/app/src/main/java/org/dnss/sfs/git/wdg/noise/MainActivity.kt +++ b/app/src/main/java/org/dnss/sfs/git/wdg/noise/MainActivity.kt @@ -1,7 +1,10 @@ package org.dnss.sfs.git.wdg.noise +import android.graphics.Color import android.os.Bundle import android.view.Menu +import android.widget.Button +import android.widget.LinearLayout import com.google.android.material.snackbar.Snackbar import com.google.android.material.navigation.NavigationView import androidx.navigation.findNavController @@ -54,4 +57,17 @@ class MainActivity : AppCompatActivity() { val navController = findNavController(R.id.nav_host_fragment_content_main) return navController.navigateUp(appBarConfiguration) || super.onSupportNavigateUp() } + + fun addButton(text: String) { + val dynamicButton = Button(this) + dynamicButton.layoutParams = LinearLayout.LayoutParams( + LinearLayout.LayoutParams.WRAP_CONTENT, + LinearLayout.LayoutParams.WRAP_CONTENT + ) + dynamicButton.text = "Dynamic Button" + dynamicButton.setBackgroundColor(Color.GREEN) + // add Button to LinearLayout + //linearLayout.addView(dynamicButton) + } + } \ No newline at end of file