aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--app/src/main/java/github/daneren2005/dsub/activity/SubsonicActivity.java5
-rw-r--r--app/src/main/res/layout/actionbar_spinner.xml18
2 files changed, 8 insertions, 15 deletions
diff --git a/app/src/main/java/github/daneren2005/dsub/activity/SubsonicActivity.java b/app/src/main/java/github/daneren2005/dsub/activity/SubsonicActivity.java
index a0b52a87..f9c14439 100644
--- a/app/src/main/java/github/daneren2005/dsub/activity/SubsonicActivity.java
+++ b/app/src/main/java/github/daneren2005/dsub/activity/SubsonicActivity.java
@@ -189,8 +189,7 @@ public class SubsonicActivity extends AppCompatActivity implements OnItemSelecte
}
protected void createCustomActionBarView() {
- View customActionbar = getLayoutInflater().inflate(R.layout.actionbar_spinner, null);
- actionBarSpinner = (Spinner)customActionbar.findViewById(R.id.spinner);
+ actionBarSpinner = (Spinner) getLayoutInflater().inflate(R.layout.actionbar_spinner, null);
if(Util.getThemeRes(this) == R.style.Theme_DSub_Light_No_Actionbar) {
actionBarSpinner.setBackgroundResource(R.drawable.abc_spinner_mtrl_am_alpha);
}
@@ -199,7 +198,7 @@ public class SubsonicActivity extends AppCompatActivity implements OnItemSelecte
actionBarSpinner.setOnItemSelectedListener(this);
actionBarSpinner.setAdapter(spinnerAdapter);
- getSupportActionBar().setCustomView(customActionbar);
+ getSupportActionBar().setCustomView(actionBarSpinner);
}
@Override
diff --git a/app/src/main/res/layout/actionbar_spinner.xml b/app/src/main/res/layout/actionbar_spinner.xml
index 023ff957..f719a67c 100644
--- a/app/src/main/res/layout/actionbar_spinner.xml
+++ b/app/src/main/res/layout/actionbar_spinner.xml
@@ -1,14 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
-<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
- android:orientation="vertical"
- android:layout_width="fill_parent"
+<Spinner xmlns:android="http://schemas.android.com/apk/res/android"
+ android:id="@+id/spinner"
+ android:layout_width="wrap_content"
android:layout_height="fill_parent"
- android:gravity="fill_horizontal" >
-
- <Spinner
- android:id="@+id/spinner"
- android:layout_width="wrap_content"
- android:layout_height="fill_parent"
- android:prompt="@string/common.appname"
- style="?attr/android:spinnerItemStyle"/>
-</RelativeLayout>
+ android:prompt="@string/common.appname"
+ style="?attr/android:spinnerItemStyle"
+ android:overlapAnchor="false"/> \ No newline at end of file