Aller au contenu
View in the app

A better way to browse. Learn more.

Forum de Frandroid

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

ProgressBar indeterminate

Featured Replies

Posté(e)

Bonjour,

Je cherche à faire une barre de progression. En théorie c'est tout simple, mais je suis bloqué sur un problème à la con.

J'ai défini la barre de progression comme ceci dans mon fichier de layout :

<ProgressBar android:indeterminate="false" android:layout_gravity="center"
		android:layout_width="wrap_content" android:id="@+id/TimerProgressBar"
		android:layout_height="wrap_content" android:progress="0"  android:max="100">
	</ProgressBar>

Normalement, et si j'ai bien compris, en mettant android:indeterminate="false", le widget devrait afficher une barre de progression et pas l'espèce de cercle d'attente. Or c'est ce rond qui s'affiche. Je récupère la progressbar dans mon code et lorsque j'utilise le debugger, sa propriété "indeterminate" est à true.

Etant donné que je l'ai déclarée à false, je ne vois pas pourquoi ça fait ce comportement.

J'ai également essayé de définir cette propriété "à la main" dans le code, mais rien n'y fait, j'ai toujours ce cercle d'attente correspondant à l'état indeterminate.

Quelqu'un aurait une idée ? Pour info voici mon code qui s'occupe de cette barre :

_progress = (ProgressBar) findViewById(R.id.TimerProgressBar);
       _progress.setSecondaryProgress(_progressStatus);

       _startTimer = System.currentTimeMillis();

       _handler = new Handler();
       new Thread(new Runnable() {
           public void run() {
               while (_progressStatus < 100) {
                   _progressStatus = getTimer();

                   _handler.post(new Runnable() {
                       public void run() {
                           _progress.setSecondaryProgress(_progressStatus);
                       }
                   });
               }
           }

       }).start();

Merci d'avance

Posté(e)

Bonjour,

public synchronized void setIndeterminate (boolean indeterminate)

Since: API Level 1

Change the indeterminate mode for this progress bar. In indeterminate mode, the progress is ignored and the progress bar shows an infinite animation instead.

If this progress bar's style only supports indeterminate mode (such as the circular progress bars), then this will be ignored.

La barre de progression par défaut semble ne supporter que le mode indéterminé.

Essaye de rajouter l’attribut style="?android:attr/progressBarStyleHorizontal" à ta progressBar (cf ici).

Posté(e)
  • Auteur

Bonjour,

La barre de progression par défaut semble ne supporter que le mode indéterminé.

Essaye de rajouter l’attribut style="?android:attr/progressBarStyleHorizontal" à ta progressBar (cf ici).

Ah oui ça marche. Bizarre :/

Merci beaucoup :)

Archivé

Ce sujet est désormais archivé et ne peut plus recevoir de nouvelles réponses.

Account

Navigation

Rechercher

Rechercher

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.