當前位置: 首頁>>代碼示例>>Java>>正文


Java Uri.EMPTY屬性代碼示例

本文整理匯總了Java中android.net.Uri.EMPTY屬性的典型用法代碼示例。如果您正苦於以下問題:Java Uri.EMPTY屬性的具體用法?Java Uri.EMPTY怎麽用?Java Uri.EMPTY使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在android.net.Uri的用法示例。


在下文中一共展示了Uri.EMPTY屬性的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: saveTheFile

private void saveTheFile(boolean saveAs) {
    if (!saveAs && greatUri != null && greatUri.getUri() != null && greatUri.getUri() != Uri.EMPTY)
        new SaveFileTask(this, greatUri, pageSystem.getAllText(mEditor.getText()
                .toString()), currentEncoding, new SaveFileTask.SaveFileInterface() {
            @Override
            public void fileSaved(Boolean success) {
                savedAFile(greatUri, true);
            }
        }).execute();
    else {
        if (Device.hasKitKatApi() && PreferenceHelper.getUseStorageAccessFramework(this)) {
            Intent intent = new Intent(Intent.ACTION_CREATE_DOCUMENT);
            intent.setType("*/*");
            intent.putExtra(Intent.EXTRA_TITLE, greatUri.getFileName());
            startActivityForResult(intent, SAVE_AS_REQUEST_CODE);
        } else {
            new NewFileDetailsDialog(
                    greatUri,
                    pageSystem.getAllText(mEditor.getText().toString()),
                    currentEncoding
            ).show(getFragmentManager().beginTransaction(), "dialog");
        }

    }
}
 
開發者ID:ujjwalagrawal17,項目名稱:CodeCompilerApp,代碼行數:25,代碼來源:MainActivity.java

示例2: FrescoBasedReactTextInlineImageSpan

public FrescoBasedReactTextInlineImageSpan(
    Resources resources,
    int height,
    int width,
    @Nullable Uri uri,
    ReadableMap headers,
    AbstractDraweeControllerBuilder draweeControllerBuilder,
    @Nullable Object callerContext) {
  mDraweeHolder = new DraweeHolder(
      GenericDraweeHierarchyBuilder.newInstance(resources)
          .build()
  );
  mDraweeControllerBuilder = draweeControllerBuilder;
  mCallerContext = callerContext;

  mHeight = height;
  mWidth = width;
  mUri = (uri != null) ? uri : Uri.EMPTY;
  mHeaders = headers;
}
 
開發者ID:qq565999484,項目名稱:RNLearn_Project1,代碼行數:20,代碼來源:FrescoBasedReactTextInlineImageSpan.java

示例3: onStart

@Override
public void onStart() {
    // why show thumbnail in onStart? because we may not need download it from internet
    if (mThumbnail != Uri.EMPTY) {
        mThumbnailView = mImageLoader.showThumbnail(BigImageView.this, mThumbnail,
                mInitScaleType);
        addView(mThumbnailView);
    }

    if (mProgressIndicator != null) {
        mProgressIndicatorView = mProgressIndicator.getView(BigImageView.this);
        addView(mProgressIndicatorView);
        mProgressIndicator.onStart();
    }

    if (mUserCallback != null) {
        mUserCallback.onStart();
    }
}
 
開發者ID:alphater,項目名稱:garras,代碼行數:19,代碼來源:BigImageView.java

示例4: start

@Override
public Uri start(Activity activity, MediaResult mediaResult, PhotoParams photoParams) {
    Log.d(getClass().getName(), "pick camera");

    if (hasPicker(activity)) {
        if (FeatureUtils.isSdAvailable()) {
            Uri externalUri = createExternalUri(activity.getApplicationContext());
            intent.putExtra(MediaStore.EXTRA_OUTPUT, externalUri);

            grantReadWritePermission(activity, externalUri);
            activity.startActivityForResult(intent, mediaResult.getRequestCode());

            return externalUri;
        } else {
            mediaResultListener.onPickMediaResult(mediaResult,
                                                  activity.getString(R.string.error_please_plug_sd_card));

        }
    } else {
        mediaResultListener.onPickMediaResult(mediaResult, photoParams.getNoGalleryMsg());
    }

    return Uri.EMPTY;
}
 
開發者ID:rosberry,項目名稱:media-picker-android,代碼行數:24,代碼來源:CameraPicker.java

示例5: getResourceDrawableUri

public Uri getResourceDrawableUri(Context context, @Nullable String name) {
  int resId = getResourceDrawableId(context, name);
  return resId > 0 ? new Uri.Builder()
      .scheme(LOCAL_RESOURCE_SCHEME)
      .path(String.valueOf(resId))
      .build() : Uri.EMPTY;
}
 
