use of android.widget.ProgressBar in project bugzy by cpunq.
the class CaseDetailsFragment method getSyncSnackbar.
public Snackbar getSyncSnackbar() {
Snackbar bar = Snackbar.make(getView(), "Syncing case details..", Snackbar.LENGTH_INDEFINITE);
ViewGroup contentLay = (ViewGroup) bar.getView().findViewById(android.support.design.R.id.snackbar_text).getParent();
ProgressBar item = new ProgressBar(getContext());
LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(inDp(24), inDp(24));
params.gravity = Gravity.CENTER_VERTICAL;
item.setLayoutParams(params);
contentLay.addView(item, 0);
return bar;
}
use of android.widget.ProgressBar in project platform_frameworks_base by android.
the class RevealActivity method onCreate.
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
final LinearLayout layout = new LinearLayout(this);
layout.setOrientation(LinearLayout.VERTICAL);
ProgressBar spinner = new ProgressBar(this, null, android.R.attr.progressBarStyleLarge);
layout.addView(spinner, new LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT));
View revealView = new MyView(this);
layout.addView(revealView, new LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT));
setContentView(layout);
revealView.setOnClickListener(this);
}
use of android.widget.ProgressBar in project platform_frameworks_base by android.
the class CirclePropActivity method onCreate.
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
final LinearLayout layout = new LinearLayout(this);
layout.setOrientation(LinearLayout.VERTICAL);
ProgressBar spinner = new ProgressBar(this, null, android.R.attr.progressBarStyleLarge);
layout.addView(spinner, new LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT));
// For testing with a functor in the tree
// WebView wv = new WebView(this);
// wv.setWebViewClient(new WebViewClient());
// wv.setWebChromeClient(new WebChromeClient());
// wv.loadUrl("http://theverge.com");
// layout.addView(wv, new LayoutParams(LayoutParams.MATCH_PARENT, 100));
layout.addView(new CircleView(this), new LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT));
setContentView(layout);
}
use of android.widget.ProgressBar in project androidquery by androidquery.
the class WebDialog method setupProgress.
private void setupProgress(RelativeLayout layout) {
Context context = getContext();
ll = new LinearLayout(context);
ProgressBar progress = new ProgressBar(context);
int p = AQUtility.dip2pixel(context, 30);
LinearLayout.LayoutParams plp = new LinearLayout.LayoutParams(p, p);
ll.addView(progress, plp);
if (message != null) {
TextView tv = new TextView(context);
LinearLayout.LayoutParams tlp = new LinearLayout.LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT);
tlp.leftMargin = AQUtility.dip2pixel(context, 5);
tlp.gravity = 0x10;
tv.setText(message);
ll.addView(tv, tlp);
}
RelativeLayout.LayoutParams lp = new RelativeLayout.LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT);
lp.addRule(RelativeLayout.CENTER_IN_PARENT);
layout.addView(ll, lp);
}
use of android.widget.ProgressBar in project aplicativo by InCasa.
the class ServerActivity method testeServer.
public void testeServer(final String ipServer) {
final ProgressBar bar = (ProgressBar) findViewById(R.id.progressBar);
JsonObjectRequest req = new JsonObjectRequest(Request.Method.GET, "http://" + ipServer + "/backend/teste", null, new Response.Listener<JSONObject>() {
// Em caso de sucesso
@Override
public void onResponse(JSONObject response) {
bar.setProgress(60);
Context context = getApplicationContext();
CharSequence text = "Servidor: OK";
int duration = Toast.LENGTH_SHORT;
saveServer(ipServer);
bar.setProgress(80);
Toast toast = Toast.makeText(context, text, duration);
toast.show();
bar.setProgress(100);
Intent it = new Intent(ServerActivity.this, LoginActivity.class);
startActivity(it);
}
}, new Response.ErrorListener() {
// Em caso de erro
@Override
public void onErrorResponse(VolleyError error) {
Context context = getApplicationContext();
CharSequence text = "Erro no servidor";
int duration = Toast.LENGTH_SHORT;
Toast toast = Toast.makeText(context, text, duration);
toast.show();
bar.setProgress(0);
}
});
// fila de requisições
RequestQueue fila = Volley.newRequestQueue(this);
// Adiciona a requisição á fila de requisições
fila.add(req);
}
Aggregations