Commit 4f2ba092 authored by fallenstardust's avatar fallenstardust

pre release下载页面

parent cea6a555
...@@ -148,6 +148,8 @@ public interface Constants { ...@@ -148,6 +148,8 @@ public interface Constants {
String URL_HELP = "http://note.youdao.com/noteshare?id=8ae2dc824b7dc04a95a4665a938e2251"; String URL_HELP = "http://note.youdao.com/noteshare?id=8ae2dc824b7dc04a95a4665a938e2251";
String URL_MASTER_RULE_CN = "https://ocg-rule.readthedocs.io/"; String URL_MASTER_RULE_CN = "https://ocg-rule.readthedocs.io/";
String WIKI_SEARCH_URL = "https://www.ourocg.cn/S.aspx?key="; String WIKI_SEARCH_URL = "https://www.ourocg.cn/S.aspx?key=";
String URL_YGO233_ADVANCE = "https://ygo233.com/pre";
String URL_YGO233_FILE = "https://cdn.233.momobako.com/ygosrv233/20211122084301/ygosrv233-pre-mobile.zip";
String SERVER_FILE = "server_list.xml"; String SERVER_FILE = "server_list.xml";
String SHARE_FILE = ".share_deck.png"; String SHARE_FILE = ".share_deck.png";
......
...@@ -4,6 +4,8 @@ import android.content.Context; ...@@ -4,6 +4,8 @@ import android.content.Context;
import android.content.Intent; import android.content.Intent;
import android.os.Bundle; import android.os.Bundle;
import android.view.MenuItem; import android.view.MenuItem;
import android.view.View;
import android.widget.Button;
import androidx.annotation.Nullable; import androidx.annotation.Nullable;
import androidx.appcompat.widget.Toolbar; import androidx.appcompat.widget.Toolbar;
...@@ -17,6 +19,7 @@ public class WebActivity extends BaseActivity { ...@@ -17,6 +19,7 @@ public class WebActivity extends BaseActivity {
private WebViewPlus mWebViewPlus; private WebViewPlus mWebViewPlus;
private String mUrl; private String mUrl;
private String mTitle; private String mTitle;
private static Button btn_download;
@Override @Override
protected void onCreate(@Nullable Bundle savedInstanceState) { protected void onCreate(@Nullable Bundle savedInstanceState) {
...@@ -26,6 +29,7 @@ public class WebActivity extends BaseActivity { ...@@ -26,6 +29,7 @@ public class WebActivity extends BaseActivity {
setSupportActionBar(toolbar); setSupportActionBar(toolbar);
enableBackHome(); enableBackHome();
mWebViewPlus = $(R.id.webbrowser); mWebViewPlus = $(R.id.webbrowser);
btn_download = $(R.id.web_btn_download_prerelease);
/*mWebViewPlus.enableHtml5(); /*mWebViewPlus.enableHtml5();
mWebViewPlus.setWebChromeClient(new DefWebChromeClient() { mWebViewPlus.setWebChromeClient(new DefWebChromeClient() {
@Override @Override
...@@ -120,6 +124,14 @@ public class WebActivity extends BaseActivity { ...@@ -120,6 +124,14 @@ public class WebActivity extends BaseActivity {
context.startActivity(intent); context.startActivity(intent);
} }
public static void open(Context context, String title, String url, boolean showButton) {
open(context, title, url);
if (showButton){
btn_download.setVisibility(View.VISIBLE);
}
}
public static void openFAQ(Context context, Card cardInfo){ public static void openFAQ(Context context, Card cardInfo){
String uri = Constants.WIKI_SEARCH_URL + String.format("%08d", cardInfo.getCode()); String uri = Constants.WIKI_SEARCH_URL + String.format("%08d", cardInfo.getCode());
WebActivity.open(context, cardInfo.Name, uri); WebActivity.open(context, cardInfo.Name, uri);
......
...@@ -336,8 +336,8 @@ public abstract class HomeActivity extends BaseActivity implements NavigationVie ...@@ -336,8 +336,8 @@ public abstract class HomeActivity extends BaseActivity implements NavigationVie
builder.show(); builder.show();
} }
break; break;
case R.id.action_add_server: case R.id.action_download_ex:
mServerListManager.addServer(); WebActivity.open(this, getString(R.string.action_download_expansions), Constants.URL_YGO233_ADVANCE, true);
break; break;
case R.id.action_card_search: case R.id.action_card_search:
startActivity(new Intent(this, CardSearchActivity.class)); startActivity(new Intent(this, CardSearchActivity.class));
...@@ -497,7 +497,7 @@ public abstract class HomeActivity extends BaseActivity implements NavigationVie ...@@ -497,7 +497,7 @@ public abstract class HomeActivity extends BaseActivity implements NavigationVie
addMenuButton(mMenuIds, menu, R.id.action_card_search, R.string.card_search, R.drawable.search); addMenuButton(mMenuIds, menu, R.id.action_card_search, R.string.card_search, R.drawable.search);
addMenuButton(mMenuIds, menu, R.id.action_deck_manager, R.string.deck_manager, R.drawable.deck); addMenuButton(mMenuIds, menu, R.id.action_deck_manager, R.string.deck_manager, R.drawable.deck);
addMenuButton(mMenuIds, menu, R.id.action_add_server, R.string.action_add_server, R.drawable.addsever); addMenuButton(mMenuIds, menu, R.id.action_download_ex, R.string.action_download_expansions, R.drawable.downloadimages);
addMenuButton(mMenuIds, menu, R.id.action_game, R.string.action_game, R.drawable.start); addMenuButton(mMenuIds, menu, R.id.action_game, R.string.action_game, R.drawable.start);
addMenuButton(mMenuIds, menu, R.id.action_help, R.string.help, R.drawable.help); addMenuButton(mMenuIds, menu, R.id.action_help, R.string.help, R.drawable.help);
......
...@@ -15,5 +15,21 @@ ...@@ -15,5 +15,21 @@
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" /> android:layout_height="match_parent" />
</LinearLayout> </LinearLayout>
<LinearLayout
android:id="@+id/web_btn_bar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="bottom"
android:orientation="horizontal">
<Button
android:id="@+id/web_btn_download_prerelease"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@drawable/button_n"
android:text="@string/Download"
android:visibility="gone"/>
</LinearLayout>
</androidx.coordinatorlayout.widget.CoordinatorLayout> </androidx.coordinatorlayout.widget.CoordinatorLayout>
\ No newline at end of file
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
android:icon="@drawable/ic_edit" android:icon="@drawable/ic_edit"
android:title="@string/deck_manager" /> android:title="@string/deck_manager" />
<item <item
android:id="@+id/action_add_server" android:id="@+id/action_download_ex"
android:icon="@drawable/ic_add" android:icon="@drawable/ic_add"
android:title="@string/action_add_server" /> android:title="@string/action_add_server" />
<item <item
......
...@@ -318,4 +318,5 @@ ...@@ -318,4 +318,5 @@
<string name="label_ot_CUSTOM">커스텀 카드</string> <string name="label_ot_CUSTOM">커스텀 카드</string>
<string name="settings_screen_padding">화면 스타일</string> <string name="settings_screen_padding">화면 스타일</string>
<string name="tip_load_cdb_error">데이터를 불러오는 중에 오류가 발생했습니다.</string> <string name="tip_load_cdb_error">데이터를 불러오는 중에 오류가 발생했습니다.</string>
<string name="action_download_expansions">다운로드 삭제</string>
</resources> </resources>
...@@ -28,6 +28,7 @@ ...@@ -28,6 +28,7 @@
<string name="bg_menu">菜单背景</string> <string name="bg_menu">菜单背景</string>
<string name="bg_deck">卡组背景</string> <string name="bg_deck">卡组背景</string>
<string name="action_add_server">添加服务器</string> <string name="action_add_server">添加服务器</string>
<string name="action_download_expansions">拓展卡下载</string>
<string name="no_find_file_selectotr">没有找到文件选择器</string> <string name="no_find_file_selectotr">没有找到文件选择器</string>
<string name="no_find_image_selector">没有找到图片选择器</string> <string name="no_find_image_selector">没有找到图片选择器</string>
<string name="no_find_image_cutor">没有找到裁剪工具</string> <string name="no_find_image_cutor">没有找到裁剪工具</string>
......
...@@ -328,4 +328,5 @@ ...@@ -328,4 +328,5 @@
<string name="label_ot_SC_OCG">SChinese OCG</string> <string name="label_ot_SC_OCG">SChinese OCG</string>
<string name="settings_screen_padding">Reserved height of curved screen</string> <string name="settings_screen_padding">Reserved height of curved screen</string>
<string name="tip_load_cdb_error">Load database error</string> <string name="tip_load_cdb_error">Load database error</string>
<string name="action_download_expansions">download\\nexpansions</string>
</resources> </resources>
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