-
Notifications
You must be signed in to change notification settings - Fork 1
/
OrderActivity.java
52 lines (45 loc) · 1.73 KB
/
OrderActivity.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
package com.tudaidai.tuantrip;
import android.app.TabActivity;
import android.content.Intent;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.TabHost;
import android.widget.TextView;
public class OrderActivity extends TabActivity {
static final boolean DEBUG = TuanTripSettings.DEBUG;
static final String TAG = "OrderActivity";
private void ensureUi() {
TabHost localTabHost = getTabHost();
Intent intent1 = new Intent(this, OrderListActivity.class);
intent1.putExtra(OrderListActivity.EXTRA_OPTION,
OrderListActivity.OPTION_ALL);
View view1 = prepareTabView("全部");
localTabHost.addTab(localTabHost.newTabSpec("all").setIndicator(view1)
.setContent(intent1));
Intent intent2 = new Intent(this, OrderListActivity.class);
intent2.putExtra(OrderListActivity.EXTRA_OPTION,
OrderListActivity.OPTION_UNPAID);
View view2 = prepareTabView("未付款");
localTabHost.addTab(localTabHost.newTabSpec("unpaid")
.setIndicator(view2).setContent(intent2));
Intent intent3 = new Intent(this, OrderListActivity.class);
intent3.putExtra(OrderListActivity.EXTRA_OPTION,
OrderListActivity.OPTION_PAID);
View view3 = prepareTabView("已付款");
localTabHost.addTab(localTabHost.newTabSpec("paid").setIndicator(view3)
.setContent(intent3));
}
protected void onCreate(Bundle bundle) {
super.onCreate(bundle);
setContentView(R.layout.ticket_view);
ensureUi();
}
private View prepareTabView(String paramString) {
View localView = LayoutInflater.from(this).inflate(R.layout.ticket_tab,
null);
((TextView) localView.findViewById(R.id.ticketTabTextView))
.setText(paramString);
return localView;
}
}