Ticket #838: fullscreen-v2.diff

File fullscreen-v2.diff, 2.1 KB (added by kamikaaze, 8 years ago)
  • navit/android/src/org/navitproject/navit/Navit.java

     
    5959import android.view.Display;
    6060import android.view.Menu;
    6161import android.view.MenuItem;
     62import android.view.WindowManager;
    6263import android.view.inputmethod.InputMethodManager;
    6364import android.widget.RelativeLayout;
    6465import android.widget.TextView;
     
    623624                // code review
    624625                NavitDestroy();
    625626        }
     627       
     628        public void fullscreen(int fullscreen) {
     629                if(fullscreen != 0) {
     630                        getWindow().addFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN);
     631                        getWindow().clearFlags(WindowManager.LayoutParams.FLAG_FORCE_NOT_FULLSCREEN);
     632                }
     633                else {
     634                        getWindow().addFlags(WindowManager.LayoutParams.FLAG_FORCE_NOT_FULLSCREEN);
     635                        getWindow().clearFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN);
     636                }
     637        }
    626638
    627639        public void disableSuspend()
    628640        {
  • navit/graphics/android/graphics_android.c

     
    625625        return 1;
    626626}
    627627
     628static jclass NavitClass;
     629static jmethodID Navit_disableSuspend, Navit_exit, Navit_fullscreen;
     630
    628631static int
    629632graphics_android_fullscreen(struct window *win, int on)
    630633{
     634        (*jnienv)->CallVoidMethod(jnienv, android_activity, Navit_fullscreen, on);
    631635        return 1;
    632636}
    633637
    634 static jclass NavitClass;
    635 static jmethodID Navit_disableSuspend, Navit_exit;
    636 
    637638static void
    638639graphics_android_disable_suspend(struct window *win)
    639640{
     
    881882        Navit_exit = (*jnienv)->GetMethodID(jnienv, NavitClass, "exit", "()V");
    882883        if (Navit_exit == NULL)
    883884                return NULL;
     885        Navit_fullscreen = (*jnienv)->GetMethodID(jnienv, NavitClass, "fullscreen", "(I)V");
     886        if (Navit_fullscreen == NULL)
     887                return NULL;
    884888        dbg(0,"ok\n");
    885889        *meth=event_android_methods;
    886890        return NULL;