Skip to content

Commit

Permalink
Merge pull request #378 from schaal/designissues
Browse files Browse the repository at this point in the history
(Partial) Fix for some design issues as discussed in #376
  • Loading branch information
David-Development committed Jul 25, 2015
2 parents f758977 + 2b9e3aa commit c231217
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 1 deletion.
Expand Up @@ -43,6 +43,7 @@
import android.support.design.widget.Snackbar;
import android.support.v4.app.DialogFragment;
import android.support.v4.view.GravityCompat;
import android.support.v4.widget.ViewDragHelper;
import android.support.v7.app.ActionBarDrawerToggle;
import android.support.v4.app.FragmentActivity;
import android.support.v4.app.FragmentManager;
Expand All @@ -56,6 +57,8 @@
import android.widget.Toast;
import android.widget.TextView;

import java.lang.reflect.Field;

import butterknife.ButterKnife;
import butterknife.InjectView;
import butterknife.Optional;
Expand Down Expand Up @@ -172,6 +175,25 @@ public void onDrawerOpened(View drawerView) {
};

drawerLayout.setDrawerListener(drawerToggle);

try {
// increase the size of the drag margin to prevent starting a star swipe when
// trying to open the drawer.
Field mDragger = drawerLayout.getClass().getDeclaredField(
"mLeftDragger");
mDragger.setAccessible(true);
ViewDragHelper draggerObj = (ViewDragHelper) mDragger
.get(drawerLayout);

Field mEdgeSize = draggerObj.getClass().getDeclaredField(
"mEdgeSize");
mEdgeSize.setAccessible(true);
int edge = mEdgeSize.getInt(draggerObj);

mEdgeSize.setInt(draggerObj, edge * 3);
} catch (Exception e) {
e.printStackTrace();
}
}
setSupportActionBar(toolbar);
getSupportActionBar().setDisplayShowHomeEnabled(true);
Expand Down
Expand Up @@ -8,7 +8,7 @@
<RelativeLayout
android:id="@+id/header_view"
android:layout_width="match_parent"
android:layout_height="180dp"
android:layout_height="100dp"
android:padding="10dp"
android:background="@drawable/left_drawer_header_background"
android:clickable="true">
Expand Down

0 comments on commit c231217

Please sign in to comment.