From dda8d60990afcca4ee2b2cf00122ccc2106a9848 Mon Sep 17 00:00:00 2001 From: Ezerous Date: Wed, 11 Nov 2020 12:04:52 +0200 Subject: [PATCH] Changed to built-in toolbar/hamburger --- app/src/main/assets/svg/hamburger.svg | 1 - .../mthmmy/activities/main/MainActivity.java | 20 +++----------- .../gr/thmmy/mthmmy/base/BaseActivity.java | 9 +++--- .../main/res/drawable-anydpi/ic_hamburger.xml | 11 -------- .../main/res/drawable-hdpi/ic_hamburger.png | Bin 124 -> 0 bytes .../main/res/drawable-mdpi/ic_hamburger.png | Bin 93 -> 0 bytes .../main/res/drawable-xhdpi/ic_hamburger.png | Bin 115 -> 0 bytes .../main/res/drawable-xxhdpi/ic_hamburger.png | Bin 138 -> 0 bytes app/src/main/res/layout/activity_main.xml | 26 ++++++++---------- app/src/main/res/values/strings.xml | 2 -- app/src/main/res/values/styles.xml | 2 +- 11 files changed, 21 insertions(+), 50 deletions(-) delete mode 100644 app/src/main/assets/svg/hamburger.svg delete mode 100644 app/src/main/res/drawable-anydpi/ic_hamburger.xml delete mode 100644 app/src/main/res/drawable-hdpi/ic_hamburger.png delete mode 100644 app/src/main/res/drawable-mdpi/ic_hamburger.png delete mode 100644 app/src/main/res/drawable-xhdpi/ic_hamburger.png delete mode 100644 app/src/main/res/drawable-xxhdpi/ic_hamburger.png diff --git a/app/src/main/assets/svg/hamburger.svg b/app/src/main/assets/svg/hamburger.svg deleted file mode 100644 index 86ff00b4..00000000 --- a/app/src/main/assets/svg/hamburger.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file 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 183211cc..e72930d4 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 @@ -59,7 +59,6 @@ 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 { @@ -87,12 +86,15 @@ public class MainActivity extends BaseActivity implements RecentFragment.RecentF return; //Avoid executing the code below } + toolbar = findViewById(R.id.toolbar); + toolbar.setTitle(""); + setSupportActionBar(toolbar); + //Initialize drawer createDrawer(); 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()); @@ -114,7 +116,6 @@ public class MainActivity extends BaseActivity implements RecentFragment.RecentF updateTabIcon(i); setMainActivity(this); - setDrawerButtonListener(); } @Override @@ -292,17 +293,4 @@ 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/java/gr/thmmy/mthmmy/base/BaseActivity.java b/app/src/main/java/gr/thmmy/mthmmy/base/BaseActivity.java index be9ec059..9d71710b 100644 --- a/app/src/main/java/gr/thmmy/mthmmy/base/BaseActivity.java +++ b/app/src/main/java/gr/thmmy/mthmmy/base/BaseActivity.java @@ -721,11 +721,10 @@ public abstract class BaseActivity extends AppCompatActivity { @Override public void onRequestPermissionsResult(int permsRequestCode, @NonNull String[] permissions , @NonNull int[] grantResults) { - switch (permsRequestCode) { - case DOWNLOAD_REQUEST_CODE: - if (grantResults.length > 0 && grantResults[0] == PackageManager.PERMISSION_GRANTED) - prepareDownload(tempThmmyFile); - break; + super.onRequestPermissionsResult(permsRequestCode, permissions, grantResults); + if (permsRequestCode == DOWNLOAD_REQUEST_CODE) { + if (grantResults.length > 0 && grantResults[0] == PackageManager.PERMISSION_GRANTED) + prepareDownload(tempThmmyFile); } } diff --git a/app/src/main/res/drawable-anydpi/ic_hamburger.xml b/app/src/main/res/drawable-anydpi/ic_hamburger.xml deleted file mode 100644 index 34ec2b86..00000000 --- a/app/src/main/res/drawable-anydpi/ic_hamburger.xml +++ /dev/null @@ -1,11 +0,0 @@ - - - diff --git a/app/src/main/res/drawable-hdpi/ic_hamburger.png b/app/src/main/res/drawable-hdpi/ic_hamburger.png deleted file mode 100644 index 495e80e30e61cc4ba3c3ab0c2fa6782c7cca554e..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 124 zcmeAS@N?(olHy`uVBq!ia0vp^Dj>|k1|%Oc%$NbBoIPC}Ln>~)y|$5)L4k+Gp}a_a zdFk?u#N1?ogVsO(DRM3mVfd!B=bP0l+XkKj!!84 diff --git a/app/src/main/res/drawable-mdpi/ic_hamburger.png b/app/src/main/res/drawable-mdpi/ic_hamburger.png deleted file mode 100644 index d2c888705ed07b0f617f334ce84ce4e54b9f06f3..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 93 zcmeAS@N?(olHy`uVBq!ia0vp^5+KaM1|%Pp+x`GjDxNNmAr-fh6C_v{H>`T_|NsB= r6^-oYngR`^PA*O`ndE-3gOwrl_KZ8{_{BEHl4J`UIvE+xRf(TV?v`J#JO^kB NgQu&X%Q~loCIIS?BB%fW diff --git a/app/src/main/res/drawable-xxhdpi/ic_hamburger.png b/app/src/main/res/drawable-xxhdpi/ic_hamburger.png deleted file mode 100644 index c0da043c101788d7ef517e5c6dfdc5c364a9eb83..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 138 zcmeAS@N?(olHy`uVBq!ia0vp^9w5xY1|&n@ZgvM!fu1goAr-gY-f-k)aNuBe{F8k+ z`1}!Djx#C}H^ehVfhrgdgnL#!=2V&Bz{FXiD8Rt*V+pH}he9KZQ8@!c!n+Ti++eAc dcObP4$Ew@a + android:gravity="center_vertical" + android:orientation="horizontal"> - + - @@ -48,5 +46,5 @@ android:id="@+id/container" android:layout_width="match_parent" android:layout_height="match_parent" - app:layout_behavior="@string/appbar_scrolling_view_behavior"/> + app:layout_behavior="@string/appbar_scrolling_view_behavior" /> diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 0491f5c5..43af28b3 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -234,6 +234,4 @@ SessionSharedPrefs - Button to open the drawer menu - diff --git a/app/src/main/res/values/styles.xml b/app/src/main/res/values/styles.xml index 28fe1690..5906eabc 100644 --- a/app/src/main/res/values/styles.xml +++ b/app/src/main/res/values/styles.xml @@ -57,7 +57,7 @@