mirror of
https://github.com/lacerta-doc/Lacerta.git
synced 2024-11-26 17:53:14 +00:00
WIP
This commit is contained in:
parent
1b050f5d3c
commit
52d2a244a0
|
@ -18,8 +18,9 @@ import android.widget.TextView;
|
|||
import android.widget.Toast;
|
||||
|
||||
import com.google.android.material.bottomnavigation.BottomNavigationView;
|
||||
|
||||
|
||||
import com.google.android.material.shape.CornerFamily;
|
||||
import com.google.android.material.shape.MaterialShapeDrawable;
|
||||
import com.google.android.material.shape.ShapeAppearanceModel;
|
||||
|
||||
|
||||
import dagger.hilt.android.AndroidEntryPoint;
|
||||
|
@ -55,17 +56,29 @@ public class MainActivity extends AppCompatActivity {
|
|||
Toolbar toolbar = findViewById(R.id.toolbar);
|
||||
setSupportActionBar(toolbar);
|
||||
|
||||
// Create a new TextView
|
||||
TextView toolbarTitle = new TextView(this);
|
||||
// Set the text and center it in the TextView
|
||||
toolbarTitle.setText("App Name");
|
||||
toolbarTitle.setTextColor(Color.WHITE);
|
||||
toolbarTitle.setTextSize(20);
|
||||
toolbarTitle.setLayoutParams(new Toolbar.LayoutParams(Toolbar.LayoutParams.WRAP_CONTENT,
|
||||
Toolbar.LayoutParams.WRAP_CONTENT, Gravity.CENTER_HORIZONTAL));
|
||||
// // Create a new TextView
|
||||
// TextView toolbarTitle = new TextView(this);
|
||||
// // Set the text and center it in the TextView
|
||||
// toolbarTitle.setText("App Name");
|
||||
// toolbarTitle.setTextColor(Color.WHITE);
|
||||
// toolbarTitle.setTextSize(20);
|
||||
// toolbarTitle.setLayoutParams(new Toolbar.LayoutParams(Toolbar.LayoutParams.WRAP_CONTENT,
|
||||
// Toolbar.LayoutParams.WRAP_CONTENT, Gravity.CENTER_HORIZONTAL));
|
||||
//
|
||||
// // Set the TextView as the title
|
||||
// toolbar.addView(toolbarTitle);
|
||||
|
||||
// Set the TextView as the title
|
||||
toolbar.addView(toolbarTitle);
|
||||
// Create a ShapeAppearanceModel with rounded corners
|
||||
ShapeAppearanceModel shapeAppearanceModel = new ShapeAppearanceModel()
|
||||
.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);
|
||||
|
||||
// Set the MaterialShapeDrawable as the background of the Toolbar
|
||||
toolbar.setBackground(shapeDrawable);
|
||||
|
||||
DrawerLayout drawer = findViewById(R.id.drawer_layout);
|
||||
ActionBarDrawerToggle toggle = new ActionBarDrawerToggle(
|
||||
|
|
|
@ -22,9 +22,9 @@
|
|||
android:id="@+id/toolbar"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="?attr/actionBarSize"
|
||||
android:background="?attr/colorPrimary"
|
||||
android:background="?attr/colorSecondaryContainer"
|
||||
app:layout_scrollFlags="scroll|enterAlways"
|
||||
app:popupTheme="@style/ThemeOverlay.AppCompat.Light" />
|
||||
app:titleCentered="true" />
|
||||
|
||||
</com.google.android.material.appbar.AppBarLayout>
|
||||
|
||||
|
|
4
shared/ui/src/main/res/values/dimens.xml
Normal file
4
shared/ui/src/main/res/values/dimens.xml
Normal file
|
@ -0,0 +1,4 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<dimen name="toolbar_corner_radius">16dp</dimen>
|
||||
</resources>
|
Loading…
Reference in New Issue
Block a user