From bb9394a46f2c541db7cfdf664bf4411a61afcba4 Mon Sep 17 00:00:00 2001 From: Egor Yusov Date: Mon, 11 Nov 2019 07:47:34 -0800 Subject: Moved NativeApp to Tools module --- .../NativeApp/Android/src/main/AndroidManifest.xml | 2 - .../android/common/DiligentApplicationBase.java | 40 ------ .../android/common/NativeActivityBase.java | 156 --------------------- .../Android/src/main/res/layout/widgets.xml | 17 --- .../src/main/res/mipmap-hdpi/ic_launcher.png | Bin 6332 -> 0 bytes .../src/main/res/mipmap-mdpi/ic_launcher.png | Bin 3611 -> 0 bytes .../src/main/res/mipmap-xhdpi/ic_launcher.png | Bin 9400 -> 0 bytes .../src/main/res/mipmap-xxhdpi/ic_launcher.png | Bin 16510 -> 0 bytes .../Android/src/main/res/values-v11/styles.xml | 11 -- .../Android/src/main/res/values-v14/styles.xml | 12 -- .../Android/src/main/res/values/strings.xml | 5 - .../Android/src/main/res/values/styles.xml | 20 --- 12 files changed, 263 deletions(-) delete mode 100644 Common/NativeApp/Android/src/main/AndroidManifest.xml delete mode 100644 Common/NativeApp/Android/src/main/java/com/diligentengine/android/common/DiligentApplicationBase.java delete mode 100644 Common/NativeApp/Android/src/main/java/com/diligentengine/android/common/NativeActivityBase.java delete mode 100644 Common/NativeApp/Android/src/main/res/layout/widgets.xml delete mode 100644 Common/NativeApp/Android/src/main/res/mipmap-hdpi/ic_launcher.png delete mode 100644 Common/NativeApp/Android/src/main/res/mipmap-mdpi/ic_launcher.png delete mode 100644 Common/NativeApp/Android/src/main/res/mipmap-xhdpi/ic_launcher.png delete mode 100644 Common/NativeApp/Android/src/main/res/mipmap-xxhdpi/ic_launcher.png delete mode 100644 Common/NativeApp/Android/src/main/res/values-v11/styles.xml delete mode 100644 Common/NativeApp/Android/src/main/res/values-v14/styles.xml delete mode 100644 Common/NativeApp/Android/src/main/res/values/strings.xml delete mode 100644 Common/NativeApp/Android/src/main/res/values/styles.xml (limited to 'Common/NativeApp/Android/src/main') diff --git a/Common/NativeApp/Android/src/main/AndroidManifest.xml b/Common/NativeApp/Android/src/main/AndroidManifest.xml deleted file mode 100644 index 467f1c7..0000000 --- a/Common/NativeApp/Android/src/main/AndroidManifest.xml +++ /dev/null @@ -1,2 +0,0 @@ - diff --git a/Common/NativeApp/Android/src/main/java/com/diligentengine/android/common/DiligentApplicationBase.java b/Common/NativeApp/Android/src/main/java/com/diligentengine/android/common/DiligentApplicationBase.java deleted file mode 100644 index 2342e46..0000000 --- a/Common/NativeApp/Android/src/main/java/com/diligentengine/android/common/DiligentApplicationBase.java +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright 2013 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.diligentengine.android.common; - -import android.app.Application; -import android.content.pm.ApplicationInfo; -import android.content.pm.PackageManager; -import android.content.pm.PackageManager.NameNotFoundException; -import android.util.Log; -import android.widget.Toast; - -public class DiligentApplicationBase extends Application { - public void onCreate(){ - Log.w("native-activity", "onCreate"); - - final PackageManager pm = getApplicationContext().getPackageManager(); - ApplicationInfo ai; - try { - ai = pm.getApplicationInfo( this.getPackageName(), 0); - } catch (final NameNotFoundException e) { - ai = null; - } - final String applicationName = (String) (ai != null ? pm.getApplicationLabel(ai) : "(unknown)"); - Toast.makeText(this, applicationName, Toast.LENGTH_SHORT).show(); - } -} diff --git a/Common/NativeApp/Android/src/main/java/com/diligentengine/android/common/NativeActivityBase.java b/Common/NativeApp/Android/src/main/java/com/diligentengine/android/common/NativeActivityBase.java deleted file mode 100644 index 396aa7a..0000000 --- a/Common/NativeApp/Android/src/main/java/com/diligentengine/android/common/NativeActivityBase.java +++ /dev/null @@ -1,156 +0,0 @@ -/* - * Copyright 2013 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.diligentengine.android.common; - -import android.app.NativeActivity; -import android.os.Bundle; -import android.view.Gravity; -import android.view.LayoutInflater; -import android.view.View; -import android.view.ViewGroup.MarginLayoutParams; -import android.view.WindowManager.LayoutParams; -import android.widget.LinearLayout; -import android.widget.PopupWindow; -import android.widget.TextView; -import android.util.Log; - -public class NativeActivityBase extends NativeActivity { - - static - { - try{ - System.loadLibrary("GraphicsEngineOpenGL"); - Log.i("native-activity", "Loaded GraphicsEngineOpenGL library.\n"); - } catch (UnsatisfiedLinkError e) { - Log.e("native-activity", "Failed to load GraphicsEngineOpenGL library.\n" + e); - } - } - - @Override - protected void onCreate(Bundle savedInstanceState) { - super.onCreate(savedInstanceState); - //Hide toolbar - int SDK_INT = android.os.Build.VERSION.SDK_INT; - if(SDK_INT >= 19) - { - setImmersiveSticky(); - - View decorView = getWindow().getDecorView(); - decorView.setOnSystemUiVisibilityChangeListener - (new View.OnSystemUiVisibilityChangeListener() { - @Override - public void onSystemUiVisibilityChange(int visibility) { - setImmersiveSticky(); - } - }); - } - - } - - protected void onResume() { - super.onResume(); - - //Hide toolbar - int SDK_INT = android.os.Build.VERSION.SDK_INT; - if(SDK_INT >= 11 && SDK_INT < 14) - { - getWindow().getDecorView().setSystemUiVisibility(View.STATUS_BAR_HIDDEN); - } - else if(SDK_INT >= 14 && SDK_INT < 19) - { - getWindow().getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_FULLSCREEN | View.SYSTEM_UI_FLAG_LOW_PROFILE); - } - else if(SDK_INT >= 19) - { - setImmersiveSticky(); - } - - } - // Our popup window, you will call it from your C/C++ code later - - void setImmersiveSticky() { - View decorView = getWindow().getDecorView(); - decorView.setSystemUiVisibility(View.SYSTEM_UI_FLAG_FULLSCREEN - | View.SYSTEM_UI_FLAG_HIDE_NAVIGATION - | View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY - | View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN - | View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION - | View.SYSTEM_UI_FLAG_LAYOUT_STABLE); - } - - NativeActivityBase _activity; - PopupWindow _popupWindow; - TextView _label; - - public void showUI() - { - if( _popupWindow != null ) - return; - - _activity = this; - - this.runOnUiThread(new Runnable() { - @Override - public void run() { - LayoutInflater layoutInflater - = (LayoutInflater)getBaseContext() - .getSystemService(LAYOUT_INFLATER_SERVICE); - View popupView = layoutInflater.inflate(R.layout.widgets, null); - _popupWindow = new PopupWindow( - popupView, - LayoutParams.WRAP_CONTENT, - LayoutParams.WRAP_CONTENT); - - LinearLayout mainLayout = new LinearLayout(_activity); - MarginLayoutParams params = new MarginLayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT); - params.setMargins(0, 0, 0, 0); - _activity.setContentView(mainLayout, params); - - // Show our UI over NativeActivity window - _popupWindow.showAtLocation(mainLayout, Gravity.TOP | Gravity.LEFT, 10, 10); - _popupWindow.update(); - - _label = (TextView)popupView.findViewById(R.id.textViewFPS); - - }}); - } - - protected void onPause() - { - super.onPause(); - if (_popupWindow != null) { - _popupWindow.dismiss(); - _popupWindow = null; - } - } - - public void updateFPS(final float fFPS) - { - if( _label == null ) - return; - - _activity = this; - this.runOnUiThread(new Runnable() { - @Override - public void run() { - _label.setText(String.format("%2.2f FPS", fFPS)); - - }}); - } -} - - diff --git a/Common/NativeApp/Android/src/main/res/layout/widgets.xml b/Common/NativeApp/Android/src/main/res/layout/widgets.xml deleted file mode 100644 index b6e86e6..0000000 --- a/Common/NativeApp/Android/src/main/res/layout/widgets.xml +++ /dev/null @@ -1,17 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/Common/NativeApp/Android/src/main/res/mipmap-hdpi/ic_launcher.png b/Common/NativeApp/Android/src/main/res/mipmap-hdpi/ic_launcher.png deleted file mode 100644 index 5a261ea..0000000 Binary files a/Common/NativeApp/Android/src/main/res/mipmap-hdpi/ic_launcher.png and /dev/null differ diff --git a/Common/NativeApp/Android/src/main/res/mipmap-mdpi/ic_launcher.png b/Common/NativeApp/Android/src/main/res/mipmap-mdpi/ic_launcher.png deleted file mode 100644 index 74263d9..0000000 Binary files a/Common/NativeApp/Android/src/main/res/mipmap-mdpi/ic_launcher.png and /dev/null differ diff --git a/Common/NativeApp/Android/src/main/res/mipmap-xhdpi/ic_launcher.png b/Common/NativeApp/Android/src/main/res/mipmap-xhdpi/ic_launcher.png deleted file mode 100644 index da6a331..0000000 Binary files a/Common/NativeApp/Android/src/main/res/mipmap-xhdpi/ic_launcher.png and /dev/null differ diff --git a/Common/NativeApp/Android/src/main/res/mipmap-xxhdpi/ic_launcher.png b/Common/NativeApp/Android/src/main/res/mipmap-xxhdpi/ic_launcher.png deleted file mode 100644 index e587387..0000000 Binary files a/Common/NativeApp/Android/src/main/res/mipmap-xxhdpi/ic_launcher.png and /dev/null differ diff --git a/Common/NativeApp/Android/src/main/res/values-v11/styles.xml b/Common/NativeApp/Android/src/main/res/values-v11/styles.xml deleted file mode 100644 index 541752f..0000000 --- a/Common/NativeApp/Android/src/main/res/values-v11/styles.xml +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/Common/NativeApp/Android/src/main/res/values-v14/styles.xml b/Common/NativeApp/Android/src/main/res/values-v14/styles.xml deleted file mode 100644 index f20e015..0000000 --- a/Common/NativeApp/Android/src/main/res/values-v14/styles.xml +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/Common/NativeApp/Android/src/main/res/values/strings.xml b/Common/NativeApp/Android/src/main/res/values/strings.xml deleted file mode 100644 index a06980b..0000000 --- a/Common/NativeApp/Android/src/main/res/values/strings.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - 0.0 FPS - - \ No newline at end of file diff --git a/Common/NativeApp/Android/src/main/res/values/styles.xml b/Common/NativeApp/Android/src/main/res/values/styles.xml deleted file mode 100644 index 4a10ca4..0000000 --- a/Common/NativeApp/Android/src/main/res/values/styles.xml +++ /dev/null @@ -1,20 +0,0 @@ - - - - - - - - - \ No newline at end of file -- cgit v1.2.3