|
|
|
|
8
|
import android.support.annotation.NonNull;
|
8
|
import android.support.annotation.NonNull;
|
9
|
|
9
|
|
10
|
import com.reactnativenavigation.NavigationApplication;
|
10
|
import com.reactnativenavigation.NavigationApplication;
|
11
|
-import com.reactnativenavigation.utils.ViewUtils;
|
|
|
12
|
|
11
|
|
13
|
import java.io.IOException;
|
12
|
import java.io.IOException;
|
14
|
import java.net.URL;
|
13
|
import java.net.URL;
|
|
|
|
|
33
|
private static Drawable tryLoadIcon(String iconDevUri) throws IOException {
|
32
|
private static Drawable tryLoadIcon(String iconDevUri) throws IOException {
|
34
|
URL url = new URL(iconDevUri);
|
33
|
URL url = new URL(iconDevUri);
|
35
|
Bitmap bitmap = BitmapFactory.decodeStream(url.openStream());
|
34
|
Bitmap bitmap = BitmapFactory.decodeStream(url.openStream());
|
36
|
- final int dimensions = (int) ViewUtils.convertDpToPixel(48);
|
|
|
37
|
- // TODO: fix hard coded dimensions -add options to decodeStream
|
|
|
38
|
- bitmap = Bitmap.createScaledBitmap(bitmap, dimensions, dimensions, false);
|
|
|
39
|
return new BitmapDrawable(NavigationApplication.instance.getResources(), bitmap);
|
35
|
return new BitmapDrawable(NavigationApplication.instance.getResources(), bitmap);
|
40
|
}
|
36
|
}
|
41
|
-
|
|
|
42
|
}
|
37
|
}
|