Skip to content

Commit

Permalink
update html files and fix back press toast
Browse files Browse the repository at this point in the history
  • Loading branch information
uberspot committed Mar 28, 2014
1 parent 9fcdfb7 commit 4f918b7
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
Binary file modified 2048.apk
Binary file not shown.
4 changes: 2 additions & 2 deletions AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.uberspot.a2048"
android:versionCode="8"
android:versionName="1.7" >
android:versionCode="9"
android:versionName="1.8" >

<uses-sdk
android:minSdkVersion="10"
Expand Down
8 changes: 5 additions & 3 deletions src/com/uberspot/a2048/MainActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,12 @@ public class MainActivity extends Activity {

private WebView mWebView;
private long mLastBackPress;
private static final long mBackPressThreshold = 4000;
private static final long mBackPressThreshold = 3500;
private static final String IS_FULLSCREEN_PREF = "is_fullscreen_pref";
private static boolean DEF_FULLSCREEN = true;
private long mLastTouch;
private static final long mTouchThreshold = 2000;
private Toast pressBackToast;

@SuppressLint("SetJavaScriptEnabled")
@Override
Expand Down Expand Up @@ -73,6 +74,9 @@ public boolean onTouch(View v, MotionEvent event) {
// by the webview as well
return false;
}});

pressBackToast = Toast.makeText(getApplicationContext(),
R.string.press_back_again_to_exit, Toast.LENGTH_SHORT);
}

@Override
Expand Down Expand Up @@ -112,8 +116,6 @@ private void applyFullScreen(boolean isFullScreen) {
@Override
public void onBackPressed() {
long currentTime = System.currentTimeMillis();
Toast pressBackToast = Toast.makeText(getApplicationContext(),
R.string.press_back_again_to_exit, Toast.LENGTH_SHORT);
if (Math.abs(currentTime - mLastBackPress) > mBackPressThreshold) {
pressBackToast.show();
mLastBackPress = currentTime;
Expand Down

0 comments on commit 4f918b7

Please sign in to comment.