Commit aa6f2d2f authored by fallenstardust's avatar fallenstardust Committed by GitHub

Merge pull request #109 from zhuhongbozhuhongbo/master

这次真的改好了!!
parents ea1b7f39 d8bd8518
...@@ -58,7 +58,6 @@ output.json ...@@ -58,7 +58,6 @@ output.json
/libcore/.cxx /libcore/.cxx
/libygo/.cxx /libygo/.cxx
/mobile/assets/data/single
/mobile/assets/data/pack /mobile/assets/data/pack
/mobile/assets/en/data/*.cdb /mobile/assets/en/data/*.cdb
/mobile/assets/kor/data/*.cdb /mobile/assets/kor/data/*.cdb
...@@ -16,6 +16,7 @@ org.gradle.parallel=true ...@@ -16,6 +16,7 @@ org.gradle.parallel=true
android.enableJetifier=true android.enableJetifier=true
android.useAndroidX=true android.useAndroidX=true
android.injected.testOnly=false android.injected.testOnly=false
org.gradle.unsafe.configuration-cache=true
android.defaults.buildfeatures.buildconfig=true android.defaults.buildfeatures.buildconfig=true
android.nonTransitiveRClass=false android.nonTransitiveRClass=false
android.nonFinalResIds=false android.nonFinalResIds=false
\ No newline at end of file
{ {
"welcome": [ "welcome": [
"안녕하세요. 듀얼리스트분들~", "안녕하세요. 듀얼리스트분들~",
"안녕하세요. 듀얼 필드에 어서오세요." "안녕하세요. 듀얼 필드에 어서오세요."
], ],
"deckerror": [ "deckerror": [
"죄송합니다. {0} 덱이 필요합니다." "죄송합니다. {0} 덱이 필요합니다."
], ],
"duelstart": [ "duelstart": [
"하하, 듀얼 시작이다.", "하하, 듀얼 시작이다.",
"내 덱은 금제를 따르지 않아서, 금지 카드 몇 장이 있을 수 있다고?", "내 덱은 금제를 따르지 않아서, 금지 카드 몇 장이 있을 수 있다고?",
"나는 간단한 듀얼만 할 줄 아니까, 금지 카드로 날 이겨보시지." "나는 간단한 듀얼만 할 줄 아니까, 금지 카드로 날 이겨보시지."
], ],
"newturn": [ "newturn": [
"아자! 드로우! (카드를 뽑으면서)", "아자! 드로우! (카드를 뽑으면서)",
"드로우할께요." "드로우할께요."
], ],
"endturn": [ "endturn": [
"내 턴 종료다. 네 턴이야.", "내 턴 종료다. 네 턴이야.",
"네 턴이구나, 설마 반칙은 하지 않겠지?" "네 턴이구나, 설마 반칙은 하지 않겠지?"
], ],
"directattack": [ "directattack": [
"{0}, 상대를 공격!", "{0}, 상대를 공격!",
"{0}, 박살!", "{0}, 박살!",
"{0}, 공격!" "{0}, 공격!"
], ],
"attack": [ "attack": [
"{0}, {1}을 박살내!", "{0}, {1}을 박살내!",
"하하, {0}, {1}을 공격!" "하하, {0}, {1}을 공격!"
], ],
"ondirectattack": [ "ondirectattack": [
"아, 공격하지마. 금지 카드 허용해줄께.", "아, 공격하지마. 금지 카드 허용해줄께.",
"아, 너무 맵다. 왜 이러니?", "아, 너무 맵다. 왜 이러니?",
"아파... 랜뽑하고 싶네." "아파... 랜뽑하고 싶네."
], ],
"facedownmonstername": "몬스터", "facedownmonstername": "몬스터",
"activate": [ "activate": [
"하하, {0} 발동!", "하하, {0} 발동!",
"헤헤, 나는 {0}을 발동하겠다!" "헤헤, 나는 {0}을 발동하겠다!"
], ],
"summon": [ "summon": [
"나는 {0}을(를) 소환하겠어!", "나는 {0}을(를) 소환하겠어!",
"나와라, 내가 좋아하는 몬스터 {0}!" "나와라, 내가 좋아하는 몬스터 {0}!"
], ],
"setmonster": [ "setmonster": [
"나는 모를 법한 몬스터 한 마리를 세트한다." "나는 모를 법한 몬스터 한 마리를 세트한다."
], ],
"chaining": [ "chaining": [
"어이, 나를 금지 카드로 보낼 수 있을까나?", "어이, 나를 금지 카드로 보낼 수 있을까나?",
"아, 내가 {0}을(를) 발동할께!", "아, 내가 {0}을(를) 발동할께!",
"미안한데, 나는 {0}을(를) 발동할께~", "미안한데, 나는 {0}을(를) 발동할께~",
"하하, {0} 효과다!" "하하, {0} 효과다!"
] ]
} }
\ No newline at end of file
...@@ -4,9 +4,9 @@ import android.os.Parcel; ...@@ -4,9 +4,9 @@ import android.os.Parcel;
import android.os.Parcelable; import android.os.Parcelable;
/* /*
This class contains two information types:ex-card information and updating log, which is marked This class contains two types of card information:ex-card information and updating log, which is marked
by "type 0" and "type 1", respectively. by "type 0" and "type 1", respectively.
本类包括两种信息,先行卡信息和更新日志(分别对应type 0和type 1)。 本类包括两种卡牌信息,先行卡信息和更新日志(分别由·type 0和type 1表示)。
*/ */
public class ExCard implements Parcelable { public class ExCard implements Parcelable {
private String name; private String name;
......
...@@ -13,6 +13,7 @@ import cn.garymb.ygomobile.lite.R; ...@@ -13,6 +13,7 @@ import cn.garymb.ygomobile.lite.R;
import cn.garymb.ygomobile.ui.activities.BaseActivity; import cn.garymb.ygomobile.ui.activities.BaseActivity;
public class ExCardActivity extends BaseActivity { public class ExCardActivity extends BaseActivity {
private static final String TAG = String.valueOf(ExCardActivity.class);
private Context context; private Context context;
private Toolbar toolbar; private Toolbar toolbar;
public static TabLayout tabLayout; public static TabLayout tabLayout;
...@@ -35,7 +36,7 @@ public class ExCardActivity extends BaseActivity { ...@@ -35,7 +36,7 @@ public class ExCardActivity extends BaseActivity {
protected void onDestroy() { protected void onDestroy() {
super.onDestroy(); super.onDestroy();
Log.i("webCrawler", "excard activity destroy"); Log.i(TAG, "excard activity destroy");
} }
private void createTabFragment() { private void createTabFragment() {
adapter = new PackageTabAdapter(getSupportFragmentManager(), tabLayout); adapter = new PackageTabAdapter(getSupportFragmentManager(), tabLayout);
......
...@@ -2,6 +2,7 @@ package cn.garymb.ygomobile.ex_card; ...@@ -2,6 +2,7 @@ package cn.garymb.ygomobile.ex_card;
import android.graphics.drawable.Drawable; import android.graphics.drawable.Drawable;
import android.util.Log;
import android.widget.ImageView; import android.widget.ImageView;
import com.bumptech.glide.RequestBuilder; import com.bumptech.glide.RequestBuilder;
...@@ -23,7 +24,7 @@ import cn.garymb.ygomobile.ui.plus.VUiKit; ...@@ -23,7 +24,7 @@ import cn.garymb.ygomobile.ui.plus.VUiKit;
import cn.garymb.ygomobile.utils.glide.GlideCompat; import cn.garymb.ygomobile.utils.glide.GlideCompat;
public class ExCardListAdapter extends BaseQuickAdapter<ExCard, BaseViewHolder> { public class ExCardListAdapter extends BaseQuickAdapter<ExCard, BaseViewHolder> {
private static final String TAG = String.valueOf(ExCardListAdapter.class);
private ImageLoader imageLoader; private ImageLoader imageLoader;
public ExCardListAdapter(int layoutResId) { public ExCardListAdapter(int layoutResId) {
...@@ -39,7 +40,7 @@ public class ExCardListAdapter extends BaseQuickAdapter<ExCard, BaseViewHolder> ...@@ -39,7 +40,7 @@ public class ExCardListAdapter extends BaseQuickAdapter<ExCard, BaseViewHolder>
Element pre_card_content = document.getElementById("pre_release_cards"); Element pre_card_content = document.getElementById("pre_release_cards");
Element tbody = pre_card_content.getElementsByTag("tbody").get(0); Element tbody = pre_card_content.getElementsByTag("tbody").get(0);
Elements cards = tbody.getElementsByTag("tr"); Elements cards = tbody.getElementsByTag("tr");
if (cards.size() > 1000) {//Considering the efficiency of html parse, if the size of if (cards.size() > 5000) {//Considering the efficiency of html parse, if the size of
// pre cards list is to large, return null directly. // pre cards list is to large, return null directly.
return null; return null;
} }
...@@ -70,11 +71,11 @@ public class ExCardListAdapter extends BaseQuickAdapter<ExCard, BaseViewHolder> ...@@ -70,11 +71,11 @@ public class ExCardListAdapter extends BaseQuickAdapter<ExCard, BaseViewHolder>
} }
} }
//Log.i("webCrawler", "webCrawler fail"); Log.i(TAG, "webCrawler fail");
}).done(exCardList -> { }).done(exCardList -> {
if (exCardList != null) { if (exCardList != null) {
//Log.i("webCrawler", "webCrawler done"); Log.i(TAG, "webCrawler done");
getData().clear(); getData().clear();
addData(exCardList); addData(exCardList);
......
...@@ -15,6 +15,7 @@ import android.util.Log; ...@@ -15,6 +15,7 @@ import android.util.Log;
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.Button;
import android.widget.LinearLayout; import android.widget.LinearLayout;
import android.widget.TextView; import android.widget.TextView;
import android.widget.Toast; import android.widget.Toast;
...@@ -57,12 +58,12 @@ import ocgcore.DataManager; ...@@ -57,12 +58,12 @@ import ocgcore.DataManager;
public class ExCardListFragment extends Fragment { public class ExCardListFragment extends Fragment {
private static final String TAG = String.valueOf(ExCardListFragment.class);
private Context context; private Context context;
private View layoutView; private View layoutView;
private ExCardListAdapter mExCardListAdapter; private ExCardListAdapter mExCardListAdapter;
private RecyclerView mExCardListView; private RecyclerView mExCardListView;
private LinearLayout btnDownload; private Button btnDownload;
private TextView textDownload; private TextView textDownload;
private List<ServerInfo> serverInfos; private List<ServerInfo> serverInfos;
private ServerInfo mServerInfo; private ServerInfo mServerInfo;
...@@ -101,10 +102,11 @@ public class ExCardListFragment extends Fragment { ...@@ -101,10 +102,11 @@ public class ExCardListFragment extends Fragment {
@Override @Override
public void onStop() { public void onStop() {
super.onStop(); super.onStop();
Log.i("webCrawler", "excard fragmetn on stop"); Log.i(TAG, "excard fragment on stop");
if (EventBus.getDefault().isRegistered(this))//加上判断 if (EventBus.getDefault().isRegistered(this))//加上判断
EventBus.getDefault().unregister(this); EventBus.getDefault().unregister(this);
} }
public void initView(View layoutView) { public void initView(View layoutView) {
mExCardListView = layoutView.findViewById(R.id.list_ex_card); mExCardListView = layoutView.findViewById(R.id.list_ex_card);
mExCardListAdapter = new ExCardListAdapter(R.layout.item_ex_card); mExCardListAdapter = new ExCardListAdapter(R.layout.item_ex_card);
...@@ -116,7 +118,17 @@ public class ExCardListFragment extends Fragment { ...@@ -116,7 +118,17 @@ public class ExCardListFragment extends Fragment {
textDownload = layoutView.findViewById(R.id.text_download_prerelease); textDownload = layoutView.findViewById(R.id.text_download_prerelease);
btnDownload = layoutView.findViewById(R.id.btn_download_prerelease); btnDownload = layoutView.findViewById(R.id.btn_download_prerelease);
//TODO //偷个懒,两个按钮的回调实现相同。For convenience I set two callbacks of a buttons
// have same implementation.
textDownload.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
if (downloadState != DownloadState.DOWNLOAD_ING) {
downloadState = DownloadState.DOWNLOAD_ING;
downloadfromWeb(URL_YGO233_FILE);
}
}
});
btnDownload.setOnClickListener(new View.OnClickListener() { btnDownload.setOnClickListener(new View.OnClickListener() {
@Override @Override
public void onClick(View v) { public void onClick(View v) {
...@@ -200,7 +212,8 @@ public class ExCardListFragment extends Fragment { ...@@ -200,7 +212,8 @@ public class ExCardListFragment extends Fragment {
break; break;
case UnzipUtils.ZIP_UNZIP_EXCEPTION: case UnzipUtils.ZIP_UNZIP_EXCEPTION:
Toast.makeText(context, getString(R.string.install_failed_bcos) + msg.obj, Toast.LENGTH_SHORT).show(); Toast.makeText(context, getString(R.string.install_failed_bcos) + msg.obj,
Toast.LENGTH_SHORT).show();
break; break;
// case HomeFragment.TYPE_GET_DATA_VER_OK: // case HomeFragment.TYPE_GET_DATA_VER_OK:
// WebActivity.exCardVer = msg.obj.toString(); // WebActivity.exCardVer = msg.obj.toString();
...@@ -310,7 +323,7 @@ public class ExCardListFragment extends Fragment { ...@@ -310,7 +323,7 @@ public class ExCardListFragment extends Fragment {
if (files.getName().contains("-") && files.getName().contains(" new cards")) if (files.getName().contains("-") && files.getName().contains(" new cards"))
files.delete(); files.delete();
} }
UnzipUtils.upZipSelectFile(file, AppsSettings.get().getResourcePath(),".ypk"); UnzipUtils.upZipSelectFile(file, AppsSettings.get().getResourcePath(), ".ypk");
} catch (Exception e) { } catch (Exception e) {
message.what = UnzipUtils.ZIP_UNZIP_EXCEPTION; message.what = UnzipUtils.ZIP_UNZIP_EXCEPTION;
} finally { } finally {
......
...@@ -24,7 +24,7 @@ import cn.garymb.ygomobile.ui.plus.DialogPlus; ...@@ -24,7 +24,7 @@ import cn.garymb.ygomobile.ui.plus.DialogPlus;
import cn.garymb.ygomobile.ui.plus.VUiKit; import cn.garymb.ygomobile.ui.plus.VUiKit;
public class ExCardLogFragment extends Fragment { public class ExCardLogFragment extends Fragment {
private static final String TAG = String.valueOf(ExCardLogFragment.class);
private View layoutView; private View layoutView;
private ExCardLogAdapter mExCardLogAdapter; private ExCardLogAdapter mExCardLogAdapter;
...@@ -93,7 +93,7 @@ public class ExCardLogFragment extends Fragment { ...@@ -93,7 +93,7 @@ public class ExCardLogFragment extends Fragment {
} }
} }
Log.i("webCrawler", "webCrawler fail"); Log.i(TAG, "webCrawler fail");
}).done(exCardLogList -> { }).done(exCardLogList -> {
mExCardLogAdapter.setData(exCardLogList); mExCardLogAdapter.setData(exCardLogList);
mExCardLogAdapter.notifyDataSetChanged(); mExCardLogAdapter.notifyDataSetChanged();
...@@ -102,7 +102,7 @@ public class ExCardLogFragment extends Fragment { ...@@ -102,7 +102,7 @@ public class ExCardLogFragment extends Fragment {
mExCardLogView.expandGroup(1); mExCardLogView.expandGroup(1);
mExCardLogView.expandGroup(2); mExCardLogView.expandGroup(2);
if (exCardLogList != null) { if (exCardLogList != null) {
Log.i("webCrawler", "webCrawler parse html complete"); Log.i(TAG, "webCrawler parse html complete");
} }
//关闭异常 //关闭异常
if (dialog_read_ex.isShowing()) { if (dialog_read_ex.isShowing()) {
......
...@@ -139,6 +139,7 @@ public class HomeFragment extends BaseFragemnt implements OnDuelAssistantListene ...@@ -139,6 +139,7 @@ public class HomeFragment extends BaseFragemnt implements OnDuelAssistantListene
if (!EventBus.getDefault().isRegistered(this)) {//加上判断 if (!EventBus.getDefault().isRegistered(this)) {//加上判断
EventBus.getDefault().register(this); EventBus.getDefault().register(this);
} }
ServerUtil.initExCardState();//HomeActivity中会调用一次本函数,此处再次调用是因为有时候HomeFragment的onCreateView()函数执行较慢,导致initExCardState()中eventbus事件发布完毕后仍未注册,因此在此处再调用一次检查,再次发布
changeColor(); changeColor();
//showNewbieGuide("homePage"); //showNewbieGuide("homePage");
return layoutView; return layoutView;
......
...@@ -15,7 +15,6 @@ ...@@ -15,7 +15,6 @@
android:scrollbars="vertical" /> android:scrollbars="vertical" />
<LinearLayout <LinearLayout
android:id="@+id/btn_download_prerelease"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_gravity="bottom|right" android:layout_gravity="bottom|right"
...@@ -24,14 +23,15 @@ ...@@ -24,14 +23,15 @@
android:clickable="true" android:clickable="true"
android:focusableInTouchMode="true" android:focusableInTouchMode="true"
android:orientation="vertical" android:orientation="vertical"
android:padding="20dp"> android:padding="10dp">
<Button <Button
android:id="@+id/btn_download_prerelease"
android:layout_width="60dp" android:layout_width="60dp"
android:layout_height="60dp" android:layout_height="60dp"
android:layout_gravity="center" android:layout_gravity="center"
android:layout_marginBottom="10dp" android:layout_marginBottom="5dp"
android:background="@drawable/downloadimages" android:background="@drawable/downloadimages"
android:clickable="false" /> android:clickable="false" />
......
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