Uploaded image for project: 'Titanium SDK/CLI'
  1. Titanium SDK/CLI
  2. TIMOB-27312

Android: Refactor "ProgressIndicator" status bar handling

    Details

      Description

      Summary:
      The Ti.UI.Android.ProgressIndicator whose "location" property is set to Ti.UI.Android.PROGRESS_INDICATOR_STATUS_BAR no longer displays a progress indicator in the activity window's ActionBar. This feature no longer works.

      The ProgressIndicator object's defaults to using the status bar, making this an issue. All Titanium developers need to set it to Ti.UI.Android.PROGRESS_INDICATOR_DIALOG to see progress. This is the only "location" property setting that works.

      Reason:
      Google has stopped supporting this feature as of Android 5.0.
      https://developer.android.com/reference/android/app/Activity#setProgress(int)

      This feature does not work on Android 4.4 either. Likely because the Google Support library's ActionBar and/or AppCompatActivity class dropped support of this feature as well.

      Test Code:
      The below code does NOT show a progress indicator on Android 4.4 and above anymore. This feature appears to be dead.

      var progressIndicator = Ti.UI.Android.createProgressIndicator({
      	message: "Progressing...",
      	location: Ti.UI.Android.PROGRESS_INDICATOR_STATUS_BAR,
      	type: Ti.UI.Android.PROGRESS_INDICATOR_INDETERMINANT,
      });
       
      var window = Ti.UI.createWindow();
      window.add(Ti.UI.createLabel({ text: "Progress Indicator Test" }));
      window.addEventListener("open", function() {
      	progressIndicator.show();
      });
      window.open();
      

      Recommended Solution:
      We should do one of the following...

      1. Find an alternative solution for showing progress in the action bar or status bar. (Note that Google's guidelines do not recommend this anymore.)
      2. Drop status bar progress support and have "location" default to showing a dialog.

      If we remove the status bar feature, then we may want to remove the TiBaseActivity.requestWindowFeature() method calls for constants FEATURE_PROGRESS and FEATURE_INDETERMINATE_PROGRESS here...
      TiBaseActivity.java#L694

        Attachments

          Activity

            People

            • Assignee:
              jquick Joshua Quick
              Reporter:
              jquick Joshua Quick
            • Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:

                Backbone Issue Sync

                • Backbone Issue Sync is enabled for your project, but we do not have any synchronization info for this issue.

                  Git Source Code