Commit e3069d02 authored by fallenstardust's avatar fallenstardust

恢复横划删除分类

parent ffba558f
package cn.garymb.ygomobile.ui.cards.deck_square; package cn.garymb.ygomobile.ui.cards.deck_square;
import static cn.garymb.ygomobile.Constants.YDK_FILE_EX;
import android.content.Context; import android.content.Context;
import android.content.DialogInterface; import android.content.DialogInterface;
import android.os.Build; import android.os.Build;
...@@ -9,6 +11,7 @@ import android.text.InputType; ...@@ -9,6 +11,7 @@ import android.text.InputType;
import android.text.TextUtils; import android.text.TextUtils;
import android.text.TextWatcher; import android.text.TextWatcher;
import android.view.Gravity; import android.view.Gravity;
import android.view.KeyEvent;
import android.view.LayoutInflater; import android.view.LayoutInflater;
import android.view.View; import android.view.View;
import android.view.ViewGroup; import android.view.ViewGroup;
...@@ -21,6 +24,7 @@ import androidx.annotation.NonNull; ...@@ -21,6 +24,7 @@ import androidx.annotation.NonNull;
import androidx.annotation.Nullable; import androidx.annotation.Nullable;
import androidx.fragment.app.Fragment; import androidx.fragment.app.Fragment;
import androidx.recyclerview.widget.FastScrollLinearLayoutManager; import androidx.recyclerview.widget.FastScrollLinearLayoutManager;
import androidx.recyclerview.widget.ItemTouchHelper;
import com.chad.library.adapter.base.BaseQuickAdapter; import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.listener.OnItemLongClickListener; import com.chad.library.adapter.base.listener.OnItemLongClickListener;
...@@ -52,6 +56,7 @@ import cn.garymb.ygomobile.utils.LogUtil; ...@@ -52,6 +56,7 @@ import cn.garymb.ygomobile.utils.LogUtil;
import cn.garymb.ygomobile.utils.SharedPreferenceUtil; import cn.garymb.ygomobile.utils.SharedPreferenceUtil;
import cn.garymb.ygomobile.utils.YGODeckDialogUtil; import cn.garymb.ygomobile.utils.YGODeckDialogUtil;
import cn.garymb.ygomobile.utils.YGOUtil; import cn.garymb.ygomobile.utils.YGOUtil;
import cn.garymb.ygomobile.utils.recyclerview.DeckTypeTouchHelperCallback;
//在dialog中卡组选择的Fragment,选中页面中某项后,在卡组编辑页面中显示卡片 //在dialog中卡组选择的Fragment,选中页面中某项后,在卡组编辑页面中显示卡片
public class DeckSelectFragment extends Fragment { public class DeckSelectFragment extends Fragment {
...@@ -416,25 +421,32 @@ public class DeckSelectFragment extends Fragment { ...@@ -416,25 +421,32 @@ public class DeckSelectFragment extends Fragment {
} }
}); });
//todo //todo
// ygoDialog.setOnDismissListener(new DialogInterface.OnDismissListener() { ItemTouchHelper itemTouchHelper = new ItemTouchHelper(new DeckTypeTouchHelperCallback(new YGODeckDialogUtil.OnDeckTypeListener() {
// @Override @Override
// public void onDismiss(DialogInterface dialog) { public void onDeckTypeListener(int positon) {
// clearDeckSelect(); File file = new File(typeList.get(positon).getPath());
// } File[] files = file.listFiles();
// }); List<DeckFile> deckFileList = new ArrayList<>();
// ygoDialog.setOnKeyListener(new DialogInterface.OnKeyListener() { if (files != null) {
// @Override for (File file1 : files) {
// public boolean onKey(DialogInterface dialog, int keyCode, KeyEvent event) { deckFileList.add(new DeckFile(file1));
// if (keyCode == KeyEvent.KEYCODE_BACK) { }
// if (deckAdp.isManySelect()) { }
// clearDeckSelect(); IOUtils.delete(file);
// return true; YGOUtil.showTextToast(R.string.done);
// } onDeckMenuListener.onDeckDel(deckFileList);
// typeAdp.remove(positon);
// } if (typeAdp.getSelectPosition() == positon) {
// return false; typeAdp.setSelectPosition(2);
// } typeAdp.notifyItemChanged(2);
// }); }
clearDeckSelect();
deckList.clear();
deckList.addAll(DeckUtil.getDeckList(typeList.get(2).getPath()));
deckAdp.notifyDataSetChanged();
}
}));
itemTouchHelper.attachToRecyclerView(binding.rvType);
} }
return binding.getRoot(); return binding.getRoot();
} }
......
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
android:id="@+id/appbar" android:id="@+id/appbar"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:background="@drawable/veil2" android:background="@drawable/button_radius_black_transparents"
android:paddingBottom="5dp"> android:paddingBottom="5dp">
<com.google.android.material.tabs.TabLayout <com.google.android.material.tabs.TabLayout
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment