mirror of
https://github.com/commons-app/apps-android-commons.git
synced 2025-10-27 04:43:54 +01:00
Attempt 1 to set layout for menu item (putting toggle button to right side)
This commit is contained in:
parent
23aa691275
commit
a2f98748d7
3 changed files with 20 additions and 1 deletions
|
|
@ -125,6 +125,7 @@ public class ContributionsActivity
|
||||||
if (mediaDetails != null && savedInstanceState.getBoolean("mediaDetailsVisible")) {
|
if (mediaDetails != null && savedInstanceState.getBoolean("mediaDetailsVisible")) {
|
||||||
// Feels awful that we have to reset this manually!
|
// Feels awful that we have to reset this manually!
|
||||||
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
|
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
|
||||||
|
getSupportActionBar().setDisplayShowCustomEnabled(true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
requestAuthToken();
|
requestAuthToken();
|
||||||
|
|
|
||||||
18
app/src/main/res/layout/theme_toggle_layout.xml
Normal file
18
app/src/main/res/layout/theme_toggle_layout.xml
Normal file
|
|
@ -0,0 +1,18 @@
|
||||||
|
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:paddingLeft="16dp"
|
||||||
|
android:paddingRight="16dp"
|
||||||
|
android:orientation="horizontal"
|
||||||
|
android:weightSum="3">
|
||||||
|
<TextView
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:layout_weight="2"/>
|
||||||
|
<ImageButton
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:src="?attr/toggleButtonIcon"
|
||||||
|
/>
|
||||||
|
</LinearLayout>
|
||||||
|
|
@ -30,7 +30,7 @@
|
||||||
/>
|
/>
|
||||||
<item android:id="@+id/menu_theme_toggle"
|
<item android:id="@+id/menu_theme_toggle"
|
||||||
android:title="Night mode"
|
android:title="Night mode"
|
||||||
android:icon="?attr/toggleButtonIcon"
|
android:actionLayout="@layout/theme_toggle_layout"
|
||||||
app:showAsAction="never"
|
app:showAsAction="never"
|
||||||
/>
|
/>
|
||||||
<item android:id="@+id/menu_refresh"
|
<item android:id="@+id/menu_refresh"
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue