To retrieve the view with the tag GoogleMapCompass in Kotlin, similar to the Java solution, you can adjust the position by modifying the rules of the RelativeLayout.
Here is an example where the button is positioned 50 pixels from the right and 150 pixels from the bottom:
val compassButton = (supportFragmentManager
.findFragmentById(R.id.map) as SupportMapFragment)
.requireView()
.findViewWithTag<View>("GoogleMapCompass");
val rlp = compassButton.layoutParams as RelativeLayout.LayoutParams
rlp.addRule(RelativeLayout.ALIGN_PARENT_END)
rlp.addRule(RelativeLayout.ALIGN_PARENT_BOTTOM)
rlp.removeRule(RelativeLayout.ALIGN_PARENT_START)
rlp.removeRule(RelativeLayout.ALIGN_PARENT_TOP)
rlp.bottomMargin = 150
rlp.rightMargin = 50
For further customizations of the compass, you will need to create your own implementation.