Commit 1533b106 authored by qq247321453's avatar qq247321453

优化搜索

parent 5365b989
......@@ -93,19 +93,24 @@ void ImageManager::SetDevice(irr::IrrlichtDevice* dev) {
driver = dev->getVideoDriver();
}
void ImageManager::ClearTexture() {
for(auto tit = tMap.begin(); tit != tMap.end(); ++tit) {
if(tit->second)
driver->removeTexture(tit->second);
for(auto & tit : tMap) {
if(tit.second)
driver->removeTexture(tit.second);
}
for(auto tit = tThumb.begin(); tit != tThumb.end(); ++tit) {
if(tit->second)
driver->removeTexture(tit->second);
for(auto & tit : tThumb) {
if(tit.second)
driver->removeTexture(tit.second);
}
for(auto & field : tFields) {
if(field.second)
driver->removeTexture(field.second);
}
tMap.clear();
tThumb.clear();
if(tBigPicture != NULL) {
tFields.clear();
if(tBigPicture != nullptr) {
driver->removeTexture(tBigPicture);
tBigPicture = NULL;
tBigPicture = nullptr;
}
}
void ImageManager::RemoveTexture(int code) {
......
......@@ -9,8 +9,8 @@ android {
minSdkVersion 21
//noinspection ExpiredTargetSdkVersion
targetSdkVersion 29
versionCode 380700801
versionName "3.8.7"
versionCode 390901604
versionName "3.9.9"
flavorDimensions "versionCode"
vectorDrawables.useSupportLibrary = true
ndk {
......
......@@ -114,7 +114,11 @@ class CardSearchInfo {
}
if (ot > CardOt.ALL.getId()) {
if(ot == CardOt.NO_EXCLUSIVE.getId()){
if(card.Ot == CardOt.OCG.getId() || card.Ot == CardOt.TCG.getId()){
if (card.Ot == CardOt.OCG.getId() || card.Ot == CardOt.TCG.getId()) {
return false;
}
} else if (ot == CardOt.OCG.getId() || ot == CardOt.TCG.getId()) {
if (card.Ot != ot) {
return false;
}
} else if ((card.Ot & ot) == 0) {
......
......@@ -24,6 +24,7 @@ import cn.garymb.ygomobile.loader.ICardSearcher;
import cn.garymb.ygomobile.ui.adapters.SimpleSpinnerAdapter;
import cn.garymb.ygomobile.ui.adapters.SimpleSpinnerItem;
import cn.garymb.ygomobile.ui.plus.DialogPlus;
import cn.garymb.ygomobile.ui.plus.VUiKit;
import ocgcore.DataManager;
import ocgcore.LimitManager;
import ocgcore.StringManager;
......@@ -135,7 +136,7 @@ public class CardSearcher implements View.OnClickListener {
myFavButton.setOnClickListener(v -> {
if(isShowFavorite()){
hideFavorites();
hideFavorites(true);
} else {
showFavorites(true);
}
......@@ -278,16 +279,30 @@ public class CardSearcher implements View.OnClickListener {
myFavButton.setSelected(true);
if (mCallBack != null) {
mCallBack.onSearchStart();
mCallBack.onSearchResult(CardFavorites.get().getCards(mCardLoader), !showList);
}
if (mCallBack != null) {
VUiKit.post(() -> {
mCallBack.onSearchResult(CardFavorites.get().getCards(mCardLoader), !showList);
});
}
}
public void hideFavorites(){
mShowFavorite = true;
public void hideFavorites(boolean reload){
mShowFavorite = false;
myFavButton.setSelected(false);
if (mCallBack != null) {
mCallBack.onSearchStart();
mCallBack.onSearchResult(Collections.emptyList(), true);
}
if (reload) {
VUiKit.post(() -> {
search();
});
} else {
if (mCallBack != null) {
VUiKit.post(() -> {
mCallBack.onSearchResult(Collections.emptyList(), true);
});
}
}
}
......@@ -529,8 +544,7 @@ public class CardSearcher implements View.OnClickListener {
@Override
public void onClick(View v) {
if (v.getId() == R.id.btn_search) {
hideFavorites();
search();
hideFavorites(true);
} else if (v.getId() == R.id.btn_reset) {
resetAll();
}
......
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