[Fix] Conflicts

This commit is contained in:
Quentin Guidée
2020-07-14 14:36:39 +02:00
3 changed files with 95 additions and 0 deletions

View File

@@ -34,6 +34,10 @@ CXX = $(NDK_TOOLCHAIN_PATH)/$(NDK_TARGET)$(NDK_VERSION)-clang++
LD = $(NDK_TOOLCHAIN_PATH)/$(NDK_TARGET)$(NDK_VERSION)-clang++
SFLAGS += -fPIC
# If MICROPY_NLR_SETJMP is 0, the MicroPython NLR is done by
# python/src/py/nlrthumb.c and creates code containing relocations, which is not
# accepted by Android.
SFLAGS += -DMICROPY_NLR_SETJMP=1
LDFLAGS += -shared
LDFLAGS += -static-libstdc++

View File

@@ -0,0 +1,84 @@
package com.numworks.calculator;
import java.util.Locale;
import android.app.Activity;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.os.Bundle;
import android.util.Log;
import com.google.android.gms.analytics.GoogleAnalytics;
import com.google.android.gms.analytics.Tracker;
import com.google.android.gms.analytics.HitBuilders;
import org.libsdl.app.SDLActivity;
public class EpsilonActivity extends SDLActivity {
private static GoogleAnalytics sAnalytics;
private static Tracker sTracker;
protected String[] getLibraries() {
return new String[] {
"epsilon"
};
}
@Override
protected String[] getArguments() {
Locale currentLocale = getResources().getConfiguration().locale;
String[] arguments = {"--language", currentLocale.getLanguage()};
return arguments;
}
public Bitmap retrieveBitmapAsset(String identifier) {
Bitmap bitmap = null;
try {
bitmap = BitmapFactory.decodeStream(
this.getResources().getAssets().open(identifier)
);
} catch (Exception e) {
Log.w("LoadTexture", "Coundn't load a file:" + identifier);
}
return bitmap;
}
public void telemetryInit() {
sAnalytics = GoogleAnalytics.getInstance(this);
sTracker = sAnalytics.newTracker("UA-93775823-3");
}
public void telemetryScreen(String screenName) {
sTracker.setScreenName(screenName);
sTracker.send(new HitBuilders.ScreenViewBuilder().build());
}
public void telemetryEvent(String category, String action, String label) {
sTracker.send(new HitBuilders.EventBuilder()
.setCategory(category)
.setAction(action)
.setLabel(label)
.build()
);
}
@Override
protected void onCreate(Bundle savedInstanceState) {
/* This is done to hide the status bar and the bottom navigation buttons.
*
* In SDLActivity::onCreate, setWindowStyle(false) is called, which means
* the fullscreen mode is put to false. We call again the method here with
* true, in order not to modify the external sources.
*
* TODO: This was not needed for v12 of Epsilon, even though
* setWindowStyle(false) was already called in SDLActivity::onCreate. Find
* out why and make a proper fix? */
super.onCreate(savedInstanceState);
if (!mBrokenLibraries) {
/* If mBrokenLibraries, SDL is not initialized by onCreate in
* SDLActivity.java. */
setWindowStyle(true);
}
}
}

View File

@@ -39,4 +39,11 @@ public class OmegaActivity extends SDLActivity {
}
return bitmap;
}
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
if (!mBrokenLibraries) {
setWindowStyle(true);
}
}
}