refactor(ui): toolbar menu design;
This commit is contained in:
@@ -19,89 +19,11 @@
|
||||
android:title="@string/_app_name"
|
||||
app:popupTheme="@style/AppTheme.PopupOverlay">
|
||||
|
||||
<com.stardust.widget.ViewSwitcher
|
||||
android:id="@+id/toolbar_switcher"
|
||||
<FrameLayout
|
||||
android:id="@+id/toolbar_menu"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_gravity="right">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_gravity="right"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<org.autojs.autojs.ui.widget.ToolbarMenuItem
|
||||
android:id="@+id/run"
|
||||
android:layout_width="40dp"
|
||||
android:layout_height="match_parent"
|
||||
app:icon="@drawable/ic_play_arrow_white_48dp"
|
||||
app:icon_color="@android:color/white"
|
||||
app:text="@string/text_run"/>
|
||||
|
||||
<org.autojs.autojs.ui.widget.ToolbarMenuItem
|
||||
android:id="@+id/undo"
|
||||
android:layout_width="40dp"
|
||||
android:layout_height="match_parent"
|
||||
app:icon="@drawable/ic_undo_white_48dp"
|
||||
app:text="@string/text_undo"/>
|
||||
|
||||
<org.autojs.autojs.ui.widget.ToolbarMenuItem
|
||||
android:id="@+id/redo"
|
||||
android:layout_width="40dp"
|
||||
android:layout_height="match_parent"
|
||||
app:icon="@drawable/ic_redo_white_48dp"
|
||||
app:text="@string/text_redo"/>
|
||||
|
||||
<org.autojs.autojs.ui.widget.ToolbarMenuItem
|
||||
android:id="@+id/save"
|
||||
android:layout_width="40dp"
|
||||
android:layout_height="match_parent"
|
||||
android:enabled="false"
|
||||
app:icon="@drawable/ic_save_white_48dp"
|
||||
app:text="@string/text_save"/>
|
||||
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_gravity="right"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<org.autojs.autojs.ui.widget.ToolbarMenuItem
|
||||
android:id="@+id/replace"
|
||||
android:layout_width="40dp"
|
||||
android:layout_height="match_parent"
|
||||
app:icon="@drawable/ic_ali_replace"
|
||||
app:text="@string/text_replace"/>
|
||||
|
||||
<org.autojs.autojs.ui.widget.ToolbarMenuItem
|
||||
android:id="@+id/find_prev"
|
||||
android:layout_width="40dp"
|
||||
android:layout_height="match_parent"
|
||||
app:icon="@drawable/ic_ali_up"
|
||||
app:text="@string/text_find_prev"/>
|
||||
|
||||
<org.autojs.autojs.ui.widget.ToolbarMenuItem
|
||||
android:id="@+id/find_next"
|
||||
android:layout_width="40dp"
|
||||
android:layout_height="match_parent"
|
||||
app:icon="@drawable/ic_ali_down"
|
||||
app:text="@string/text_find_next"/>
|
||||
|
||||
|
||||
<org.autojs.autojs.ui.widget.ToolbarMenuItem
|
||||
android:id="@+id/cancel"
|
||||
android:layout_width="40dp"
|
||||
android:layout_height="match_parent"
|
||||
app:icon="@drawable/ic_close_white_48dp"
|
||||
app:text="@string/text_cancel"/>
|
||||
|
||||
|
||||
</LinearLayout>
|
||||
</com.stardust.widget.ViewSwitcher>
|
||||
android:layout_gravity="right"/>
|
||||
|
||||
</com.stardust.theme.widget.ThemeColorToolbar>
|
||||
|
||||
|
||||
40
app/src/main/res/layout/fragment_normal_toolbar.xml
Normal file
40
app/src/main/res/layout/fragment_normal_toolbar.xml
Normal file
@@ -0,0 +1,40 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_gravity="right"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<org.autojs.autojs.ui.widget.ToolbarMenuItem
|
||||
android:id="@+id/run"
|
||||
android:layout_width="40dp"
|
||||
android:layout_height="match_parent"
|
||||
app:icon="@drawable/ic_play_arrow_white_48dp"
|
||||
app:icon_color="@android:color/white"
|
||||
app:text="@string/text_run"/>
|
||||
|
||||
<org.autojs.autojs.ui.widget.ToolbarMenuItem
|
||||
android:id="@+id/undo"
|
||||
android:layout_width="40dp"
|
||||
android:layout_height="match_parent"
|
||||
app:icon="@drawable/ic_undo_white_48dp"
|
||||
app:text="@string/text_undo"/>
|
||||
|
||||
<org.autojs.autojs.ui.widget.ToolbarMenuItem
|
||||
android:id="@+id/redo"
|
||||
android:layout_width="40dp"
|
||||
android:layout_height="match_parent"
|
||||
app:icon="@drawable/ic_redo_white_48dp"
|
||||
app:text="@string/text_redo"/>
|
||||
|
||||
<org.autojs.autojs.ui.widget.ToolbarMenuItem
|
||||
android:id="@+id/save"
|
||||
android:layout_width="40dp"
|
||||
android:layout_height="match_parent"
|
||||
android:enabled="false"
|
||||
app:icon="@drawable/ic_save_white_48dp"
|
||||
app:text="@string/text_save"/>
|
||||
|
||||
|
||||
</LinearLayout>
|
||||
39
app/src/main/res/layout/fragment_search_toolbar.xml
Normal file
39
app/src/main/res/layout/fragment_search_toolbar.xml
Normal file
@@ -0,0 +1,39 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_gravity="right"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<org.autojs.autojs.ui.widget.ToolbarMenuItem
|
||||
android:id="@+id/replace"
|
||||
android:layout_width="40dp"
|
||||
android:layout_height="match_parent"
|
||||
app:icon="@drawable/ic_ali_replace"
|
||||
app:text="@string/text_replace"/>
|
||||
|
||||
<org.autojs.autojs.ui.widget.ToolbarMenuItem
|
||||
android:id="@+id/find_prev"
|
||||
android:layout_width="40dp"
|
||||
android:layout_height="match_parent"
|
||||
app:icon="@drawable/ic_ali_up"
|
||||
app:text="@string/text_find_prev"/>
|
||||
|
||||
<org.autojs.autojs.ui.widget.ToolbarMenuItem
|
||||
android:id="@+id/find_next"
|
||||
android:layout_width="40dp"
|
||||
android:layout_height="match_parent"
|
||||
app:icon="@drawable/ic_ali_down"
|
||||
app:text="@string/text_find_next"/>
|
||||
|
||||
|
||||
<org.autojs.autojs.ui.widget.ToolbarMenuItem
|
||||
android:id="@+id/cancel_search"
|
||||
android:layout_width="40dp"
|
||||
android:layout_height="match_parent"
|
||||
app:icon="@drawable/ic_close_white_48dp"
|
||||
app:text="@string/text_cancel"/>
|
||||
|
||||
|
||||
</LinearLayout>
|
||||
Reference in New Issue
Block a user