When I see on the XML layout file in the android studio I can see the padding is there but on the device, I can not see it. I am not adding padding programmatically on that button. I only set the background of the button programmatically.
In Android Studio
In Device
Here is my button code
<Button
android:id="@+id/LoadBtn"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:minHeight="0dp"
android:minWidth="0dp"
android:layout_marginTop="16dp"
android:background="@color/colorAccent"
android:foreground="?android:attr/selectableItemBackground"
android:text=" LOAD MAP "
android:textAlignment="viewStart"
android:textColor="@android:color/white"
android:textSize="30sp"
android:textStyle="bold"
android:paddingStart="7dp"
android:paddingEnd="7dp"
android:paddingTop="10dp"
android:paddingBottom="10dp"
app:layout_constraintStart_toStartOf="@+id/fileTypeRadioGroup"
app:layout_constraintTop_toBottomOf="@+id/fileTypeRadioGroup" />
Here is the java code that I am doing with that button.
loadBtn = findViewById(R.id.LoadBtn);
loadBtn.setEnabled(false);
loadBtn.setBackground(ContextCompat.getDrawable(getApplicationContext(), R.drawable.disabled_button_background));
loadBtn.setEnabled(true);
loadBtn.setBackground(ContextCompat.getDrawable(getApplicationContext(), R.color.colorAccent));


