• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java MapUtils类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中com.google.samples.apps.iosched.util.MapUtils的典型用法代码示例。如果您正苦于以下问题:Java MapUtils类的具体用法?Java MapUtils怎么用?Java MapUtils使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



MapUtils类属于com.google.samples.apps.iosched.util包,在下文中一共展示了MapUtils类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: onOverlayLoaderComplete

import com.google.samples.apps.iosched.util.MapUtils; //导入依赖的package包/类
private void onOverlayLoaderComplete(Cursor cursor) {

        if (cursor != null && cursor.getCount() > 0) {

            cursor.moveToFirst();
            while (!cursor.isAfterLast()) {
                final int floor = cursor.getInt(OverlayQuery.TILE_FLOOR);
                final String file = cursor.getString(OverlayQuery.TILE_FILE);

                File f = MapUtils.getTileFile(getActivity().getApplicationContext(), file);
                if (f != null) {
                    addTileProvider(floor, f);
                }

                cursor.moveToNext();
            }

        }

        mOverlaysLoaded = true;
        enableMapElements();
    }
 
开发者ID:gdg-bh,项目名称:AppDevFestSudeste2015,代码行数:23,代码来源:MapFragment.java


示例2: deselectActiveMarker

import com.google.samples.apps.iosched.util.MapUtils; //导入依赖的package包/类
private void deselectActiveMarker() {
    if (mActiveMarker == null) {
        return;
    }

    final String typeString = mActiveMarker.getProperty("type");
    final int type = MapUtils.detectMarkerType(typeString);
    GeoJsonPointStyle style = mActiveMarker.getPointStyle();

    if (type == MarkerModel.TYPE_ICON) {
        // For icon markers, use the Maputils to load the original icon again.
        final Bitmap iconBitmap = MapUtils.getIconMarkerBitmap(getContext(), typeString, false);
        if (iconBitmap != null) {
            style.setIcon(BitmapDescriptorFactory.fromBitmap(iconBitmap));
        }
    } else if (MapUtils.useActiveMarker(type)) {
        // Change the icon back if the generic active marker was used.
        style.setIcon(ICON_NORMAL);
    }
    mActiveMarker.setPointStyle(style);
    mActiveMarker = null;
}
 
开发者ID:google,项目名称:iosched,代码行数:23,代码来源:MapFragment.java


示例3: selectActiveMarker

import com.google.samples.apps.iosched.util.MapUtils; //导入依赖的package包/类
private void selectActiveMarker(GeoJsonFeature feature) {
    if (mActiveMarker == feature || feature == null) {
        return;
    }
    final String typeString = feature.getProperty("type");
    final int type = MapUtils.detectMarkerType(typeString);

    mActiveMarker = feature;
    GeoJsonPointStyle style = mActiveMarker.getPointStyle();


    if (type == MarkerModel.TYPE_ICON) {
        // For TYPE_ICON markers, use the MapUtils to generate a tinted icon.
        final Bitmap iconBitmap = MapUtils.getIconMarkerBitmap(getContext(), typeString, true);
        if (iconBitmap != null) {
            style.setIcon(BitmapDescriptorFactory.fromBitmap(iconBitmap));
        }
    } else if (MapUtils.useActiveMarker(type)) {
        // Replace the icon of this feature with the generic active marker.
        style.setIcon(ICON_ACTIVE);
    }
    mActiveMarker.setPointStyle(style);
}
 
开发者ID:google,项目名称:iosched,代码行数:24,代码来源:MapFragment.java


示例4: onMarkersLoaded

import com.google.samples.apps.iosched.util.MapUtils; //导入依赖的package包/类
private void onMarkersLoaded(JSONObject data) {
    if (data != null) {
        // Parse the JSONObject as GeoJson and add it to the map
        mGeoJsonLayer = MapUtils.processGeoJson(getContext(), mMap, data);
        if (mGeoJsonLayer == null) {
            return;
        }
        mGeoJsonLayer.addLayerToMap();
        for (GeoJsonFeature feature : mGeoJsonLayer.getFeatures()) {
            if (feature == null) {
                break;
            }
            mMarkers.put(feature.getProperty("id"), feature);
        }
    }

    // Highlight a room if there is a pending id.
    highlightRoom(mHighlightedRoomId);
    mHighlightedRoomId = null;

}
 
开发者ID:google,项目名称:iosched,代码行数:22,代码来源:MapFragment.java


示例5: showSessionSubtitle

