I’m going to prepare for special edition for family on my car-launcher.
I’m going to prepare for special edition for family on my car-launcher. I wanna user-customization area for family picture. eg) Just place one 500×600 picture on 1024×600 which is original resolution.
Once user press the icon(e.g (+)) then into the gallery and can select favorite picture on fixed frame layer.
Is there any idea for this?
]]>
< ![CDATA[
I don’t, but I know there are plenty of photo widgets with this functionality. I assume you don’t want to use one though?
]]>
< ![CDATA[
IIRC lukas wrote a picture changing script
]]>
< ![CDATA[
//I wrote this a while ago for myself
LL.bindClass(“android.widget.ImageView”);
LL.bindClass(“android.graphics.Bitmap”)
var iv = new ImageView(LL.getContext());
var path = “replace_with_image_path”;
var image = LL.createImage(path);
var get = image.getBitmap();
var bmp = Bitmap.createBitmap(get);
iv.setImageBitmap(bmp);
iv.setScaleType(ImageView.ScaleType.CENTER_CROP);
return iv;
]]>
< ![CDATA[
To use this script paste it into the script editor give it a name if you want remember to replace the path string^ with the path of an image file go to your desktop and add a custom view long press it press the pencil icon and under create script select the script. You might need to play around with the ScaleType so see here https://developer.android.com/reference/android/widget/ImageView.ScaleType.html
]]>
< ![CDATA[
Jay M ok i will try.. but i have never been familiar with scaletype as you comment
]]>
< ![CDATA[
just look at the enum values lets say you want to try the CENTER_INSIDE value all you need to do is replace.
ImageView.ScaleType.CENTER_CROP);
with
ImageView.ScaleType.CENTER_INSIDE);
that’s all there is to it really.
]]>