Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 1f0e2706 authored by Danesh Mondegarian's avatar Danesh Mondegarian Committed by Gerrit Code Review
Browse files

Merge "Navbar : Padding fix" into cm-10.1

parents 5f009136 311f039c
Loading
Loading
Loading
Loading
+20 −10
Original line number Diff line number Diff line
@@ -363,18 +363,28 @@ public class NavbarEditor implements OnTouchListener {
        int sCount = visibleCount;
        for (int v = 0; v < viewParent.getChildCount();v++) {
            View cView = viewParent.getChildAt(v);
            if (NavigationBarView.getEditMode()) {
                cView.setVisibility(View.VISIBLE);
            } else if (cView instanceof KeyButtonView) {
            if (cView instanceof KeyButtonView) {
                View nextPadding = viewParent.getChildAt(v+1);
                String curTag = (String) cView.getTag();
                if (curTag == null || curTag.equals(NAVBAR_EMPTY)) {
                    cView.setVisibility(View.GONE);
                if (nextPadding != null) {
                    View nextKey = viewParent.getChildAt(v+2);
                    String nextTag = NAVBAR_EMPTY;
                    if (nextKey != null) {
                        nextTag = (String) nextKey.getTag();
                    }
                    String curTag = (String) cView.getTag();
                    if (nextKey != null && nextTag != null && curTag != null && !curTag.equals(NAVBAR_EMPTY)) {
                        if (!nextTag.equals(NAVBAR_EMPTY)){
                            nextPadding.setVisibility(View.VISIBLE);
                        } else {
                            if (sCount > 1) {
                                nextPadding.setVisibility(View.VISIBLE);
                            } else {
                                nextPadding.setVisibility(View.GONE);
                            }
                        }
                        sCount--;
                    } else {
                        View prevPadding = viewParent.getChildAt(v-1);
                        prevPadding.setVisibility(View.GONE);
                        nextPadding.setVisibility(View.GONE);
                    }
                }
            }