• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright 2010 Mario Zechner (contact@badlogicgames.com), Nathan Sweet (admin@esotericsoftware.com), Dave Clayton (contact@redskyforge.com)
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the
5  * License. You may obtain a copy of the License at
6  *
7  * http://www.apache.org/licenses/LICENSE-2.0
8  *
9  * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS"
10  * BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language
11  * governing permissions and limitations under the License.
12  */
13 
14 package com.badlogic.gdx.backends.android.surfaceview;
15 
16 import android.view.View;
17 
18 /** This {@link ResolutionStrategy} will stretch the GLSurfaceView to full screen. FillResolutionStrategy is the default
19  * {@link ResolutionStrategy} if none is specified.
20  *
21  * @author christoph widulle */
22 public class FillResolutionStrategy implements ResolutionStrategy {
23 
24 	@Override
calcMeasures(int widthMeasureSpec, int heightMeasureSpec)25 	public MeasuredDimension calcMeasures (int widthMeasureSpec, int heightMeasureSpec) {
26 
27 		final int width = View.MeasureSpec.getSize(widthMeasureSpec);
28 		final int height = View.MeasureSpec.getSize(heightMeasureSpec);
29 
30 		return new MeasuredDimension(width, height);
31 	}
32 }
33