3939import android .net .Uri ;
4040import android .os .Build ;
4141import android .os .Bundle ;
42- import android .os .CountDownTimer ;
4342import android .os .Looper ;
4443import android .os .PowerManager ;
4544import android .os .SystemClock ;
4645import android .provider .Settings ;
4746import android .view .Gravity ;
4847import android .view .Surface ;
49- import android .widget .Toast ;
5048
5149
5250/**
@@ -60,8 +58,6 @@ public class MapperActivity extends org.qtproject.qt5.android.bindings.QtActivit
6058 private String no_string ;
6159 private String gps_disabled_string ;
6260
63- private static Toast toast ;
64- private static CountDownTimer toast_reset ;
6561 private static boolean service_started = false ;
6662 private static boolean optimization_request_done = false ;
6763
@@ -180,52 +176,6 @@ public static void setTranslatableStrings(String yes_string, String no_string, S
180176 instance .gps_disabled_string = gps_disabled_string ;
181177 }
182178
183- public static void showToast (final String message , final int duration )
184- {
185- instance .runOnUiThread (new Runnable () {
186- public void run () {
187- if (toast_reset != null )
188- toast_reset .cancel ();
189-
190- if (toast == null )
191- {
192- toast = Toast .makeText (instance , "" , Toast .LENGTH_SHORT );
193- toast .setGravity (Gravity .BOTTOM |Gravity .CENTER_HORIZONTAL , 0 , 4 );
194- }
195-
196- toast .setText (message );
197- toast .show ();
198-
199- if (duration <= 0 )
200- return ;
201-
202- toast_reset = new CountDownTimer (duration , 500 ) {
203- public void onTick (long millisUntilFinished )
204- {
205- toast .show ();
206- }
207-
208- public void onFinish () {
209- toast .cancel ();
210- }
211- };
212- toast_reset .start ();
213- }
214- } );
215- }
216-
217- public static void hideToast ()
218- {
219- instance .runOnUiThread (new Runnable () {
220- public void run () {
221- if (toast_reset != null )
222- toast_reset .cancel ();
223- if (toast != null )
224- toast .cancel ();
225- }
226- } );
227- }
228-
229179 /** Locks the current display orientation.
230180 * While a native "locked" mode comes in API level 18,
231181 * this method tries to determine and lock the current orientation
0 commit comments