Recently whenever I create new activity it always generate edgetoedge code like this:
class BonDetail : AppCompatActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
enableEdgeToEdge()
setContentView(R.layout.bon_detail)
ViewCompat.setOnApplyWindowInsetsListener(findViewById(R.id.main)) { v, insets ->
val systemBars = insets.getInsets(WindowInsetsCompat.Type.systemBars())
v.setPadding(systemBars.left, systemBars.top, systemBars.right, systemBars.bottom)
insets
}
}
}
which I can just delete the line just fine but the problem is it also add this line into my gradle
implementation 'androidx.activity:activity:1.9.1'
and because of that broke my current app. because I assume it conflict with implementation 'androidx.core:core-ktx:1.9.0'
this is what my current gradle looks like:
implementation 'androidx.core:core-ktx:1.9.0'
implementation 'androidx.appcompat:appcompat:1.5.0'
implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
implementation 'com.google.android.gms:play-services-location:18.0.0'
implementation 'androidx.work:work-runtime-ktx:2.7.1'
//MATERIAL DESIGN
implementation 'com.google.android.material:material:1.9.0'
implementation 'androidx.activity:activity:1.9.1' <-- this is automatically added whenever I create new activity
This is an old project but I don’t want to change many things in the project since many of our client still use old android like 5.0 or 6.0.
I just want to prevent Android Studio to automatically change my gradle with this edgetoedge thing, anyone know how to do this?