開發者ID:qq565999484,項目名稱:RNLearn_Project1,代碼行數:7,代碼來源:ResourceDrawableIdHelper.java

示例6: setUri

private void setUri(SimpleDraweeView view, String url) {
    Uri uri = url == null ? Uri.EMPTY : Uri.parse(url);
    DraweeController controller = Fresco.newDraweeControllerBuilder()
            .setOldController(view.getController())
            .setTapToRetryEnabled(true)
            .setAutoPlayAnimations(true)
            .setUri(uri)
            .build();
    view.setController(controller);
}
 
開發者ID:mingdroid,項目名稱:tumbviewer,代碼行數:10,代碼來源:PhotoPostVH.java

示例7: OnlineVideo

public OnlineVideo(PostsItem postsItem) {
    String videoUrl = postsItem.getVideo_url();
    String thumbnailUrl = postsItem.getThumbnail_url();
    sourceUri = videoUrl == null ? Uri.EMPTY : Uri.parse(videoUrl);
    thumbnailUri = thumbnailUrl == null ? Uri.EMPTY : Uri.parse(thumbnailUrl);
    int videoWidth = postsItem.getThumbnail_width();
    int videoHeight = postsItem.getThumbnail_height();
    width = ExpressApplication.width;
    if (videoWidth > 0) {
        height = width * videoHeight / videoWidth;
    } else {
        height = width / 2;
    }

}
 
開發者ID:mingdroid,項目名稱:tumbviewer,代碼行數:15,代碼來源:OnlineVideo.java

示例8: getDataUri

@Override
public Uri getDataUri(QueryEnum query) {
    if (query == VideoLibraryModel.VideoLibraryQueryEnum.VIDEOS
            || query == VideoLibraryModel.VideoLibraryQueryEnum.FILTERS) {
        return ScheduleContract.Videos.CONTENT_URI;
    } else if (query == VideoLibraryModel.VideoLibraryQueryEnum.MY_VIEWED_VIDEOS) {
        return ScheduleContract.MyViewedVideos.CONTENT_URI;
    }
    return Uri.EMPTY;
}
 
開發者ID:dreaminglion,項目名稱:iosched-reader,代碼行數:10,代碼來源:VideoLibraryFilteredFragment.java

示例9: parseSound

/**
 * Parse path path to native URI.
 *
 * @param path
 *      Path to path file
 */
Uri parseSound (String path) {

    if (path == null || path.isEmpty())
        return Uri.EMPTY;

    if (path.equalsIgnoreCase(DEFAULT_SOUND)) {
        return RingtoneManager.getDefaultUri(RingtoneManager
                .TYPE_NOTIFICATION);
    }

    return parse(path);
}
 
開發者ID:disit,項目名稱:siiMobilityAppKit,代碼行數:18,代碼來源:AssetUtil.java

示例10: parse

/**
 * The URI for a path.
 *
 * @param path
 *      The given path
 */
Uri parse (String path) {

    if (path.startsWith("res:")) {
        return getUriForResourcePath(path);
    } else if (path.startsWith("file:///")) {
        return getUriFromPath(path);
    } else if (path.startsWith("file://")) {
        return getUriFromAsset(path);
    } else if (path.startsWith("http")){
        return getUriFromRemote(path);
    }

    return Uri.EMPTY;
}
 
開發者ID:disit,項目名稱:siiMobilityAppKit,代碼行數:20,代碼來源:AssetUtil.java

示例11: getUriFromPath

/**
 * URI for a file.
 *
 * @param path
 *      Absolute path like file:///...
 *
 * @return
 *      URI pointing to the given path
 */
private Uri getUriFromPath(String path) {
    String absPath = path.replaceFirst("file://", "");
    File file = new File(absPath);

    if (!file.exists()) {
        Log.e("Asset", "File not found: " + file.getAbsolutePath());
        return Uri.EMPTY;
    }

    return Uri.fromFile(file);
}
 
開發者ID:disit,項目名稱:siiMobilityAppKit,代碼行數:20,代碼來源:AssetUtil.java

示例12: CropImageOptions

/**
 * Init options with defaults.
 */
