mirror of
https://github.com/M66B/FairEmail.git
synced 2025-01-01 04:35:57 +00:00
Added optional search in text button
This commit is contained in:
parent
9e366b4cf6
commit
ee12d06469
4 changed files with 60 additions and 2 deletions
|
@ -423,6 +423,7 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
|
|||
private ImageButton ibPin;
|
||||
private ImageButton ibShare;
|
||||
private ImageButton ibEvent;
|
||||
private ImageButton ibSearchText;
|
||||
private ImageButton ibSearch;
|
||||
private ImageButton ibHide;
|
||||
private ImageButton ibSeen;
|
||||
|
@ -653,6 +654,7 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
|
|||
ibPin = vsBody.findViewById(R.id.ibPin);
|
||||
ibShare = vsBody.findViewById(R.id.ibShare);
|
||||
ibEvent = vsBody.findViewById(R.id.ibEvent);
|
||||
ibSearchText = vsBody.findViewById(R.id.ibSearchText);
|
||||
ibSearch = vsBody.findViewById(R.id.ibSearch);
|
||||
ibHide = vsBody.findViewById(R.id.ibHide);
|
||||
ibSeen = vsBody.findViewById(R.id.ibSeen);
|
||||
|
@ -760,6 +762,7 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
|
|||
ibPin.setOnClickListener(this);
|
||||
ibShare.setOnClickListener(this);
|
||||
ibEvent.setOnClickListener(this);
|
||||
ibSearchText.setOnClickListener(this);
|
||||
ibSearch.setOnClickListener(this);
|
||||
ibHide.setOnClickListener(this);
|
||||
ibSeen.setOnClickListener(this);
|
||||
|
@ -877,6 +880,7 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
|
|||
ibPin.setOnClickListener(null);
|
||||
ibShare.setOnClickListener(null);
|
||||
ibEvent.setOnClickListener(null);
|
||||
ibSearchText.setOnClickListener(null);
|
||||
ibSearch.setOnClickListener(null);
|
||||
ibHide.setOnClickListener(null);
|
||||
ibSeen.setOnClickListener(null);
|
||||
|
@ -1344,6 +1348,7 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
|
|||
ibPin.setVisibility(View.GONE);
|
||||
ibShare.setVisibility(View.GONE);
|
||||
ibEvent.setVisibility(View.GONE);
|
||||
ibSearchText.setVisibility(View.GONE);
|
||||
ibSearch.setVisibility(View.GONE);
|
||||
ibHide.setVisibility(View.GONE);
|
||||
ibSeen.setVisibility(View.GONE);
|
||||
|
@ -1551,6 +1556,7 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
|
|||
ibPin.setVisibility(View.GONE);
|
||||
ibShare.setVisibility(View.GONE);
|
||||
ibEvent.setVisibility(View.GONE);
|
||||
ibSearchText.setVisibility(View.GONE);
|
||||
ibSearch.setVisibility(View.GONE);
|
||||
ibHide.setVisibility(View.GONE);
|
||||
ibSeen.setVisibility(View.GONE);
|
||||
|
@ -1715,6 +1721,8 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
|
|||
final boolean delete = (inTrash || !hasTrash || inJunk || outbox ||
|
||||
message.uid == null || message.accountProtocol == EntityAccount.TYPE_POP);
|
||||
|
||||
boolean full = properties.getValue("full", message.id);
|
||||
|
||||
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context);
|
||||
boolean expand_all = prefs.getBoolean("expand_all", false);
|
||||
boolean expand_one = prefs.getBoolean("expand_one", true);
|
||||
|
@ -1729,6 +1737,7 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
|
|||
boolean button_seen = prefs.getBoolean("button_seen", false);
|
||||
boolean button_hide = prefs.getBoolean("button_hide", false);
|
||||
boolean button_search = prefs.getBoolean("button_search", false);
|
||||
boolean button_search_text = prefs.getBoolean("button_search_text", false);
|
||||
boolean button_event = prefs.getBoolean("button_event", false);
|
||||
boolean button_share = prefs.getBoolean("button_share", false);
|
||||
boolean button_pin = prefs.getBoolean("button_pin", false);
|
||||
|
@ -1748,6 +1757,7 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
|
|||
ibPin.setVisibility(tools && button_pin && pin ? View.VISIBLE : View.GONE);
|
||||
ibShare.setVisibility(tools && button_share && message.content ? View.VISIBLE : View.GONE);
|
||||
ibEvent.setVisibility(tools && button_event && message.content ? View.VISIBLE : View.GONE);
|
||||
ibSearchText.setVisibility(tools && button_search_text && message.content && !full ? View.VISIBLE : View.GONE);
|
||||
ibSearch.setVisibility(tools && button_search && (froms > 0 || tos > 0) && !outbox ? View.VISIBLE : View.GONE);
|
||||
ibHide.setVisibility(tools && button_hide && !outbox ? View.VISIBLE : View.GONE);
|
||||
ibSeen.setVisibility(tools && button_seen && !outbox && seen ? View.VISIBLE : View.GONE);
|
||||
|
@ -3097,6 +3107,8 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
|
|||
onMenuShare(message, true);
|
||||
else
|
||||
context.startActivity(new Intent(context, ActivityBilling.class));
|
||||
} else if (id == R.id.ibSearchText) {
|
||||
onMenuSearch(message);
|
||||
} else if (id == R.id.ibSearch) {
|
||||
onSearchContact(message);
|
||||
} else if (id == R.id.ibAnswer) {
|
||||
|
@ -3928,6 +3940,7 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
|
|||
properties.setHeight(message.id, null);
|
||||
properties.setPosition(message.id, null);
|
||||
|
||||
setupTools(message, false, false);
|
||||
bindBody(message, false);
|
||||
}
|
||||
|
||||
|
@ -6879,6 +6892,7 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
|
|||
final CheckBox cbSeen = dview.findViewById(R.id.cbSeen);
|
||||
final CheckBox cbHide = dview.findViewById(R.id.cbHide);
|
||||
final CheckBox cbSearch = dview.findViewById(R.id.cbSearch);
|
||||
final CheckBox cbSearchText = dview.findViewById(R.id.cbSearchText);
|
||||
final CheckBox cbEvent = dview.findViewById(R.id.cbEvent);
|
||||
final CheckBox cbShare = dview.findViewById(R.id.cbShare);
|
||||
final CheckBox cbPin = dview.findViewById(R.id.cbPin);
|
||||
|
@ -6898,6 +6912,7 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
|
|||
cbSeen.setChecked(prefs.getBoolean("button_seen", false));
|
||||
cbHide.setChecked(prefs.getBoolean("button_hide", false));
|
||||
cbSearch.setChecked(prefs.getBoolean("button_search", false));
|
||||
cbSearchText.setChecked(prefs.getBoolean("button_search_text", false));
|
||||
cbEvent.setChecked(prefs.getBoolean("button_event", false));
|
||||
cbShare.setChecked(prefs.getBoolean("button_share", false));
|
||||
cbPin.setChecked(prefs.getBoolean("button_pin", false));
|
||||
|
@ -6921,6 +6936,7 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
|
|||
editor.putBoolean("button_seen", cbSeen.isChecked());
|
||||
editor.putBoolean("button_hide", cbHide.isChecked());
|
||||
editor.putBoolean("button_search", cbSearch.isChecked());
|
||||
editor.putBoolean("button_search_text", cbSearchText.isChecked());
|
||||
editor.putBoolean("button_event", cbEvent.isChecked());
|
||||
editor.putBoolean("button_share", cbShare.isChecked());
|
||||
editor.putBoolean("button_pin", cbPin.isChecked());
|
||||
|
|
20
app/src/main/res/drawable/twotone_manage_search_24.xml
Normal file
20
app/src/main/res/drawable/twotone_manage_search_24.xml
Normal file
|
@ -0,0 +1,20 @@
|
|||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:viewportWidth="24"
|
||||
android:viewportHeight="24"
|
||||
android:tint="?attr/colorControlNormal"
|
||||
android:autoMirrored="true">
|
||||
<path
|
||||
android:fillColor="@android:color/white"
|
||||
android:pathData="M2,12h5v2h-5z"/>
|
||||
<path
|
||||
android:fillColor="@android:color/white"
|
||||
android:pathData="M18.17,13.75C18.69,12.96 19,12.02 19,11c0,-2.76 -2.24,-5 -5,-5s-5,2.24 -5,5s2.24,5 5,5c1.02,0 1.96,-0.31 2.76,-0.83L20.59,19L22,17.59L18.17,13.75zM14,14c-1.65,0 -3,-1.35 -3,-3c0,-1.65 1.35,-3 3,-3s3,1.35 3,3C17,12.65 15.65,14 14,14z"/>
|
||||
<path
|
||||
android:fillColor="@android:color/white"
|
||||
android:pathData="M2,7h5v2h-5z"/>
|
||||
<path
|
||||
android:fillColor="@android:color/white"
|
||||
android:pathData="M2,17h10v2h-10z"/>
|
||||
</vector>
|
|
@ -131,6 +131,16 @@
|
|||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/cbHide" />
|
||||
|
||||
<CheckBox
|
||||
android:id="@+id/cbSearchText"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="12dp"
|
||||
android:text="@string/title_search_in_text"
|
||||
android:textAppearance="@style/TextAppearance.AppCompat.Small"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/cbSearch" />
|
||||
|
||||
<CheckBox
|
||||
android:id="@+id/cbEvent"
|
||||
android:layout_width="wrap_content"
|
||||
|
@ -139,7 +149,7 @@
|
|||
android:text="@string/title_event"
|
||||
android:textAppearance="@style/TextAppearance.AppCompat.Small"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/cbSearch" />
|
||||
app:layout_constraintTop_toBottomOf="@id/cbSearchText" />
|
||||
|
||||
<CheckBox
|
||||
android:id="@+id/cbShare"
|
||||
|
|
|
@ -41,7 +41,7 @@
|
|||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginEnd="3dp"
|
||||
app:constraint_referenced_ids="ibMore,ibInbox,ibJunk,ibTrash,ibArchive,ibMove,ibCopy,ibKeywords,ibLabels,ibNotes,ibAnswer,ibSeen,ibHide,ibSearch,ibEvent,ibShare,ibPin,ibPrint,ibUnsubscribe,ibRule,ibUndo"
|
||||
app:constraint_referenced_ids="ibMore,ibInbox,ibJunk,ibTrash,ibArchive,ibMove,ibCopy,ibKeywords,ibLabels,ibNotes,ibAnswer,ibSeen,ibHide,ibSearch,ibSearchText,ibEvent,ibShare,ibPin,ibPrint,ibUnsubscribe,ibRule,ibUndo"
|
||||
app:flow_horizontalBias="0"
|
||||
app:flow_horizontalGap="3dp"
|
||||
app:flow_horizontalStyle="packed"
|
||||
|
@ -212,6 +212,18 @@
|
|||
app:srcCompat="@drawable/twotone_search_24"
|
||||
tools:ignore="MissingConstraints" />
|
||||
|
||||
<ImageButton
|
||||
android:id="@+id/ibSearchText"
|
||||
android:layout_width="36dp"
|
||||
android:layout_height="36dp"
|
||||
android:background="?android:attr/selectableItemBackgroundBorderless"
|
||||
android:contentDescription="@string/title_search_in_text"
|
||||
android:padding="6dp"
|
||||
android:scaleType="fitCenter"
|
||||
android:tooltipText="@string/title_search_in_text"
|
||||
app:srcCompat="@drawable/twotone_manage_search_24"
|
||||
tools:ignore="MissingConstraints" />
|
||||
|
||||
<ImageButton
|
||||
android:id="@+id/ibEvent"
|
||||
android:layout_width="36dp"
|
||||
|
|
Loading…
Reference in a new issue