diff --git a/app/src/main/java/one/nem/lacerta/MainActivity.java b/app/src/main/java/one/nem/lacerta/MainActivity.java index 5c6f5717..2a3b248a 100644 --- a/app/src/main/java/one/nem/lacerta/MainActivity.java +++ b/app/src/main/java/one/nem/lacerta/MainActivity.java @@ -68,17 +68,14 @@ public class MainActivity extends AppCompatActivity { // // Set the TextView as the title // toolbar.addView(toolbarTitle); - // Create a ShapeAppearanceModel with rounded corners - ShapeAppearanceModel shapeAppearanceModel = new ShapeAppearanceModel() + float radius = getResources().getDimension(one.nem.lacerta.shared.ui.R.dimen.toolbar_corner_radius); + + MaterialShapeDrawable materialShapeDrawable = (MaterialShapeDrawable)toolbar.getBackground(); + materialShapeDrawable.setShapeAppearanceModel(materialShapeDrawable.getShapeAppearanceModel() .toBuilder() - .setAllCorners(CornerFamily.ROUNDED, getResources().getDimension(one.nem.lacerta.shared.ui.R.dimen.toolbar_corner_radius)) - .build(); - - // Create a MaterialShapeDrawable with the ShapeAppearanceModel - MaterialShapeDrawable shapeDrawable = new MaterialShapeDrawable(shapeAppearanceModel); - + .setAllCorners(CornerFamily.ROUNDED,radius) + .build()); // Set the MaterialShapeDrawable as the background of the Toolbar - toolbar.setBackground(shapeDrawable); DrawerLayout drawer = findViewById(R.id.drawer_layout); ActionBarDrawerToggle toggle = new ActionBarDrawerToggle(