|  |  |  | 
|---|
|  |  |  | import com.secondworld.univeralsdk.R; | 
|---|
|  |  |  | import com.unity3d.player.UnityPlayer; | 
|---|
|  |  |  | import com.unity3d.player.UnityPlayerActivity; | 
|---|
|  |  |  | import android.util.DisplayMetrics; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | public class MainActivity extends UnityPlayerActivity | 
|---|
|  |  |  | { | 
|---|
|  |  |  | 
|---|
|  |  |  | private RelativeLayout m_MainContainer; | 
|---|
|  |  |  | private int mType; | 
|---|
|  |  |  | private boolean isNotch = false; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | private int gameWidth; | 
|---|
|  |  |  | private int gameHeight; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @Override | 
|---|
|  |  |  | protected void onCreate(Bundle savedInstanceState) | 
|---|
|  |  |  | 
|---|
|  |  |  | Sdk.getInstance().init(this, "55748756613777418058915575591656", "23010677"); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | QuickSDK.getInstance().setIsLandScape(true); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | DisplayMetrics dm = new DisplayMetrics(); | 
|---|
|  |  |  | this.getWindowManager().getDefaultDisplay().getRealMetrics(dm); | 
|---|
|  |  |  | if(gameWidth == 0){ | 
|---|
|  |  |  | gameWidth = dm.widthPixels; | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | if(gameHeight == 0) | 
|---|
|  |  |  | { | 
|---|
|  |  |  | gameHeight = dm.heightPixels; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @Override | 
|---|
|  |  |  | 
|---|
|  |  |  | H2EngineSDK.onConfigurationChanged(newConfig); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | super.onConfigurationChanged(newConfig); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | mUnityPlayer.getView().getLayoutParams().width = gameWidth; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | mUnityPlayer.getView().getLayoutParams().height = gameHeight; | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @Override | 
|---|