root / src / com / rackspacecloud / android / LoadBalancersActivity.java @ eb3b3154
History | View | Annotate | Download (2 kB)
1 |
package com.rackspacecloud.android; |
---|---|
2 |
|
3 |
import android.app.Activity; |
4 |
import android.app.ProgressDialog; |
5 |
import android.content.Intent; |
6 |
import android.os.Bundle; |
7 |
import android.view.View; |
8 |
import android.view.WindowManager; |
9 |
import android.view.ViewGroup.LayoutParams; |
10 |
import android.widget.ImageButton; |
11 |
import android.widget.ProgressBar; |
12 |
|
13 |
public class LoadBalancersActivity extends Activity { |
14 |
ProgressDialog pDialog; |
15 |
|
16 |
@Override
|
17 |
public void onCreate(Bundle savedInstanceState) { |
18 |
super.onCreate(savedInstanceState);
|
19 |
setContentView(R.layout.loadbalancers_activity); |
20 |
|
21 |
// Set up buttons
|
22 |
//Others will be other options
|
23 |
// ImageButton button1 = (ImageButton) findViewById(R.id.serverbutton);
|
24 |
// ImageButton button2 = (ImageButton) findViewById(R.id.filesbutton);
|
25 |
ImageButton button3 = (ImageButton) findViewById(R.id.lbbuttonmed); |
26 |
|
27 |
// button1.setOnClickListener(myListener);
|
28 |
// button2.setOnClickListener(myListener);
|
29 |
button3.setOnClickListener(myListener); |
30 |
} |
31 |
|
32 |
View.OnClickListener myListener = new View.OnClickListener() { |
33 |
public void onClick(View v) { |
34 |
switch (v.getId()) {
|
35 |
case R.id.lbbuttonmed:
|
36 |
Intent listLoadBalancersIntent = new Intent(getApplicationContext(), ListLoadBalancersActivity.class);
|
37 |
startActivity(listLoadBalancersIntent); |
38 |
case R.id.filesbutton:
|
39 |
//add for configuration i.e default datacenter, other info.
|
40 |
case R.id.serverbutton:
|
41 |
//add for loadbalancers info, ie 'What is a load balancer' and other semi-techinal briefings.
|
42 |
default:
|
43 |
// Nothing
|
44 |
break;
|
45 |
} |
46 |
} |
47 |
}; |
48 |
|
49 |
protected void showDialog() { |
50 |
pDialog = new ProgressDialog(this, R.style.NewDialog); |
51 |
// Set blur to background
|
52 |
WindowManager.LayoutParams lp = pDialog.getWindow().getAttributes(); |
53 |
lp.dimAmount = 0.0f;
|
54 |
pDialog.getWindow().setAttributes(lp); |
55 |
pDialog.getWindow().addFlags(WindowManager.LayoutParams.FLAG_BLUR_BEHIND); |
56 |
pDialog.show(); |
57 |
pDialog.setContentView(new ProgressBar(this), new LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT)); |
58 |
} |
59 |
} |