Commit 2b36949e authored by fallenstardust's avatar fallenstardust

调整拓展卡下载页面布局

parent 73b1d7d2
......@@ -149,7 +149,7 @@
<!-- android:screenOrientation="landscape"-->
<activity
android:name="cn.garymb.ygomobile.ex_card.ExCardActivity2"
android:name="cn.garymb.ygomobile.ex_card.ExCardActivity"
android:theme="@style/AppTheme.Mycard"
android:launchMode="singleTop"
/>
......
package cn.garymb.ygomobile.ex_card;
import android.content.Context;
import android.os.Bundle;
import android.util.Log;
import androidx.appcompat.widget.Toolbar;
import androidx.viewpager.widget.ViewPager;
import com.google.android.material.tabs.TabLayout;
import cn.garymb.ygomobile.lite.R;
import cn.garymb.ygomobile.ui.activities.BaseActivity;
public class ExCardActivity extends BaseActivity {
private Context context;
private Toolbar toolbar;
public static TabLayout tabLayout;
public static ViewPager viewPager;
private PackageTabAdapter adapter;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_ex_card);
viewPager = (ViewPager) findViewById(R.id.viewPager);
viewPager.setOffscreenPageLimit(2);
tabLayout = (TabLayout) findViewById(R.id.packagetablayout);
createTabFragment();
}
@Override
protected void onDestroy() {
super.onDestroy();
Log.i("webCrawler", "excard activity destroy");
}
private void createTabFragment() {
adapter = new PackageTabAdapter(getSupportFragmentManager(), tabLayout);
viewPager.setAdapter(adapter);
/* setupWithViewPager() is used to link the TabLayout to the ViewPager */
tabLayout.setupWithViewPager(viewPager);
}
@Override
public boolean onSupportNavigateUp() {
onBackPressed();
return true;
}
}
......@@ -140,7 +140,7 @@ public class ExCardListFragment extends Fragment {
//btn_download展示默认视图
textDownload.setText(R.string.tip_redownload);
} else if (ServerUtil.exCardState == ServerUtil.ExCardState.NEED_UPDATE) {
textDownload.setText(R.string.action_download_expansions);
textDownload.setText(R.string.Download);
} else if (ServerUtil.exCardState == ServerUtil.ExCardState.ERROR) {
Toast.makeText(getActivity(), "无法获取服务器先行卡信息", Toast.LENGTH_LONG).show();
}
......
......@@ -91,7 +91,6 @@ public abstract class HomeActivity extends BaseActivity implements BottomNavigat
break;
case TYPE_GET_VERSION_FAILED:
String error = msg.obj.toString();
Log.e(BuildConfig.VERSION_NAME, error);
break;
}
......@@ -365,7 +364,6 @@ public abstract class HomeActivity extends BaseActivity implements BottomNavigat
@Override
public void onResponse(Call call, Response response) throws IOException {
String json = response.body().string();
Log.i(BuildConfig.VERSION_NAME, json);
Message message = new Message();
message.what = TYPE_GET_VERSION_OK;
message.obj = json;
......
......@@ -59,7 +59,7 @@ import cn.garymb.ygomobile.bean.ServerInfo;
import cn.garymb.ygomobile.bean.ServerList;
import cn.garymb.ygomobile.bean.events.ServerInfoEvent;
import cn.garymb.ygomobile.bean.events.ExCardEvent;
import cn.garymb.ygomobile.ex_card.ExCardActivity2;
import cn.garymb.ygomobile.ex_card.ExCardActivity;
import cn.garymb.ygomobile.lite.R;
import cn.garymb.ygomobile.loader.ImageLoader;
import cn.garymb.ygomobile.ui.activities.WebActivity;
......@@ -722,7 +722,7 @@ public class HomeFragment extends BaseFragemnt implements OnDuelAssistantListene
// break;
// }
/* using Web crawler to extract the information of pre card */
Intent exCardIntent = new Intent(getActivity(), ExCardActivity2.class);
Intent exCardIntent = new Intent(getActivity(), ExCardActivity.class);
startActivity(exCardIntent);
break;
case R.id.action_help: {
......
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
<androidx.coordinatorlayout.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent">
android:layout_height="match_parent"
android:background="@drawable/bg3">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<androidx.viewpager.widget.ViewPager
android:layout_width="match_parent"
android:layout_height="match_parent">
android:background="#aa000000" />
<com.google.android.material.tabs.TabLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"/>
<ExpandableListView
android:id="@+id/expandableListView"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:divider="@android:color/darker_gray"
android:dividerHeight="0.5dp"
android:indicatorLeft="?android:attr/expandableListPreferredItemIndicatorLeft" />
<com.google.android.material.appbar.AppBarLayout
android:id="@+id/appbar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@null"
android:paddingBottom="5dp"
app:elevation="0dp">
<com.tubb.smrv.SwipeMenuRecyclerView
android:id="@+id/list_ex_cards"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:divider="@android:color/transparent"
android:dividerHeight="4dp"
android:padding="5dp"
android:scrollbars="vertical" />
<com.google.android.material.tabs.TabLayout
android:id="@+id/packagetablayout"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
app:tabGravity="fill"
app:tabMode="scrollable"/>
</com.google.android.material.appbar.AppBarLayout>
</androidx.viewpager.widget.ViewPager>
<Button
android:id="@+id/web_btn_download_prerelease"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"
android:background="@drawable/button_bg"
android:text="@string/Download" />
</LinearLayout>
</LinearLayout>
\ No newline at end of file
<androidx.viewpager.widget.ViewPager
android:id="@+id/viewPager"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:layout_behavior="@string/appbar_scrolling_view_behavior" />
</androidx.coordinatorlayout.widget.CoordinatorLayout>
<?xml version="1.0" encoding="utf-8"?>
<androidx.coordinatorlayout.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@drawable/list_item_bg">
<com.google.android.material.appbar.AppBarLayout
android:id="@+id/appbar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@null"
android:paddingBottom="5dp"
app:elevation="0dp">
<com.google.android.material.tabs.TabLayout
android:id="@+id/packagetablayout"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
app:tabGravity="fill"
app:tabMode="scrollable"/>
</com.google.android.material.appbar.AppBarLayout>
<androidx.viewpager.widget.ViewPager
android:id="@+id/viewPager"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:layout_behavior="@string/appbar_scrolling_view_behavior" />
</androidx.coordinatorlayout.widget.CoordinatorLayout>
......@@ -4,6 +4,8 @@
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingBottom="10dp"
android:background="@drawable/list_item_bg"
android:orientation="horizontal">
<!-- set the layout_height in the linear layout to “wrap_content”
so it doesn’t only show one TextView per page.-->
......@@ -12,13 +14,15 @@
android:id="@+id/ex_card_image"
android:layout_width="@dimen/card_width_middle"
android:layout_height="@dimen/card_height_middle"
android:paddingTop="5dp"
android:padding="10dp"
android:layout_gravity="center_vertical"
android:scaleType="fitXY"
tools:src="@drawable/unknown" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="10dp"
android:orientation="vertical">
<cn.garymb.ygomobile.ui.widget.AlwaysMarqueeTextView
......@@ -32,8 +36,7 @@
android:shadowRadius="2"
android:singleLine="true"
android:textAppearance="@style/TextAppearance.AppCompat.Title"
android:textColor="@color/brightgreen"
android:padding="20dp"
android:textColor="@color/gold"
android:textSize="15sp"
tools:text="Card Name" />
......@@ -41,15 +44,8 @@
android:id="@+id/ex_card_description"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="20dp"
android:textColor="@color/white"
android:textSize="12sp" />
<View
android:id="@+id/view_bar"
android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_marginTop="3dp"
android:background="@color/colorPrimaryDark" />
</LinearLayout>
</LinearLayout>
\ No newline at end of file
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