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
/* start other app in android*/ | |
Intent intent = mPackageManager.getLaunchIntentForPackage(pi.packageName); | |
mContext.startActivity(intent); |
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
android:descendantFocusability="afterDescendants" | |
android:descendantFocusability="beforeDescendants" | |
android:descendantFocusability="blocksDescendants" |
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
package jie.ma.china.view; | |
import android.content.Context; | |
import android.graphics.Rect; | |
import android.util.AttributeSet; | |
import android.widget.TextView; | |
public class MyTextView extends TextView { | |
public MyTextView(Context context) { |
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 |
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
<?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
<?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
//背景不透明 | |
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
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
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); |
OlderNewer