add: jump, find, replace, copy, paste for editor

This commit is contained in:
hyb1996
2017-09-28 21:09:16 +08:00
parent 8f3d88c94c
commit e1f95c09f3
23 changed files with 721 additions and 123 deletions

View File

@@ -0,0 +1,69 @@
<?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="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:paddingLeft="16dp"
android:paddingRight="16dp"
android:paddingTop="16dp">
<android.support.design.widget.TextInputLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<android.support.design.widget.TextInputEditText
android:id="@+id/keywords"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="@string/text_find"/>
</android.support.design.widget.TextInputLayout>
<CheckBox
android:id="@+id/checkbox_regex"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/text_regex"/>
<android.support.design.widget.TextInputLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<android.support.design.widget.TextInputEditText
android:id="@+id/replacement"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="@string/text_replace"/>
</android.support.design.widget.TextInputLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<CheckBox
android:id="@+id/checkbox_replace"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="@string/text_replace"/>
<CheckBox
android:id="@+id/checkbox_replace_all"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="@string/text_replace_all"/>
</LinearLayout>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="4dp"
android:text="@string/hint_regex"
android:textColor="#929397"
android:textSize="12sp"/>
</LinearLayout>

View File

@@ -10,6 +10,7 @@
android:layout_height="wrap_content"
android:theme="@style/AppTheme.AppBarOverlay">
<com.stardust.theme.widget.ThemeColorToolbar
android:id="@+id/toolbar"
android:layout_width="match_parent"
@@ -18,46 +19,92 @@
android:title="@string/_app_name"
app:popupTheme="@style/AppTheme.PopupOverlay">
<LinearLayout
<com.stardust.widget.ViewSwitcher
android:id="@+id/toolbar_switcher"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_gravity="right"
android:orientation="horizontal">
android:layout_gravity="right">
<com.stardust.widget.ToolbarMenuItem
android:id="@+id/run"
android:layout_width="40dp"
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="match_parent"
app:icon="@drawable/ic_play_arrow_white_48dp"
app:icon_color="@android:color/white"
app:text="@string/text_run"/>
android:layout_gravity="right"
android:orientation="horizontal">
<com.stardust.widget.ToolbarMenuItem
android:id="@+id/undo"
android:layout_width="40dp"
<com.stardust.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"/>
<com.stardust.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"/>
<com.stardust.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"/>
<com.stardust.widget.ToolbarMenuItem
android:id="@+id/save"
android:layout_width="40dp"
android:layout_height="match_parent"
app:icon="@drawable/ic_save_white_48dp"
app:text="@string/text_save"/>
</LinearLayout>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="match_parent"
app:icon="@drawable/ic_undo_white_48dp"
app:text="@string/text_undo"/>
android:layout_gravity="right"
android:orientation="horizontal">
<com.stardust.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"/>
<com.stardust.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"/>
<com.stardust.widget.ToolbarMenuItem
android:id="@+id/save"
android:layout_width="40dp"
android:layout_height="match_parent"
app:icon="@drawable/ic_save_white_48dp"
app:text="@string/text_save"/>
<com.stardust.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"/>
<com.stardust.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"/>
</LinearLayout>
<com.stardust.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>
</com.stardust.theme.widget.ThemeColorToolbar>
</android.support.design.widget.AppBarLayout>