public CropImageOptions() {

    DisplayMetrics dm = Resources.getSystem().getDisplayMetrics();

    cropShape = CropImageView.CropShape.RECTANGLE;
    snapRadius = TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, 3, dm);
    touchRadius = TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, 24, dm);
    guidelines = CropImageView.Guidelines.ON_TOUCH;
    scaleType = CropImageView.ScaleType.FIT_CENTER;
    showCropOverlay = true;
    showProgressBar = true;
    autoZoomEnabled = true;
    multiTouchEnabled = false;
    maxZoom = 4;
    initialCropWindowPaddingRatio = 0.1f;

    fixAspectRatio = false;
    aspectRatioX = 1;
    aspectRatioY = 1;

    borderLineThickness = TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, 3, dm);
    borderLineColor = Color.argb(170, 255, 255, 255);
    borderCornerThickness = TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, 2, dm);
    borderCornerOffset = TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, 5, dm);
    borderCornerLength = TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, 14, dm);
    borderCornerColor = Color.WHITE;

    guidelinesThickness = TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, 1, dm);
    guidelinesColor = Color.argb(170, 255, 255, 255);
    backgroundColor = Color.argb(119, 0, 0, 0);

    minCropWindowWidth = (int) TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, 42, dm);
    minCropWindowHeight = (int) TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, 42, dm);
    minCropResultWidth = 40;
    minCropResultHeight = 40;
    maxCropResultWidth = 99999;
    maxCropResultHeight = 99999;

    activityTitle = "";
    activityMenuIconColor = 0;

    outputUri = Uri.EMPTY;
    outputCompressFormat = Bitmap.CompressFormat.JPEG;
    outputCompressQuality = 90;
    outputRequestWidth = 0;
    outputRequestHeight = 0;
    outputRequestSizeOptions = CropImageView.RequestSizeOptions.NONE;
    noOutputImage = false;

    initialCropWindowRectangle = null;
    initialRotation = -1;
    allowRotation = true;
    allowCounterRotation = false;
    rotationDegrees = 90;
}
 
開發者ID:chuch0805,項目名稱:Android-Demo_ImageCroper,代碼行數:58,代碼來源:CropImageOptions.java

示例13: loadContactPicture

/**
 * Load a contact picture and display it using the supplied {@link ContactBadge} instance.
 * <p>
 * <p>
 * If a picture is found in the cache, it is displayed in the {@code ContactBadge}
 * immediately. Otherwise a {@link ContactPictureLoader} is started to try to load the
 * contact picture in a background thread.
 * Depending on the result the contact picture or a fallback picture is shown (letter).
 * </p>
 */
public void loadContactPicture(Contact contact, ContactBadge badge) {
    String key = contact.getLookupKey();

    // retrieve or create uri for the contact picture
    Uri photoUri = contact.getPhotoUri();
    if (photoUri == null) {
        photoUri = ContactUriCache.getUriFromCache(key);
        if (photoUri == Uri.EMPTY) {
            // pseudo uri used as key to retrieve Uris from the cache
            photoUri = Uri.parse("picture://1gravity.com/" + Uri.encode(key));
            ContactUriCache.getInstance().put(key, photoUri);
        }
    }

    // retrieve contact picture from cache
    Bitmap bitmap = sPhotoCache.get(photoUri, sDummyBitmap);    // can handle Null keys

    if (bitmap != null && bitmap != sDummyBitmap) {
        // 1) picture found --> update the contact badge
        badge.setBitmap(bitmap);
    } else if (photoUri == Uri.EMPTY || bitmap == sDummyBitmap) {
        // 2) we already tried to retrieve the contact picture before (unsuccessfully)
        // --> "letter" contact image
        badge.setCharacter(contact.getContactLetter(), contact.getContactColor());
    } else {
        synchronized (badge) {
            boolean hasLoaderAssociated = hasLoaderAssociated(key, badge);

            if (!hasLoaderAssociated) {
                // 3a) temporary "letter" contact image till the contact picture is loaded (if there's any)
                badge.setCharacter(contact.getContactLetter(), contact.getContactColor());

                // 3b) load the contact picture
                ContactPictureLoader loader = new ContactPictureLoader(key, badge, contact.getPhotoUri(), mRoundContactPictures);
                badge.setKey(key);
                try {
                    sExecutor.execute(loader);
                } catch (Exception ignore) {
                }
            }
        }
    }
}
 
開發者ID:adithya321,項目名稱:SOS-The-Healthcare-Companion,代碼行數:53,代碼來源:ContactPictureManager.java

示例14: paused

static public void paused(Context ctxt) {
    Log.d("AVP", "Sending paused intent");
    Intent i = new Intent(intentPaused, Uri.EMPTY, ctxt.getApplicationContext(), TorrentObserverService.class);
    ctxt.getApplicationContext().startService(i);
}
 
開發者ID:archos-sa,項目名稱:aos-Video,代碼行數:5,代碼來源:TorrentObserverService.java

示例15: resumed

static public void resumed(Context ctxt) {
    Log.d("AVP", "Sending resumed intent");
    Intent i = new Intent(intentResumed, Uri.EMPTY, ctxt.getApplicationContext(), TorrentObserverService.class);
    ctxt.getApplicationContext().startService(i);
}
 
開發者ID:archos-sa,項目名稱:aos-Video,代碼行數:5,代碼來源:TorrentObserverService.java


注:本文中的android.net.Uri.EMPTY屬性示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。