Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Text Editor UI/UX Update & Code Refactor #3907

Merged
merged 4 commits into from
Oct 29, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view

Large diffs are not rendered by default.

16 changes: 9 additions & 7 deletions app/src/main/res/anim/fade_in_top.xml
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android"
android:shareInterpolator="true"
android:interpolator="@android:interpolator/decelerate_cubic">
android:interpolator="@android:interpolator/decelerate_cubic"
android:shareInterpolator="true">
<translate
android:fromXDelta="0%" android:toXDelta="0%"
android:fromYDelta="-50%" android:toYDelta="0%"
android:duration="200" />
android:duration="200"
android:fromXDelta="0%"
android:fromYDelta="-50%"
android:toXDelta="0%"
android:toYDelta="0%" />
<alpha
android:duration="200"
android:fromAlpha="0"
android:toAlpha="1"
android:duration="200"/>
android:toAlpha="1" />
</set>
15 changes: 15 additions & 0 deletions app/src/main/res/anim/fade_out_top.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android"
android:interpolator="@android:interpolator/decelerate_cubic"
android:shareInterpolator="true">
<translate
android:duration="200"
android:fromXDelta="0%"
android:fromYDelta="0%"
android:toXDelta="0%"
android:toYDelta="-50%" />
<alpha
android:duration="200"
android:fromAlpha="1"
android:toAlpha="0" />
</set>
52 changes: 0 additions & 52 deletions app/src/main/res/layout/actionmode_textviewer.xml

This file was deleted.

57 changes: 29 additions & 28 deletions app/src/main/res/layout/search.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,49 +16,50 @@
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
-->

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
<androidx.appcompat.widget.LinearLayoutCompat xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/textEditorRootView"
android:layout_width="match_parent"
android:id="@+id/texteditor"
android:orientation="vertical"
android:layout_height="match_parent"
android:animateLayoutChanges="true"
android:layout_height="match_parent" >
android:orientation="vertical">

<LinearLayout
android:orientation="vertical"
android:elevation="10dp"
android:layout_width="match_parent"
android:id="@+id/lin"
android:layout_height="wrap_content">
<include layout="@layout/toolbar"
android:layout_height="?actionBarSize"
android:layout_height="wrap_content"
android:elevation="12dp"
android:orientation="vertical"
tools:targetApi="lollipop">

<include
layout="@layout/toolbar"
android:layout_width="match_parent"
/>
<include layout="@layout/actionmode_textviewer"/>
android:layout_height="?actionBarSize" />

<include
layout="@layout/text_editor_search_bar"
android:layout_width="match_parent"
android:layout_height="wrap_content" />

</LinearLayout>
<View
android:layout_width="0px"
android:layout_height="0px"
android:focusable="true"
android:focusableInTouchMode="true" />

<ScrollView
android:id="@+id/textEditorScrollView"
android:layout_width="match_parent"
android:id="@+id/editscroll"
android:layout_height="match_parent"
android:fillViewport="true">

<androidx.appcompat.widget.AppCompatEditText
android:id="@+id/fname"
android:id="@+id/textEditorMainEditText"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:background="@null"
android:layout_height="wrap_content"
android:fontFamily="sans-serif-light"
android:textSize="14sp"
android:ems="10"
android:gravity="left|top"
android:gravity="start|top"
android:inputType="textCapSentences|textMultiLine"
/>
android:lineSpacingExtra="1dp"
android:padding="16dp"
android:textSize="14sp" />

</ScrollView>

</LinearLayout>
</androidx.appcompat.widget.LinearLayoutCompat>
52 changes: 52 additions & 0 deletions app/src/main/res/layout/text_editor_search_bar.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/textEditorSearchBar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:visibility="gone">

<androidx.appcompat.widget.AppCompatEditText
android:id="@+id/textEditorSearchBox"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_margin="8dp"
android:hint="@string/search"
android:maxLines="1"
android:singleLine="true"
android:textColor="@color/primary_white"
android:textColorHint="@color/white_translucent"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toStartOf="@id/textEditorSearchPrevButton"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />

<androidx.appcompat.widget.AppCompatImageButton
android:id="@+id/textEditorSearchPrevButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:background="?android:selectableItemBackground"
android:padding="8dp"
android:tint="@color/primary_white"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toStartOf="@id/textEditorSearchNextButton"
app:layout_constraintStart_toEndOf="@id/textEditorSearchBox"
app:layout_constraintTop_toTopOf="parent"
app:srcCompat="@drawable/ic_keyboard_arrow_up_white" />

<androidx.appcompat.widget.AppCompatImageButton
android:id="@+id/textEditorSearchNextButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:background="?android:selectableItemBackground"
android:padding="8dp"
android:tint="@color/primary_white"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@id/textEditorSearchPrevButton"
app:layout_constraintTop_toTopOf="parent"
app:srcCompat="@drawable/ic_keyboard_arrow_down_white" />

</androidx.constraintlayout.widget.ConstraintLayout>
1 change: 0 additions & 1 deletion app/src/main/res/values/colors.xml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
<color name="divider_dark_card">#575757</color>
<color name="divider_dark">#484848</color>
<color name="divider_translucent">#50575757</color>
<color name="search_text_highlight">#FF9632</color>
<!-- TODO: replace this hardcoded color with default list item selection color -->
<color name="grid_background_light">#f2f2f2</color>
<!--GRAY 700 used for icons instead of black-->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ private void generateActivity(Intent intent) {
Robolectric.buildActivity(TextEditorActivity.class, intent).create().start().visible();

TextEditorActivity activity = controller.get();
text = activity.findViewById(R.id.fname);
text = activity.findViewById(R.id.textEditorMainEditText);
activity.onDestroy();
}

Expand Down