I've read this answer : https://stackoverflow.com/a/5027921/1364174
And wonder why depending on the root parameter inflate method changes its behavior such drastically creating confusion.
According to that answer this code:
view = LayoutInflater.from(getBaseContext()).inflate(R.layout.smallred, null);
parent.addView(view);
Will create will create view specified in smallred.xml completely ignoring the properties of tags replacing them with some mysterious defaults values.
But this code will respect the properties from smallred.xml
view = LayoutInflater.from(getBaseContext()).inflate(R.layout.smallred, parent, false);
parent.addView(view);
Why is that ? Why we need to specify root/parent to which we later insert our view to, nflate" method? Why is that necessary ? Why if we wouldn't we won't get the properties from .xml file ?