Search in sources :

Example 96 with ProgressBar

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;
}
Also used : ViewGroup(android.view.ViewGroup) ProgressBar(android.widget.ProgressBar) LinearLayout(android.widget.LinearLayout) Snackbar(android.support.design.widget.Snackbar)

Example 97 with ProgressBar

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);
}
Also used : LayoutParams(android.widget.LinearLayout.LayoutParams) ProgressBar(android.widget.ProgressBar) View(android.view.View) LinearLayout(android.widget.LinearLayout)

Example 98 with ProgressBar

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);
}
Also used : LayoutParams(android.widget.LinearLayout.LayoutParams) ProgressBar(android.widget.ProgressBar) LinearLayout(android.widget.LinearLayout)

Example 99 with ProgressBar

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);
}
Also used : Context(android.content.Context) RelativeLayout(android.widget.RelativeLayout) TextView(android.widget.TextView) ProgressBar(android.widget.ProgressBar) LinearLayout(android.widget.LinearLayout)

Example 100 with ProgressBar

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);
}
Also used : Context(android.content.Context) VolleyError(com.android.volley.VolleyError) Intent(android.content.Intent) Response(com.android.volley.Response) JSONObject(org.json.JSONObject) Toast(android.widget.Toast) RequestQueue(com.android.volley.RequestQueue) JsonObjectRequest(com.android.volley.toolbox.JsonObjectRequest) ProgressBar(android.widget.ProgressBar)

Aggregations

ProgressBar (android.widget.ProgressBar)193 TextView (android.widget.TextView)66 View (android.view.View)63 ImageView (android.widget.ImageView)41 LinearLayout (android.widget.LinearLayout)30 Context (android.content.Context)18 ViewGroup (android.view.ViewGroup)16 WindowManager (android.view.WindowManager)14 FrameLayout (android.widget.FrameLayout)14 Drawable (android.graphics.drawable.Drawable)13 Dialog (android.app.Dialog)12 Button (android.widget.Button)12 RelativeLayout (android.widget.RelativeLayout)12 LayoutInflater (android.view.LayoutInflater)11 SuppressLint (android.annotation.SuppressLint)10 LayoutParams (android.widget.LinearLayout.LayoutParams)9 Intent (android.content.Intent)8 LayoutParams (android.view.ViewGroup.LayoutParams)8 AlertDialog (android.app.AlertDialog)7 TypedArray (android.content.res.TypedArray)7