如何将android弹出窗口转换为玻璃活动\卡片?

时间:2014-01-21 14:01:05

标签: java android android-layout android-activity google-gdk

我写了一个带有活动和弹出窗口的Android应用程序,我可以在它们之间滚动。

我的弹出窗口有自定义布局(不是纯文本卡)

我想将其调整为玻璃风格。

我希望每个弹出窗口都被视为全屏视图。你怎么建议我这样做?

1)我应该在cardsScrollView中使用卡吗? (但我的弹出窗口有几个按钮,我想通过玻璃手势在它们之间滚动)

像这样?

public class CardScrollActivity extends Activity {

private List<Card> mCards;
private CardScrollView mCardScrollView;

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    createCards();

    mCardScrollView = new CardScrollView(this);
    ExampleCardScrollAdapter adapter = new ExampleCardScrollAdapter();
    mCardScrollView.setAdapter(adapter);
    mCardScrollView.activate();
    setContentView(mCardScrollView);
}

private void createCards() {
    mCards = new ArrayList<Card>();

    Card card;

    card = new Card(this);
    card.setText("This card has a footer.");
    card.setFootnote("I'm the footer!");
    mCards.add(card);

    card = new Card(this);
    card.setText("This card has a puppy background image.");
    card.setFootnote("How can you resist?");
    card.setImageLayout(Card.ImageLayout.FULL);
    card.addImage(R.drawable.puppy_bg);
    mCards.add(card);

    card = new Card(this);
    card.setText("This card has a mosaic of puppies.");
    card.setFootnote("Aren't they precious?");
    card.setImageLayout(Card.ImageLayout.LEFT);
    card.addImage(R.drawable.puppy_small_1);
    card.addImage(R.drawable.puppy_small_2);
    card.addImage(R.drawable.puppy_small_3);
    mCards.add(card);
}

2)我应该使用活动吗? (但我将如何在它们之间滚动?)

0 个答案:

没有答案