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