import com.google.samples.apps.iosched.util.MapUtils; //导入依赖的package包/类
private void showSessionSubtitle(String roomTitle, int roomType, Cursor sessions,
                                 String iconType) {
    if (sessions == null || sessions.isAfterLast()) {
        onSessionLoadingFailed(roomTitle, roomType, iconType);
        return;
    }
    sessions.moveToFirst();

    final String title = roomTitle;
    final String subtitle = sessions.getString(SingleSessionLoader.Query.SESSION_ABSTRACT);

    setHeader(MapUtils.getDrawableForIconType(getContext(), iconType), title, subtitle);
    mList.setVisibility(GONE);

    onRoomSubtitleLoaded(title, roomType, subtitle, iconType);
}
 
开发者ID:google,项目名称:iosched,代码行数:17,代码来源:MapInfoFragment.java


示例6: setupMap

import com.google.samples.apps.iosched.util.MapUtils; //导入依赖的package包/类
private void setupMap(boolean resetCamera) {

        // Add a Marker for Moscone
        mMosconeMaker = mMap
                .addMarker(MapUtils.createMosconeMarker(MOSCONE).visible(false));

        if (resetCamera) {
            // Move camera directly to Moscone
            centerOnMoscone(false);
        }

        LOGD(TAG, "Map setup complete.");
    }
 
开发者ID:dreaminglion,项目名称:iosched-reader,代码行数:14,代码来源:MapFragment.java


示例7: showSessionList

import com.google.samples.apps.iosched.util.MapUtils; //导入依赖的package包/类
private void showSessionList(String roomTitle, int roomType, Cursor sessions) {
    if (sessions == null || sessions.isAfterLast()) {
        onSessionLoadingFailed(roomTitle, roomType);
        return;
    }

    onSessionsLoaded(roomTitle, roomType, sessions);
    mList.setAdapter(new SessionAdapter(getActivity(), sessions, 0,
            MapUtils.hasInfoSessionListIcons(roomType)));
}
 
开发者ID:dreaminglion,项目名称:iosched-reader,代码行数:11,代码来源:MapInfoFragment.java


示例8: showSessionSubtitle

import com.google.samples.apps.iosched.util.MapUtils; //导入依赖的package包/类
private void showSessionSubtitle(String roomTitle, int roomType, Cursor sessions) {
    if (sessions == null || sessions.isAfterLast()) {
        onSessionLoadingFailed(roomTitle, roomType);
        return;
    }
    sessions.moveToFirst();

    final String title = roomTitle;
    final String subtitle = sessions.getString(SingleSessionLoader.Query.SESSION_ABSTRACT);

    setHeader(MapUtils.getRoomIcon(roomType), title, subtitle);
    mList.setVisibility(View.GONE);

    onRoomSubtitleLoaded(title, roomType, subtitle);
}
 
开发者ID:dreaminglion,项目名称:iosched-reader,代码行数:16,代码来源:MapInfoFragment.java


示例9: loadSessions

import com.google.samples.apps.iosched.util.MapUtils; //导入依赖的package包/类
/**
 * Prepares and starts a SessionLoader for the specified query token.
 */
private void loadSessions(String roomId, String roomTitle, int roomType, int queryToken){
    setHeader(MapUtils.getRoomIcon(roomType), roomTitle, null);
    onSessionListLoading(roomId, roomTitle);

    // Load the following sessions for this room
    LoaderManager lm = getLoaderManager();
    Bundle args = new Bundle();
    args.putString(QUERY_ARG_ROOMID, roomId);
    args.putString(QUERY_ARG_ROOMTITLE, roomTitle);
    args.putInt(QUERY_ARG_ROOMTYPE, roomType);
    lm.restartLoader(queryToken, args, this);
}
 
开发者ID:dreaminglion,项目名称:iosched-reader,代码行数:16,代码来源:MapInfoFragment.java


示例10: setupMap

import com.google.samples.apps.iosched.util.MapUtils; //导入依赖的package包/类
private void setupMap(boolean resetCamera) {
    mInfoAdapter = new MapInfoWindowAdapter(LayoutInflater.from(getActivity()), getResources(),
            mMarkers);
    mMap = getMap();

    // Add a Marker for Moscone
    mMosconeMaker = mMap.addMarker(MapUtils.createMosconeMarker(mIconGenerator,
            MOSCONE, getActivity()).visible(false));

    mMap.setOnMarkerClickListener(this);
    mMap.setOnInfoWindowClickListener(this);
    mMap.setOnIndoorStateChangeListener(this);
    mMap.setOnMapLoadedCallback(this);
    mMap.setInfoWindowAdapter(mInfoAdapter);

    if (resetCamera) {
        // Move camera directly to Moscone
       centerOnMoscone(false);
    }

    mMap.setIndoorEnabled(false);
    mMap.getUiSettings().setZoomControlsEnabled(false);
    mMap.setMyLocationEnabled(false);

    Bundle data = getArguments();
    if (data != null && data.containsKey(BaseMapActivity.EXTRA_ROOM)) {
        mHighlightedRoom = data.getString(BaseMapActivity.EXTRA_ROOM);
    }

    LOGD(TAG, "Map setup complete.");
}
 
