|
|
@ -24,6 +24,7 @@ import android.content.DialogInterface;
|
|
|
|
import android.content.Intent;
|
|
|
|
import android.content.Intent;
|
|
|
|
import android.graphics.Typeface;
|
|
|
|
import android.graphics.Typeface;
|
|
|
|
import android.os.Bundle;
|
|
|
|
import android.os.Bundle;
|
|
|
|
|
|
|
|
import android.text.TextUtils;
|
|
|
|
import android.util.Log;
|
|
|
|
import android.util.Log;
|
|
|
|
import android.view.LayoutInflater;
|
|
|
|
import android.view.LayoutInflater;
|
|
|
|
import android.view.Menu;
|
|
|
|
import android.view.Menu;
|
|
|
@ -57,15 +58,16 @@ public class AdapterFolder extends RecyclerView.Adapter<AdapterFolder.ViewHolder
|
|
|
|
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;
|
|
|
|
private View itemView;
|
|
|
|
ImageView ivState;
|
|
|
|
private ImageView ivState;
|
|
|
|
TextView tvName;
|
|
|
|
private TextView tvName;
|
|
|
|
TextView tvMessages;
|
|
|
|
private TextView tvMessages;
|
|
|
|
ImageView ivUnified;
|
|
|
|
private ImageView ivUnified;
|
|
|
|
TextView tvType;
|
|
|
|
private TextView tvType;
|
|
|
|
TextView tvAfter;
|
|
|
|
private TextView tvAfter;
|
|
|
|
ImageView ivSync;
|
|
|
|
private ImageView ivSync;
|
|
|
|
TextView tvError;
|
|
|
|
private TextView tvKeywords;
|
|
|
|
|
|
|
|
private TextView tvError;
|
|
|
|
|
|
|
|
|
|
|
|
private final static int action_synchronize_now = 1;
|
|
|
|
private final static int action_synchronize_now = 1;
|
|
|
|
private final static int action_delete_local = 2;
|
|
|
|
private final static int action_delete_local = 2;
|
|
|
@ -84,6 +86,7 @@ public class AdapterFolder extends RecyclerView.Adapter<AdapterFolder.ViewHolder
|
|
|
|
tvType = itemView.findViewById(R.id.tvType);
|
|
|
|
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);
|
|
|
|
|
|
|
|
tvKeywords = itemView.findViewById(R.id.tvKeywords);
|
|
|
|
tvError = itemView.findViewById(R.id.tvError);
|
|
|
|
tvError = itemView.findViewById(R.id.tvError);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -142,6 +145,9 @@ public class AdapterFolder extends RecyclerView.Adapter<AdapterFolder.ViewHolder
|
|
|
|
ivSync.setImageResource(folder.synchronize ? R.drawable.baseline_sync_24 : R.drawable.baseline_sync_disabled_24);
|
|
|
|
ivSync.setImageResource(folder.synchronize ? R.drawable.baseline_sync_24 : R.drawable.baseline_sync_disabled_24);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
tvKeywords.setText(TextUtils.join(" ", folder.keywords));
|
|
|
|
|
|
|
|
tvKeywords.setVisibility(folder.keywords.length > 0 ? View.VISIBLE : View.GONE);
|
|
|
|
|
|
|
|
|
|
|
|
tvError.setText(folder.error);
|
|
|
|
tvError.setText(folder.error);
|
|
|
|
tvError.setVisibility(folder.error != null && BuildConfig.DEBUG ? View.VISIBLE : View.GONE);
|
|
|
|
tvError.setVisibility(folder.error != null && BuildConfig.DEBUG ? View.VISIBLE : View.GONE);
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -321,7 +327,7 @@ public class AdapterFolder extends RecyclerView.Adapter<AdapterFolder.ViewHolder
|
|
|
|
|
|
|
|
|
|
|
|
private boolean showAll = false;
|
|
|
|
private boolean showAll = false;
|
|
|
|
|
|
|
|
|
|
|
|
public void showHidden(boolean show) {
|
|
|
|
void showHidden(boolean show) {
|
|
|
|
showAll = show;
|
|
|
|
showAll = show;
|
|
|
|
set(all);
|
|
|
|
set(all);
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -385,7 +391,7 @@ public class AdapterFolder extends RecyclerView.Adapter<AdapterFolder.ViewHolder
|
|
|
|
diff.dispatchUpdatesTo(this);
|
|
|
|
diff.dispatchUpdatesTo(this);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public void setAccountState(String state) {
|
|
|
|
void setAccountState(String state) {
|
|
|
|
this.accountState = state;
|
|
|
|
this.accountState = state;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|