Commit 40f27232 authored by fallenstardust's avatar fallenstardust

补充首页按钮功能

parent a876edf8
......@@ -76,12 +76,18 @@ public class CardSearchFragment extends BaseFragemnt implements CardLoader.CallB
super.onCreateView(inflater, container, savedInstanceState);
View layoutView;
layoutView = inflater.inflate(R.layout.fragment_search, container, false);
mResult_count = layoutView.findViewById(R.id.search_result_count);
initView(layoutView);
//showNewbieGuide();
return layoutView;
}
public void initView(View layoutView){
duelAssistantManagement = DuelAssistantManagement.getInstance();
intentSearchMessage = getActivity().getIntent().getStringExtra(CardSearchFragment.SEARCH_MESSAGE);
mResult_count = layoutView.findViewById(R.id.search_result_count);
mDrawerlayout = layoutView.findViewById(R.id.drawer_layout);
mImageLoader = new ImageLoader(true);
mListView = layoutView.findViewById(R.id.list_cards);
mImageLoader = new ImageLoader(true);
mCardListAdapter = new CardListAdapter(getContext(), mImageLoader);
mCardListAdapter.setItemBg(true);
mListView.setLayoutManager(new FastScrollLinearLayoutManager(getContext()));
......@@ -111,8 +117,6 @@ public class CardSearchFragment extends BaseFragemnt implements CardLoader.CallB
intentSearch(intentSearchMessage);
isInitCdbOk = true;
});
//showNewbieGuide();
return layoutView;
}
@Override
......
......@@ -58,7 +58,6 @@ import cn.garymb.ygomobile.ui.activities.WebActivity;
import cn.garymb.ygomobile.ui.adapters.ServerListAdapter;
import cn.garymb.ygomobile.ui.adapters.SimpleListAdapter;
import cn.garymb.ygomobile.ui.cards.CardDetailRandom;
import cn.garymb.ygomobile.ui.mycard.MyCardActivity;
import cn.garymb.ygomobile.ui.plus.DialogPlus;
import cn.garymb.ygomobile.ui.plus.VUiKit;
......@@ -82,11 +81,17 @@ public class HomeFragment extends BaseFragemnt implements View.OnClickListener {
private CardManager mCardManager;
private CardDetailRandom mCardDetailRandom;
private ImageLoader mImageLoader;
CardView cv_deckmanager;
CardView cv_donation;
//ygopro功能
CardView cv_game;
CardView cv_bot_game;
CardView cv_watch_replay;
//辅助功能
CardView cv_download_ex;
CardView cv_reset_res;
//外连
CardView cv_donation;
CardView cv_join_QQ;
CardView cv_help;
@Nullable
@Override
......@@ -130,25 +135,30 @@ public class HomeFragment extends BaseFragemnt implements View.OnClickListener {
mServerListManager = new ServerListManager(getContext(), mServerListAdapter);
mServerListManager.bind(mServerList);
mServerListManager.syncLoadData();
cv_donation = view.findViewById(R.id.nav_webpage);
cv_game = view.findViewById(R.id.action_game);
cv_game.setOnClickListener(this);
cv_bot_game = view.findViewById(R.id.action_bot);
cv_bot_game.setOnClickListener(this);
cv_watch_replay = view.findViewById(R.id.action_replay);
cv_watch_replay.setOnClickListener(this);
cv_download_ex = view.findViewById(R.id.action_download_ex);
//萌卡
CardView iv_mc = view.findViewById(R.id.action_replay);
iv_mc.setOnClickListener((v) -> {
if (Constants.SHOW_MYCARD) {
startActivity(new Intent(getActivity(), MyCardActivity.class));
}
});
//
iv_mc.setOnLongClickListener(new View.OnLongClickListener() {
cv_download_ex.setOnClickListener(this);
cv_download_ex.setOnLongClickListener(new View.OnLongClickListener() {
@Override
public boolean onLongClick(View v) {
startActivity(new Intent(getActivity(), FileLogActivity.class));
return true;
}
});
cv_reset_res = view.findViewById(R.id.action_reset_game_res);
cv_reset_res.setOnClickListener(this);
cv_join_QQ = view.findViewById(R.id.action_join_qq_group);
cv_join_QQ.setOnClickListener(this);
cv_donation = view.findViewById(R.id.nav_webpage);
cv_donation.setOnClickListener(this);
cv_help = view.findViewById(R.id.action_help);
cv_help.setOnClickListener(this);
tv = (ShimmerTextView) view.findViewById(R.id.shimmer_tv);
toggleAnimation(tv);
mImageLoader = new ImageLoader(false);
......@@ -504,10 +514,6 @@ public class HomeFragment extends BaseFragemnt implements View.OnClickListener {
switch (v.getId()) {
case R.id.action_about:
break;
case R.id.action_replay:
break;
case R.id.action_bot:
break;
case R.id.action_game:
setRandomCardDetail();
if (mCardDetailRandom != null) {
......@@ -515,6 +521,12 @@ public class HomeFragment extends BaseFragemnt implements View.OnClickListener {
}
openGame();
break;
case R.id.action_replay:
YGOStarter.startGame(getActivity(), null, "-k", "-r");
break;
case R.id.action_bot:
YGOStarter.startGame(getActivity(), null, "-k", "-s");
break;
case R.id.action_settings: {
Intent intent = new Intent(getContext(), SettingsActivity.class);
startActivity(intent);
......@@ -522,12 +534,6 @@ public class HomeFragment extends BaseFragemnt implements View.OnClickListener {
}
case R.id.action_download_ex:
WebActivity.open(getContext(), getString(R.string.action_download_expansions), Constants.URL_YGO233_ADVANCE);
break;
case R.id.action_card_search:
//startActivity(new Intent(getContext(), CardSearchActivity.class));
break;
case R.id.action_deck_manager:
break;
case R.id.action_join_qq_group:
String key = "anEjPCDdhLgxtfLre-nT52G1Coye3LkK";
......
......@@ -396,6 +396,47 @@
android:textStyle="bold" />
</RelativeLayout>
</androidx.cardview.widget.CardView>
<androidx.cardview.widget.CardView
android:id="@+id/action_bot"
android:layout_width="100dp"
android:layout_height="100dp"
android:layout_marginRight="10dp"
android:layout_marginBottom="10dp"
android:clickable="true"
android:foreground="?android:attr/selectableItemBackground"
android:orientation="vertical"
app:cardBackgroundColor="@color/transparent"
app:cardElevation="0dp"
app:cardUseCompatPadding="false"
app:elevation="0dp">
<RelativeLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content">
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="-30dp"
android:layout_marginLeft="20dp"
android:layout_marginTop="20dp"
android:layout_marginEnd="-30dp"
android:layout_marginRight="-20dp"
android:layout_marginBottom="-20dp"
android:scaleType="fitEnd"
android:src="@drawable/help" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/window3"
android:paddingLeft="13dp"
android:paddingTop="13dp"
android:text="@string/bot_mode"
android:textColor="@color/holo_blue_bright"
android:textStyle="bold" />
</RelativeLayout>
</androidx.cardview.widget.CardView>
</LinearLayout>
</LinearLayout>
</LinearLayout>
......
......@@ -38,7 +38,7 @@
<intent
android:action="android.intent.action.VIEW"
android:targetClass="cn.garymb.ygomobile.ui.cards.DeckManagerActivity"
android:targetClass="cn.garymb.ygomobile.ui.cards.DeckManagerFragment"
android:targetPackage="cn.garymb.ygomobile" />
<categories android:name="android.shortcut.conversation" />
</shortcut>
......
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