收藏前修改,收藏后修改,修改值校验
This commit is contained in:
parent
eb05d03808
commit
ec032b205b
BIN
app-debug.apk
BIN
app-debug.apk
Binary file not shown.
|
@ -2,7 +2,7 @@
|
|||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
package="com.hty.browser"
|
||||
android:versionCode="3"
|
||||
android:versionName="3.8">
|
||||
android:versionName="3.10">
|
||||
|
||||
<uses-sdk
|
||||
android:minSdkVersion="16"
|
||||
|
@ -45,7 +45,6 @@
|
|||
<uses-permission android:name="android.permission.READ_PHONE_STATE"/>
|
||||
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
|
||||
<!-- GPS权限 -->
|
||||
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
|
||||
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/>
|
||||
<uses-permission android:name="android.permission.ACCESS_GPS" />
|
||||
<uses-permission android:name="android.permission.ACCESS_ASSISTED_GPS" />
|
||||
|
|
|
@ -9,7 +9,7 @@ p { text-indent:2em; }
|
|||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<h2 align=center><img src=logo.png><br>海天鹰浏览器 V3.8</h2>
|
||||
<h2 align=center><img src=logo.png><br>海天鹰浏览器 V3.10</h2>
|
||||
<p>内置扩展的浏览器。</p>
|
||||
<p>扩展:[国产]高亮,广告图片自定义过滤。</p>
|
||||
<p>作者:黄颖</p>
|
||||
|
@ -20,6 +20,8 @@ p { text-indent:2em; }
|
|||
<p><a href="https://www.jianshu.com/p/6e38e1ef203a" target="_blank">Android WebView 三种文件下载方式</a></p>
|
||||
<p><a href="https://blog.csdn.net/lowprofile_coding/article/details/77852131" target="_blank">自动安装apk包</a></p>
|
||||
<h3>更新日志:</h3>
|
||||
<h3>V3.10 (2019-02-10)</h3><ol><li>增加:收藏前修改,收藏后修改,修改校验。</li></ol>
|
||||
<h3>V3.9 (2018-12-20)</h3><ol><li>视频独立播放JS读不到iframe里的video,使用跳转iframe代替。</li></ol>
|
||||
<h3>V3.8 (2018-07-14)</h3><ol><li>增加定位权限。</li></ol>
|
||||
<h3>V3.7 (2018-06-13)</h3><ol><li>增加自动更新。</li></ol>
|
||||
<h3>V3.6 (2018-05-30)</h3><ol><li>修复从收藏夹返回输入法不能自动隐藏的问题。</li></ol>
|
||||
|
|
|
@ -12,7 +12,7 @@ public class DBHelper extends SQLiteOpenHelper {
|
|||
|
||||
public static final String DATABASE_NAME = MainActivity.dir + File.separator + "webfav.db";
|
||||
private final static int VERSION = 1;
|
||||
String TableName = "webfav";
|
||||
static String TableName = "webfav";
|
||||
private SQLiteDatabase db;
|
||||
private static DBHelper mInstance = null;
|
||||
|
||||
|
@ -39,10 +39,6 @@ public class DBHelper extends SQLiteOpenHelper {
|
|||
// onCreate(db);
|
||||
switch (newVersion) {
|
||||
case 6:
|
||||
db.execSQL("alter table battery rename to battery_temp");
|
||||
db.execSQL("CREATE TABLE battery (_id INTEGER PRIMARY KEY ,time TEXT,level INTEGER, voltage INTEGER, current INTEGER , temperature INTEGER, cpu INTEGER)");
|
||||
db.execSQL("insert into battery select *,'' from battery_temp");
|
||||
db.execSQL("drop table battery_temp");
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,11 +1,15 @@
|
|||
package com.hty.browser;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.app.AlertDialog;
|
||||
import android.content.ClipData;
|
||||
import android.content.ClipboardManager;
|
||||
import android.content.ContentValues;
|
||||
import android.content.Context;
|
||||
import android.content.DialogInterface;
|
||||
import android.content.Intent;
|
||||
import android.database.Cursor;
|
||||
import android.database.sqlite.SQLiteDatabase;
|
||||
import android.graphics.Color;
|
||||
import android.graphics.drawable.ColorDrawable;
|
||||
import android.os.Bundle;
|
||||
|
@ -23,11 +27,14 @@ import android.widget.AdapterView;
|
|||
import android.widget.AdapterView.AdapterContextMenuInfo;
|
||||
import android.widget.AdapterView.OnItemClickListener;
|
||||
import android.widget.EditText;
|
||||
import android.widget.LinearLayout;
|
||||
import android.widget.ListView;
|
||||
import android.widget.SimpleCursorAdapter;
|
||||
import android.widget.TextView;
|
||||
import android.widget.Toast;
|
||||
|
||||
import java.lang.reflect.Field;
|
||||
|
||||
public class FavoriteActivity extends Activity {
|
||||
SimpleCursorAdapter adapter;
|
||||
ListView listView;
|
||||
|
@ -66,6 +73,92 @@ public class FavoriteActivity extends Activity {
|
|||
adapter = new SimpleCursorAdapter(this, R.layout.favorite_row, c, from, to, 0);
|
||||
listView.setAdapter(adapter);
|
||||
break;
|
||||
case 2:
|
||||
final String sid = ((TextView) menuInfo.targetView.findViewById(R.id.id)).getText().toString();
|
||||
final String stitle = ((TextView) menuInfo.targetView.findViewById(R.id.title)).getText().toString();
|
||||
final String surl = ((TextView) menuInfo.targetView.findViewById(R.id.website)).getText().toString();
|
||||
LinearLayout layout = new LinearLayout(FavoriteActivity.this);
|
||||
layout.setOrientation(LinearLayout.VERTICAL);
|
||||
final EditText ET_title = new EditText(FavoriteActivity.this);
|
||||
ET_title.setHint("标题");
|
||||
ET_title.setText(stitle);
|
||||
layout.addView(ET_title);
|
||||
final EditText ET_url = new EditText(FavoriteActivity.this);
|
||||
ET_title.setHint("网址");
|
||||
ET_url.setText(surl);
|
||||
layout.addView(ET_url);
|
||||
AlertDialog.Builder builder = new AlertDialog.Builder(FavoriteActivity.this);
|
||||
builder.setIcon(android.R.drawable.btn_star_big_on);
|
||||
builder.setTitle("修改收藏");
|
||||
builder.setView(layout);
|
||||
builder.setPositiveButton("确定", new DialogInterface.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(DialogInterface dialog, int which) {
|
||||
String stitle = ET_title.getText().toString();
|
||||
String surl = ET_url.getText().toString();
|
||||
Field field = null;
|
||||
try {
|
||||
//通过反射获取dialog中的私有属性mShowing
|
||||
field = dialog.getClass().getSuperclass().getDeclaredField("mShowing");
|
||||
field.setAccessible(true);//设置该属性可以访问
|
||||
} catch (Exception ex) {
|
||||
|
||||
}
|
||||
if (!stitle.equals("") && surl.startsWith("http")) {
|
||||
DBHelper dbHelper = new DBHelper(getApplicationContext());
|
||||
SQLiteDatabase db = dbHelper.getWritableDatabase();
|
||||
ContentValues values = new ContentValues();
|
||||
values.put("website", surl);
|
||||
values.put("title", stitle);
|
||||
db.update(DBHelper.TableName, values, "_id = " + sid, null);
|
||||
IMM.hideSoftInputFromWindow(ET_title.getWindowToken(), 0);
|
||||
Cursor c = dbHelper.query(editText.getText().toString());
|
||||
String[] from = { "_id", "title", "website" };
|
||||
int[] to = { R.id.id, R.id.title, R.id.website };
|
||||
adapter = new SimpleCursorAdapter(FavoriteActivity.this, R.layout.favorite_row, c, from, to, 0);
|
||||
listView.setAdapter(adapter);
|
||||
try {
|
||||
//关闭
|
||||
field.set(dialog, true);
|
||||
dialog.dismiss();
|
||||
} catch (Exception ex) {
|
||||
}
|
||||
} else {
|
||||
if (stitle.equals("")){
|
||||
ET_title.setError("标题不能为空!");
|
||||
}
|
||||
if (!surl.startsWith("http")){
|
||||
ET_url.setError("网址错误!");
|
||||
}
|
||||
try {
|
||||
//设置dialog不可关闭
|
||||
field.set(dialog, false);
|
||||
dialog.dismiss();
|
||||
} catch (Exception ex) {
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
builder.setNegativeButton("取消", new DialogInterface.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(DialogInterface dialog, int which) {
|
||||
IMM.hideSoftInputFromWindow(ET_title.getWindowToken(), 0);
|
||||
Field field = null;
|
||||
try {
|
||||
//通过反射获取dialog中的私有属性mShowing
|
||||
field = dialog.getClass().getSuperclass().getDeclaredField("mShowing");
|
||||
field.setAccessible(true);//设置该属性可以访问
|
||||
} catch (Exception ex) {
|
||||
}
|
||||
try {
|
||||
field.set(dialog, true);
|
||||
dialog.dismiss();
|
||||
} catch (Exception ex) {
|
||||
}
|
||||
}
|
||||
});
|
||||
builder.create().show();
|
||||
break;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
@ -104,6 +197,7 @@ public class FavoriteActivity extends Activity {
|
|||
menu.setHeaderTitle(title);
|
||||
menu.add(0, 0, 0, "复制链接");
|
||||
menu.add(0, 1, 1, "删除");
|
||||
menu.add(0, 2, 2, "修改");
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
|
@ -9,6 +9,7 @@ import java.io.FileOutputStream;
|
|||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.io.InputStreamReader;
|
||||
import java.lang.reflect.Field;
|
||||
import java.net.HttpURLConnection;
|
||||
import java.net.URL;
|
||||
import java.util.ArrayList;
|
||||
|
@ -33,6 +34,7 @@ import android.content.pm.PackageManager;
|
|||
import android.content.res.Configuration;
|
||||
import android.database.Cursor;
|
||||
import android.graphics.Bitmap;
|
||||
import android.graphics.Color;
|
||||
import android.media.MediaScannerConnection;
|
||||
import android.net.ConnectivityManager;
|
||||
import android.net.NetworkInfo;
|
||||
|
@ -86,7 +88,7 @@ public class MainActivity extends Activity {
|
|||
ImageButton btnGo, btnBack, btnForward, btnMenu, findPrev, findNext, findClose;
|
||||
WebView webView1;
|
||||
// RelativeLayout RelativeLayout1;
|
||||
LinearLayout LinearLayout1,LinearLayout2;
|
||||
LinearLayout LinearLayout1, LinearLayout2;
|
||||
FrameLayout video, findbar;
|
||||
ImageView imageView1;
|
||||
InputMethodManager IMM;
|
||||
|
@ -192,8 +194,21 @@ public class MainActivity extends Activity {
|
|||
webView1.setWebViewClient(new WebViewClient() {
|
||||
@Override
|
||||
public boolean shouldOverrideUrlLoading(WebView view, String url) {
|
||||
if(url.startsWith("http"))
|
||||
Log.e("OverrideUrlLoading", url);
|
||||
// 协议过滤
|
||||
if(url.startsWith("http")){
|
||||
view.loadUrl(url);
|
||||
}
|
||||
/*
|
||||
else if(url.startsWith("tbopen://")){
|
||||
Intent intent = new Intent();
|
||||
intent.setAction("android.intent.action.VIEW");
|
||||
Uri uri = Uri.parse(url);
|
||||
intent.setData(uri);
|
||||
intent.setClassName("com.taobao.taobao", "com.taobao.tao.detail.activity.DetailActivity");
|
||||
startActivity(intent);
|
||||
}
|
||||
*/
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -204,14 +219,16 @@ public class MainActivity extends Activity {
|
|||
urln = url;
|
||||
btnBack.setEnabled(true);
|
||||
IMM.hideSoftInputFromWindow(editText1.getWindowToken(), 0);
|
||||
pgb1.setVisibility(View.VISIBLE);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPageFinished(WebView view, String url) {
|
||||
super.onPageFinished(view, url);
|
||||
pgb1.setVisibility(View.INVISIBLE);
|
||||
String js = "";
|
||||
// 关键字链接高亮
|
||||
js = "javascript:var a=document.getElementsByTagName('a');for(var i=0;i<a.length;i++){if(a[i].textContent.indexOf('国产')!=-1){a[i].style.color='white';a[i].style.backgroundColor='#DA3434';}}";
|
||||
// 链接关键字链接高亮、屏蔽
|
||||
js = "javascript:var a=document.getElementsByTagName('a');for(var i=0;i<a.length;i++){if(a[i].textContent.indexOf('国产')!=-1){a[i].style.color='white';a[i].style.backgroundColor='#DA3434';}if(a[i].textContent.indexOf('习近平')!=-1 || a[i].textContent.indexOf('总书记')!=-1){a[i].textContent='';}}";
|
||||
view.loadUrl(js);
|
||||
}
|
||||
|
||||
|
@ -229,30 +246,7 @@ public class MainActivity extends Activity {
|
|||
urln = url;
|
||||
break;
|
||||
case WebViewClient.ERROR_UNSUPPORTED_SCHEME:
|
||||
// Log.e("ErrorUnsupportedScheme",failingUrl);
|
||||
// String surl = "";
|
||||
// try {
|
||||
// surl = URLDecoder.decode(failingUrl, "utf-8");
|
||||
// Log.e("Decode",surl);
|
||||
// } catch (UnsupportedEncodingException e) {
|
||||
// e.printStackTrace();
|
||||
// }
|
||||
// String paraUrl="";
|
||||
// if(failingUrl.startsWith("baiduboxapp://")){
|
||||
// String[] paras=surl.split("&");
|
||||
// for(int i=0;i<paras.length;i++){
|
||||
// Log.e("para",paras[i]);
|
||||
// if(paras[i].startsWith("url=")){
|
||||
// paraUrl=paras[i].substring(4);
|
||||
// // break;
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// if(failingUrl.startsWith("intent://")){
|
||||
// paraUrl=surl.substring(surl.indexOf("http"),surl.indexOf("}\""));
|
||||
// }
|
||||
// Log.e("提取网址:",paraUrl);
|
||||
// webView1.loadUrl(paraUrl);
|
||||
Log.e("ErrorUnsupportedScheme",failingUrl);
|
||||
}
|
||||
} else {
|
||||
webView1.loadDataWithBaseURL(
|
||||
|
@ -276,8 +270,7 @@ public class MainActivity extends Activity {
|
|||
|
||||
// HTML5.input.file转换为安卓文件选择器
|
||||
@Override
|
||||
public boolean onShowFileChooser(WebView webView, ValueCallback<Uri[]> uploadMsg,
|
||||
WebChromeClient.FileChooserParams fileChooserParams) {
|
||||
public boolean onShowFileChooser(WebView webView, ValueCallback<Uri[]> uploadMsg, WebChromeClient.FileChooserParams fileChooserParams) {
|
||||
openFileChooserImplForAndroid5(uploadMsg);
|
||||
return true;
|
||||
}
|
||||
|
@ -287,6 +280,7 @@ public class MainActivity extends Activity {
|
|||
public void onProgressChanged(WebView view, int newProgress) {
|
||||
super.onProgressChanged(view, newProgress);
|
||||
pgb1.setProgress(newProgress);
|
||||
/*
|
||||
if(!isFullScreen) {
|
||||
if (newProgress == 100) {
|
||||
pgb1.setVisibility(View.INVISIBLE);
|
||||
|
@ -294,6 +288,7 @@ public class MainActivity extends Activity {
|
|||
pgb1.setVisibility(View.VISIBLE);
|
||||
}
|
||||
}
|
||||
*/
|
||||
if(sharedPreferences.getBoolean("switch_adBlock",true)){
|
||||
ADBlock();
|
||||
}
|
||||
|
@ -337,8 +332,7 @@ public class MainActivity extends Activity {
|
|||
|
||||
@Override
|
||||
public boolean onConsoleMessage(ConsoleMessage consoleMessage) {
|
||||
Log.d("onConsoleMessage", consoleMessage.message() + " at " + consoleMessage.sourceId() + ":"
|
||||
+ consoleMessage.lineNumber());
|
||||
Log.d("onConsoleMessage", consoleMessage.message() + " at " + consoleMessage.sourceId() + ":" + consoleMessage.lineNumber());
|
||||
return super.onConsoleMessage(consoleMessage);
|
||||
}
|
||||
|
||||
|
@ -516,7 +510,6 @@ public class MainActivity extends Activity {
|
|||
}
|
||||
break;
|
||||
case R.id.ImageButtonMenu:
|
||||
// MainActivity.this.openOptionsMenu();
|
||||
MenuDialog();
|
||||
break;
|
||||
case R.id.imageView1:
|
||||
|
@ -540,11 +533,10 @@ public class MainActivity extends Activity {
|
|||
|
||||
private class MyWebViewDownLoadListener implements DownloadListener {
|
||||
@Override
|
||||
public void onDownloadStart(String url, String userAgent, String contentDisposition, String mimetype,
|
||||
long contentLength) {
|
||||
// Uri uri = Uri.parse(url);
|
||||
// Intent intent = new Intent(Intent.ACTION_VIEW, uri);
|
||||
// startActivity(intent);
|
||||
public void onDownloadStart(String url, String userAgent, String contentDisposition, String mimetype, long contentLength) {
|
||||
// Uri uri = Uri.parse(url);
|
||||
// Intent intent = new Intent(Intent.ACTION_VIEW, uri);
|
||||
// startActivity(intent);
|
||||
downloadBySystem(url,"","");
|
||||
}
|
||||
}
|
||||
|
@ -562,6 +554,7 @@ public class MainActivity extends Activity {
|
|||
menu.add(0, 2, 2, "保存图片");
|
||||
menu.add(0, 3, 3, "复制链接");
|
||||
menu.add(0, 4, 4, "屏蔽图片");
|
||||
menu.add(0, 5, 5, "隐藏图片");
|
||||
}
|
||||
if (result.getType() == HitTestResult.SRC_ANCHOR_TYPE) {
|
||||
menu.add(0, 2, 2, "下载");
|
||||
|
@ -571,7 +564,6 @@ public class MainActivity extends Activity {
|
|||
|
||||
@Override
|
||||
public boolean onContextItemSelected(MenuItem item) {
|
||||
//AdapterContextMenuInfo menuInfo = (AdapterContextMenuInfo) item.getMenuInfo();
|
||||
switch (item.getItemId()) {
|
||||
case 0:
|
||||
webView1.loadUrl(HTRE);
|
||||
|
@ -587,7 +579,6 @@ public class MainActivity extends Activity {
|
|||
mClipboard.setPrimaryClip(theClip);
|
||||
break;
|
||||
case 2:
|
||||
//new SaveImage().execute();
|
||||
downloadBySystem(HTRE,"","");
|
||||
break;
|
||||
case 3:
|
||||
|
@ -598,11 +589,10 @@ public class MainActivity extends Activity {
|
|||
case 4:
|
||||
DialogBlock(HTRE);
|
||||
break;
|
||||
// case 5:
|
||||
// downloadBySystem(HTRE,"","");
|
||||
// break;
|
||||
default:
|
||||
return super.onContextItemSelected(item);
|
||||
case 5:
|
||||
String js = "javascript:var imgs=document.getElementsByTagName('img');for(i=0;i<imgs.length;i++){if(imgs[i].src=='" + HTRE +"'){imgs[i].style.display='none';break;}}";
|
||||
webView1.loadUrl(js);
|
||||
break;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
@ -776,7 +766,7 @@ public class MainActivity extends Activity {
|
|||
}
|
||||
|
||||
void MenuDialog() {
|
||||
String[] items = { "收藏本页", "收藏夹", "查找", "分享", "视频独立播放", "查看源码", "主页", "全屏", "广告过滤规则", "设置", "检查更新", "关于", "退出" };
|
||||
String[] items = { "收藏当前页", "收藏夹", "查找", "分享", "视频独立播放", "查看源码", "主页", "全屏", "广告过滤规则", "设置", "检查更新", "关于", "退出" };
|
||||
AlertDialog.Builder builder = new AlertDialog.Builder(this);
|
||||
builder.setTitle("菜单");
|
||||
builder.setIcon(R.drawable.ic_launcher);
|
||||
|
@ -786,18 +776,86 @@ public class MainActivity extends Activity {
|
|||
dialog.dismiss();
|
||||
switch (which) {
|
||||
case 0:
|
||||
if (!urln.equals("about:blank")) {
|
||||
LinearLayout layout = new LinearLayout(MainActivity.this);
|
||||
layout.setOrientation(LinearLayout.VERTICAL);
|
||||
final EditText ET_title = new EditText(MainActivity.this);
|
||||
ET_title.setHint("标题");
|
||||
ET_title.setText(ptitle);
|
||||
layout.addView(ET_title);
|
||||
final EditText ET_url = new EditText(MainActivity.this);
|
||||
ET_title.setHint("网址");
|
||||
ET_url.setText(urln);
|
||||
layout.addView(ET_url);
|
||||
AlertDialog.Builder builder = new AlertDialog.Builder(MainActivity.this);
|
||||
builder.setIcon(android.R.drawable.btn_star);
|
||||
builder.setTitle("添加收藏");
|
||||
builder.setView(layout);
|
||||
builder.setPositiveButton("确定", new DialogInterface.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(DialogInterface dialog, int which) {
|
||||
String stitle = ET_title.getText().toString();
|
||||
String surl = ET_url.getText().toString();
|
||||
Field field = null;
|
||||
try {
|
||||
//通过反射获取dialog中的私有属性mShowing
|
||||
field = dialog.getClass().getSuperclass().getDeclaredField("mShowing");
|
||||
field.setAccessible(true);//设置该属性可以访问
|
||||
} catch (Exception ex) {
|
||||
|
||||
}
|
||||
if (!stitle.equals("") && surl.startsWith("http")) {
|
||||
DBHelper helper = new DBHelper(getApplicationContext());
|
||||
Cursor c = helper.query(urln);
|
||||
Cursor c = helper.query(surl);
|
||||
if (c.getCount() == 0) {
|
||||
ContentValues values = new ContentValues();
|
||||
values.put("website", urln);
|
||||
values.put("title", ptitle);
|
||||
values.put("website", surl);
|
||||
values.put("title", stitle);
|
||||
helper.insert(values);
|
||||
} else {
|
||||
Toast.makeText(getApplicationContext(), "网址已存在", Toast.LENGTH_SHORT).show();
|
||||
IMM.hideSoftInputFromWindow(ET_title.getWindowToken(), 0);
|
||||
}
|
||||
try {
|
||||
//关闭
|
||||
field.set(dialog, true);
|
||||
dialog.dismiss();
|
||||
} catch (Exception ex) {
|
||||
}
|
||||
} else {
|
||||
if (stitle.equals("")){
|
||||
ET_title.setError("标题不能为空!");
|
||||
}
|
||||
if (!surl.startsWith("http")){
|
||||
ET_url.setError("网址错误!");
|
||||
}
|
||||
try {
|
||||
//设置dialog不可关闭
|
||||
field.set(dialog, false);
|
||||
dialog.dismiss();
|
||||
} catch (Exception ex) {
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
builder.setNegativeButton("取消", new DialogInterface.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(DialogInterface dialog, int which) {
|
||||
IMM.hideSoftInputFromWindow(ET_title.getWindowToken(), 0);
|
||||
Field field = null;
|
||||
try {
|
||||
//通过反射获取dialog中的私有属性mShowing
|
||||
field = dialog.getClass().getSuperclass().getDeclaredField("mShowing");
|
||||
field.setAccessible(true);//设置该属性可以访问
|
||||
} catch (Exception ex) {
|
||||
}
|
||||
try {
|
||||
field.set(dialog, true);
|
||||
dialog.dismiss();
|
||||
} catch (Exception ex) {
|
||||
}
|
||||
}
|
||||
});
|
||||
builder.create().show();
|
||||
break;
|
||||
case 1:
|
||||
Intent intent = new Intent(MainActivity.this, FavoriteActivity.class);
|
||||
|
@ -816,7 +874,7 @@ public class MainActivity extends Activity {
|
|||
startActivity(Intent.createChooser(intent, "分享"));
|
||||
break;
|
||||
case 4:
|
||||
String js = "javascript:var video0=document.getElementsByTagName('video')[0]; if(video0!=null){ var url=video0.src; document.body.innerHTML=''; var video=document.createElement('video'); video.style.width='100%'; video.style.height='auto'; video.src=url; video.controls=true; document.body.appendChild(video); var a=document.createElement('a'); a.textContent=url; a.href=url; document.body.appendChild(a); }";
|
||||
String js = "javascript:var videos=document.getElementsByTagName('video'); if(videos.length!=0){ var url=videos[0].src; document.body.innerHTML=''; var video=document.createElement('video'); video.style.width='100%'; video.style.height='auto'; video.src=url; video.controls=true; document.body.appendChild(video); var a=document.createElement('a'); a.textContent=url; a.href=url; document.body.appendChild(a); } else { var iframes=document.getElementsByTagName('iframe'); if(iframes.length!=0) window.location.href=iframes[0].src; }";
|
||||
webView1.loadUrl(js);
|
||||
break;
|
||||
case 5:
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
<solid android:color="#CBCED6" />
|
||||
</shape>
|
||||
</item>
|
||||
<!-- 第二条进度条颜色 -->
|
||||
<!-- 第二条进度条 -->
|
||||
<item android:id="@android:id/secondaryProgress">
|
||||
<clip>
|
||||
<shape>
|
||||
|
|
|
@ -34,9 +34,14 @@
|
|||
android:id="@+id/editText"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="10dp"
|
||||
android:layout_marginLeft="10dp"
|
||||
android:layout_marginRight="10dp"
|
||||
android:background="@drawable/border_edittext"
|
||||
android:ems="10"
|
||||
android:hint="搜索"
|
||||
android:inputType="text"/>
|
||||
android:inputType="text"
|
||||
android:padding="3dp"/>
|
||||
|
||||
<ListView
|
||||
android:id="@+id/listView1"
|
||||
|
|
|
@ -46,11 +46,13 @@
|
|||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:background="@null"
|
||||
android:hint="输入网址"
|
||||
android:imeOptions="actionGo"
|
||||
android:inputType="textUri"
|
||||
android:padding="2dp"
|
||||
android:singleLine="true"
|
||||
/>
|
||||
android:textSize="20sp"/>
|
||||
|
||||
<ImageButton
|
||||
android:id="@+id/ImageButtonGo"
|
||||
|
@ -68,17 +70,25 @@
|
|||
|
||||
</LinearLayout>
|
||||
|
||||
<ProgressBar
|
||||
android:id="@+id/progressBar1" style="?android:attr/progressBarStyleHorizontal"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="1dp"
|
||||
android:progressDrawable="@drawable/progressbar_color"
|
||||
android:visibility="invisible" />
|
||||
<RelativeLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<WebView
|
||||
android:id="@+id/WebView1"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent" />
|
||||
android:layout_height="match_parent"/>
|
||||
|
||||
<ProgressBar
|
||||
android:id="@+id/progressBar1"
|
||||
style="@android:style/Widget.Holo.ProgressBar.Horizontal"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="1dp"
|
||||
android:layout_alignTop="@+id/WebView1"
|
||||
android:progressDrawable="@drawable/progressbar_color"/>
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<ImageView
|
||||
|
@ -108,10 +118,13 @@
|
|||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:background="@null"
|
||||
android:hint="查找"
|
||||
android:imeOptions="actionSearch"
|
||||
android:inputType="textUri"
|
||||
android:singleLine="true"/>
|
||||
android:padding="2dp"
|
||||
android:singleLine="true"
|
||||
android:textSize="20sp"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/findCount"
|
||||
|
|
BIN
preview.png
BIN
preview.png
Binary file not shown.
Before Width: | Height: | Size: 825 KiB After Width: | Height: | Size: 371 KiB |
Loading…
Reference in New Issue