开发者ID:gdg-bh,项目名称:AppDevFestSudeste2015,代码行数:32,代码来源:MapFragment.java


示例11: onStop

import com.google.samples.apps.iosched.util.MapUtils; //导入依赖的package包/类
@Override
public void onStop() {
    super.onStop();

    closeTileCache();
    MapUtils.clearDiskCache(getActivity());

}
 
开发者ID:secondsun,项目名称:devnexus-android,代码行数:9,代码来源:VenueMapFragment.java


示例12: selectMarker

import com.google.samples.apps.iosched.util.MapUtils; //导入依赖的package包/类
private void selectMarker(GeoJsonFeature feature) {
    if (feature == null) {
        mCallbacks.onInfoHide();
        return;
    }

    String type = feature.getProperty("type");
    int markerType = MapUtils.detectMarkerType(type);
    String id = feature.getProperty("id");
    String title = feature.getProperty("title");
    String subtitle = feature.getProperty("description");

    if (MapUtils.hasInfoTitleOnly(markerType)) {
        // Show a basic info window with a title only
        mCallbacks.onInfoShowTitle(title, subtitle, markerType, type);
        selectActiveMarker(feature);

    } else if (MapUtils.hasInfoSessionList(markerType) || MapUtils.hasInfoSessionListIcons(markerType)) {
        // Type has sessions to display
        mCallbacks.onInfoShowSessionList(id, title, markerType, type);
        selectActiveMarker(feature);

    } else if (MapUtils.hasInfoFirstDescriptionOnly(markerType)) {
        // Display the description of the first session only
        mCallbacks.onInfoShowFirstSessionTitle(id, title, markerType, type);
        selectActiveMarker(feature);

    } else {
        // Hide the bottom sheet for unknown markers
        mCallbacks.onInfoHide();
    }

}
 
开发者ID:google,项目名称:iosched,代码行数:34,代码来源:MapFragment.java


示例13: showSessionList

import com.google.samples.apps.iosched.util.MapUtils; //导入依赖的package包/类
private void showSessionList(String roomTitle, int roomType, Cursor sessions, String iconType) {
    if (sessions == null || sessions.isAfterLast()) {
        onSessionLoadingFailed(roomTitle, roomType, iconType);
        return;
    }

    onSessionsLoaded(roomTitle, roomType, sessions, iconType);
    mList.setAdapter(new SessionAdapter(getActivity(), sessions,
            MapUtils.hasInfoSessionListIcons(roomType), mOnClickListener));
}
 
开发者ID:google,项目名称:iosched,代码行数:11,代码来源:MapInfoFragment.java


示例14: loadSessions

import com.google.samples.apps.iosched.util.MapUtils; //导入依赖的package包/类
/**
 * Prepares and starts a SessionLoader for the specified query token.
 */
private void loadSessions(String roomId, String roomTitle, int roomType, int queryToken,
                          String iconType){
    setHeader(MapUtils.getDrawableForIconType(getContext(), iconType), roomTitle, null);
    onSessionListLoading(roomId, roomTitle);

    // Load the following sessions for this room
    LoaderManager lm = getLoaderManager();
    Bundle args = new Bundle();
    args.putString(QUERY_ARG_ROOMID, roomId);
    args.putString(QUERY_ARG_ROOMTITLE, roomTitle);
    args.putInt(QUERY_ARG_ROOMTYPE, roomType);
    args.putString(QUERY_ARG_ICONTYPE, iconType);
    lm.restartLoader(queryToken, args, this);
}
 
开发者ID:google,项目名称:iosched,代码行数:18,代码来源:MapInfoFragment.java


示例15: onMarkerClick

import com.google.samples.apps.iosched.util.MapUtils; //导入依赖的package包/类
@Override
public boolean onMarkerClick(Marker marker) {
    final String title = marker.getTitle();
    final MarkerModel model = mMarkers.get(title);

    // Log clicks on all markers (regardless of type)
    // ANALYTICS EVENT: Click on marker on the map.
    // Contains: Marker ID (for example room UUID)
    AnalyticsHelper.sendEvent("Map", "markerclick", title);

    deselectActiveMarker();

    // The Moscone marker can be compared directly.
    // For all other markers the model needs to be looked up first.
    if (marker.equals(mMosconeMaker)) {
        // Return camera to Moscone
        LOGD(TAG, "Clicked on Moscone marker, return to initial display.");
        centerOnMoscone(true);

    } else if (model != null && MapUtils.hasInfoTitleOnly(model.type)) {
        // Show a basic info window with a title only
        mCallbacks.onInfoShowTitle(model.label, model.type);
        selectActiveMarker(marker);

    } else if (model != null && MapUtils.hasInfoSessionList(model.type)) {
        // Type has sessions to display
        mCallbacks.onInfoShowSessionlist(model.id, model.label, model.type);
        selectActiveMarker(marker);

    } else if (model != null && MapUtils.hasInfoFirstDescriptionOnly(model.type)) {
        // Display the description of the first session only
        mCallbacks.onInfoShowFirstSessionTitle(model.id, model.label, model.type);
        selectActiveMarker(marker);

    } else {
        // Hide the bottom sheet for unknown markers
        mCallbacks.onInfoHide();
    }

    return true;
}
 
