Skip to content

Commit

Permalink
navigation: reduce size of logo (fixes #2584) (#2585)
Browse files Browse the repository at this point in the history
Co-authored-by: dogi <[email protected]>
  • Loading branch information
Okuro3499 and dogi authored Oct 12, 2023
1 parent 98bece4 commit b2a90d3
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 10 deletions.
4 changes: 2 additions & 2 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ android {
applicationId "org.ole.planet.myplanet"
minSdkVersion 21
targetSdkVersion 34
versionCode 1092
versionName "0.10.92"
versionCode 1093
versionName "0.10.93"
ndkVersion '21.3.6528147'
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
vectorDrawables.useSupportLibrary = true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
import com.mikepenz.materialdrawer.model.PrimaryDrawerItem;
import com.mikepenz.materialdrawer.model.interfaces.IDrawerItem;
import com.mikepenz.materialdrawer.model.interfaces.Nameable;
import com.mikepenz.materialdrawer.holder.DimenHolder;

import org.ole.planet.myplanet.R;
import org.ole.planet.myplanet.callback.OnHomeItemClickListener;
Expand Down Expand Up @@ -259,18 +260,17 @@ private AccountHeader getAccountHeader() {
.withActivity(DashboardActivity.this)
.withTextColor(getResources().getColor(R.color.bg_white))
.withHeaderBackground(R.drawable.ole_logo)
.withHeaderBackgroundScaleType(ImageView.ScaleType.FIT_XY)
.withDividerBelowHeader(false)
.build();

ImageView headerBackground = header.getHeaderBackgroundView();
headerBackground.setPadding(20, 12, 20, 12); // Add padding values as per your requirement
headerBackground.setPadding(30, 60, 30, 60);
headerBackground.setColorFilter(getResources().getColor(R.color.md_white_1000), PorterDuff.Mode.SRC_IN);
return header;
}

private void createDrawer() {
com.mikepenz.materialdrawer.holder.DimenHolder dimenHolder = com.mikepenz.materialdrawer.holder.DimenHolder.fromDp(200);
com.mikepenz.materialdrawer.holder.DimenHolder dimenHolder = com.mikepenz.materialdrawer.holder.DimenHolder.fromDp(160);
result = new DrawerBuilder().withActivity(this).withFullscreen(true).withSliderBackgroundColor(getResources().getColor(R.color.colorPrimary)).withToolbar(mTopToolbar).withAccountHeader(headerResult).withHeaderHeight(dimenHolder).addDrawerItems(getDrawerItems()).addStickyDrawerItems(getDrawerItemsFooter()).withOnDrawerItemClickListener((view, position, drawerItem) -> {
if (drawerItem != null) {
menuAction(((Nameable) drawerItem).getName().getTextRes());
Expand Down Expand Up @@ -311,9 +311,6 @@ private void menuAction(int selectedMenuId) {
case R.string.enterprises:
openEnterpriseFragment();
break;
case R.string.menu_feedback:
openMyFragment(new FeedbackListFragment());
break;
case R.string.menu_logout:
logout();
break;
Expand Down Expand Up @@ -379,10 +376,9 @@ private IDrawerItem[] getDrawerItems() {
@NonNull
private IDrawerItem[] getDrawerItemsFooter() {
ArrayList<Drawable> menuImageListFooter = new ArrayList<>();
menuImageListFooter.add(getResources().getDrawable(R.drawable.feedback));
menuImageListFooter.add(getResources().getDrawable(R.drawable.logout));

return new IDrawerItem[]{changeUX(R.string.menu_feedback, menuImageListFooter.get(0)), changeUX(R.string.menu_logout, menuImageListFooter.get(1)),};
return new IDrawerItem[]{changeUX(R.string.menu_logout, menuImageListFooter.get(0)),};
}

public PrimaryDrawerItem changeUX(int iconText, Drawable drawable) {
Expand Down

0 comments on commit b2a90d3

Please sign in to comment.