Skip to content

Commit

Permalink
change interface name
Browse files Browse the repository at this point in the history
  • Loading branch information
user23 committed Oct 25, 2016
1 parent e97192e commit 4c9753a
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 8 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package com.ahmadnemati.clickablewebviewapp;

import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.widget.Toast;

import com.ahmadnemati.clickablewebview.ClickableWebView;
Expand All @@ -10,18 +10,17 @@
public class MainActivity extends AppCompatActivity implements OnWebViewClicked {
private ClickableWebView clickableWebView;


@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
clickableWebView= (ClickableWebView) findViewById(R.id.clickable_webview);
clickableWebView = (ClickableWebView) findViewById(R.id.clickable_webview);
clickableWebView.setOnWebViewClickListener(this);
clickableWebView.loadUrl("http://www.ushistory.org/Betsy/flagfact.html");
}

@Override
public void onClick(String url) {
Toast.makeText(MainActivity.this, "Url : "+url, Toast.LENGTH_SHORT).show();
Toast.makeText(MainActivity.this, "Url : " + url, Toast.LENGTH_SHORT).show();
}
}
4 changes: 2 additions & 2 deletions clickablewebview/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ android {
minSdkVersion 9
targetSdkVersion 24
versionCode 1
versionName "1.0"
versionName "1.1.2"

testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"

Expand All @@ -26,7 +26,7 @@ publish {
userOrg = 'ahmadnemati'
groupId = 'com.ahmadnemati.clickablewebview'
artifactId = 'clickablewebview'
publishVersion = '1.1.1'
publishVersion = '1.1.2'
desc = 'Simple WebView for Detect click on an image'
website = 'https://github.com/AhmadNemati/ClickableWebView/'
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
public class ClickableWebView extends WebView implements View.OnClickListener, View.OnTouchListener {
private OnWebViewClicked listener;
private static final int MAX_CLICK_DURATION = 200;
private static final int IMAGE_TYPE=5;
private static final int IMAGE_TYPE = 5;
private long startClickTime;

public ClickableWebView(Context context) {
Expand Down Expand Up @@ -82,7 +82,6 @@ public boolean onTouch(View view, MotionEvent event) {
long clickDuration = Calendar.getInstance().getTimeInMillis() - startClickTime;
if (clickDuration < MAX_CLICK_DURATION) {
performClick();

}
}
}
Expand Down

0 comments on commit 4c9753a

Please sign in to comment.