Commit 467f17a3 authored by fallenstardust's avatar fallenstardust

美化toast view

parent 4366e5fd
......@@ -34,6 +34,7 @@ public class CardDetailRandom {
private static StringManager mStringManager;
public static void RandomCardDetail(Context context, Card cardInfo) {
if (cardInfo == null) return;
imageLoader = ImageLoader.get(context);
viewCardDetail = inflate(context, R.layout.dialog_cardinfo_small, null);
cardImage = viewCardDetail.findViewById(R.id.card_image_toast);
......@@ -49,7 +50,6 @@ public class CardDetailRandom {
textdefView = viewCardDetail.findViewById(R.id.TextDef_toast);
desc = viewCardDetail.findViewById(R.id.text_desc_toast);
if (cardInfo == null) return;
mStringManager = DataManager.get().getStringManager();
imageLoader.bindImage(cardImage, cardInfo.Code);
name.setText(cardInfo.Name);
......@@ -89,7 +89,7 @@ public class CardDetailRandom {
Toast toast = new Toast(context);
toast.setView(viewCardDetail);
toast.setDuration(Toast.LENGTH_LONG);
toast.setGravity(Gravity.LEFT, 50, 0);
toast.setGravity(Gravity.LEFT, 30, 0);
toast.show();
}
}
......@@ -665,9 +665,8 @@ public abstract class HomeActivity extends BaseActivity implements NavigationVie
cards = mCardManager.getAllCards();
int y = (int) (Math.random() * cards.size());
Card cardInfo = cards.valueAt(y);
if (cardInfo == null) {
Toast.makeText(this, "code为空", Toast.LENGTH_LONG).show();
}
if (cardInfo == null)
return;
CardDetailRandom.RandomCardDetail(this, cardInfo);
}
}
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="wrap_content"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<LinearLayout
android:layout_width="wrap_content"
android:layout_width="170dp"
android:layout_height="wrap_content"
android:layout_margin="10dp"
android:layout_marginLeft="10dp"
android:layout_marginTop="10dp"
android:layout_marginRight="5dp"
android:layout_marginBottom="10dp"
android:background="@drawable/window2"
android:orientation="vertical">
<ImageView
......@@ -90,7 +94,9 @@
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="10dp"
android:background="@drawable/window2"
android:layout_marginTop="10dp"
android:layout_marginBottom="10dp"
android:orientation="vertical">
<cn.garymb.ygomobile.ui.widget.AlwaysMarqueeTextView
......@@ -99,7 +105,7 @@
android:layout_height="wrap_content"
android:maxLines="1"
android:shadowColor="@color/black"
android:shadowDx="1"
android:shadowDx="-2"
android:shadowDy="2"
android:shadowRadius="2"
android:singleLine="true"
......@@ -112,7 +118,6 @@
android:id="@+id/star_attr_race_toast"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center_horizontal"
android:orientation="horizontal">
<TextView
......@@ -175,11 +180,6 @@
android:textColor="@color/gray"
tools:text="SpellCaster" />
</LinearLayout>
<View
android:layout_width="0dp"
android:layout_height="1dp"
android:layout_weight="1" />
</LinearLayout>
<LinearLayout
......
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