diff --git a/app/src/main/java/gr/thmmy/mthmmy/activities/main/MainActivity.java b/app/src/main/java/gr/thmmy/mthmmy/activities/main/MainActivity.java index 5d8aa004..183211cc 100644 --- a/app/src/main/java/gr/thmmy/mthmmy/activities/main/MainActivity.java +++ b/app/src/main/java/gr/thmmy/mthmmy/activities/main/MainActivity.java @@ -5,6 +5,8 @@ import android.content.SharedPreferences; import android.net.Uri; import android.os.Build; import android.os.Bundle; +import android.view.View; +import android.widget.ImageView; import android.widget.Toast; import androidx.appcompat.app.AppCompatDelegate; @@ -57,6 +59,7 @@ public class MainActivity extends BaseActivity implements RecentFragment.RecentF private SectionsPagerAdapter sectionsPagerAdapter; private ViewPager viewPager; private TabLayout tabLayout; + private ImageView drawerButton; //Fix for vector drawables on android <21 static { @@ -89,6 +92,7 @@ public class MainActivity extends BaseActivity implements RecentFragment.RecentF tabLayout = findViewById(R.id.tabs); viewPager = findViewById(R.id.container); + drawerButton = findViewById(R.id.main_activity_open_drawer_btn); //Create the adapter that will return a fragment for each section of the activity sectionsPagerAdapter = new SectionsPagerAdapter(getSupportFragmentManager()); @@ -110,6 +114,7 @@ public class MainActivity extends BaseActivity implements RecentFragment.RecentF updateTabIcon(i); setMainActivity(this); + setDrawerButtonListener(); } @Override @@ -287,4 +292,17 @@ public class MainActivity extends BaseActivity implements RecentFragment.RecentF } } } + + + private void setDrawerButtonListener() + { + this.drawerButton.setOnClickListener(new View.OnClickListener() + { + @Override + public void onClick(View v) + { + drawer.openDrawer(); + } + }); + } } \ No newline at end of file diff --git a/app/src/main/res/layout/activity_main.xml b/app/src/main/res/layout/activity_main.xml index 053c2fb7..bc02d041 100644 --- a/app/src/main/res/layout/activity_main.xml +++ b/app/src/main/res/layout/activity_main.xml @@ -14,16 +14,32 @@ android:layout_width="match_parent" android:layout_height="wrap_content" android:theme="@style/ToolbarTheme"> - + android:orientation="horizontal" + > + + + + + + SessionSharedPrefs + Button to open the drawer menu