mirror of
https://github.com/M66B/FairEmail.git
synced 2025-01-02 21:24:34 +00:00
Toggle cc/bcc button on/off
This commit is contained in:
parent
82774b273d
commit
c50d93c215
5 changed files with 53 additions and 3 deletions
|
@ -1240,6 +1240,7 @@ public class FragmentCompose extends FragmentBase {
|
|||
}
|
||||
});
|
||||
|
||||
ibCcBcc.setImageLevel(cc_bcc ? 0 : 1);
|
||||
grpAddresses.setVisibility(cc_bcc ? View.VISIBLE : View.GONE);
|
||||
|
||||
ibRemoveAttachments.setVisibility(View.GONE);
|
||||
|
@ -1952,6 +1953,7 @@ public class FragmentCompose extends FragmentBase {
|
|||
}
|
||||
|
||||
private void onMenuAddresses() {
|
||||
ibCcBcc.setImageLevel(grpAddresses.getVisibility() == View.GONE ? 0 : 1);
|
||||
grpAddresses.setVisibility(grpAddresses.getVisibility() == View.GONE ? View.VISIBLE : View.GONE);
|
||||
|
||||
getMainHandler().post(new Runnable() {
|
||||
|
@ -4058,8 +4060,10 @@ public class FragmentCompose extends FragmentBase {
|
|||
|
||||
private void onContactGroupSelected(Bundle args) {
|
||||
final int target = args.getInt("target");
|
||||
if (target > 0)
|
||||
if (target > 0) {
|
||||
ibCcBcc.setImageLevel(0);
|
||||
grpAddresses.setVisibility(View.VISIBLE);
|
||||
}
|
||||
|
||||
args.putString("to", etTo.getText().toString().trim());
|
||||
args.putString("cc", etCc.getText().toString().trim());
|
||||
|
@ -5547,8 +5551,10 @@ public class FragmentCompose extends FragmentBase {
|
|||
grpHeader.setVisibility(View.VISIBLE);
|
||||
if ("reply_all".equals(action) ||
|
||||
(data.draft.cc != null && data.draft.cc.length > 0) ||
|
||||
(data.draft.bcc != null && data.draft.bcc.length > 0))
|
||||
(data.draft.bcc != null && data.draft.bcc.length > 0)) {
|
||||
ibCcBcc.setImageLevel(0);
|
||||
grpAddresses.setVisibility(View.VISIBLE);
|
||||
}
|
||||
ibCcBcc.setVisibility(View.VISIBLE);
|
||||
|
||||
bottom_navigation.getMenu().findItem(R.id.action_undo).setVisible(data.draft.revision > 1);
|
||||
|
|
9
app/src/main/res/drawable/group.xml
Normal file
9
app/src/main/res/drawable/group.xml
Normal file
|
@ -0,0 +1,9 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<level-list xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item
|
||||
android:drawable="@drawable/twotone_group_off_24"
|
||||
android:maxLevel="0" />
|
||||
<item
|
||||
android:drawable="@drawable/twotone_group_24"
|
||||
android:maxLevel="1" />
|
||||
</level-list>
|
20
app/src/main/res/drawable/twotone_group_24.xml
Normal file
20
app/src/main/res/drawable/twotone_group_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">
|
||||
<path
|
||||
android:fillColor="@android:color/white"
|
||||
android:pathData="M9,8.5m-1.5,0a1.5,1.5 0,1 1,3 0a1.5,1.5 0,1 1,-3 0"
|
||||
android:strokeAlpha="0.3"
|
||||
android:fillAlpha="0.3"/>
|
||||
<path
|
||||
android:fillColor="@android:color/white"
|
||||
android:pathData="M4.34,17h9.32c-0.84,-0.58 -2.87,-1.25 -4.66,-1.25s-3.82,0.67 -4.66,1.25z"
|
||||
android:strokeAlpha="0.3"
|
||||
android:fillAlpha="0.3"/>
|
||||
<path
|
||||
android:fillColor="@android:color/white"
|
||||
android:pathData="M9,12c1.93,0 3.5,-1.57 3.5,-3.5S10.93,5 9,5 5.5,6.57 5.5,8.5 7.07,12 9,12zM9,7c0.83,0 1.5,0.67 1.5,1.5S9.83,10 9,10s-1.5,-0.67 -1.5,-1.5S8.17,7 9,7zM9,13.75c-2.34,0 -7,1.17 -7,3.5L2,19h14v-1.75c0,-2.33 -4.66,-3.5 -7,-3.5zM4.34,17c0.84,-0.58 2.87,-1.25 4.66,-1.25s3.82,0.67 4.66,1.25L4.34,17zM16.04,13.81c1.16,0.84 1.96,1.96 1.96,3.44L18,19h4v-1.75c0,-2.02 -3.5,-3.17 -5.96,-3.44zM15,12c1.93,0 3.5,-1.57 3.5,-3.5S16.93,5 15,5c-0.54,0 -1.04,0.13 -1.5,0.35 0.63,0.89 1,1.98 1,3.15s-0.37,2.26 -1,3.15c0.46,0.22 0.96,0.35 1.5,0.35z"/>
|
||||
</vector>
|
15
app/src/main/res/drawable/twotone_group_off_24.xml
Normal file
15
app/src/main/res/drawable/twotone_group_off_24.xml
Normal file
|
@ -0,0 +1,15 @@
|
|||
<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">
|
||||
<path
|
||||
android:fillColor="@android:color/white"
|
||||
android:pathData="M10.99,8.16C11,8.11 11,8.06 11,8c0,-1.1 -0.9,-2 -2,-2C8.94,6 8.89,6 8.84,6.01L10.99,8.16zM9,15c-2.7,0 -5.8,1.29 -6,2.01V18h12v-0.17l-2.11,-2.11C11.76,15.31 10.33,15 9,15z"
|
||||
android:strokeAlpha="0.3"
|
||||
android:fillAlpha="0.3"/>
|
||||
<path
|
||||
android:fillColor="@android:color/white"
|
||||
android:pathData="M15,8c0,-1.42 -0.5,-2.73 -1.33,-3.76C14.09,4.1 14.53,4 15,4c2.21,0 4,1.79 4,4s-1.79,4 -4,4c-0.06,0 -0.12,0 -0.18,0l-0.77,-0.77C14.65,10.29 15,9.18 15,8zM22.83,20H23v-3c0,-2.18 -3.58,-3.47 -6.34,-3.87c1.1,0.75 1.95,1.71 2.23,2.94L22.83,20zM9,6C8.94,6 8.89,6 8.84,6.01l-1.6,-1.6C7.77,4.15 8.37,4 9,4c2.21,0 4,1.79 4,4c0,0.63 -0.15,1.23 -0.41,1.76l-1.6,-1.6C11,8.11 11,8.06 11,8C11,6.9 10.1,6 9,6zM9.17,12C9.11,12 9.06,12 9,12c-2.21,0 -4,-1.79 -4,-4c0,-0.06 0,-0.11 0,-0.17L0.69,3.51L2.1,2.1l19.8,19.8l-1.41,1.41L17,19.83V20H1v-3c0,-2.66 5.33,-4 8,-4c0.37,0 0.8,0.03 1.25,0.08L9.17,12zM9,15c-2.7,0 -5.8,1.29 -6,2.01V18h12v-0.17l-2.11,-2.11C11.76,15.31 10.33,15 9,15z"/>
|
||||
</vector>
|
|
@ -112,7 +112,7 @@
|
|||
app:layout_constraintEnd_toStartOf="@+id/ibToAdd"
|
||||
app:layout_constraintStart_toEndOf="@id/etTo"
|
||||
app:layout_constraintTop_toTopOf="@+id/etTo"
|
||||
app:srcCompat="@drawable/twotone_people_24"
|
||||
app:srcCompat="@drawable/group"
|
||||
app:tint="?attr/colorAccent" />
|
||||
|
||||
<ImageButton
|
||||
|
|
Loading…
Reference in a new issue