mirror of https://github.com/M66B/FairEmail.git
parent
a9bc7ad84b
commit
bbe2c76ee8
@ -0,0 +1,194 @@
|
||||
package eu.faircode.email;
|
||||
|
||||
/*
|
||||
This file is part of FairEmail.
|
||||
|
||||
FairEmail is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
FairEmail is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with FairEmail. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Copyright 2018-2019 by Marcel Bokhorst (M66B)
|
||||
*/
|
||||
|
||||
import android.content.Context;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.lifecycle.LifecycleOwner;
|
||||
import androidx.recyclerview.widget.DiffUtil;
|
||||
import androidx.recyclerview.widget.ListUpdateCallback;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import java.text.Collator;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.Comparator;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
import java.util.Objects;
|
||||
|
||||
public class AdapterOrder extends RecyclerView.Adapter<AdapterOrder.ViewHolder> {
|
||||
private Context context;
|
||||
private LifecycleOwner owner;
|
||||
private LayoutInflater inflater;
|
||||
|
||||
private String clazz;
|
||||
private List<EntityOrder> items = new ArrayList<>();
|
||||
|
||||
public class ViewHolder extends RecyclerView.ViewHolder {
|
||||
private TextView tvTitle;
|
||||
|
||||
ViewHolder(View itemView) {
|
||||
super(itemView);
|
||||
|
||||
tvTitle = itemView.findViewById(R.id.tvTitle);
|
||||
}
|
||||
|
||||
private void bindTo(EntityOrder item) {
|
||||
tvTitle.setText(item.getSortTitle(context));
|
||||
}
|
||||
}
|
||||
|
||||
AdapterOrder(Context context, LifecycleOwner owner, String clazz) {
|
||||
this.context = context;
|
||||
this.owner = owner;
|
||||
this.clazz = clazz;
|
||||
this.inflater = LayoutInflater.from(context);
|
||||
setHasStableIds(true);
|
||||
}
|
||||
|
||||
public void set(@NonNull List<EntityOrder> items) {
|
||||
Log.i("Set sort items=" + items.size());
|
||||
|
||||
final Collator collator = Collator.getInstance(Locale.getDefault());
|
||||
collator.setStrength(Collator.SECONDARY); // Case insensitive, process accents etc
|
||||
|
||||
Collections.sort(items, new Comparator<EntityOrder>() {
|
||||
@Override
|
||||
public int compare(EntityOrder s1, EntityOrder s2) {
|
||||
int o = Integer.compare(s1.order == null ? -1 : s1.order, s2.order == null ? -1 : s2.order);
|
||||
if (o != 0)
|
||||
return o;
|
||||
|
||||
String name1 = s1.getSortTitle(context);
|
||||
String name2 = s2.getSortTitle(context);
|
||||
return collator.compare(name1, name2);
|
||||
}
|
||||
});
|
||||
|
||||
DiffUtil.DiffResult diff = DiffUtil.calculateDiff(new DiffCallback(this.items, items), false);
|
||||
|
||||
this.items = items;
|
||||
|
||||
diff.dispatchUpdatesTo(new ListUpdateCallback() {
|
||||
@Override
|
||||
public void onInserted(int position, int count) {
|
||||
Log.i("Inserted @" + position + " #" + count);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onRemoved(int position, int count) {
|
||||
Log.i("Removed @" + position + " #" + count);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onMoved(int fromPosition, int toPosition) {
|
||||
Log.i("Moved " + fromPosition + ">" + toPosition);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onChanged(int position, int count, Object payload) {
|
||||
Log.i("Changed @" + position + " #" + count);
|
||||
}
|
||||
});
|
||||
diff.dispatchUpdatesTo(this);
|
||||
}
|
||||
|
||||
private class DiffCallback extends DiffUtil.Callback {
|
||||
private List<EntityOrder> prev = new ArrayList<>();
|
||||
private List<EntityOrder> next = new ArrayList<>();
|
||||
|
||||
DiffCallback(List<EntityOrder> prev, List<EntityOrder> next) {
|
||||
this.prev.addAll(prev);
|
||||
this.next.addAll(next);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getOldListSize() {
|
||||
return prev.size();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getNewListSize() {
|
||||
return next.size();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean areItemsTheSame(int oldItemPosition, int newItemPosition) {
|
||||
EntityOrder s1 = prev.get(oldItemPosition);
|
||||
EntityOrder s2 = next.get(newItemPosition);
|
||||
return s1.getSortId().equals(s2.getSortId());
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean areContentsTheSame(int oldItemPosition, int newItemPosition) {
|
||||
EntityOrder s1 = prev.get(oldItemPosition);
|
||||
EntityOrder s2 = next.get(newItemPosition);
|
||||
return (Objects.equals(s1.order, s2.order));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getItemId(int position) {
|
||||
return items.get(position).getSortId();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getItemCount() {
|
||||
return items.size();
|
||||
}
|
||||
|
||||
List<EntityOrder> getItems() {
|
||||
return this.items;
|
||||
}
|
||||
|
||||
void onMove(int from, int to) {
|
||||
if (from < 0 || from >= items.size() ||
|
||||
to < 0 || to >= items.size())
|
||||
return;
|
||||
|
||||
if (from < to)
|
||||
for (int i = from; i < to; i++)
|
||||
Collections.swap(items, i, i + 1);
|
||||
else
|
||||
for (int i = from; i > to; i--)
|
||||
Collections.swap(items, i, i - 1);
|
||||
|
||||
notifyItemMoved(from, to);
|
||||
}
|
||||
|
||||
@Override
|
||||
@NonNull
|
||||
public ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
|
||||
return new ViewHolder(inflater.inflate(R.layout.item_order, parent, false));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBindViewHolder(@NonNull ViewHolder holder, int position) {
|
||||
EntityOrder item = items.get(position);
|
||||
holder.bindTo(item);
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,30 @@
|
||||
package eu.faircode.email;
|
||||
|
||||
/*
|
||||
This file is part of FairEmail.
|
||||
|
||||
FairEmail is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
FairEmail is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with FairEmail. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Copyright 2018-2019 by Marcel Bokhorst (M66B)
|
||||
*/
|
||||
|
||||
import android.content.Context;
|
||||
|
||||
public abstract class EntityOrder {
|
||||
public Integer order;
|
||||
|
||||
abstract Long getSortId();
|
||||
|
||||
abstract String getSortTitle(Context context);
|
||||
}
|
@ -0,0 +1,247 @@
|
||||
package eu.faircode.email;
|
||||
|
||||
/*
|
||||
This file is part of FairEmail.
|
||||
|
||||
FairEmail is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
FairEmail is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with FairEmail. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Copyright 2018-2019 by Marcel Bokhorst (M66B)
|
||||
*/
|
||||
|
||||
import android.content.Context;
|
||||
import android.os.Bundle;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.Menu;
|
||||
import android.view.MenuInflater;
|
||||
import android.view.MenuItem;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.constraintlayout.widget.Group;
|
||||
import androidx.lifecycle.Observer;
|
||||
import androidx.recyclerview.widget.ItemTouchHelper;
|
||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class FragmentOrder extends FragmentBase {
|
||||
private int title;
|
||||
private String clazz;
|
||||
|
||||
private RecyclerView rvOrder;
|
||||
private ContentLoadingProgressBar pbWait;
|
||||
private Group grpReady;
|
||||
|
||||
private AdapterOrder adapter;
|
||||
|
||||
@Override
|
||||
public void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
|
||||
// Get arguments
|
||||
Bundle args = getArguments();
|
||||
title = args.getInt("title", -1);
|
||||
clazz = args.getString("class");
|
||||
Log.i("Order class=" + clazz);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Nullable
|
||||
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
|
||||
setSubtitle(title);
|
||||
setHasOptionsMenu(true);
|
||||
|
||||
View view = inflater.inflate(R.layout.fragment_order, container, false);
|
||||
|
||||
// Get controls
|
||||
rvOrder = view.findViewById(R.id.rvOrder);
|
||||
pbWait = view.findViewById(R.id.pbWait);
|
||||
grpReady = view.findViewById(R.id.grpReady);
|
||||
|
||||
// Wire controls
|
||||
rvOrder.setHasFixedSize(true);
|
||||
LinearLayoutManager llm = new LinearLayoutManager(getContext());
|
||||
rvOrder.setLayoutManager(llm);
|
||||
|
||||
adapter = new AdapterOrder(getContext(), getViewLifecycleOwner(), clazz);
|
||||
rvOrder.setAdapter(adapter);
|
||||
new ItemTouchHelper(touchHelper).attachToRecyclerView(rvOrder);
|
||||
|
||||
// Initialize
|
||||
grpReady.setVisibility(View.GONE);
|
||||
pbWait.setVisibility(View.VISIBLE);
|
||||
|
||||
return view;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onActivityCreated(@Nullable Bundle savedInstanceState) {
|
||||
super.onActivityCreated(savedInstanceState);
|
||||
|
||||
DB db = DB.getInstance(getContext());
|
||||
|
||||
if (EntityAccount.class.getName().equals(clazz))
|
||||
db.account().liveSynchronizingAccounts().observe(getViewLifecycleOwner(), new Observer<List<EntityAccount>>() {
|
||||
@Override
|
||||
public void onChanged(List<EntityAccount> accounts) {
|
||||
if (accounts == null)
|
||||
accounts = new ArrayList<>();
|
||||
|
||||
Log.i("Order " + clazz + "=" + accounts.size());
|
||||
|
||||
adapter.set((List<EntityOrder>) (List<?>) accounts);
|
||||
|
||||
pbWait.setVisibility(View.GONE);
|
||||
grpReady.setVisibility(View.VISIBLE);
|
||||
}
|
||||
});
|
||||
else if (TupleFolderSort.class.getName().equals(clazz))
|
||||
db.folder().liveSort().observe(getViewLifecycleOwner(), new Observer<List<TupleFolderSort>>() {
|
||||
@Override
|
||||
public void onChanged(List<TupleFolderSort> folders) {
|
||||
if (folders == null)
|
||||
folders = new ArrayList<>();
|
||||
|
||||
Log.i("Order " + clazz + "=" + folders.size());
|
||||
|
||||
adapter.set((List<EntityOrder>) (List<?>) folders);
|
||||
|
||||
pbWait.setVisibility(View.GONE);
|
||||
grpReady.setVisibility(View.VISIBLE);
|
||||
}
|
||||
});
|
||||
else
|
||||
throw new IllegalArgumentException();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPause() {
|
||||
super.onPause();
|
||||
|
||||
List<EntityOrder> items = adapter.getItems();
|
||||
|
||||
List<Long> order = new ArrayList<>();
|
||||
for (int i = 0; i < items.size(); i++)
|
||||
order.add(items.get(i).getSortId());
|
||||
|
||||
Bundle args = new Bundle();
|
||||
args.putString("class", clazz);
|
||||
args.putLongArray("order", Helper.toLongArray(order));
|
||||
|
||||
new SimpleTask<Void>() {
|
||||
@Override
|
||||
protected Void onExecute(Context context, Bundle args) {
|
||||
final String clazz = args.getString("class");
|
||||
final long[] order = args.getLongArray("order");
|
||||
|
||||
final DB db = DB.getInstance(context);
|
||||
db.runInTransaction(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
for (int i = 0; i < order.length; i++)
|
||||
if (EntityAccount.class.getName().equals(clazz))
|
||||
db.account().setAccountOrder(order[i], i);
|
||||
else if (TupleFolderSort.class.getName().equals(clazz))
|
||||
db.folder().setFolderOrder(order[i], i);
|
||||
else
|
||||
throw new IllegalArgumentException("Unknown class=" + clazz);
|
||||
}
|
||||
});
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onException(Bundle args, Throwable ex) {
|
||||
Helper.unexpectedError(getContext(), getViewLifecycleOwner(), ex);
|
||||
|
||||
}
|
||||
}.execute(getContext(), getViewLifecycleOwner(), args, "order:set");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {
|
||||
inflater.inflate(R.menu.menu_sort, menu);
|
||||
super.onCreateOptionsMenu(menu, inflater);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onOptionsItemSelected(MenuItem item) {
|
||||
switch (item.getItemId()) {
|
||||
case R.id.menu_reset_order:
|
||||
onMenuResetOrder();
|
||||
return true;
|
||||
default:
|
||||
return super.onOptionsItemSelected(item);
|
||||
}
|
||||
}
|
||||
|
||||
private void onMenuResetOrder() {
|
||||
Bundle args = new Bundle();
|
||||
args.putString("class", clazz);
|
||||
|
||||
new SimpleTask<Void>() {
|
||||
@Override
|
||||
protected Void onExecute(Context context, Bundle args) {
|
||||
String clazz = args.getString("class");
|
||||
|
||||
DB db = DB.getInstance(context);
|
||||
|
||||
if (EntityAccount.class.getName().equals(clazz))
|
||||
db.account().resetAccountOrder();
|
||||
else if (TupleFolderSort.class.getName().equals(clazz))
|
||||
db.folder().resetFolderOrder();
|
||||
else
|
||||
throw new IllegalArgumentException("Unknown class=" + clazz);
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onException(Bundle args, Throwable ex) {
|
||||
Helper.unexpectedError(getContext(), getViewLifecycleOwner(), ex);
|
||||
}
|
||||
}.execute(this, args, "order:reset");
|
||||
}
|
||||
|
||||
private ItemTouchHelper.Callback touchHelper = new ItemTouchHelper.Callback() {
|
||||
@Override
|
||||
public int getMovementFlags(@NonNull RecyclerView recyclerView, @NonNull RecyclerView.ViewHolder viewHolder) {
|
||||
int flags = 0;
|
||||
int pos = viewHolder.getAdapterPosition();
|
||||
if (pos != RecyclerView.NO_POSITION) {
|
||||
if (pos - 1 >= 0)
|
||||
flags |= ItemTouchHelper.UP;
|
||||
if (pos + 1 < rvOrder.getAdapter().getItemCount())
|
||||
flags |= ItemTouchHelper.DOWN;
|
||||
}
|
||||
|
||||
return makeMovementFlags(flags, 0);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onMove(@NonNull RecyclerView recyclerView, @NonNull RecyclerView.ViewHolder source, @NonNull RecyclerView.ViewHolder target) {
|
||||
((AdapterOrder) rvOrder.getAdapter()).onMove(source.getAdapterPosition(), target.getAdapterPosition());
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onSwiped(@NonNull RecyclerView.ViewHolder viewHolder, int direction) {
|
||||
}
|
||||
};
|
||||
}
|
@ -0,0 +1,31 @@
|
||||
package eu.faircode.email;
|
||||
|
||||
/*
|
||||
This file is part of FairEmail.
|
||||
|
||||
FairEmail is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
FairEmail is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with FairEmail. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Copyright 2018-2019 by Marcel Bokhorst (M66B)
|
||||
*/
|
||||
|
||||
import android.content.Context;
|
||||
|
||||
public class TupleFolderSort extends EntityFolder {
|
||||
public String accountName;
|
||||
|
||||
@Override
|
||||
String getSortTitle(Context context) {
|
||||
return accountName + "/" + super.getSortTitle(context);
|
||||
}
|
||||
}
|
@ -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="M3,15h18v-2L3,13v2zM3,19h18v-2L3,17v2zM3,11h18L21,9L3,9v2zM3,5v2h18L21,5L3,5z"/>
|
||||
</vector>
|
@ -0,0 +1,36 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
tools:context=".ActivitySetup">
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/rvOrder"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"
|
||||
android:scrollbarStyle="outsideOverlay"
|
||||
android:scrollbars="vertical"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<eu.faircode.email.ContentLoadingProgressBar
|
||||
android:id="@+id/pbWait"
|
||||
style="@style/Base.Widget.AppCompat.ProgressBar"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:indeterminate="true"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<androidx.constraintlayout.widget.Group
|
||||
android:id="@+id/grpReady"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"
|
||||
app:constraint_referenced_ids="rvOrder" />
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
@ -0,0 +1,25 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:id="@+id/clItem"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:clickable="true"
|
||||
android:foreground="?attr/selectableItemBackground"
|
||||
android:padding="12dp">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvTitle"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="Text1"
|
||||
android:textAppearance="@style/TextAppearance.AppCompat.Medium"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
</FrameLayout>
|
@ -0,0 +1,9 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<menu xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto">
|
||||
|
||||
<item
|
||||
android:id="@+id/menu_reset_order"
|
||||
android:title="@string/title_reset_order"
|
||||
app:showAsAction="never" />
|
||||
</menu>
|
Loading…
Reference in new issue