mirror of
https://github.com/M66B/FairEmail.git
synced 2025-01-02 21:24:34 +00:00
EML: use floating action button
This commit is contained in:
parent
4670c11dfe
commit
0aa295b899
4 changed files with 34 additions and 19 deletions
|
@ -54,6 +54,7 @@ import androidx.preference.PreferenceManager;
|
||||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||||
import androidx.recyclerview.widget.RecyclerView;
|
import androidx.recyclerview.widget.RecyclerView;
|
||||||
|
|
||||||
|
import com.google.android.material.floatingactionbutton.FloatingActionButton;
|
||||||
import com.google.android.material.snackbar.Snackbar;
|
import com.google.android.material.snackbar.Snackbar;
|
||||||
import com.sun.mail.imap.IMAPFolder;
|
import com.sun.mail.imap.IMAPFolder;
|
||||||
|
|
||||||
|
@ -94,6 +95,7 @@ public class ActivityEML extends ActivityBase {
|
||||||
private TextView tvHeaders;
|
private TextView tvHeaders;
|
||||||
private TextView tvAuthentication;
|
private TextView tvAuthentication;
|
||||||
private ContentLoadingProgressBar pbWait;
|
private ContentLoadingProgressBar pbWait;
|
||||||
|
private FloatingActionButton fabSave;
|
||||||
private Group grpReady;
|
private Group grpReady;
|
||||||
|
|
||||||
private boolean draft;
|
private boolean draft;
|
||||||
|
@ -136,6 +138,7 @@ public class ActivityEML extends ActivityBase {
|
||||||
tvHeaders = findViewById(R.id.tvHeaders);
|
tvHeaders = findViewById(R.id.tvHeaders);
|
||||||
tvAuthentication = findViewById(R.id.tvAuthentication);
|
tvAuthentication = findViewById(R.id.tvAuthentication);
|
||||||
pbWait = findViewById(R.id.pbWait);
|
pbWait = findViewById(R.id.pbWait);
|
||||||
|
fabSave = findViewById(R.id.fabSave);
|
||||||
grpReady = findViewById(R.id.grpReady);
|
grpReady = findViewById(R.id.grpReady);
|
||||||
|
|
||||||
rvAttachment.setHasFixedSize(false);
|
rvAttachment.setHasFixedSize(false);
|
||||||
|
@ -211,6 +214,13 @@ public class ActivityEML extends ActivityBase {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
fabSave.setOnClickListener(new View.OnClickListener() {
|
||||||
|
@Override
|
||||||
|
public void onClick(View v) {
|
||||||
|
onMenuSave();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
// Initialize
|
// Initialize
|
||||||
vSeparatorAttachments.setVisibility(View.GONE);
|
vSeparatorAttachments.setVisibility(View.GONE);
|
||||||
grpReady.setVisibility(View.GONE);
|
grpReady.setVisibility(View.GONE);
|
||||||
|
@ -568,14 +578,11 @@ public class ActivityEML extends ActivityBase {
|
||||||
.setChecked(junk);
|
.setChecked(junk);
|
||||||
|
|
||||||
if (draft && BuildConfig.DEBUG)
|
if (draft && BuildConfig.DEBUG)
|
||||||
menu.findItem(R.id.menu_save)
|
fabSave.setImageResource(R.drawable.twotone_drafts_24);
|
||||||
.setIcon(R.drawable.twotone_drafts_24);
|
|
||||||
else if (junk && BuildConfig.DEBUG)
|
else if (junk && BuildConfig.DEBUG)
|
||||||
menu.findItem(R.id.menu_save)
|
fabSave.setImageResource(R.drawable.twotone_report_24);
|
||||||
.setIcon(R.drawable.twotone_report_24);
|
|
||||||
else
|
else
|
||||||
menu.findItem(R.id.menu_save)
|
fabSave.setImageResource(R.drawable.twotone_move_to_inbox_24);
|
||||||
.setIcon(R.drawable.twotone_move_to_inbox_24);
|
|
||||||
|
|
||||||
return super.onPrepareOptionsMenu(menu);
|
return super.onPrepareOptionsMenu(menu);
|
||||||
}
|
}
|
||||||
|
@ -586,9 +593,6 @@ public class ActivityEML extends ActivityBase {
|
||||||
if (itemId == android.R.id.home) {
|
if (itemId == android.R.id.home) {
|
||||||
finish();
|
finish();
|
||||||
return true;
|
return true;
|
||||||
} else if (itemId == R.id.menu_save) {
|
|
||||||
onMenuSave();
|
|
||||||
return true;
|
|
||||||
} else if (itemId == R.id.menu_draft) {
|
} else if (itemId == R.id.menu_draft) {
|
||||||
draft = !draft;
|
draft = !draft;
|
||||||
if (draft)
|
if (draft)
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
tools:context="eu.faircode.email.ActivityEML">
|
tools:context="eu.faircode.email.ActivityEML">
|
||||||
|
|
||||||
<ScrollView
|
<androidx.core.widget.NestedScrollView
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:orientation="vertical"
|
android:orientation="vertical"
|
||||||
|
@ -17,7 +17,8 @@
|
||||||
|
|
||||||
<androidx.constraintlayout.widget.ConstraintLayout
|
<androidx.constraintlayout.widget.ConstraintLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content">
|
android:layout_height="wrap_content"
|
||||||
|
android:paddingBottom="90dp">
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/tvHint"
|
android:id="@+id/tvHint"
|
||||||
|
@ -356,7 +357,7 @@
|
||||||
android:layout_height="0dp"
|
android:layout_height="0dp"
|
||||||
app:constraint_referenced_ids="cardMessage,cardStructure" />
|
app:constraint_referenced_ids="cardMessage,cardStructure" />
|
||||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
</ScrollView>
|
</androidx.core.widget.NestedScrollView>
|
||||||
|
|
||||||
<eu.faircode.email.ContentLoadingProgressBar
|
<eu.faircode.email.ContentLoadingProgressBar
|
||||||
android:id="@+id/pbWait"
|
android:id="@+id/pbWait"
|
||||||
|
@ -368,4 +369,17 @@
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
app:layout_constraintTop_toTopOf="parent" />
|
app:layout_constraintTop_toTopOf="parent" />
|
||||||
|
|
||||||
|
<com.google.android.material.floatingactionbutton.FloatingActionButton
|
||||||
|
android:id="@+id/fabSave"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_gravity="end|bottom"
|
||||||
|
android:layout_margin="@dimen/fab_padding"
|
||||||
|
android:contentDescription="@string/title_save"
|
||||||
|
app:backgroundTint="?attr/colorFabBackground"
|
||||||
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:srcCompat="@drawable/twotone_move_to_inbox_24"
|
||||||
|
app:tint="?attr/colorFabForeground" />
|
||||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
|
@ -1,12 +1,6 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<menu xmlns:android="http://schemas.android.com/apk/res/android"
|
<menu xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
xmlns:app="http://schemas.android.com/apk/res-auto">
|
xmlns:app="http://schemas.android.com/apk/res-auto">
|
||||||
<item
|
|
||||||
android:id="@+id/menu_save"
|
|
||||||
android:icon="@drawable/twotone_move_to_inbox_24"
|
|
||||||
android:title="@string/title_save"
|
|
||||||
app:showAsAction="always" />
|
|
||||||
|
|
||||||
<item
|
<item
|
||||||
android:id="@+id/menu_draft"
|
android:id="@+id/menu_draft"
|
||||||
android:checkable="true"
|
android:checkable="true"
|
||||||
|
|
|
@ -2352,7 +2352,10 @@
|
||||||
<string name="title_hint_junk">Spam filtering should be done by the email server and cannot be done reliably on a battery powered device with limited capabilities.</string>
|
<string name="title_hint_junk">Spam filtering should be done by the email server and cannot be done reliably on a battery powered device with limited capabilities.</string>
|
||||||
<string name="title_hint_junk_learn">By moving messages to and from the spam folder, the email server "learns" what spam is</string>
|
<string name="title_hint_junk_learn">By moving messages to and from the spam folder, the email server "learns" what spam is</string>
|
||||||
<string name="title_hint_contact_actions">Long press for options</string>
|
<string name="title_hint_contact_actions">Long press for options</string>
|
||||||
<string name="title_hint_eml">This is a summary of the content of a raw message file. Save the raw message with the save icon in the action bar to view all content.</string>
|
<string name="title_hint_eml">
|
||||||
|
This is a summary of the contents of a raw message file.
|
||||||
|
You can use the bottom-right button to save the message to the inbox to view all content.
|
||||||
|
</string>
|
||||||
|
|
||||||
<string name="title_open_link">Open link</string>
|
<string name="title_open_link">Open link</string>
|
||||||
<string name="title_image_link">Image link</string>
|
<string name="title_image_link">Image link</string>
|
||||||
|
|
Loading…
Reference in a new issue