This file contains hidden or 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
<TableLayout | |
android:id="@+id/mytubeplayer_user_info_table" | |
android:layout_width="match_parent" | |
android:layout_height="wrap_content" | |
android:layout_alignParentBottom="true" | |
android:stretchColumns="0,1" > | |
<TableRow> | |
<TextView |
This file contains hidden or 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
class PhotoDecodeRunnable implements Runnable {... /* * Defines the code to run for this task. */ @Override public void run() { // Moves the current Thread into the background android.os.Process.setThreadPriority(android.os.Process.THREAD_PRIORITY_BACKGROUND); ... /* * Stores the current Thread in the PhotoTask instance, * so that the instance * can interrupt the Thread. */ mPhotoTask.setImageDecodeThread(Thread.currentThread()); ... }...} |
This file contains hidden or 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:drawable="@drawable/my_logo" | |
android:right="10dp"/> | |
</layer-list> |
This file contains hidden or 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
item_layout's background. | |
<?xml version="1.0" encoding="utf-8"?> | |
<selector xmlns:android="http://schemas.android.com/apk/res/android"> | |
<item android:drawable="@drawable/bg_music_list_item_selected" android:state_pressed="true"></item> | |
<item android:drawable="@drawable/bg_music_list_item_selected" android:state_selected="true"></item> | |
<item android:drawable="@drawable/bg_music_list_item_selected" android:state_activated="true"></item> | |
<item android:drawable="@drawable/bg_music_list_item_normal" ></item> |
This file contains hidden or 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
/** | |
* This seems to be a bug in the newly added support for nested fragments. | |
* Basically, the child FragmentManager ends up with a broken internal state | |
* when it is detached from the activity. A short-term workaround that fixed | |
* it for me is to add the following to onDetach() of every Fragment which | |
* you call getChildFragmentManager() on: | |
*/ | |
@Override | |
public void onDetach() { | |
super.onDetach(); |
This file contains hidden or 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
static boolean isMain() { | |
return Looper.getMainLooper().getThread() == Thread.currentThread(); | |
} |
This file contains hidden or 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 static String extractJsUrl(String originHtml) { | |
// <script src="//s.ytimg.com/yts/jsbin/html5player-zh_CN-vflHa9pzi.js" | |
// name="html5player"></script> | |
final String REGEX = "//s[.]ytimg[.]com/.*html5player.*[.]js"; | |
Pattern p = Pattern.compile(REGEX); | |
Matcher m = p.matcher(originHtml); | |
String jsUrl = null; | |
if (m.find()) { | |
jsUrl = originHtml.substring(m.start(), m.end()); |
This file contains hidden or 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
InputMethodManager imm = (InputMethodManager) mActivity | |
.getSystemService(Context.INPUT_METHOD_SERVICE); | |
imm.hideSoftInputFromWindow(mSearchView.getWindowToken(), 0); |
This file contains hidden or 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"?> | |
<inset xmlns:android="http://schemas.android.com/apk/res/android" | |
android:insetLeft="60dp" | |
android:insetRight="8dp" > | |
<shape> | |
<solid android:color="#c0c0c0" /> | |
</shape> | |
</inset> |
This file contains hidden or 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 static boolean isAvailable(Context ctx, Intent intent) { | |
final PackageManager mgr = ctx.getPackageManager(); | |
List<ResolveInfo> list = | |
mgr.queryIntentActivities(intent, | |
PackageManager.MATCH_DEFAULT_ONLY); |