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 7c0f6b6..2fb3485 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 @@ -45,6 +45,11 @@ class MainActivity : AppCompatActivity() { ) setupActionBarWithNavController(navController, appBarConfiguration) navView.setupWithNavController(navController) + + addButton( "a", 0xff0000) + addButton( "b", 0xff0000) + addButton( "c", 0xff0000) + addButton( "d", 0xff0000) } override fun onCreateOptionsMenu(menu: Menu): Boolean { @@ -58,16 +63,19 @@ class MainActivity : AppCompatActivity() { return navController.navigateUp(appBarConfiguration) || super.onSupportNavigateUp() } - fun addButton(text: String) { + fun addButton(userName: String, color: Int) { + val contactScrollField = findViewById(R.id.linear_layout) + // = findViewById(R.id.linear_layout) as LinearLayout + val dynamicButton = Button(this) - dynamicButton.layoutParams = LinearLayout.LayoutParams( + /*dynamicButton.layoutParams = LinearLayout.LayoutParams( LinearLayout.LayoutParams.WRAP_CONTENT, LinearLayout.LayoutParams.WRAP_CONTENT - ) - dynamicButton.text = "Dynamic Button" + )*/ + dynamicButton.text = userName dynamicButton.setBackgroundColor(Color.GREEN) - // add Button to LinearLayout - //linearLayout.addView(dynamicButton) + + contactScrollField.addView(dynamicButton) } } \ No newline at end of file diff --git a/app/src/main/res/layout/content_main.xml b/app/src/main/res/layout/content_main.xml index 6e0ea39..63c598a 100644 --- a/app/src/main/res/layout/content_main.xml +++ b/app/src/main/res/layout/content_main.xml @@ -17,4 +17,20 @@ app:layout_constraintRight_toRightOf="parent" app:layout_constraintTop_toTopOf="parent" app:navGraph="@navigation/mobile_navigation" /> + + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/values/colors.xml b/app/src/main/res/values/colors.xml index ce92792..20952f5 100644 --- a/app/src/main/res/values/colors.xml +++ b/app/src/main/res/values/colors.xml @@ -7,4 +7,5 @@ #FF018786 #FF000000 #FFFFFFFF + #00FF0090 \ No newline at end of file