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
<?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
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
<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
short answer: | |
when inflating for convertView, instead of just | |
result = inf.inflate(R.layout.thread_item, null); | |
do | |
result = inf.inflate(R.layout.thread_item, parent, false); | |
explanation: |
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
private void moveUserInfoLayoutInY(int marginTop) { | |
MarginLayoutParams marginParams = new MarginLayoutParams(mUserInfoLayout.getLayoutParams()); | |
float px = TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, marginTop, getResources().getDisplayMetrics()); | |
marginParams.setMargins((int)mUserInfoLayout.getLeft(), (int)px, 0, 0); | |
RelativeLayout.LayoutParams layoutParams = new RelativeLayout.LayoutParams(marginParams); | |
mUserInfoLayout.setLayoutParams(layoutParams); | |
} |
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
protected static String getRealPlayUrl(String playUrlWithTempSig, String sig) { | |
// http://r13---sn-a5m7ln7r.googlevideo.com/videoplayback? | |
// sparams=gcr%2Cid%2Cinitcwndbps%2Cip%2Cipbits%2Citag%2Cratebypass%2Csource%2Cupn%2Cexpire&source=youtube | |
// &signature=74A5A84D017C326B86FBB2515BD6C00BCD85133A.E1CB6514CD41B99045FF236A3F7CF0F50F4AEC14&itag=22&key=yt5&mws=yes&gcr=cn&ms=au | |
// &ipbits=0&ratebypass=yes&expire=1406281956&upn=raAqucAppMU&id=o-AP5UIALOxGG5ae6zN-JNagnKvRQa_WtGXk8czf3NgFuW&mv=u&sver=3&ip=199.245.60.115 | |
// &fexp=902408%2C924222%2C927622%2C934024%2C934030%2C941431%2C945066%2C946023&mt=1406260337&initcwndbps=1093375 | |
String realUrl = playUrlWithTempSig.replaceFirst("signature="+"[^&]*", "signature="+sig); | |
System.out.println("======= realUrl ======="+realUrl); | |
return realUrl; | |
} |
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
*F1 显示声明。 | |
Shift+F1 浏览器查看声明 | |
*Command+B 进入源码。 | |
Command+F12 显示类中的所有方法。 | |
*Option+Enter 修复提示,还可以提取字符串到value中。 |
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:layout_width="match_parent" | |
android:layout_height="wrap_content" | |
android:layout_marginTop="12dp" > | |
<TableRow> | |
<TextView | |
android:layout_width="0dp" | |
android:layout_height="wrap_content" |