This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public synchronized Rect getFramingRectInPreview(){ | |
int tmpRigth = rect.right; | |
int tmpLeft = rect.left; | |
int tmpTop = rect.top; | |
int tmpBottom =rect.bottom; | |
rect.left = (tmpTop * cameraResolution.x) /screenResolution.y ; | |
rect.top = cameraResolution.y - tmpRigth *cameraResolution.y/screenResolution.x; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
import os | |
# -*- coding: utf-8 -*- | |
def writeFile(filename, content): | |
outfile = open(filename, "w") | |
outfile.write(content) | |
outfile.close() | |
def build(versionString): | |
xmlHeader = "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n" | |
xmlResH = "<resources>\n\t" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
nginx和tornado就像apache和tomcat的功能; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Intent myIntent = new Intent(android.content.Intent.ACTION_VIEW); | |
File file = new File(sdcardPath); | |
String extension = android.webkit.MimeTypeMap.getFileExtensionFromUrl(Uri.fromFile(file).toString()); | |
String mimetype = android.webkit.MimeTypeMap.getSingleton().getMimeTypeFromExtension(extension); | |
myIntent.setDataAndType(Uri.fromFile(file),mimetype); | |
mContext.startActivity(myIntent); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
mWebView.getSettings().setJavaScriptEnabled(true); | |
mWebView.getSettings().setDatabaseEnabled(true); | |
// mWebView.getSettings().setDomStorageEnabled(true); | |
// mWebView.requestFocus(View.FOCUS_DOWN); | |
mWebView.requestFocus(View.FOCUS_DOWN); | |
// mWebView.addJavascriptInterface(new | |
// JavaScriptInterface(RecommendActivity.this, bookId,bookName), | |
// "android"); | |
mWebView.getSettings().setJavaScriptCanOpenWindowsAutomatically(true); | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//背景不透明 | |
mPopupWindow.setBackgroundDrawable(null); | |
final View contentView = getContentView(); | |
//设置触摸事件 给 PopupWindow的ContentView重新设置触摸事件 解决setOutsideTouchable(true) 失效了,contentView为popuwindow的View | |
contentView.setOnTouchListener(new View.OnTouchListener() { | |
@Override | |
public boolean onTouch(View v, MotionEvent event) { | |
final int x = (int) event.getX(); | |
final int y = (int) event.getY(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="UTF-8"?> | |
<layer-list xmlns:android="http://schemas.android.com/apk/res/android"> | |
<item android:id="@android:id/background" android:drawable="@drawable/progress_bg" /> | |
<item android:id="@android:id/secondaryProgress" android:drawable="@drawable/progress_fg_start" /> | |
<item android:id="@android:id/progress" android:drawable="@drawable/progress_fg_start" /> | |
</layer-list> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="utf-8"?> | |
<layer-list xmlns:android="http://schemas.android.com/apk/res/android" > | |
<item android:id="@android:id/background"> | |
<shape> | |
<corners android:radius="0dip" /> | |
<gradient | |
android:angle="270" | |
android:centerColor="#ff5a5d5a" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
mWebView.requestFocus(View.FOCUS_DOWN); | |
//先是去焦点,然后再给焦点去对焦 | |
mEditText.setFocusable(false); | |
mEditText.setFocusableInTouchMode(true); | |
mEditText.setFocusable(true); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ctrl + shift + r |
NewerOlder