प्रोग्रेस के बारे में सूचना बनाना

प्रोग्रेस से जुड़ी सूचना
पहली इमेज. शेड में सबसे ऊपर, प्रोग्रेस से जुड़ी सूचना.

Android 16 में एक नया सूचना टेंप्लेट जोड़ा गया है. इससे उपयोगकर्ताओं को, शुरू से लेकर आखिर तक की पूरी प्रोसेस को आसानी से ट्रैक करने में मदद मिलती है. इन सूचनाओं को सिस्टम के प्लैटफ़ॉर्म पर बेहतर तरीके से दिखाया जाएगा. साथ ही, सूचनाओं के ड्रॉर में ये सूचनाएं सबसे ऊपर दिखेंगी.

प्रोग्रेस से जुड़ी सूचनाओं को स्टाइल देने के लिए, Notification.ProgressStyle का इस्तेमाल करें. इस्तेमाल के मुख्य उदाहरणों में, राइडशेयर, डिलीवरी, और नेविगेशन शामिल हैं. उस क्लास में, आपको पॉइंट और सेगमेंट का इस्तेमाल करके, उपयोगकर्ता के सफ़र में स्थितियों और माइलस्टोन को दिखाने की सुविधा मिलेगी.

काम की क्लास

यहां दी गई क्लास में ऐसे अलग-अलग एपीआई शामिल हैं जिनका इस्तेमाल करके, ProgressStyle सूचना बनाई जाती है:

बनावट और कस्टमाइज़ेशन

नीचे दी गई इमेज में, ProgressStyle सूचनाओं के अलग-अलग हिस्सों को दिखाया गया है:

दूसरी इमेज.ProgressStyle notification.
Figure 3. Apps can set a vehicle image for the tracker icon and use segments and points to denote the rideshare experience and milestones.

Set up

Use the right APIs and follow best practices to provide the best user experience for progress updates.

  • Set the right fields to meet promoted visibility.
  • Use the right visual elements to guide users. For example, rideshare apps should set a vehicle image and use the most accurate color of the vehicle in the notification using Notification#setLargeIcon.
  • Use concise and clear language to define the progress of the user journey. Time of arrival, driver name, and state of the journey are important text that the notification should communicate.
  • Provide useful and relevant actions in the notification that streamline the user journey. For example, providing "Tip" and "Add dish" to a newly initiated food delivery order are useful actions before delivery.
  • Use segments and points to denote states. For example, segments can colorize the state and duration of traffic in a rideshare journey. Points represent states for milestones such as food preparation, delivery, and passenger pickup.
  • Update the progress experience to accurately reflect the actual progression of the journey. For example, changes in traffic conditions can be reflected in changes in segment colors and updates in text.

The following example shows a ProgressStyle notification for a rideshare app.

The example shows the use of a vehicle image for the tracker icon. It also shows the use of segments and points to denote the rideshare experience and milestones.

See the sample app to experiment with these APIs.

के अलग-अलग हिस्से