root / src / com / rackspacecloud / android / LoadBalancersActivity.java @ 23bc5e75
History | View | Annotate | Download (2.1 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 |
getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN); |
21 |
|
22 |
// Set up buttons
|
23 |
//Others will be other options
|
24 |
// ImageButton button1 = (ImageButton) findViewById(R.id.serverbutton);
|
25 |
// ImageButton button2 = (ImageButton) findViewById(R.id.filesbutton);
|
26 |
ImageButton button3 = (ImageButton) findViewById(R.id.lbbuttonmed); |
27 |
|
28 |
// button1.setOnClickListener(myListener);
|
29 |
// button2.setOnClickListener(myListener);
|
30 |
button3.setOnClickListener(myListener); |
31 |
} |
32 |
|
33 |
View.OnClickListener myListener = new View.OnClickListener() { |
34 |
public void onClick(View v) { |
35 |
switch (v.getId()) {
|
36 |
case R.id.lbbuttonmed:
|
37 |
Intent listLoadBalancersIntent = new Intent(LoadBalancersActivity.this, ListLoadBalancersActivity.class);
|
38 |
startActivity(listLoadBalancersIntent); |
39 |
case R.id.filesbutton:
|
40 |
//add for configuration i.e default datacenter, other info.
|
41 |
case R.id.serverbutton:
|
42 |
//add for loadbalancers info, ie 'What is a load balancer' and other semi-techinal briefings.
|
43 |
default:
|
44 |
// Nothing
|
45 |
break;
|
46 |
} |
47 |
} |
48 |
}; |
49 |
|
50 |
protected void showDialog() { |
51 |
pDialog = new ProgressDialog(this, R.style.NewDialog); |
52 |
// Set blur to background
|
53 |
WindowManager.LayoutParams lp = pDialog.getWindow().getAttributes(); |
54 |
lp.dimAmount = 0.0f;
|
55 |
pDialog.getWindow().setAttributes(lp); |
56 |
pDialog.getWindow().addFlags(WindowManager.LayoutParams.FLAG_BLUR_BEHIND); |
57 |
pDialog.show(); |
58 |
pDialog.setContentView(new ProgressBar(this), new LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT)); |
59 |
} |
60 |
} |