Skip to content

Commit c73581f

Browse files
committed
Fix: revert accidental formatting changes and adjusted button padding and margin
1 parent 0b8c023 commit c73581f

File tree

4 files changed

+45
-19
lines changed

4 files changed

+45
-19
lines changed

app/src/main/java/com/amaze/filemanager/ui/views/appbar/SearchView.java

+27-2
Original file line numberDiff line numberDiff line change
@@ -52,9 +52,14 @@
5252
import android.content.Context;
5353
import android.graphics.PorterDuff;
5454
import android.graphics.PorterDuffColorFilter;
55+
import android.graphics.Typeface;
5556
import android.graphics.drawable.Drawable;
5657
import android.text.Editable;
58+
import android.text.Spannable;
59+
import android.text.SpannableString;
5760
import android.text.TextWatcher;
61+
import android.text.style.ForegroundColorSpan;
62+
import android.text.style.StyleSpan;
5863
import android.view.ContextThemeWrapper;
5964
import android.view.View;
6065
import android.view.ViewAnimationUtils;
@@ -223,6 +228,8 @@ public void afterTextChanged(Editable s) {}
223228

224229
searchMode = 2;
225230

231+
deepSearchButton.setText(mainActivity.getString(R.string.try_deep_search));
232+
226233
} else if (searchMode == 2) {
227234

228235
mainActivity
@@ -266,8 +273,8 @@ private void basicSearch(String s) {
266273
searchResultsSortButton.setVisibility(View.VISIBLE);
267274
searchResultsSortHintTV.setVisibility(View.VISIBLE);
268275
deepSearchContainer.setVisibility(View.VISIBLE);
269-
270276
searchMode = 1;
277+
deepSearchButton.setText(mainActivity.getString(R.string.try_indexed_search));
271278

272279
mainActivity
273280
.getCurrentMainFragment()
@@ -346,7 +353,7 @@ private void initRecentSearches(Context context) {
346353

347354
private void resetSearchMode() {
348355
searchMode = 0;
349-
356+
deepSearchButton.setText(mainActivity.getString(R.string.try_indexed_search));
350357
deepSearchContainer.setVisibility(View.GONE);
351358
}
352359

@@ -610,6 +617,24 @@ private void clearRecyclerView() {
610617
searchResultsSortButton.setVisibility(View.GONE);
611618
}
612619

620+
private SpannableString getSpannableText(String s1, String s2) {
621+
622+
SpannableString spannableString = new SpannableString(s1 + " " + s2);
623+
624+
spannableString.setSpan(
625+
new ForegroundColorSpan(mainActivity.getCurrentColorPreference().getAccent()),
626+
s1.length() + 1,
627+
spannableString.length(),
628+
Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);
629+
spannableString.setSpan(
630+
new StyleSpan(Typeface.BOLD),
631+
s1.length() + 1,
632+
spannableString.length(),
633+
Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);
634+
635+
return spannableString;
636+
}
637+
613638
/**
614639
* Returns the current text in {@link SearchView#searchViewEditText}
615640
*

app/src/main/res/layout-v21/layout_search.xml

+8-9
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,6 @@
9797
android:layout_marginStart="8dp"
9898
android:layout_marginTop="4dp"
9999
android:layout_marginEnd="8dp"
100-
android:layout_marginBottom="8dp"
101100
app:chipSpacing="4dp"
102101
app:singleLine="true" />
103102

@@ -110,10 +109,10 @@
110109
android:layout_marginStart="8dp"
111110
android:layout_marginTop="8dp"
112111
android:layout_marginEnd="8dp"
113-
android:layout_marginBottom="8dp"
112+
android:layout_marginBottom="12dp"
114113
android:gravity="center_vertical"
115114
android:orientation="horizontal"
116-
android:padding="8dp"
115+
android:paddingVertical="12dp"
117116
android:visibility="gone"
118117
app:layout_constraintStart_toStartOf="parent"
119118
app:layout_constraintTop_toBottomOf="@id/searchRecentItemsScrollView">
@@ -122,7 +121,7 @@
122121
android:id="@+id/notFindingTextView"
123122
android:layout_width="0dp"
124123
android:layout_height="wrap_content"
125-
android:layout_weight="1.3"
124+
android:layout_weight="1.4"
126125
android:text="@string/not_finding_what_you_re_looking_for"
127126
android:textSize="16sp" />
128127

@@ -131,12 +130,12 @@
131130
style="?android:attr/borderlessButtonStyle"
132131
android:layout_width="0dp"
133132
android:layout_height="wrap_content"
134-
android:layout_marginStart="0dp"
135-
android:layout_weight="0.7"
133+
android:layout_marginStart="8dp"
134+
android:layout_weight="0.6"
136135
android:background="@drawable/ripple_button_background"
137-
android:minHeight="8dp"
138-
android:paddingVertical="8dp"
139-
android:text="@string/try_deep_search"
136+
android:minHeight="4dp"
137+
android:paddingVertical="2dp"
138+
android:text="@string/try_indexed_search"
140139
android:textAllCaps="false"
141140
android:textColor="@color/primary_pink"
142141
android:textSize="14sp" />

app/src/main/res/layout-w720dp/layout_search.xml

+3-2
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,7 @@
107107
android:layout_height="wrap_content"
108108
android:layout_marginStart="8dp"
109109
android:layout_marginTop="8dp"
110+
android:layout_marginBottom="8dp"
110111
android:orientation="horizontal"
111112
android:gravity="center_vertical"
112113
android:visibility="gone"
@@ -129,12 +130,12 @@
129130
android:layout_height="wrap_content"
130131
android:layout_marginStart="16dp"
131132
android:textAllCaps="false"
132-
android:textSize="14sp"
133+
android:textSize="16sp"
133134
android:paddingHorizontal="8dp"
134135
android:minHeight="8dp"
135136
android:paddingVertical="8dp"
136137
android:background="@drawable/button_background"
137-
android:text="@string/try_deep_search"
138+
android:text="@string/try_indexed_search"
138139
android:textColor="@color/primary_pink" />
139140

140141

app/src/main/res/layout/layout_search.xml

+7-6
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,6 @@
9494
android:layout_marginStart="8dp"
9595
android:layout_marginTop="4dp"
9696
android:layout_marginEnd="8dp"
97-
android:layout_marginBottom="8dp"
9897
app:chipSpacing="4dp"
9998
app:singleLine="true" />
10099

@@ -115,21 +114,23 @@
115114

116115
<androidx.appcompat.widget.AppCompatTextView
117116
android:id="@+id/notFindingTextView"
118-
android:layout_width="wrap_content"
117+
android:layout_width="0dp"
119118
android:layout_height="wrap_content"
119+
android:layout_weight="1.4"
120120
android:text="@string/not_finding_what_you_re_looking_for"
121121
android:textSize="16sp" />
122122

123123
<androidx.appcompat.widget.AppCompatButton
124124
android:id="@+id/tryDeepSearchButton"
125125
style="?android:attr/borderlessButtonStyle"
126-
android:layout_width="wrap_content"
126+
android:layout_width="0dp"
127127
android:layout_height="wrap_content"
128+
android:layout_weight="0.6"
128129
android:layout_marginStart="4dp"
129130
android:background="@drawable/button_background"
130-
android:minHeight="8dp"
131-
android:paddingVertical="8dp"
132-
android:text="@string/try_deep_search"
131+
android:minHeight="4dp"
132+
android:paddingVertical="2dp"
133+
android:text="@string/try_indexed_search"
133134
android:textAllCaps="false"
134135
android:textColor="@color/primary_pink"
135136
android:textSize="14sp" />

0 commit comments

Comments
 (0)