开发者ID:dreaminglion,项目名称:iosched-reader,代码行数:42,代码来源:MapFragment.java


示例16: onSessionsLoaded

import com.google.samples.apps.iosched.util.MapUtils; //导入依赖的package包/类
protected void onSessionsLoaded(String roomTitle, int roomType, Cursor cursor) {
    setHeader(MapUtils.getRoomIcon(roomType), roomTitle, null);
    mList.setVisibility(View.VISIBLE);
}
 
开发者ID:dreaminglion,项目名称:iosched-reader,代码行数:5,代码来源:MapInfoFragment.java


示例17: onSessionLoadingFailed

import com.google.samples.apps.iosched.util.MapUtils; //导入依赖的package包/类
protected void onSessionLoadingFailed(String roomTitle, int roomType) {
    setHeader(MapUtils.getRoomIcon(roomType), roomTitle, null);
    mList.setVisibility(View.GONE);
}
 
开发者ID:dreaminglion,项目名称:iosched-reader,代码行数:5,代码来源:MapInfoFragment.java


示例18: showMoscone

import com.google.samples.apps.iosched.util.MapUtils; //导入依赖的package包/类
public void showMoscone() {
    setHeader(MapUtils.getRoomIcon(MarkerModel.TYPE_MOSCONE), R.string.map_moscone,
            R.string.map_moscone_address);
    mList.setVisibility(View.GONE);
}
 
开发者ID:dreaminglion,项目名称:iosched-reader,代码行数:6,代码来源:MapInfoFragment.java


示例19: showTitleOnly

import com.google.samples.apps.iosched.util.MapUtils; //导入依赖的package包/类
public void showTitleOnly(int roomType, String title) {
    setHeader(MapUtils.getRoomIcon(roomType), title, null);
    mList.setVisibility(View.GONE);
}
 
开发者ID:dreaminglion,项目名称:iosched-reader,代码行数:5,代码来源:MapInfoFragment.java


示例20: loadInBackground

import com.google.samples.apps.iosched.util.MapUtils; //导入依赖的package包/类
@Override
public List<TileEntry> loadInBackground() {
    List<TileEntry> list = null;
    // Create a URI to get a cursor for all map tile entries.
    final Uri uri = ScheduleContract.MapTiles.buildUri();
    Cursor cursor = getContext().getContentResolver().query(uri,
            OverlayQuery.PROJECTION, null, null, null);

    if (cursor != null) {
        // Create a TileProvider for each entry in the cursor
        final int count = cursor.getCount();

        // Initialise the tile cache that is reused for all TileProviders.
        // Note that the cache *MUST* be closed when the encapsulating Fragment is stopped.
        DiskLruCache tileCache = MapUtils.openDiskCache(getContext());

        list = new ArrayList<>(count);
        cursor.moveToFirst();
        while (!cursor.isAfterLast()) {
            final int floor = cursor.getInt(OverlayQuery.TILE_FLOOR);
            final String file = cursor.getString(OverlayQuery.TILE_FILE);

            File f = MapUtils.getTileFile(getContext().getApplicationContext(), file);
            if (f == null || !f.exists()) {
                // Skip the file if it is invalid or does not exist.
                break;
            }

            CachedTileProvider provider;
            try {
                SVGTileProvider svgProvider = new SVGTileProvider(f, mDPI);
                // Wrap the SVGTileProvider in a CachedTileProvider for caching on disk.
                provider = new CachedTileProvider(Integer.toString(floor), svgProvider,
                        tileCache);
            } catch (IOException e) {
                LOGD(TAG, "Could not create Tile Provider.");
                break;
            }
            list.add(new TileEntry(floor, provider));
            cursor.moveToNext();
        }

        cursor.close();
    }

    return list;
}
 
开发者ID:dreaminglion,项目名称:iosched-reader,代码行数:48,代码来源:TileLoadingTask.java



注:本文中的com.google.samples.apps.iosched.util.MapUtils类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java GWTMockUtilities类代码示例发布时间:2022-05-23
下一篇:
Java CFStatement类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap