diff --git a/app/src/main/java/org/schabi/newpipe/MainActivity.java b/app/src/main/java/org/schabi/newpipe/MainActivity.java
index 1d7a930ba..4ca16082a 100644
--- a/app/src/main/java/org/schabi/newpipe/MainActivity.java
+++ b/app/src/main/java/org/schabi/newpipe/MainActivity.java
@@ -83,11 +83,12 @@ public class MainActivity extends AppCompatActivity {
private static final String TAG = "MainActivity";
public static final boolean DEBUG = !BuildConfig.BUILD_TYPE.equals("release");
- private ActionBarDrawerToggle toggle = null;
- private DrawerLayout drawer = null;
- private NavigationView drawerItems = null;
- private TextView headerServiceView = null;
- private Button toggleServiceButton = null;
+ private ActionBarDrawerToggle toggle;
+ private DrawerLayout drawer;
+ private NavigationView drawerItems;
+ private ImageView headerServiceIcon;
+ private TextView headerServiceView;
+ private Button toggleServiceButton;
private boolean servicesShown = false;
private ImageView serviceArrow;
@@ -285,11 +286,10 @@ public class MainActivity extends AppCompatActivity {
View hView = navigationView.getHeaderView(0);
serviceArrow = hView.findViewById(R.id.drawer_arrow);
+ headerServiceIcon = hView.findViewById(R.id.drawer_header_service_icon);
headerServiceView = hView.findViewById(R.id.drawer_header_service_view);
toggleServiceButton = hView.findViewById(R.id.drawer_header_action_button);
- toggleServiceButton.setOnClickListener(view -> {
- toggleServices();
- });
+ toggleServiceButton.setOnClickListener(view -> toggleServices());
}
private void toggleServices() {
@@ -299,7 +299,6 @@ public class MainActivity extends AppCompatActivity {
drawerItems.getMenu().removeGroup(R.id.menu_tabs_group);
drawerItems.getMenu().removeGroup(R.id.menu_options_about_group);
-
if(servicesShown) {
showServices();
} else {
@@ -312,7 +311,7 @@ public class MainActivity extends AppCompatActivity {
}
private void showServices() {
- serviceArrow.setImageResource(R.drawable.ic_arrow_up_white);
+ serviceArrow.setImageResource(R.drawable.ic_arrow_drop_up_white_24dp);
for(StreamingService s : NewPipe.getServices()) {
final String title = s.getServiceInfo().getName() +
@@ -370,7 +369,7 @@ public class MainActivity extends AppCompatActivity {
}
private void showTabs() throws ExtractionException {
- serviceArrow.setImageResource(R.drawable.ic_arrow_down_white);
+ serviceArrow.setImageResource(R.drawable.ic_arrow_drop_down_white_24dp);
//Tabs
int currentServiceId = ServiceHelper.getSelectedServiceId(this);
@@ -428,9 +427,11 @@ public class MainActivity extends AppCompatActivity {
// when the user returns to MainActivity
drawer.closeDrawer(GravityCompat.START, false);
try {
- String selectedServiceName = NewPipe.getService(
- ServiceHelper.getSelectedServiceId(this)).getServiceInfo().getName();
+ final int selectedServiceId = ServiceHelper.getSelectedServiceId(this);
+ final String selectedServiceName = NewPipe.getService(selectedServiceId).getServiceInfo().getName();
headerServiceView.setText(selectedServiceName);
+ headerServiceIcon.setImageResource(ServiceHelper.getIcon(selectedServiceId));
+
headerServiceView.post(() -> headerServiceView.setSelected(true));
toggleServiceButton.setContentDescription(
getString(R.string.drawer_header_description) + selectedServiceName);
diff --git a/app/src/main/res/drawable-hdpi/ic_arrow_down_white.png b/app/src/main/res/drawable-hdpi/ic_arrow_down_white.png
deleted file mode 100644
index 33939600d..000000000
Binary files a/app/src/main/res/drawable-hdpi/ic_arrow_down_white.png and /dev/null differ
diff --git a/app/src/main/res/drawable-hdpi/ic_arrow_up_white.png b/app/src/main/res/drawable-hdpi/ic_arrow_up_white.png
deleted file mode 100644
index 0972a9bca..000000000
Binary files a/app/src/main/res/drawable-hdpi/ic_arrow_up_white.png and /dev/null differ
diff --git a/app/src/main/res/drawable-mdpi/ic_arrow_down_white.png b/app/src/main/res/drawable-mdpi/ic_arrow_down_white.png
deleted file mode 100644
index 40a0f499e..000000000
Binary files a/app/src/main/res/drawable-mdpi/ic_arrow_down_white.png and /dev/null differ
diff --git a/app/src/main/res/drawable-mdpi/ic_arrow_up_white.png b/app/src/main/res/drawable-mdpi/ic_arrow_up_white.png
deleted file mode 100644
index fe67b4673..000000000
Binary files a/app/src/main/res/drawable-mdpi/ic_arrow_up_white.png and /dev/null differ
diff --git a/app/src/main/res/drawable-xhdpi/ic_arrow_down_white.png b/app/src/main/res/drawable-xhdpi/ic_arrow_down_white.png
deleted file mode 100644
index 86bc5db3b..000000000
Binary files a/app/src/main/res/drawable-xhdpi/ic_arrow_down_white.png and /dev/null differ
diff --git a/app/src/main/res/drawable-xhdpi/ic_arrow_up_white.png b/app/src/main/res/drawable-xhdpi/ic_arrow_up_white.png
deleted file mode 100644
index dda36882e..000000000
Binary files a/app/src/main/res/drawable-xhdpi/ic_arrow_up_white.png and /dev/null differ
diff --git a/app/src/main/res/drawable-xxhdpi/ic_arrow_down_white.png b/app/src/main/res/drawable-xxhdpi/ic_arrow_down_white.png
deleted file mode 100644
index 7e901e098..000000000
Binary files a/app/src/main/res/drawable-xxhdpi/ic_arrow_down_white.png and /dev/null differ
diff --git a/app/src/main/res/drawable-xxhdpi/ic_arrow_up_white.png b/app/src/main/res/drawable-xxhdpi/ic_arrow_up_white.png
deleted file mode 100644
index bc71e23de..000000000
Binary files a/app/src/main/res/drawable-xxhdpi/ic_arrow_up_white.png and /dev/null differ
diff --git a/app/src/main/res/drawable/drawer_header_bottom_background.xml b/app/src/main/res/drawable/drawer_header_bottom_background.xml
new file mode 100644
index 000000000..913522274
--- /dev/null
+++ b/app/src/main/res/drawable/drawer_header_bottom_background.xml
@@ -0,0 +1,7 @@
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/drawable/ic_arrow_drop_down_white_24dp.xml b/app/src/main/res/drawable/ic_arrow_drop_down_white_24dp.xml
new file mode 100644
index 000000000..588d26403
--- /dev/null
+++ b/app/src/main/res/drawable/ic_arrow_drop_down_white_24dp.xml
@@ -0,0 +1,9 @@
+
+
+
diff --git a/app/src/main/res/drawable/ic_arrow_drop_up_white_24dp.xml b/app/src/main/res/drawable/ic_arrow_drop_up_white_24dp.xml
new file mode 100644
index 000000000..2a2ceba52
--- /dev/null
+++ b/app/src/main/res/drawable/ic_arrow_drop_up_white_24dp.xml
@@ -0,0 +1,9 @@
+
+
+
diff --git a/app/src/main/res/layout-v21/drawer_header.xml b/app/src/main/res/layout-v21/drawer_header.xml
deleted file mode 100644
index 9ed9f833a..000000000
--- a/app/src/main/res/layout-v21/drawer_header.xml
+++ /dev/null
@@ -1,82 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/app/src/main/res/layout/drawer_header.xml b/app/src/main/res/layout/drawer_header.xml
index 83ed644ba..81d09c278 100644
--- a/app/src/main/res/layout/drawer_header.xml
+++ b/app/src/main/res/layout/drawer_header.xml
@@ -1,81 +1,107 @@
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
+ android:background="?selectableItemBackground"
+ android:focusable="true" />
+
\ No newline at end of file
diff --git a/app/src/main/res/values-v21/dimens.xml b/app/src/main/res/values-v21/dimens.xml
new file mode 100644
index 000000000..2217a895c
--- /dev/null
+++ b/app/src/main/res/values-v21/dimens.xml
@@ -0,0 +1,6 @@
+
+
+
+ 150dp
+ 36dp
+
\ No newline at end of file
diff --git a/app/src/main/res/values/colors.xml b/app/src/main/res/values/colors.xml
index 425886cdc..e80676065 100644
--- a/app/src/main/res/values/colors.xml
+++ b/app/src/main/res/values/colors.xml
@@ -44,7 +44,7 @@
#25FFFFFF
- #ddffffff
+ #F2FFFFFF
#aa000000
#c8E53935
#e6000000
diff --git a/app/src/main/res/values/dimens.xml b/app/src/main/res/values/dimens.xml
index 538179b73..b11bb620d 100644
--- a/app/src/main/res/values/dimens.xml
+++ b/app/src/main/res/values/dimens.xml
@@ -1,5 +1,17 @@
+
+ 130dp
+ 16dp
+ 48dp
+ 12dp
+ 120dp
+ 220dp
+ 18sp
+ 32sp
+ 16dp
+ 14sp
+
16sp