Support Chrome debug
This commit is contained in:
parent
bab0f87c16
commit
109cd67b13
|
@ -20,7 +20,7 @@ p { text-indent:2em; }
|
||||||
<p><a href="https://blog.csdn.net/lowprofile_coding/article/details/77852131" target="_blank">自动安装apk包</a></p>
|
<p><a href="https://blog.csdn.net/lowprofile_coding/article/details/77852131" target="_blank">自动安装apk包</a></p>
|
||||||
<p><a href="https://stackoverflow.com/questions/3462582/display-the-android-webviews-favicon" target="_blank">获取网页图标</a></p>
|
<p><a href="https://stackoverflow.com/questions/3462582/display-the-android-webviews-favicon" target="_blank">获取网页图标</a></p>
|
||||||
<h3>更新日志:</h3>
|
<h3>更新日志:</h3>
|
||||||
<h3>V3.12 (2019-02-19)</h3><ol><li>支持跨域。</li><li>获取网页图标。</li></ol>
|
<h3>V3.12 (2019-02-25)</h3><ol><li>支持跨域。</li><li>获取网页图标。</li><li>屏蔽百度首页视频百度好看跳转下载。</li><li>Android API 19 以上开启调试,运行 adb devices 连接手机,Chrome 浏览器 chrome://inspect 查看。</li></ol>
|
||||||
<h3>V3.11 (2019-02-13)</h3><ol><li>链接中的关键字屏蔽、高亮可设置。</li></ol>
|
<h3>V3.11 (2019-02-13)</h3><ol><li>链接中的关键字屏蔽、高亮可设置。</li></ol>
|
||||||
<h3>V3.10 (2019-02-10)</h3><ol><li>增加:收藏前修改,收藏后修改,修改校验。</li></ol>
|
<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.9 (2018-12-20)</h3><ol><li>视频独立播放JS读不到iframe里的video,使用跳转iframe代替。</li></ol>
|
||||||
|
|
|
@ -10,9 +10,11 @@ import android.content.DialogInterface;
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
import android.database.Cursor;
|
import android.database.Cursor;
|
||||||
import android.database.sqlite.SQLiteDatabase;
|
import android.database.sqlite.SQLiteDatabase;
|
||||||
import android.graphics.Color;
|
import android.graphics.Bitmap;
|
||||||
import android.graphics.drawable.ColorDrawable;
|
import android.graphics.BitmapFactory;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
|
import android.os.Handler;
|
||||||
|
import android.os.Message;
|
||||||
import android.text.Editable;
|
import android.text.Editable;
|
||||||
import android.text.TextWatcher;
|
import android.text.TextWatcher;
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
|
@ -23,160 +25,238 @@ import android.view.View;
|
||||||
import android.view.View.OnCreateContextMenuListener;
|
import android.view.View.OnCreateContextMenuListener;
|
||||||
import android.view.WindowManager;
|
import android.view.WindowManager;
|
||||||
import android.view.inputmethod.InputMethodManager;
|
import android.view.inputmethod.InputMethodManager;
|
||||||
|
import android.webkit.WebIconDatabase;
|
||||||
import android.widget.AdapterView;
|
import android.widget.AdapterView;
|
||||||
import android.widget.AdapterView.AdapterContextMenuInfo;
|
import android.widget.AdapterView.AdapterContextMenuInfo;
|
||||||
import android.widget.AdapterView.OnItemClickListener;
|
import android.widget.AdapterView.OnItemClickListener;
|
||||||
import android.widget.EditText;
|
import android.widget.EditText;
|
||||||
|
import android.widget.ImageButton;
|
||||||
|
import android.widget.ImageView;
|
||||||
import android.widget.LinearLayout;
|
import android.widget.LinearLayout;
|
||||||
import android.widget.ListView;
|
import android.widget.ListView;
|
||||||
import android.widget.SimpleCursorAdapter;
|
import android.widget.SimpleCursorAdapter;
|
||||||
import android.widget.TextView;
|
import android.widget.TextView;
|
||||||
import android.widget.Toast;
|
import android.widget.Toast;
|
||||||
|
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.io.InputStream;
|
||||||
import java.lang.reflect.Field;
|
import java.lang.reflect.Field;
|
||||||
|
import java.net.HttpURLConnection;
|
||||||
|
import java.net.MalformedURLException;
|
||||||
|
import java.net.URL;
|
||||||
|
|
||||||
public class FavoriteActivity extends Activity {
|
public class FavoriteActivity extends Activity {
|
||||||
SimpleCursorAdapter adapter;
|
SimpleCursorAdapter adapter;
|
||||||
ListView listView;
|
ListView listView;
|
||||||
EditText editText;
|
EditText editText;
|
||||||
InputMethodManager IMM;
|
InputMethodManager IMM;
|
||||||
|
ImageButton imageButton_clear;
|
||||||
|
WebIconDatabase WID;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onCreate(Bundle savedInstanceState) {
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
setContentView(R.layout.activity_favorite);
|
setContentView(R.layout.activity_favorite);
|
||||||
getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_HIDDEN);
|
getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_HIDDEN);
|
||||||
editText = (EditText) findViewById(R.id.editText);
|
editText = (EditText) findViewById(R.id.editText);
|
||||||
editText.addTextChangedListener(new EditChangedListener());
|
editText.addTextChangedListener(new EditChangedListener());
|
||||||
listView = (ListView) findViewById(R.id.listView1);
|
listView = (ListView) findViewById(R.id.listView1);
|
||||||
|
imageButton_clear = (ImageButton) findViewById(R.id.imageButton_clear);
|
||||||
|
imageButton_clear.setOnClickListener(new ButtonListener());
|
||||||
|
imageButton_clear.setVisibility(View.GONE);
|
||||||
search(editText.getText().toString());
|
search(editText.getText().toString());
|
||||||
IMM = (InputMethodManager) getApplicationContext().getSystemService(Context.INPUT_METHOD_SERVICE);
|
IMM = (InputMethodManager) getApplicationContext().getSystemService(Context.INPUT_METHOD_SERVICE);
|
||||||
}
|
WID = WebIconDatabase.getInstance();
|
||||||
|
WID.open(getDir("icons", MODE_PRIVATE).getPath());
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
class ButtonListener implements View.OnClickListener {
|
||||||
public boolean onContextItemSelected(MenuItem item) {
|
@Override
|
||||||
AdapterContextMenuInfo menuInfo = (AdapterContextMenuInfo) item.getMenuInfo();
|
public void onClick(View v) {
|
||||||
switch (item.getItemId()) {
|
switch (v.getId()) {
|
||||||
case 0:
|
case R.id.imageButton_clear:
|
||||||
ClipboardManager cm = (ClipboardManager) getSystemService(CLIPBOARD_SERVICE);
|
editText.setText("");
|
||||||
String url = ((TextView) menuInfo.targetView.findViewById(R.id.website)).getText().toString();
|
break;
|
||||||
cm.setPrimaryClip(ClipData.newPlainText("link", url));
|
}
|
||||||
Toast.makeText(getApplicationContext(), "链接已复制", Toast.LENGTH_SHORT).show();
|
}
|
||||||
break;
|
}
|
||||||
case 1:
|
|
||||||
int id = Integer.parseInt(((TextView) menuInfo.targetView.findViewById(R.id.id)).getText().toString());
|
|
||||||
DBHelper helper = new DBHelper(getApplicationContext());
|
|
||||||
helper.del(id);
|
|
||||||
Cursor c = helper.query(editText.getText().toString());
|
|
||||||
String[] from = { "_id", "title", "website" };
|
|
||||||
int[] to = { R.id.id, R.id.title, R.id.website };
|
|
||||||
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) {
|
|
||||||
|
|
||||||
}
|
@Override
|
||||||
if (!stitle.equals("") && surl.startsWith("http")) {
|
public boolean onContextItemSelected(MenuItem item) {
|
||||||
DBHelper dbHelper = new DBHelper(getApplicationContext());
|
AdapterContextMenuInfo menuInfo = (AdapterContextMenuInfo) item.getMenuInfo();
|
||||||
SQLiteDatabase db = dbHelper.getWritableDatabase();
|
switch (item.getItemId()) {
|
||||||
ContentValues values = new ContentValues();
|
case 0:
|
||||||
values.put("website", surl);
|
ClipboardManager cm = (ClipboardManager) getSystemService(CLIPBOARD_SERVICE);
|
||||||
values.put("title", stitle);
|
String url = ((TextView) menuInfo.targetView.findViewById(R.id.website)).getText().toString();
|
||||||
db.update(DBHelper.TableName, values, "_id = " + sid, null);
|
cm.setPrimaryClip(ClipData.newPlainText("link", url));
|
||||||
IMM.hideSoftInputFromWindow(ET_title.getWindowToken(), 0);
|
Toast.makeText(getApplicationContext(), "链接已复制", Toast.LENGTH_SHORT).show();
|
||||||
Cursor c = dbHelper.query(editText.getText().toString());
|
break;
|
||||||
String[] from = { "_id", "title", "website" };
|
case 1:
|
||||||
int[] to = { R.id.id, R.id.title, R.id.website };
|
int id = Integer.parseInt(((TextView) menuInfo.targetView.findViewById(R.id.id)).getText().toString());
|
||||||
adapter = new SimpleCursorAdapter(FavoriteActivity.this, R.layout.favorite_row, c, from, to, 0);
|
DBHelper helper = new DBHelper(getApplicationContext());
|
||||||
listView.setAdapter(adapter);
|
helper.del(id);
|
||||||
|
search(editText.getText().toString());
|
||||||
|
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") || !surl.startsWith("file:///"))) {
|
||||||
|
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);
|
||||||
|
search(editText.getText().toString());
|
||||||
|
try {
|
||||||
|
//关闭
|
||||||
|
field.set(dialog, true);
|
||||||
|
dialog.dismiss();
|
||||||
|
} catch (Exception ex) {
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if (stitle.equals("")){
|
||||||
|
ET_title.setError("标题不能为空!");
|
||||||
|
}
|
||||||
|
if (!surl.startsWith("http") || !surl.startsWith("file:///")){
|
||||||
|
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 {
|
try {
|
||||||
//关闭
|
|
||||||
field.set(dialog, true);
|
field.set(dialog, true);
|
||||||
dialog.dismiss();
|
dialog.dismiss();
|
||||||
} catch (Exception ex) {
|
} 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.create().show();
|
||||||
builder.setNegativeButton("取消", new DialogInterface.OnClickListener() {
|
break;
|
||||||
@Override
|
}
|
||||||
public void onClick(DialogInterface dialog, int which) {
|
return true;
|
||||||
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;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void favback(View v) {
|
public void favback(View v) {
|
||||||
IMM.hideSoftInputFromWindow(editText.getWindowToken(), 0);
|
IMM.hideSoftInputFromWindow(editText.getWindowToken(), 0);
|
||||||
finish();
|
finish();
|
||||||
}
|
}
|
||||||
|
|
||||||
void search(String s) {
|
void search(String s) {
|
||||||
DBHelper helper = new DBHelper(this);
|
DBHelper helper = new DBHelper(this);
|
||||||
Cursor c = helper.query(s);
|
Cursor c = helper.query(s);
|
||||||
String[] from = { "_id", "title", "website" };
|
String[] from = { "_id", "title", "website", "website" };
|
||||||
int[] to = { R.id.id, R.id.title, R.id.website };
|
int[] to = { R.id.id, R.id.title, R.id.website, R.id.imageView_favicon };
|
||||||
adapter = new SimpleCursorAdapter(this, R.layout.favorite_row, c, from, to, 0);
|
adapter = new SimpleCursorAdapter(this, R.layout.favorite_row, c, from, to, 0);
|
||||||
|
adapter.setViewBinder(new SimpleCursorAdapter.ViewBinder(){
|
||||||
|
public boolean setViewValue(View view, Cursor cursor, int columnIndex){
|
||||||
|
//Log.e("L192", view.toString() + columnIndex);
|
||||||
|
if(view.getId() == R.id.imageView_favicon){
|
||||||
|
String website = cursor.getString(columnIndex);
|
||||||
|
// if (website.startsWith("https://")) {
|
||||||
|
// //((ImageView) view).setImageResource(android.R.drawable.ic_secure);
|
||||||
|
// Runner1 r1 = new Runner1();
|
||||||
|
// r1.setUrl("https://static.easyicon.net/preview/52/523893.gif");
|
||||||
|
// r1.setView(view);
|
||||||
|
// Thread thread1 = new Thread(r1);
|
||||||
|
// thread1.start();
|
||||||
|
// return true;
|
||||||
|
// } else if (website.startsWith("http://")) {
|
||||||
|
// // ((ImageView) view).setImageResource(android.R.drawable.ic_partial_secure);
|
||||||
|
// Runner1 r1 = new Runner1();
|
||||||
|
// r1.setUrl("https://static.easyicon.net/preview/1/11847.gif");
|
||||||
|
// r1.setView(view);
|
||||||
|
// Thread thread1 = new Thread(r1);
|
||||||
|
// thread1.start();
|
||||||
|
// return true;
|
||||||
|
// } else {
|
||||||
|
// ((ImageView) view).setImageResource(R.drawable.network);
|
||||||
|
// return true;
|
||||||
|
// }
|
||||||
|
Runner1 r1 = new Runner1();
|
||||||
|
r1.setUrl(website);
|
||||||
|
r1.setView(view);
|
||||||
|
Thread thread1 = new Thread(r1);
|
||||||
|
thread1.start();
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
});
|
||||||
listView.setAdapter(adapter);
|
listView.setAdapter(adapter);
|
||||||
listView.setDivider(new ColorDrawable(Color.GREEN));
|
|
||||||
listView.setDividerHeight(2);
|
// WebIconDatabase WID = WebIconDatabase.getInstance();
|
||||||
|
// WID.open(getDir("icons", MODE_PRIVATE).getPath());
|
||||||
|
// for (int i=0; i<adapter.getCount(); i++) {
|
||||||
|
// LinearLayout layout = (LinearLayout) listView.getAdapter().getView(i, null, null);
|
||||||
|
// String website = ((TextView) layout.findViewById(R.id.website)).getText().toString();
|
||||||
|
// if (website.startsWith("https://")) {
|
||||||
|
// Log.e("star_big_on", website);
|
||||||
|
// ImageView imageView = (ImageView) layout.findViewById(R.id.imageView_favicon);
|
||||||
|
// imageView.setImageResource(android.R.drawable.star_big_on);
|
||||||
|
// } else if (website.startsWith("http://")){
|
||||||
|
// ImageView imageView = (ImageView) layout.findViewById(R.id.imageView_favicon);
|
||||||
|
// imageView.setImageResource(android.R.drawable.star_big_off);
|
||||||
|
// Log.e("star_big_off", website);
|
||||||
|
// } else {
|
||||||
|
// Log.e("earth", website);
|
||||||
|
// }
|
||||||
|
// WID.requestIconForPageUrl(website, new WebIconDatabase.IconListener() {
|
||||||
|
// public void onReceivedIcon(String url, Bitmap icon) {
|
||||||
|
// Log.e("onReceivedIcon", url);
|
||||||
|
// ImageView imageView = (ImageView) layout.findViewById(R.id.imageView_favicon);
|
||||||
|
// imageView.setImageBitmap(icon);
|
||||||
|
// }
|
||||||
|
// });
|
||||||
|
// }
|
||||||
|
// adapter.notifyDataSetChanged();
|
||||||
|
|
||||||
listView.setOnItemClickListener(new OnItemClickListener() {
|
listView.setOnItemClickListener(new OnItemClickListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onItemClick(AdapterView<?> arg0, View arg1, int arg2, long arg3) {
|
public void onItemClick(AdapterView<?> arg0, View arg1, int arg2, long arg3) {
|
||||||
|
@ -200,6 +280,7 @@ public class FavoriteActivity extends Activity {
|
||||||
menu.add(0, 2, 2, "修改");
|
menu.add(0, 2, 2, "修改");
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
class EditChangedListener implements TextWatcher {
|
class EditChangedListener implements TextWatcher {
|
||||||
|
@ -216,8 +297,81 @@ public class FavoriteActivity extends Activity {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void afterTextChanged(Editable s) {
|
public void afterTextChanged(Editable s) {
|
||||||
search(s.toString());
|
if(s.toString().equals("")){
|
||||||
|
imageButton_clear.setVisibility(View.GONE);
|
||||||
|
}else{
|
||||||
|
imageButton_clear.setVisibility(View.VISIBLE);
|
||||||
|
}
|
||||||
|
search(s.toString());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
public Bitmap webBitMap(String surl) {
|
||||||
|
URL url = null;
|
||||||
|
Bitmap bitmap = null;
|
||||||
|
try {
|
||||||
|
url = new URL(surl);
|
||||||
|
} catch (MalformedURLException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
try {
|
||||||
|
HttpURLConnection conn = (HttpURLConnection) url.openConnection();
|
||||||
|
conn.setDoInput(true);
|
||||||
|
conn.connect();
|
||||||
|
InputStream IS = conn.getInputStream();
|
||||||
|
bitmap = BitmapFactory.decodeStream(IS);
|
||||||
|
IS.close();
|
||||||
|
} catch (IOException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
return bitmap;
|
||||||
|
}
|
||||||
|
|
||||||
|
class Runner1 implements Runnable {
|
||||||
|
private String surl;
|
||||||
|
private View view;
|
||||||
|
|
||||||
|
private void setUrl(String surl1) {
|
||||||
|
surl = surl1;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void setView(View view1) {
|
||||||
|
view = view1;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void run() {
|
||||||
|
// Bitmap bitmap = webBitMap(surl);
|
||||||
|
// Message msg = new Message();
|
||||||
|
// Bundle bundle = new Bundle();
|
||||||
|
// bundle.putParcelable("bitmap", bitmap);
|
||||||
|
// msg.setData(bundle);
|
||||||
|
// msg.obj = view;
|
||||||
|
// handler.sendMessage(msg);
|
||||||
|
Log.e("L350", surl);
|
||||||
|
WID.requestIconForPageUrl(surl, new WebIconDatabase.IconListener() {
|
||||||
|
public void onReceivedIcon(String url, Bitmap icon) {
|
||||||
|
Log.e("L353", url);
|
||||||
|
Message msg = new Message();
|
||||||
|
Bundle bundle = new Bundle();
|
||||||
|
bundle.putParcelable("bitmap", icon);
|
||||||
|
msg.setData(bundle);
|
||||||
|
msg.obj = view;
|
||||||
|
handler.sendMessage(msg);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
static Handler handler = new Handler(){
|
||||||
|
@Override
|
||||||
|
public void handleMessage(Message msg) {
|
||||||
|
super.handleMessage(msg);
|
||||||
|
Bundle bundle = msg.getData();
|
||||||
|
Bitmap bitmap = bundle.getParcelable("bitmap");
|
||||||
|
View view = (View) msg.obj;
|
||||||
|
Log.e("L372", "setIcon");
|
||||||
|
((ImageView) view).setImageBitmap(bitmap);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
}
|
|
@ -41,6 +41,7 @@ import android.net.ConnectivityManager;
|
||||||
import android.net.NetworkInfo;
|
import android.net.NetworkInfo;
|
||||||
import android.net.Uri;
|
import android.net.Uri;
|
||||||
import android.os.AsyncTask;
|
import android.os.AsyncTask;
|
||||||
|
import android.os.Build;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.os.Environment;
|
import android.os.Environment;
|
||||||
import android.os.Looper;
|
import android.os.Looper;
|
||||||
|
@ -165,7 +166,7 @@ public class MainActivity extends Activity {
|
||||||
findClose.setOnClickListener(new ButtonListener());
|
findClose.setOnClickListener(new ButtonListener());
|
||||||
editText1 = (EditText) findViewById(R.id.EditText1);
|
editText1 = (EditText) findViewById(R.id.EditText1);
|
||||||
webView1 = (WebView) findViewById(R.id.WebView1);
|
webView1 = (WebView) findViewById(R.id.WebView1);
|
||||||
WebIconDatabase.getInstance().open(getDir("icons", MODE_PRIVATE).getPath()); //获取favicon图标路径
|
WebIconDatabase.getInstance().open(getDir("icons", MODE_PRIVATE).getPath()); //获取图标数据库路径
|
||||||
registerForContextMenu(webView1);
|
registerForContextMenu(webView1);
|
||||||
// 开启JS
|
// 开启JS
|
||||||
webView1.getSettings().setJavaScriptEnabled(true);
|
webView1.getSettings().setJavaScriptEnabled(true);
|
||||||
|
@ -196,13 +197,17 @@ public class MainActivity extends Activity {
|
||||||
webView1.requestFocusFromTouch();
|
webView1.requestFocusFromTouch();
|
||||||
// 允许跨域
|
// 允许跨域
|
||||||
webView1.getSettings().setAllowUniversalAccessFromFileURLs(true);
|
webView1.getSettings().setAllowUniversalAccessFromFileURLs(true);
|
||||||
|
// 允许调试
|
||||||
|
if(Build.VERSION.SDK_INT >= 19) {
|
||||||
|
webView1.setWebContentsDebuggingEnabled(true);
|
||||||
|
}
|
||||||
|
|
||||||
webView1.setWebViewClient(new WebViewClient() {
|
webView1.setWebViewClient(new WebViewClient() {
|
||||||
@Override
|
@Override
|
||||||
public boolean shouldOverrideUrlLoading(WebView view, String url) {
|
public boolean shouldOverrideUrlLoading(WebView view, String url) {
|
||||||
Log.e("OverrideUrlLoading", url);
|
Log.e("OverrideUrlLoading", url);
|
||||||
// 协议过滤
|
// 协议过滤
|
||||||
if(url.startsWith("http")){
|
if(url.startsWith("http") && !url.startsWith("https://cdn-haokanapk.baidu.com/")){
|
||||||
view.loadUrl(url);
|
view.loadUrl(url);
|
||||||
}
|
}
|
||||||
/*
|
/*
|
||||||
|
@ -220,13 +225,16 @@ public class MainActivity extends Activity {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onPageStarted(WebView view, String url, Bitmap favicon) {
|
public void onPageStarted(WebView view, String url, Bitmap favicon) {
|
||||||
super.onPageStarted(view, url, favicon);
|
//super.onPageStarted(view, url, favicon);
|
||||||
editText1.setText(url);
|
editText1.setText(url);
|
||||||
urln = url;
|
urln = url;
|
||||||
btnBack.setEnabled(true);
|
btnBack.setEnabled(true);
|
||||||
IMM.hideSoftInputFromWindow(editText1.getWindowToken(), 0);
|
IMM.hideSoftInputFromWindow(editText1.getWindowToken(), 0);
|
||||||
pgb1.setVisibility(View.VISIBLE);
|
pgb1.setVisibility(View.VISIBLE);
|
||||||
imageButton_info.setImageResource(android.R.drawable.ic_menu_info_details);
|
imageButton_info.setImageResource(android.R.drawable.ic_menu_info_details);
|
||||||
|
// if(favicon != null) {
|
||||||
|
// imageButton_info.setImageBitmap(favicon);
|
||||||
|
// }
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -318,10 +326,7 @@ public class MainActivity extends Activity {
|
||||||
|
|
||||||
// 接收网站图标(favicon)
|
// 接收网站图标(favicon)
|
||||||
public void onReceivedIcon(WebView view, Bitmap icon) {
|
public void onReceivedIcon(WebView view, Bitmap icon) {
|
||||||
Matrix matrix = new Matrix();
|
imageButton_info.setImageBitmap(icon);
|
||||||
matrix.postScale((float)60 / icon.getWidth(), (float)60 / icon.getHeight());
|
|
||||||
Bitmap bitmap = Bitmap.createBitmap(icon, 0, 0, icon.getWidth(), icon.getHeight(), matrix, true);
|
|
||||||
imageButton_info.setImageBitmap(bitmap);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// 播放网络视频时全屏会被调用的方法
|
// 播放网络视频时全屏会被调用的方法
|
||||||
|
@ -552,7 +557,6 @@ public class MainActivity extends Activity {
|
||||||
@Override
|
@Override
|
||||||
public void onDownloadStart(String url, String userAgent, String contentDisposition, String mimetype, long contentLength) {
|
public void onDownloadStart(String url, String userAgent, String contentDisposition, String mimetype, long contentLength) {
|
||||||
Log.e("Download", url);
|
Log.e("Download", url);
|
||||||
//if(!url.contains("baidu.com"))
|
|
||||||
downloadBySystem(url, "", "");
|
downloadBySystem(url, "", "");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -563,16 +567,19 @@ public class MainActivity extends Activity {
|
||||||
WebView w = (WebView) v;
|
WebView w = (WebView) v;
|
||||||
HitTestResult result = w.getHitTestResult();
|
HitTestResult result = w.getHitTestResult();
|
||||||
HTRE = result.getExtra();
|
HTRE = result.getExtra();
|
||||||
|
menu.setHeaderIcon(android.R.drawable.ic_menu_report_image);
|
||||||
menu.setHeaderTitle(HTRE);
|
menu.setHeaderTitle(HTRE);
|
||||||
if (result.getType() == HitTestResult.IMAGE_TYPE || result.getType() == HitTestResult.SRC_IMAGE_ANCHOR_TYPE) {
|
if (result.getType() == HitTestResult.IMAGE_TYPE || result.getType() == HitTestResult.SRC_IMAGE_ANCHOR_TYPE) {
|
||||||
|
menu.setHeaderIcon(android.R.drawable.ic_menu_gallery); // Context menu items do not support icons
|
||||||
menu.add(0, 0, 0, "查看图片");
|
menu.add(0, 0, 0, "查看图片");
|
||||||
menu.add(0, 1, 1, "复制图片");
|
menu.add(0, 1, 1, "复制图片");
|
||||||
menu.add(0, 2, 2, "保存图片");
|
menu.add(0, 2, 2, "保存图片").setIcon(android.R.drawable.ic_menu_save); // Context menu items do not support icons
|
||||||
menu.add(0, 3, 3, "复制链接");
|
menu.add(0, 3, 3, "复制链接");
|
||||||
menu.add(0, 4, 4, "屏蔽图片");
|
menu.add(0, 4, 4, "屏蔽图片");
|
||||||
menu.add(0, 5, 5, "隐藏图片");
|
menu.add(0, 5, 5, "隐藏图片");
|
||||||
}
|
}
|
||||||
if (result.getType() == HitTestResult.SRC_ANCHOR_TYPE) {
|
if (result.getType() == HitTestResult.SRC_ANCHOR_TYPE) {
|
||||||
|
menu.setHeaderIcon(android.R.drawable.ic_menu_sort_alphabetically);
|
||||||
menu.add(0, 2, 2, "下载");
|
menu.add(0, 2, 2, "下载");
|
||||||
menu.add(0, 3, 3, "复制链接");
|
menu.add(0, 3, 3, "复制链接");
|
||||||
}
|
}
|
||||||
|
@ -806,7 +813,8 @@ public class MainActivity extends Activity {
|
||||||
Matrix matrix = new Matrix();
|
Matrix matrix = new Matrix();
|
||||||
matrix.postScale((float)100/icon.getWidth(), (float)100/icon.getHeight());
|
matrix.postScale((float)100/icon.getWidth(), (float)100/icon.getHeight());
|
||||||
Bitmap bitmap = Bitmap.createBitmap(icon, 0, 0, icon.getWidth(), icon.getHeight(), matrix, true);
|
Bitmap bitmap = Bitmap.createBitmap(icon, 0, 0, icon.getWidth(), icon.getHeight(), matrix, true);
|
||||||
builder.setIcon(new BitmapDrawable(getResources(), bitmap));
|
BitmapDrawable drawable = new BitmapDrawable(getResources(), bitmap);
|
||||||
|
builder.setIcon(drawable);
|
||||||
builder.setTitle("添加收藏");
|
builder.setTitle("添加收藏");
|
||||||
builder.setView(layout);
|
builder.setView(layout);
|
||||||
builder.setPositiveButton("确定", new DialogInterface.OnClickListener() {
|
builder.setPositiveButton("确定", new DialogInterface.OnClickListener() {
|
||||||
|
@ -822,7 +830,7 @@ public class MainActivity extends Activity {
|
||||||
} catch (Exception ex) {
|
} catch (Exception ex) {
|
||||||
|
|
||||||
}
|
}
|
||||||
if (!stitle.equals("") && surl.startsWith("http")) {
|
if (!stitle.equals("") && (surl.startsWith("http") || surl.startsWith("file:///"))) {
|
||||||
DBHelper helper = new DBHelper(getApplicationContext());
|
DBHelper helper = new DBHelper(getApplicationContext());
|
||||||
Cursor c = helper.query(surl);
|
Cursor c = helper.query(surl);
|
||||||
if (c.getCount() == 0) {
|
if (c.getCount() == 0) {
|
||||||
|
@ -844,7 +852,7 @@ public class MainActivity extends Activity {
|
||||||
if (stitle.equals("")){
|
if (stitle.equals("")){
|
||||||
ET_title.setError("标题不能为空!");
|
ET_title.setError("标题不能为空!");
|
||||||
}
|
}
|
||||||
if (!surl.startsWith("http")){
|
if (!surl.startsWith("http") || !surl.startsWith("file:///")){
|
||||||
ET_url.setError("网址错误!");
|
ET_url.setError("网址错误!");
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
|
@ -1106,9 +1114,9 @@ public class MainActivity extends Activity {
|
||||||
}
|
}
|
||||||
|
|
||||||
// 调用系统下载,https://www.jianshu.com/p/6e38e1ef203a
|
// 调用系统下载,https://www.jianshu.com/p/6e38e1ef203a
|
||||||
private void downloadBySystem(String url, String contentDisposition, String mimeType) {
|
private void downloadBySystem(String surl, String contentDisposition, String mimeType) {
|
||||||
// 指定下载地址
|
// 指定下载地址
|
||||||
DownloadManager.Request request = new DownloadManager.Request(Uri.parse(url));
|
DownloadManager.Request request = new DownloadManager.Request(Uri.parse(surl));
|
||||||
// 允许媒体扫描,根据下载的文件类型被加入相册、音乐等媒体库
|
// 允许媒体扫描,根据下载的文件类型被加入相册、音乐等媒体库
|
||||||
request.allowScanningByMediaScanner();
|
request.allowScanningByMediaScanner();
|
||||||
// 设置通知的显示类型,下载进行时和完成后显示通知
|
// 设置通知的显示类型,下载进行时和完成后显示通知
|
||||||
|
@ -1116,27 +1124,27 @@ public class MainActivity extends Activity {
|
||||||
// 设置通知栏的标题,如果不设置,默认使用文件名
|
// 设置通知栏的标题,如果不设置,默认使用文件名
|
||||||
// request.setTitle("This is title");
|
// request.setTitle("This is title");
|
||||||
// 设置通知栏的描述
|
// 设置通知栏的描述
|
||||||
// request.setDescription("This is description");
|
request.setDescription(surl);
|
||||||
// 允许在计费流量下下载
|
// 允许在计费流量下下载
|
||||||
request.setAllowedOverMetered(false);
|
request.setAllowedOverMetered(false);
|
||||||
// 允许该记录在下载管理界面可见
|
// 允许该记录在下载管理界面可见
|
||||||
request.setVisibleInDownloadsUi(true);
|
//request.setVisibleInDownloadsUi(true);
|
||||||
// 允许漫游时下载
|
// 允许漫游时下载
|
||||||
request.setAllowedOverRoaming(true);
|
request.setAllowedOverRoaming(true);
|
||||||
// 允许下载的网路类型
|
// 允许下载的网路类型
|
||||||
request.setAllowedNetworkTypes(DownloadManager.Request.NETWORK_WIFI);
|
request.setAllowedNetworkTypes(DownloadManager.Request.NETWORK_WIFI);
|
||||||
// 设置下载文件保存的路径和文件名
|
// 设置下载文件保存的路径和文件名
|
||||||
String fileName = URLUtil.guessFileName(url, contentDisposition, mimeType);
|
String fileName = URLUtil.guessFileName(surl, contentDisposition, mimeType);
|
||||||
Log.e("fileName:", fileName);
|
Log.e("fileName:", fileName);
|
||||||
request.setDestinationInExternalPublicDir(Environment.DIRECTORY_DOWNLOADS, fileName);
|
request.setDestinationInExternalPublicDir(Environment.DIRECTORY_DOWNLOADS, fileName);
|
||||||
// 自定义下载路径
|
// 自定义下载路径
|
||||||
// request.setDestinationUri()
|
//request.setDestinationUri();
|
||||||
// request.setDestinationInExternalFilesDir()
|
//request.setDestinationInExternalFilesDir();
|
||||||
DownloadManager downloadManager = (DownloadManager) getSystemService(DOWNLOAD_SERVICE);
|
DownloadManager downloadManager = (DownloadManager) getSystemService(DOWNLOAD_SERVICE);
|
||||||
// 添加一个下载任务
|
// 添加一个下载任务
|
||||||
long downloadId = downloadManager.enqueue(request);
|
long downloadId = downloadManager.enqueue(request);
|
||||||
Log.e("downloadId:", downloadId+"");
|
Log.e("downloadId:", downloadId+"");
|
||||||
if(url == urlUpdate){
|
if(surl == urlUpdate){
|
||||||
downloadIdUpdate = downloadId;
|
downloadIdUpdate = downloadId;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
xmlns:tools="http://schemas.android.com/tools"
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:orientation="vertical"
|
android:orientation="vertical"
|
||||||
|
@ -27,25 +28,52 @@
|
||||||
android:onClick="favback"
|
android:onClick="favback"
|
||||||
android:text=" × "
|
android:text=" × "
|
||||||
android:textSize="30sp" />
|
android:textSize="30sp" />
|
||||||
|
|
||||||
</RelativeLayout>
|
</RelativeLayout>
|
||||||
|
|
||||||
<EditText
|
<LinearLayout
|
||||||
android:id="@+id/editText"
|
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginBottom="10dp"
|
android:gravity="center"
|
||||||
android:layout_marginLeft="10dp"
|
android:orientation="horizontal"
|
||||||
android:layout_marginRight="10dp"
|
android:paddingLeft="10dp"
|
||||||
android:background="@drawable/border_edittext"
|
android:paddingRight="10dp">
|
||||||
android:ems="10"
|
|
||||||
android:hint="搜索"
|
<EditText
|
||||||
android:inputType="text"
|
android:id="@+id/editText"
|
||||||
android:padding="3dp"/>
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_weight="9"
|
||||||
|
android:background="@drawable/border_edittext"
|
||||||
|
android:hint="搜索"
|
||||||
|
android:inputType="text"
|
||||||
|
android:paddingLeft="10dp"
|
||||||
|
android:paddingTop="5dp"
|
||||||
|
android:paddingRight="10dp"
|
||||||
|
android:paddingBottom="5dp"
|
||||||
|
android:textAppearance="@android:style/TextAppearance.DeviceDefault.Medium"/>
|
||||||
|
|
||||||
|
<ImageButton
|
||||||
|
android:id="@+id/imageButton_clear"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:background="#ffffff"
|
||||||
|
android:paddingLeft="-15dp"
|
||||||
|
android:paddingRight="-15dp"
|
||||||
|
android:src="@android:drawable/ic_notification_clear_all"/>
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
<ListView
|
<ListView
|
||||||
android:id="@+id/listView1"
|
android:id="@+id/listView1"
|
||||||
android:layout_width="fill_parent"
|
android:layout_width="fill_parent"
|
||||||
android:layout_height="wrap_content" />
|
android:layout_height="wrap_content"
|
||||||
|
android:divider="#ccc"
|
||||||
|
android:dividerHeight="1dp"
|
||||||
|
android:paddingLeft="10dp"
|
||||||
|
android:paddingRight="10dp">
|
||||||
|
|
||||||
|
|
||||||
|
</ListView>
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
|
@ -44,11 +44,10 @@
|
||||||
|
|
||||||
<ImageButton
|
<ImageButton
|
||||||
android:id="@+id/imageButton_info"
|
android:id="@+id/imageButton_info"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="25dp"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="25dp"
|
||||||
android:adjustViewBounds="false"
|
|
||||||
android:background="@null"
|
android:background="@null"
|
||||||
android:scaleType="centerInside"
|
android:scaleType="fitCenter"
|
||||||
android:src="@android:drawable/ic_menu_info_details"/>
|
android:src="@android:drawable/ic_menu_info_details"/>
|
||||||
|
|
||||||
<EditText
|
<EditText
|
||||||
|
|
|
@ -1,37 +1,57 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
xmlns:tools="http://schemas.android.com/tools"
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
android:id="@+id/LinearLayout1"
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
android:layout_width="match_parent"
|
android:id="@+id/LinearLayout1"
|
||||||
android:layout_height="wrap_content"
|
android:layout_width="match_parent"
|
||||||
android:orientation="vertical" >
|
android:layout_height="wrap_content"
|
||||||
|
android:gravity="center"
|
||||||
|
android:paddingLeft="5dp"
|
||||||
|
android:paddingRight="5dp">
|
||||||
|
|
||||||
<TextView
|
<ImageView
|
||||||
android:id="@+id/id"
|
android:id="@+id/imageView_favicon"
|
||||||
android:layout_width="fill_parent"
|
android:layout_width="30dp"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="30dp"
|
||||||
android:singleLine="true"
|
android:layout_gravity="center"
|
||||||
android:text="id"
|
android:layout_weight="1"
|
||||||
android:visibility="gone" />
|
android:scaleType="fitCenter"
|
||||||
|
android:src="@drawable/network"/>
|
||||||
|
|
||||||
<TextView
|
<LinearLayout
|
||||||
android:id="@+id/title"
|
android:layout_width="match_parent"
|
||||||
android:layout_width="fill_parent"
|
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginLeft="10dp"
|
android:layout_weight="5"
|
||||||
android:layout_marginRight="10dp"
|
android:orientation="vertical">
|
||||||
android:layout_marginTop="5dp"
|
|
||||||
android:singleLine="true"
|
|
||||||
android:text="title" />
|
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/website"
|
android:id="@+id/id"
|
||||||
android:layout_width="fill_parent"
|
android:layout_width="fill_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginBottom="5dp"
|
android:singleLine="true"
|
||||||
android:layout_marginLeft="10dp"
|
android:text="id"
|
||||||
android:layout_marginRight="10dp"
|
android:visibility="gone"/>
|
||||||
android:singleLine="true"
|
|
||||||
android:text="website" />
|
<TextView
|
||||||
|
android:id="@+id/title"
|
||||||
|
android:layout_width="fill_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginLeft="10dp"
|
||||||
|
android:layout_marginTop="5dp"
|
||||||
|
android:layout_marginRight="10dp"
|
||||||
|
android:singleLine="true"
|
||||||
|
android:text="title"/>
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/website"
|
||||||
|
android:layout_width="fill_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginLeft="10dp"
|
||||||
|
android:layout_marginRight="10dp"
|
||||||
|
android:layout_marginBottom="5dp"
|
||||||
|
android:singleLine="true"
|
||||||
|
android:text="website"/>
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
Loading…
Reference in New Issue