Commit 991f7f6e authored by fallenstardust's avatar fallenstardust

将分享卡组图片改为分享卡组文件

parent 377ecc3b
......@@ -44,6 +44,9 @@ public class ShareFileActivity extends Activity {
} else if (ext.equals("lua")) {
sharePath = AppsSettings.get().getSingleDir() + "/" + title;
shareIntent.setType("*/*");
} else if (ext.equals("ydk")) {
sharePath = AppsSettings.get().getDeckDir() + "/" + title;
shareIntent.setType("*/*");
} else if (ext.equals(("jpg"))) {
sharePath = AppsSettings.get().getCardImagePath() + "/" + title;
shareIntent.setType("image/jpeg");
......
......@@ -58,6 +58,7 @@ import cn.garymb.ygomobile.bean.DeckInfo;
import cn.garymb.ygomobile.bean.DeckType;
import cn.garymb.ygomobile.bean.events.CardInfoEvent;
import cn.garymb.ygomobile.bean.events.DeckFile;
import cn.garymb.ygomobile.core.IrrlichtBridge;
import cn.garymb.ygomobile.lite.R;
import cn.garymb.ygomobile.ui.activities.WebActivity;
import cn.garymb.ygomobile.ui.adapters.SimpleSpinnerAdapter;
......@@ -73,6 +74,7 @@ import cn.garymb.ygomobile.ui.plus.DefaultOnBoomListener;
import cn.garymb.ygomobile.ui.plus.DialogPlus;
import cn.garymb.ygomobile.ui.plus.VUiKit;
import cn.garymb.ygomobile.utils.BitmapUtil;
import cn.garymb.ygomobile.utils.DeckUtil;
import cn.garymb.ygomobile.utils.FileUtils;
import cn.garymb.ygomobile.utils.IOUtils;
import cn.garymb.ygomobile.utils.ShareUtil;
......@@ -86,6 +88,7 @@ import ocgcore.enums.LimitType;
import static cn.garymb.ygomobile.Constants.ORI_DECK;
import static cn.garymb.ygomobile.Constants.YDK_FILE_EX;
import static cn.garymb.ygomobile.core.IrrlichtBridge.ACTION_SHARE_FILE;
class DeckManagerActivityImpl extends BaseCardsAcitivity implements RecyclerViewItemListener.OnItemListener, OnItemDragListener, YGODialogUtil.OnDeckMenuListener {
......@@ -859,8 +862,24 @@ class DeckManagerActivityImpl extends BaseCardsAcitivity implements RecyclerView
@Override
public void onClick(View v) {
du.dis();
ShareUtil.shareImage(DeckManagerActivityImpl.this, getContext().getString(R.string.screenshoot), savePath, null);
//ShareUtil.shareImage(DeckManagerActivityImpl.this, getContext().getString(R.string.screenshoot), savePath, null);
String category = mDeckAdapater.getYdkFile().getParent();
String fname = deck.getName();
Intent intent = new Intent(ACTION_SHARE_FILE);
intent.addCategory(Intent.CATEGORY_DEFAULT);
intent.putExtra(IrrlichtBridge.EXTRA_SHARE_TYPE, "ydk");
if (category.equals(mSettings.getDeckDir())) {
intent.putExtra(IrrlichtBridge.EXTRA_SHARE_FILE, fname);
} else {
String cname = DeckUtil.getDeckTypeName(mDeckAdapater.getYdkFile().getAbsolutePath());
intent.putExtra(IrrlichtBridge.EXTRA_SHARE_FILE, cname + "/" + fname);
}
intent.setPackage(getPackageName());
try {
startActivity(intent);
} catch (Throwable e) {
Toast.makeText(getContext(), "dev error:not found activity.", Toast.LENGTH_SHORT).show();
}
}
});
......
......@@ -150,6 +150,7 @@
<string name="share_deck">덱 공유</string>
<string name="code_share">덱 코드 공유</string>
<string name="screenshoot">스크린샷</string>
<string name="ydk_share">파일 공유</string>
<string name="no_share_app">공유할 앱이 없습니다.</string>
<string name="intput_room_name">비밀번호를 입력하세요. (선택 사항)</string>
<string name="join">입장</string>
......
......@@ -150,6 +150,7 @@
<string name="share_deck">分享卡组</string>
<string name="code_share">卡组码分享</string>
<string name="screenshoot">图片分享</string>
<string name="ydk_share">文件分享</string>
<string name="no_share_app">没有找到分享应用</string>
<string name="intput_room_name">输入密码(可不填)</string>
<string name="join">加入</string>
......
......@@ -271,6 +271,7 @@
<string name="donot_editor_bot_Deck">Pls Donot edit/remove AI Deck, if you do\nAI mode wont work properly</string>
<string name="code_share">Code Share</string>
<string name="screenshoot">Share Art</string>
<string name="ydk_share">File sahre</string>
<string name="unable_to_edit_empty_deck">unable to edit empty deck</string>
<string name="create_new_failed">Create Failed</string>
<string name="about_pref_settings_keep_scale">Original Resolution Scale Display</string>
......
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