Browse Source

Move edit folder to menu, use close button for hints

main
M66B 6 years ago
parent
commit
ef44555115
8 changed files with 178 additions and 112 deletions
  1. +60
    -52
      app/src/main/java/eu/faircode/email/AdapterFolder.java
  2. +20
    -0
      app/src/main/java/eu/faircode/email/FragmentFolders.java
  3. +9
    -10
      app/src/main/java/eu/faircode/email/FragmentMessages.java
  4. +10
    -0
      app/src/main/res/drawable/baseline_sync_disabled_24.xml
  5. +40
    -1
      app/src/main/res/layout/fragment_folders.xml
  6. +11
    -11
      app/src/main/res/layout/fragment_messages.xml
  7. +25
    -36
      app/src/main/res/layout/item_folder.xml
  8. +3
    -2
      app/src/main/res/values/strings.xml

+ 60
- 52
app/src/main/java/eu/faircode/email/AdapterFolder.java View File

@ -51,56 +51,62 @@ import androidx.recyclerview.widget.RecyclerView;
public class AdapterFolder extends RecyclerView.Adapter<AdapterFolder.ViewHolder> { public class AdapterFolder extends RecyclerView.Adapter<AdapterFolder.ViewHolder> {
private Context context; private Context context;
private LifecycleOwner owner; private LifecycleOwner owner;
private String accountState = null;
private List<TupleFolderEx> all = new ArrayList<>(); private List<TupleFolderEx> all = new ArrayList<>();
private List<TupleFolderEx> filtered = new ArrayList<>(); private List<TupleFolderEx> filtered = new ArrayList<>();
public class ViewHolder extends RecyclerView.ViewHolder implements View.OnClickListener, View.OnLongClickListener { public class ViewHolder extends RecyclerView.ViewHolder implements View.OnClickListener, View.OnLongClickListener {
View itemView; View itemView;
ImageView ivEdit;
ImageView ivState;
TextView tvName; TextView tvName;
TextView tvMessages; TextView tvMessages;
TextView tvType;
ImageView ivUnified; ImageView ivUnified;
TextView tvType;
TextView tvAfter; TextView tvAfter;
ImageView ivSync; ImageView ivSync;
ImageView ivState;
TextView tvError; TextView tvError;
private final static int action_synchronize = 1;
private final static int action_delete_local = 2;
private final static int action_edit = 1;
private final static int action_sync = 2;
private final static int action_delete = 3;
ViewHolder(View itemView) { ViewHolder(View itemView) {
super(itemView); super(itemView);
this.itemView = itemView; this.itemView = itemView;
ivEdit = itemView.findViewById(R.id.ivEdit);
ivState = itemView.findViewById(R.id.ivState);
tvName = itemView.findViewById(R.id.tvName); tvName = itemView.findViewById(R.id.tvName);
tvMessages = itemView.findViewById(R.id.tvMessages); tvMessages = itemView.findViewById(R.id.tvMessages);
tvType = itemView.findViewById(R.id.tvType);
ivUnified = itemView.findViewById(R.id.ivUnified); ivUnified = itemView.findViewById(R.id.ivUnified);
tvType = itemView.findViewById(R.id.tvType);
tvAfter = itemView.findViewById(R.id.tvAfter); tvAfter = itemView.findViewById(R.id.tvAfter);
ivSync = itemView.findViewById(R.id.ivSync); ivSync = itemView.findViewById(R.id.ivSync);
tvError = itemView.findViewById(R.id.tvError); tvError = itemView.findViewById(R.id.tvError);
ivState = itemView.findViewById(R.id.ivState);
} }
private void wire(boolean properties) {
private void wire() {
itemView.setOnClickListener(this); itemView.setOnClickListener(this);
itemView.setOnLongClickListener(this); itemView.setOnLongClickListener(this);
if (properties)
ivEdit.setOnClickListener(this);
} }
private void unwire() { private void unwire() {
itemView.setOnClickListener(null); itemView.setOnClickListener(null);
itemView.setOnLongClickListener(null); itemView.setOnLongClickListener(null);
ivEdit.setOnClickListener(null);
} }
private void bindTo(TupleFolderEx folder) { private void bindTo(TupleFolderEx folder) {
boolean outbox = EntityFolder.OUTBOX.equals(folder.type);
ivEdit.setVisibility(outbox ? View.INVISIBLE : View.VISIBLE);
if ("connected".equals(folder.state))
ivState.setImageResource(R.drawable.baseline_cloud_24);
else if ("connecting".equals(folder.state))
ivState.setImageResource(R.drawable.baseline_cloud_queue_24);
else if ("closing".equals(folder.state))
ivState.setImageResource(R.drawable.baseline_close_24);
else if ("syncing".equals(folder.state))
ivState.setImageResource(R.drawable.baseline_compare_arrows_24);
else
ivState.setImageResource(R.drawable.baseline_cloud_off_24);
ivState.setVisibility(folder.synchronize || folder.state != null ? View.VISIBLE : View.INVISIBLE);
String name = Helper.localizeFolderName(context, folder.name); String name = Helper.localizeFolderName(context, folder.name);
if (folder.unseen > 0) if (folder.unseen > 0)
@ -112,28 +118,22 @@ public class AdapterFolder extends RecyclerView.Adapter<AdapterFolder.ViewHolder
tvMessages.setText(Integer.toString(folder.messages)); tvMessages.setText(Integer.toString(folder.messages));
ivUnified.setVisibility(folder.unified ? View.VISIBLE : View.INVISIBLE);
int resid = context.getResources().getIdentifier( int resid = context.getResources().getIdentifier(
"title_folder_" + folder.type.toLowerCase(), "title_folder_" + folder.type.toLowerCase(),
"string", "string",
context.getPackageName()); context.getPackageName());
tvType.setText(resid > 0 ? context.getString(resid) : folder.type); tvType.setText(resid > 0 ? context.getString(resid) : folder.type);
ivUnified.setVisibility(folder.unified ? View.VISIBLE : View.GONE);
tvAfter.setText(Integer.toString(folder.after));
ivSync.setVisibility(folder.synchronize ? View.VISIBLE : View.INVISIBLE);
if ("connected".equals(folder.state))
ivState.setImageResource(R.drawable.baseline_cloud_24);
else if ("connecting".equals(folder.state))
ivState.setImageResource(R.drawable.baseline_cloud_queue_24);
else if ("closing".equals(folder.state))
ivState.setImageResource(R.drawable.baseline_close_24);
else if ("syncing".equals(folder.state))
ivState.setImageResource(R.drawable.baseline_compare_arrows_24);
else
ivState.setImageResource(R.drawable.baseline_cloud_off_24);
ivState.setVisibility(folder.synchronize || folder.state != null ? View.VISIBLE : View.INVISIBLE);
if (folder.account == null) {
tvAfter.setText(null);
ivSync.setVisibility(View.GONE);
} else {
tvAfter.setText(Integer.toString(folder.after));
ivSync.setImageResource(folder.synchronize ? R.drawable.baseline_sync_24 : R.drawable.baseline_sync_disabled_24);
ivSync.setVisibility(View.VISIBLE);
}
tvError.setText(folder.error); tvError.setText(folder.error);
tvError.setVisibility(folder.error == null ? View.GONE : View.VISIBLE); tvError.setVisibility(folder.error == null ? View.GONE : View.VISIBLE);
@ -147,19 +147,10 @@ public class AdapterFolder extends RecyclerView.Adapter<AdapterFolder.ViewHolder
TupleFolderEx folder = filtered.get(pos); TupleFolderEx folder = filtered.get(pos);
if (view.getId() == R.id.ivEdit) {
if (!EntityFolder.OUTBOX.equals(folder.type)) {
LocalBroadcastManager lbm = LocalBroadcastManager.getInstance(context);
lbm.sendBroadcast(
new Intent(ActivityView.ACTION_EDIT_FOLDER)
.putExtra("id", folder.id));
}
} else {
LocalBroadcastManager lbm = LocalBroadcastManager.getInstance(context);
lbm.sendBroadcast(
new Intent(ActivityView.ACTION_VIEW_MESSAGES)
.putExtra("folder", folder.id));
}
LocalBroadcastManager lbm = LocalBroadcastManager.getInstance(context);
lbm.sendBroadcast(
new Intent(ActivityView.ACTION_VIEW_MESSAGES)
.putExtra("folder", folder.id));
} }
@Override @Override
@ -171,21 +162,34 @@ public class AdapterFolder extends RecyclerView.Adapter<AdapterFolder.ViewHolder
final TupleFolderEx folder = filtered.get(pos); final TupleFolderEx folder = filtered.get(pos);
PopupMenu popupMenu = new PopupMenu(context, itemView); PopupMenu popupMenu = new PopupMenu(context, itemView);
popupMenu.getMenu().add(Menu.NONE, action_synchronize, 1, R.string.title_synchronize_now);
popupMenu.getMenu().add(Menu.NONE, action_delete_local, 2, R.string.title_delete_local);
popupMenu.getMenu().add(Menu.NONE, action_sync, 1, R.string.title_synchronize_now);
popupMenu.getMenu().findItem(action_sync).setEnabled("connected".equals(accountState));
if (folder.account != null) {
popupMenu.getMenu().add(Menu.NONE, action_delete, 2, R.string.title_delete_local);
popupMenu.getMenu().add(Menu.NONE, action_edit, 3, R.string.title_edit_properties);
}
popupMenu.setOnMenuItemClickListener(new PopupMenu.OnMenuItemClickListener() { popupMenu.setOnMenuItemClickListener(new PopupMenu.OnMenuItemClickListener() {
@Override @Override
public boolean onMenuItemClick(MenuItem target) { public boolean onMenuItemClick(MenuItem target) {
LocalBroadcastManager lbm = LocalBroadcastManager.getInstance(context);
switch (target.getItemId()) { switch (target.getItemId()) {
case action_synchronize:
case action_edit:
lbm.sendBroadcast(
new Intent(ActivityView.ACTION_EDIT_FOLDER)
.putExtra("id", folder.id));
break;
case action_sync:
Log.i(Helper.TAG, folder.name + " requesting sync"); Log.i(Helper.TAG, folder.name + " requesting sync");
LocalBroadcastManager lbm = LocalBroadcastManager.getInstance(context);
lbm.sendBroadcast(new Intent(ServiceSynchronize.ACTION_SYNCHRONIZE_FOLDER)
.setType("account/" + (folder.account == null ? "outbox" : Long.toString(folder.account)))
.putExtra("folder", folder.id));
lbm.sendBroadcast(
new Intent(ServiceSynchronize.ACTION_SYNCHRONIZE_FOLDER)
.setType("account/" + (folder.account == null ? "outbox" : Long.toString(folder.account)))
.putExtra("folder", folder.id));
break; break;
case action_delete_local:
case action_delete:
Bundle args = new Bundle(); Bundle args = new Bundle();
args.putLong("id", folder.id); args.putLong("id", folder.id);
@ -276,6 +280,10 @@ public class AdapterFolder extends RecyclerView.Adapter<AdapterFolder.ViewHolder
diff.dispatchUpdatesTo(this); diff.dispatchUpdatesTo(this);
} }
public void setAccountState(String state) {
this.accountState = state;
}
private class MessageDiffCallback extends DiffUtil.Callback { private class MessageDiffCallback extends DiffUtil.Callback {
private List<TupleFolderEx> prev; private List<TupleFolderEx> prev;
private List<TupleFolderEx> next; private List<TupleFolderEx> next;
@ -333,6 +341,6 @@ public class AdapterFolder extends RecyclerView.Adapter<AdapterFolder.ViewHolder
TupleFolderEx folder = filtered.get(position); TupleFolderEx folder = filtered.get(position);
holder.bindTo(folder); holder.bindTo(folder);
holder.wire(folder.account != null);
holder.wire();
} }
} }

+ 20
- 0
app/src/main/java/eu/faircode/email/FragmentFolders.java View File

@ -20,10 +20,13 @@ package eu.faircode.email;
*/ */
import android.content.Intent; import android.content.Intent;
import android.content.SharedPreferences;
import android.os.Bundle; import android.os.Bundle;
import android.preference.PreferenceManager;
import android.view.LayoutInflater; import android.view.LayoutInflater;
import android.view.View; import android.view.View;
import android.view.ViewGroup; import android.view.ViewGroup;
import android.widget.ImageButton;
import android.widget.ProgressBar; import android.widget.ProgressBar;
import com.google.android.material.floatingactionbutton.FloatingActionButton; import com.google.android.material.floatingactionbutton.FloatingActionButton;
@ -38,8 +41,10 @@ import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView; import androidx.recyclerview.widget.RecyclerView;
public class FragmentFolders extends FragmentEx { public class FragmentFolders extends FragmentEx {
private ImageButton ibHintActions;
private RecyclerView rvFolder; private RecyclerView rvFolder;
private ProgressBar pbWait; private ProgressBar pbWait;
private Group grpHintActions;
private Group grpReady; private Group grpReady;
private FloatingActionButton fab; private FloatingActionButton fab;
@ -61,13 +66,24 @@ public class FragmentFolders extends FragmentEx {
View view = inflater.inflate(R.layout.fragment_folders, container, false); View view = inflater.inflate(R.layout.fragment_folders, container, false);
// Get controls // Get controls
ibHintActions = view.findViewById(R.id.ibHintActions);
rvFolder = view.findViewById(R.id.rvFolder); rvFolder = view.findViewById(R.id.rvFolder);
pbWait = view.findViewById(R.id.pbWait); pbWait = view.findViewById(R.id.pbWait);
grpHintActions = view.findViewById(R.id.grpHintActions);
grpReady = view.findViewById(R.id.grpReady); grpReady = view.findViewById(R.id.grpReady);
fab = view.findViewById(R.id.fab); fab = view.findViewById(R.id.fab);
// Wire controls // Wire controls
final SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(getContext());
ibHintActions.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
prefs.edit().putBoolean("folder_actions", true).apply();
grpHintActions.setVisibility(View.GONE);
}
});
rvFolder.setHasFixedSize(false); rvFolder.setHasFixedSize(false);
LinearLayoutManager llm = new LinearLayoutManager(getContext()); LinearLayoutManager llm = new LinearLayoutManager(getContext());
rvFolder.setLayoutManager(llm); rvFolder.setLayoutManager(llm);
@ -99,6 +115,9 @@ public class FragmentFolders extends FragmentEx {
public void onActivityCreated(@Nullable Bundle savedInstanceState) { public void onActivityCreated(@Nullable Bundle savedInstanceState) {
super.onActivityCreated(savedInstanceState); super.onActivityCreated(savedInstanceState);
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(getContext());
grpHintActions.setVisibility(prefs.getBoolean("folder_actions", false) ? View.GONE : View.VISIBLE);
DB db = DB.getInstance(getContext()); DB db = DB.getInstance(getContext());
// Observe account // Observe account
@ -106,6 +125,7 @@ public class FragmentFolders extends FragmentEx {
@Override @Override
public void onChanged(@Nullable EntityAccount account) { public void onChanged(@Nullable EntityAccount account) {
setSubtitle(account == null ? null : account.name); setSubtitle(account == null ? null : account.name);
adapter.setAccountState(account.state);
} }
}); });


+ 9
- 10
app/src/main/java/eu/faircode/email/FragmentMessages.java View File

@ -34,7 +34,7 @@ import android.view.MenuInflater;
import android.view.MenuItem; import android.view.MenuItem;
import android.view.View; import android.view.View;
import android.view.ViewGroup; import android.view.ViewGroup;
import android.widget.Button;
import android.widget.ImageButton;
import android.widget.ProgressBar; import android.widget.ProgressBar;
import android.widget.TextView; import android.widget.TextView;
import android.widget.Toast; import android.widget.Toast;
@ -60,11 +60,11 @@ import androidx.recyclerview.widget.RecyclerView;
public class FragmentMessages extends FragmentEx { public class FragmentMessages extends FragmentEx {
private ViewGroup view; private ViewGroup view;
private Button btnHintActions;
private ImageButton ibHintActions;
private RecyclerView rvMessage; private RecyclerView rvMessage;
private TextView tvNoEmail; private TextView tvNoEmail;
private ProgressBar pbWait; private ProgressBar pbWait;
private Group grpHintSwipe;
private Group grpHintActions;
private Group grpReady; private Group grpReady;
private FloatingActionButton fab; private FloatingActionButton fab;
@ -104,22 +104,22 @@ public class FragmentMessages extends FragmentEx {
setHasOptionsMenu(true); setHasOptionsMenu(true);
// Get controls // Get controls
btnHintActions = view.findViewById(R.id.btnHintActions);
ibHintActions = view.findViewById(R.id.ibHintActions);
rvMessage = view.findViewById(R.id.rvFolder); rvMessage = view.findViewById(R.id.rvFolder);
tvNoEmail = view.findViewById(R.id.tvNoEmail); tvNoEmail = view.findViewById(R.id.tvNoEmail);
pbWait = view.findViewById(R.id.pbWait); pbWait = view.findViewById(R.id.pbWait);
grpReady = view.findViewById(R.id.grpReady); grpReady = view.findViewById(R.id.grpReady);
grpHintSwipe = view.findViewById(R.id.grpHintSwipe);
grpHintActions = view.findViewById(R.id.grpHintActions);
fab = view.findViewById(R.id.fab); fab = view.findViewById(R.id.fab);
// Wire controls // Wire controls
final SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(getContext()); final SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(getContext());
btnHintActions.setOnClickListener(new View.OnClickListener() {
ibHintActions.setOnClickListener(new View.OnClickListener() {
@Override @Override
public void onClick(View v) { public void onClick(View v) {
prefs.edit().putBoolean("understood_actions", true).apply();
grpHintSwipe.setVisibility(View.GONE);
prefs.edit().putBoolean("message_actions", true).apply();
grpHintActions.setVisibility(View.GONE);
} }
}); });
@ -283,8 +283,7 @@ public class FragmentMessages extends FragmentEx {
super.onActivityCreated(savedInstanceState); super.onActivityCreated(savedInstanceState);
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(getContext()); SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(getContext());
grpHintSwipe.setVisibility(prefs.getBoolean("understood_actions", false) ? View.GONE : View.VISIBLE);
grpHintActions.setVisibility(prefs.getBoolean("message_actions", false) ? View.GONE : View.VISIBLE);
final DB db = DB.getInstance(getContext()); final DB db = DB.getInstance(getContext());


+ 10
- 0
app/src/main/res/drawable/baseline_sync_disabled_24.xml View File

@ -0,0 +1,10 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24.0"
android:viewportHeight="24.0"
android:tint="?attr/colorControlNormal">
<path
android:fillColor="@android:color/white"
android:pathData="M10,6.35L10,4.26c-0.8,0.21 -1.55,0.54 -2.23,0.96l1.46,1.46c0.25,-0.12 0.5,-0.24 0.77,-0.33zM2.86,5.41l2.36,2.36C4.45,8.99 4,10.44 4,12c0,2.21 0.91,4.2 2.36,5.64L4,20h6v-6l-2.24,2.24C6.68,15.15 6,13.66 6,12c0,-1 0.25,-1.94 0.68,-2.77l8.08,8.08c-0.25,0.13 -0.5,0.25 -0.77,0.34v2.09c0.8,-0.21 1.55,-0.54 2.23,-0.96l2.36,2.36 1.27,-1.27L4.14,4.14 2.86,5.41zM20,4h-6v6l2.24,-2.24C17.32,8.85 18,10.34 18,12c0,1 -0.25,1.94 -0.68,2.77l1.46,1.46C19.55,15.01 20,13.56 20,12c0,-2.21 -0.91,-4.2 -2.36,-5.64L20,4z"/>
</vector>

+ 40
- 1
app/src/main/res/layout/fragment_folders.xml View File

@ -6,6 +6,39 @@
android:layout_height="match_parent" android:layout_height="match_parent"
tools:context=".ActivityView"> tools:context=".ActivityView">
<TextView
android:id="@+id/tvHintActions"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginEnd="6dp"
android:layout_marginStart="6dp"
android:layout_marginTop="6dp"
android:gravity="center_vertical"
android:minHeight="33dp"
android:text="@string/title_hint_folder_actions"
android:textColor="?android:attr/textColorPrimary"
app:layout_constraintEnd_toStartOf="@+id/ibHintActions"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<ImageButton
android:id="@+id/ibHintActions"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/baseline_close_24"
app:layout_constraintBottom_toBottomOf="@id/tvHintActions"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="@id/tvHintActions" />
<View
android:id="@+id/vSeparator"
android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_marginTop="6dp"
android:background="?attr/colorSeparator"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/tvHintActions" />
<androidx.recyclerview.widget.RecyclerView <androidx.recyclerview.widget.RecyclerView
android:id="@+id/rvFolder" android:id="@+id/rvFolder"
android:layout_width="0dp" android:layout_width="0dp"
@ -15,7 +48,7 @@
app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintBottom_toBottomOf="parent"
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_toBottomOf="@id/vSeparator" />
<ProgressBar <ProgressBar
android:id="@+id/pbWait" android:id="@+id/pbWait"
@ -28,6 +61,12 @@
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" /> app:layout_constraintTop_toTopOf="parent" />
<androidx.constraintlayout.widget.Group
android:id="@+id/grpHintActions"
android:layout_width="0dp"
android:layout_height="0dp"
app:constraint_referenced_ids="tvHintActions,ibHintActions,vSeparator" />
<androidx.constraintlayout.widget.Group <androidx.constraintlayout.widget.Group
android:id="@+id/grpReady" android:id="@+id/grpReady"
android:layout_width="0dp" android:layout_width="0dp"


+ 11
- 11
app/src/main/res/layout/fragment_messages.xml View File

@ -24,19 +24,19 @@
android:layout_marginEnd="6dp" android:layout_marginEnd="6dp"
android:layout_marginStart="6dp" android:layout_marginStart="6dp"
android:layout_marginTop="6dp" android:layout_marginTop="6dp"
android:text="@string/title_hint_actions"
app:layout_constraintEnd_toStartOf="@+id/btnHintActions"
android:gravity="center_vertical"
android:minHeight="33dp"
android:text="@string/title_hint_message_actions"
android:textColor="?android:attr/textColorPrimary"
app:layout_constraintEnd_toStartOf="@+id/ibHintActions"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" /> app:layout_constraintTop_toTopOf="parent" />
<Button
android:id="@+id/btnHintActions"
style="?android:attr/buttonStyleSmall"
<ImageButton
android:id="@+id/ibHintActions"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:minHeight="0dp"
android:minWidth="0dp"
android:text="@string/title_understood"
android:src="@drawable/baseline_close_24"
app:layout_constraintBottom_toBottomOf="@id/tvHintActions" app:layout_constraintBottom_toBottomOf="@id/tvHintActions"
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="@id/tvHintActions" /> app:layout_constraintTop_toTopOf="@id/tvHintActions" />
@ -48,7 +48,7 @@
android:layout_marginTop="6dp" android:layout_marginTop="6dp"
android:background="?attr/colorSeparator" android:background="?attr/colorSeparator"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/btnHintActions" />
app:layout_constraintTop_toBottomOf="@id/tvHintActions" />
<androidx.recyclerview.widget.RecyclerView <androidx.recyclerview.widget.RecyclerView
android:id="@+id/rvFolder" android:id="@+id/rvFolder"
@ -85,10 +85,10 @@
app:layout_constraintEnd_toEndOf="parent" /> app:layout_constraintEnd_toEndOf="parent" />
<androidx.constraintlayout.widget.Group <androidx.constraintlayout.widget.Group
android:id="@+id/grpHintSwipe"
android:id="@+id/grpHintActions"
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="0dp" android:layout_height="0dp"
app:constraint_referenced_ids="tvHintActions,btnHintActions,vSeparator" />
app:constraint_referenced_ids="tvHintActions,ibHintActions,vSeparator" />
<androidx.constraintlayout.widget.Group <androidx.constraintlayout.widget.Group
android:id="@+id/grpReady" android:id="@+id/grpReady"


+ 25
- 36
app/src/main/res/layout/item_folder.xml View File

@ -5,41 +5,40 @@
android:layout_height="wrap_content"> android:layout_height="wrap_content">
<ImageView <ImageView
android:id="@+id/ivEdit"
android:id="@+id/ivState"
android:layout_width="24dp" android:layout_width="24dp"
android:layout_height="24dp" android:layout_height="24dp"
android:layout_marginEnd="6dp"
android:layout_marginStart="6dp" android:layout_marginStart="6dp"
android:background="?attr/colorButtonNormal"
android:src="@drawable/baseline_edit_24"
app:layout_constraintBottom_toBottomOf="@+id/ivMessages"
android:src="@drawable/baseline_cloud_off_24"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="@+id/ivMessages" />
app:layout_constraintTop_toTopOf="parent" />
<TextView <TextView
android:id="@+id/tvName" android:id="@+id/tvName"
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_height="24dp"
android:layout_marginEnd="6dp" android:layout_marginEnd="6dp"
android:layout_marginStart="6dp" android:layout_marginStart="6dp"
android:ellipsize="start" android:ellipsize="start"
android:gravity="center_vertical"
android:singleLine="true" android:singleLine="true"
android:text="Name" android:text="Name"
android:textAppearance="@style/TextAppearance.AppCompat.Medium" android:textAppearance="@style/TextAppearance.AppCompat.Medium"
app:layout_constraintBottom_toBottomOf="@+id/ivEdit"
app:layout_constraintEnd_toStartOf="@+id/tvAfter" app:layout_constraintEnd_toStartOf="@+id/tvAfter"
app:layout_constraintStart_toEndOf="@id/ivEdit"
app:layout_constraintTop_toTopOf="@+id/ivEdit" />
app:layout_constraintStart_toEndOf="@id/ivState"
app:layout_constraintTop_toTopOf="parent" />
<TextView <TextView
android:id="@+id/tvMessages" android:id="@+id/tvMessages"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_height="24dp"
android:layout_marginEnd="6dp" android:layout_marginEnd="6dp"
android:gravity="center_vertical"
android:text="123" android:text="123"
android:textAppearance="@android:style/TextAppearance.Small" android:textAppearance="@android:style/TextAppearance.Small"
app:layout_constraintBottom_toBottomOf="@+id/ivEdit"
app:layout_constraintEnd_toStartOf="@+id/ivMessages" app:layout_constraintEnd_toStartOf="@+id/ivMessages"
app:layout_constraintTop_toTopOf="@+id/ivEdit" />
app:layout_constraintTop_toTopOf="parent" />
<ImageView <ImageView
android:id="@+id/ivMessages" android:id="@+id/ivMessages"
@ -48,49 +47,39 @@
android:layout_marginEnd="6dp" android:layout_marginEnd="6dp"
android:src="@drawable/baseline_mail_outline_24" android:src="@drawable/baseline_mail_outline_24"
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="@+id/ivEdit" />
app:layout_constraintTop_toTopOf="parent" />
<ImageView <ImageView
android:id="@+id/ivState"
android:id="@+id/ivUnified"
android:layout_width="24dp" android:layout_width="24dp"
android:layout_height="24dp" android:layout_height="24dp"
android:layout_marginEnd="6dp"
android:layout_marginStart="6dp" android:layout_marginStart="6dp"
android:src="@drawable/baseline_cloud_off_24"
android:src="@drawable/baseline_folder_special_24"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/ivEdit" />
app:layout_constraintTop_toBottomOf="@id/ivState" />
<TextView <TextView
android:id="@+id/tvType" android:id="@+id/tvType"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_height="24dp"
android:layout_marginStart="6dp" android:layout_marginStart="6dp"
android:gravity="center_vertical"
android:text="type" android:text="type"
android:textAppearance="@android:style/TextAppearance.Small" android:textAppearance="@android:style/TextAppearance.Small"
app:layout_constraintBottom_toBottomOf="@id/ivState"
app:layout_constraintStart_toEndOf="@+id/ivState"
app:layout_constraintTop_toTopOf="@id/ivState" />
<ImageView
android:id="@+id/ivUnified"
android:layout_width="24dp"
android:layout_height="24dp"
android:layout_marginStart="6dp"
android:src="@drawable/baseline_folder_special_24"
app:layout_constraintBottom_toBottomOf="@id/ivState"
app:layout_constraintStart_toEndOf="@id/tvType"
app:layout_constraintTop_toTopOf="@id/ivState" />
app:layout_constraintStart_toEndOf="@id/ivUnified"
app:layout_constraintTop_toBottomOf="@id/ivState" />
<TextView <TextView
android:id="@+id/tvAfter" android:id="@+id/tvAfter"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_height="24dp"
android:layout_marginEnd="6dp" android:layout_marginEnd="6dp"
android:gravity="center_vertical"
android:text="30" android:text="30"
android:textAppearance="@android:style/TextAppearance.Small" android:textAppearance="@android:style/TextAppearance.Small"
app:layout_constraintBottom_toBottomOf="@id/ivState"
app:layout_constraintEnd_toStartOf="@+id/ivSync" app:layout_constraintEnd_toStartOf="@+id/ivSync"
app:layout_constraintTop_toTopOf="@id/ivState" />
app:layout_constraintTop_toBottomOf="@id/ivState" />
<ImageView <ImageView
android:id="@+id/ivSync" android:id="@+id/ivSync"
@ -99,7 +88,7 @@
android:layout_marginEnd="6dp" android:layout_marginEnd="6dp"
android:src="@drawable/baseline_sync_24" android:src="@drawable/baseline_sync_24"
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="@id/ivState" />
app:layout_constraintTop_toBottomOf="@id/ivState" />
<TextView <TextView
android:id="@+id/tvError" android:id="@+id/tvError"
@ -112,7 +101,7 @@
android:textColor="?attr/colorWarning" android:textColor="?attr/colorWarning"
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/ivState" />
app:layout_constraintTop_toBottomOf="@id/tvType" />
<View <View
android:id="@+id/vSeparator" android:id="@+id/vSeparator"


+ 3
- 2
app/src/main/res/values/strings.xml View File

@ -122,6 +122,7 @@
<string name="title_insecure">Insecure connections are not supported</string> <string name="title_insecure">Insecure connections are not supported</string>
<string name="title_folder_unseen" translatable="false">%1$s (%2$d)</string> <string name="title_folder_unseen" translatable="false">%1$s (%2$d)</string>
<string name="title_edit_properties">Edit properties</string>
<string name="title_synchronize_now">Synchronize now</string> <string name="title_synchronize_now">Synchronize now</string>
<string name="title_delete_local">Delete local messages</string> <string name="title_delete_local">Delete local messages</string>
<string name="title_synchronize_folder">Synchronize (receive messages)</string> <string name="title_synchronize_folder">Synchronize (receive messages)</string>
@ -213,8 +214,8 @@
<string name="title_legend_synchronizing">Synchronizing</string> <string name="title_legend_synchronizing">Synchronizing</string>
<string name="title_legend_closing">Closing</string> <string name="title_legend_closing">Closing</string>
<string name="title_hint_actions">Swipe left to trash; swipe right to archive (if available); long press to mark read/unread or to add/remove star</string>
<string name="title_understood">Understood</string>
<string name="title_hint_folder_actions">Long press for options</string>
<string name="title_hint_message_actions">Swipe left to trash; swipe right to archive (if available); long press to mark read/unread or to add/remove star</string>
<string name="title_updated">There is an update to version %1$s available</string> <string name="title_updated">There is an update to version %1$s available</string>
<string name="title_issue">Do you have a question or problem?</string> <string name="title_issue">Do you have a question or problem?</string>


Loading…
Cancel
Save