Search in sources :

Example 21 with UiThread

use of androidx.annotation.UiThread in project mapbox-plugins-android by mapbox.

the class FillManager method create.

/**
 * Create a list of fills on the map.
 * <p>
 * Fills are going to be created only for features with a matching geometry.
 * <p>
 * All supported properties are:<br>
 * FillOptions.PROPERTY_FILL_OPACITY - Float<br>
 * FillOptions.PROPERTY_FILL_COLOR - String<br>
 * FillOptions.PROPERTY_FILL_OUTLINE_COLOR - String<br>
 * FillOptions.PROPERTY_FILL_PATTERN - String<br>
 * Learn more about above properties in the <a href="https://www.mapbox.com/mapbox-gl-js/style-spec/">Style specification</a>.
 * <p>
 * Out of spec properties:<br>
 * "is-draggable" - Boolean, true if the fill should be draggable, false otherwise
 *
 * @param featureCollection the featureCollection defining the list of fills to build
 * @return the list of built fills
 */
@UiThread
public List<Fill> create(@NonNull FeatureCollection featureCollection) {
    List<Feature> features = featureCollection.features();
    List<FillOptions> options = new ArrayList<>();
    if (features != null) {
        for (Feature feature : features) {
            FillOptions option = FillOptions.fromFeature(feature);
            if (option != null) {
                options.add(option);
            }
        }
    }
    return create(options);
}
Also used : ArrayList(java.util.ArrayList) Feature(com.mapbox.geojson.Feature) UiThread(androidx.annotation.UiThread)

Example 22 with UiThread

use of androidx.annotation.UiThread in project mapbox-plugins-android by mapbox.

the class SymbolManager method create.

/**
 * Create a list of symbols on the map.
 * <p>
 * Symbols are going to be created only for features with a matching geometry.
 * <p>
 * All supported properties are:<br>
 * SymbolOptions.PROPERTY_SYMBOL_SORT_KEY - Float<br>
 * SymbolOptions.PROPERTY_ICON_SIZE - Float<br>
 * SymbolOptions.PROPERTY_ICON_IMAGE - String<br>
 * SymbolOptions.PROPERTY_ICON_ROTATE - Float<br>
 * SymbolOptions.PROPERTY_ICON_OFFSET - Float[]<br>
 * SymbolOptions.PROPERTY_ICON_ANCHOR - String<br>
 * SymbolOptions.PROPERTY_TEXT_FIELD - String<br>
 * SymbolOptions.PROPERTY_TEXT_FONT - String[]<br>
 * SymbolOptions.PROPERTY_TEXT_SIZE - Float<br>
 * SymbolOptions.PROPERTY_TEXT_MAX_WIDTH - Float<br>
 * SymbolOptions.PROPERTY_TEXT_LETTER_SPACING - Float<br>
 * SymbolOptions.PROPERTY_TEXT_JUSTIFY - String<br>
 * SymbolOptions.PROPERTY_TEXT_RADIAL_OFFSET - Float<br>
 * SymbolOptions.PROPERTY_TEXT_ANCHOR - String<br>
 * SymbolOptions.PROPERTY_TEXT_ROTATE - Float<br>
 * SymbolOptions.PROPERTY_TEXT_TRANSFORM - String<br>
 * SymbolOptions.PROPERTY_TEXT_OFFSET - Float[]<br>
 * SymbolOptions.PROPERTY_ICON_OPACITY - Float<br>
 * SymbolOptions.PROPERTY_ICON_COLOR - String<br>
 * SymbolOptions.PROPERTY_ICON_HALO_COLOR - String<br>
 * SymbolOptions.PROPERTY_ICON_HALO_WIDTH - Float<br>
 * SymbolOptions.PROPERTY_ICON_HALO_BLUR - Float<br>
 * SymbolOptions.PROPERTY_TEXT_OPACITY - Float<br>
 * SymbolOptions.PROPERTY_TEXT_COLOR - String<br>
 * SymbolOptions.PROPERTY_TEXT_HALO_COLOR - String<br>
 * SymbolOptions.PROPERTY_TEXT_HALO_WIDTH - Float<br>
 * SymbolOptions.PROPERTY_TEXT_HALO_BLUR - Float<br>
 * Learn more about above properties in the <a href="https://www.mapbox.com/mapbox-gl-js/style-spec/">Style specification</a>.
 * <p>
 * Out of spec properties:<br>
 * "is-draggable" - Boolean, true if the symbol should be draggable, false otherwise
 *
 * @param featureCollection the featureCollection defining the list of symbols to build
 * @return the list of built symbols
 */
@UiThread
public List<Symbol> create(@NonNull FeatureCollection featureCollection) {
    List<Feature> features = featureCollection.features();
    List<SymbolOptions> options = new ArrayList<>();
    if (features != null) {
        for (Feature feature : features) {
            SymbolOptions option = SymbolOptions.fromFeature(feature);
            if (option != null) {
                options.add(option);
            }
        }
    }
    return create(options);
}
Also used : ArrayList(java.util.ArrayList) Feature(com.mapbox.geojson.Feature) UiThread(androidx.annotation.UiThread)

Aggregations

UiThread (androidx.annotation.UiThread)22 ArrayList (java.util.ArrayList)5 Feature (com.mapbox.geojson.Feature)4 SuppressLint (android.annotation.SuppressLint)2 PreferenceCategory (androidx.preference.PreferenceCategory)2 Attachment (org.thoughtcrime.securesms.attachments.Attachment)2 BlurHash (org.thoughtcrime.securesms.blurhash.BlurHash)2 Slide (org.thoughtcrime.securesms.mms.Slide)2 SettableFuture (org.thoughtcrime.securesms.util.concurrent.SettableFuture)2 Account (android.accounts.Account)1 AccountManager (android.accounts.AccountManager)1 AlertDialog (android.app.AlertDialog)1 Dialog (android.app.Dialog)1 Notification (android.app.Notification)1 NotificationChannel (android.app.NotificationChannel)1 NotificationManager (android.app.NotificationManager)1 JobInfo (android.app.job.JobInfo)1 JobScheduler (android.app.job.JobScheduler)1 ComponentName (android.content.ComponentName)1 Drawable (android.graphics.drawable.Drawable)1