1
created a Viewa class where I take two pictures of the drawable folder and draw on the screen with draw method();
public class ViewA extends View {
private Bitmap img1;
private Bitmap img2;
public ViewA(Context context){
super(context);
img1 = BitmapFactory.decodeResource(getResources(), R.drawable.imagem01);
img2 = BitmapFactory.decodeResource(getResources(), R.drawable.imagem02);
}
public void draw(Canvas canvas){
super.draw(canvas);
canvas.drawBitmap(img1, 0, 0, null);
canvas.drawBitmap(img2, 0, 0, null);
}
}
and here is Mainacttivity
public class MainActivity extends AppCompatActivity {
private ViewA view;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
view = new ViewA(this);
setContentView(view);
getWindow().getDecorView().setSystemUiVisibility(
View.SYSTEM_UI_FLAG_LAYOUT_STABLE |
View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION |
View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN |
View.SYSTEM_UI_FLAG_HIDE_NAVIGATION |
View.SYSTEM_UI_FLAG_FULLSCREEN |
View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY);
}
}
is full screen however at the time of taking the images and drawing on the screen, assuming that it is an image of resolution 1920x1080 the images is cropped and only part of the image appears. I wanted to know if there is a way to put these images on the screen !! without being cropped.
img1 = Bitmap.createScaledBitmap(img1, 1300, 800, true);
I found this solution, but if changing device does not fill the whole screen ...– SanekeDev