本文整理汇总了Java中com.nostra13.universalimageloader.core.download.ImageDownloader.Scheme.ofUri方法的典型用法代码示例。如果您正苦于以下问题:Java Scheme.ofUri方法的具体用法?Java Scheme.ofUri怎么用?Java Scheme.ofUri使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.nostra13.universalimageloader.core.download.ImageDownloader.Scheme
的用法示例。
在下文中一共展示了Scheme.ofUri方法的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getStream
import com.nostra13.universalimageloader.core.download.ImageDownloader.Scheme; //导入方法依赖的package包/类
public InputStream getStream(String imageUri, Object extra) throws IOException {
switch (Scheme.ofUri(imageUri)) {
case HTTP:
case HTTPS:
return getStreamFromNetwork(imageUri, extra);
case FILE:
return getStreamFromFile(imageUri, extra);
case CONTENT:
return getStreamFromContent(imageUri, extra);
case ASSETS:
return getStreamFromAssets(imageUri, extra);
case DRAWABLE:
return getStreamFromDrawable(imageUri, extra);
default:
return getStreamFromOtherSource(imageUri, extra);
}
}
示例2: testSchemeHttp
import com.nostra13.universalimageloader.core.download.ImageDownloader.Scheme; //导入方法依赖的package包/类
@Test
public void testSchemeHttp() throws Exception {
String uri = "http://image.com/1.png";
Scheme result = Scheme.ofUri(uri);
Scheme expected = Scheme.HTTP;
Assertions.assertThat(result).isEqualTo(expected);
}
示例3: testSchemeHttps
import com.nostra13.universalimageloader.core.download.ImageDownloader.Scheme; //导入方法依赖的package包/类
@Test
public void testSchemeHttps() throws Exception {
String uri = "https://image.com/1.png";
Scheme result = Scheme.ofUri(uri);
Scheme expected = Scheme.HTTPS;
Assertions.assertThat(result).isEqualTo(expected);
}
示例4: getStream
import com.nostra13.universalimageloader.core.download.ImageDownloader.Scheme; //导入方法依赖的package包/类
public InputStream getStream(String imageUri, Object extra) throws IOException {
switch (Scheme.ofUri(imageUri)) {
case HTTP:
case HTTPS:
throw new IllegalStateException();
default:
return this.wrappedDownloader.getStream(imageUri, extra);
}
}
示例5: testSchemeAssets
import com.nostra13.universalimageloader.core.download.ImageDownloader.Scheme; //导入方法依赖的package包/类
@Test
public void testSchemeAssets() throws Exception {
String uri = "assets://folder/1.png";
Scheme result = Scheme.ofUri(uri);
Scheme expected = Scheme.ASSETS;
Assertions.assertThat(result).isEqualTo(expected);
}
示例6: testSchemeDrawables
import com.nostra13.universalimageloader.core.download.ImageDownloader.Scheme; //导入方法依赖的package包/类
@Test
public void testSchemeDrawables() throws Exception {
String uri = "drawable://123456890";
Scheme result = Scheme.ofUri(uri);
Scheme expected = Scheme.DRAWABLE;
Assertions.assertThat(result).isEqualTo(expected);
}
示例7: testSchemeUnknown
import com.nostra13.universalimageloader.core.download.ImageDownloader.Scheme; //导入方法依赖的package包/类
@Test
public void testSchemeUnknown() throws Exception {
String uri = "other://image.com/1.png";
Scheme result = Scheme.ofUri(uri);
Scheme expected = Scheme.UNKNOWN;
Assertions.assertThat(result).isEqualTo(expected);
}
示例8: getStream
import com.nostra13.universalimageloader.core.download.ImageDownloader.Scheme; //导入方法依赖的package包/类
public InputStream getStream(String imageUri, Object extra) throws IOException {
InputStream imageStream = this.wrappedDownloader.getStream(imageUri, extra);
switch (Scheme.ofUri(imageUri)) {
case HTTP:
case HTTPS:
return new FlushedInputStream(imageStream);
default:
return imageStream;
}
}
示例9: testSchemeContent
import com.nostra13.universalimageloader.core.download.ImageDownloader.Scheme; //导入方法依赖的package包/类
@Test
public void testSchemeContent() throws Exception {
String uri = "content://path/to/content";
Scheme result = Scheme.ofUri(uri);
Scheme expected = Scheme.CONTENT;
Assertions.assertThat(result).isEqualTo(expected);
}
示例10: testSchemeFile
import com.nostra13.universalimageloader.core.download.ImageDownloader.Scheme; //导入方法依赖的package包/类
@Test
public void testSchemeFile() throws Exception {
String uri = "file://path/on/the/device/1.png";
Scheme result = Scheme.ofUri(uri);
Scheme expected = Scheme.FILE;
Assertions.assertThat(result).isEqualTo(expected);
}
示例11: canDefineExifParams
import com.nostra13.universalimageloader.core.download.ImageDownloader.Scheme; //导入方法依赖的package包/类
private boolean canDefineExifParams(String imageUri, String mimeType) {
return "image/jpeg".equalsIgnoreCase(mimeType) && (Scheme.ofUri(imageUri) == Scheme.FILE);
}
示例12: canDefineExifParams
import com.nostra13.universalimageloader.core.download.ImageDownloader.Scheme; //导入方法依赖的package包/类
private boolean canDefineExifParams(String imageUri, String mimeType) {
return "image/jpeg".equalsIgnoreCase(mimeType) && Scheme.ofUri(imageUri) == Scheme.FILE;
}
示例13: canDefineExifParams
import com.nostra13.universalimageloader.core.download.ImageDownloader.Scheme; //导入方法依赖的package包/类
private boolean canDefineExifParams(String imageUri, String mimeType) {
return "image/jpeg".equalsIgnoreCase(mimeType) && (Scheme.ofUri(imageUri) == Scheme.FILE);
}
示例14: canDefineExifParams
import com.nostra13.universalimageloader.core.download.ImageDownloader.Scheme; //导入方法依赖的package包/类
private boolean canDefineExifParams(String imageUri, String mimeType) {
return Build.VERSION.SDK_INT >= Build.VERSION_CODES.ECLAIR && "image/jpeg".equalsIgnoreCase(mimeType) && Scheme
.ofUri(imageUri) == Scheme.FILE;
}