SDL: updated to Android 6.0 Marshmallow framework

This commit is contained in:
Sergii Pylypenko
2015-09-04 21:39:14 +03:00
parent 246345d6a4
commit 52117704d4
8 changed files with 26 additions and 34 deletions

View File

@@ -1034,28 +1034,6 @@ public class MainActivity extends Activity
this.runOnUiThread(cb);
}
public void showTaskbarNotification()
{
showTaskbarNotification("SDL application paused", "SDL application", "Application is paused, click to activate");
}
// Stolen from SDL port by Mamaich
public void showTaskbarNotification(String text0, String text1, String text2)
{
NotificationManager NotificationManager = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);
Intent intent = new Intent(this, MainActivity.class);
PendingIntent pendingIntent = PendingIntent.getActivity(this, 0, intent, Intent.FLAG_ACTIVITY_NEW_TASK);
Notification n = new Notification(R.drawable.icon, text0, System.currentTimeMillis());
n.setLatestEventInfo(this, text1, text2, pendingIntent);
NotificationManager.notify(NOTIFY_ID, n);
}
public void hideTaskbarNotification()
{
NotificationManager NotificationManager = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);
NotificationManager.cancel(NOTIFY_ID);
}
@Override
public void onNewIntent(Intent i)
{
@@ -1396,8 +1374,6 @@ public class MainActivity extends Activity
public FrameLayout getVideoLayout() { return _videoLayout; }
static int NOTIFY_ID = 12367098; // Random ID
DemoGLSurfaceView mGLView = null;
private static AudioThread mAudioThread = null;
private static DataDownloader downloader = null;

View File

@@ -376,6 +376,10 @@ abstract class DifferentTouchInput
if( (buttonStateNew & i) != (buttonState & i) )
DemoGLSurfaceView.nativeMouseButtonsPressed(i, ((buttonStateNew & i) == 0) ? 0 : 1);
}
if( (buttonStateNew & MotionEvent.BUTTON_STYLUS_PRIMARY) != (buttonState & MotionEvent.BUTTON_STYLUS_PRIMARY) )
DemoGLSurfaceView.nativeMouseButtonsPressed(2, ((buttonStateNew & MotionEvent.BUTTON_STYLUS_PRIMARY) == 0) ? 0 : 1);
if( (buttonStateNew & MotionEvent.BUTTON_STYLUS_SECONDARY) != (buttonState & MotionEvent.BUTTON_STYLUS_SECONDARY) )
DemoGLSurfaceView.nativeMouseButtonsPressed(4, ((buttonStateNew & MotionEvent.BUTTON_STYLUS_SECONDARY) == 0) ? 0 : 1);
buttonState = buttonStateNew;
}
super.process(event);