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
package com.xianguo.xreader.utils; | |
import java.text.SimpleDateFormat; | |
import java.util.Date; | |
import android.annotation.SuppressLint; | |
public class RelativeTime { | |
private static final long ONE_DAY = 86400000L; |
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
package com.tediscript.android; | |
import android.content.Context; | |
import android.content.SharedPreferences; | |
public class Settings { | |
public static String PREFS_NAME = "com.tediscript.android.settings"; | |
public static void putString(Context ctx, String key, String 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
public void PopToast() { | |
// 获取LayoutInflater对象,该对象能把XML文件转换为与之一直的View对象 | |
LayoutInflater inflater = getLayoutInflater(); | |
// 根据指定的布局文件创建一个具有层级关系的View对象 | |
// 第二个参数为View对象的根节点,即LinearLayout的ID | |
View layout = inflater.inflate(R.layout.sort_toast, | |
(ViewGroup) findViewById(R.id.toast_layout_root)); | |
Toast toast = new Toast(this); | |
// 设置Toast的位置 | |
toast.setGravity(Gravity.BOTTOM, 0, 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
{ | |
"response": { | |
"name": "推荐博客", | |
"more_url": "http://api.eoe.cn//client/blog?k=lists&pageNum=2&t=top", | |
"items": [ | |
{ | |
"id": "3130", | |
"name": "admin", | |
"head_image_url": "http://www.eoeandroid.com/uc_server/avatar.php?uid=1&size=small", | |
"title": "重磅消息!eoe.cn客户端开源啦", |
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
<TextView | |
android:layout_width="wrap_content" | |
android:layout_height="wrap_content" | |
android:singleLine="true" | |
android:scrollHorizontally="true" | |
android:ellipsize="marquee" | |
android:marqueeRepeatLimit ="marquee_forever" | |
android:focusable="true" | |
android:focusableInTouchMode="true" | |
android:text="Hello Android.. I am android developer and developing this auto scroll text view via XML." /> |
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
package com.example.app; | |
import java.io.File; | |
import android.media.MediaScannerConnection; | |
import android.media.MediaScannerConnection.MediaScannerConnectionClient; | |
import android.net.Uri; | |
import android.util.Log; | |
public class MyMediaScannerConnectionClient implements MediaScannerConnectionClient { |
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 HashMap<String, List<MusicInfo>> scanDirectory(File path, HashMap<String, List<MusicInfo>> musicHashMap) { | |
if (musicHashMap == null) { | |
musicHashMap = new HashMap<String, List<MusicInfo>>(); | |
} | |
if (path.exists()) { | |
File[] files = path.listFiles(); | |
if (files == null) { | |
return null; | |
} | |
for (int i = 0; i < files.length; i++) { |
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
import android.content.res.Resources; | |
import android.graphics.Bitmap; | |
import android.graphics.NinePatch; | |
import android.graphics.Rect; | |
import android.graphics.drawable.NinePatchDrawable; | |
import java.nio.ByteBuffer; | |
import java.nio.ByteOrder; | |
/** |
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"?> | |
<message module="CATALOG_SERVICE" version="1.0"> | |
<header action="RESPONSE" command="CONTENT_QUERY" sequence="" component-id="portal52" component-type="CATALOG_SERVER" /> | |
<body> | |
<result code="1" description="ok" /> | |
<contents> | |
<content> | |
<name><![CDATA[快乐大本营]]></name> | |
<code><![CDATA[jxgd-000000000000000000000000211]]></code> | |
<type><![CDATA[10]]></type> |
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 class AlphaImageFetchTask extends BaseImageFetchTask { | |
public AlphaImageFetchTask(String url, int targetWidth, int targetHeight) { | |
super(url, targetWidth, targetHeight); | |
} | |
public AlphaImageFetchTask(String url, int targetWidth, int targetHeight, String key) { | |
super(url, targetWidth, targetHeight, key); | |
} | |
@Override | |
public void setDrawable(View view, Drawable drawable) { |