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
| /** | |
| * Created by chensuilun on 2017/7/4. | |
| */ | |
| public class NTUSUtils { | |
| private static final String TAG = "NTUSUtils"; | |
| private static final String NTP_TRUSTED_TIME = "android.util.NtpTrustedTime"; | |
| private static final String GET_INSTANCE = "getInstance";//private NtpTrustedTime getInstance(Context context) | |
| private static final String FORCE_REFRESH = "forceRefresh"; //public boolean forceRefresh() | |
| private static final String GET_CACHED_NTP_TIME = "getCachedNtpTime";//public long getCachedNtpTime() | |
| private static Context sContext = AppApplication.getContext(); |
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
| /** | |
| * Created by chensuilun on 2017/12/08. | |
| */ | |
| public class DownloadManagerRx implements IDownloadListener { | |
| private static final String TAG = "DownloadManagerRx"; | |
| private static DownloadManagerRx mInstance; | |
| private HashMap<Object, Disposable> mRunningRequest; | |
| private Map<Object, Float> mProgress; | |
| private List<IDownloadListener> mIDownloadListeners; |
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
| Pick Audio file from Gallery: | |
| //Use MediaStore.Audio.Media.EXTERNAL_CONTENT_URI | |
| Intent intent = new Intent(Intent.ACTION_PICK, MediaStore.Audio.Media.EXTERNAL_CONTENT_URI); | |
| Pick Video file from Gallery: | |
| //Use MediaStore.Audio.Media.EXTERNAL_CONTENT_URI | |
| Intent intent = new Intent(Intent.ACTION_PICK, MediaStore.Video.Media.EXTERNAL_CONTENT_URI); | |
| Pick Image from gallery: |
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
| <templateSet group="AndroidLogKotlin"> | |
| <template name="logm" value="android.util.Log.d(TAG, $FORMAT$)" description="Log method name and its arguments" toReformat="true" toShortenFQNames="true"> | |
| <variable name="FORMAT" expression="groovyScript("def params = _2.collect {it + ' = [$' + it + ']'}.join(', '); return '\"' + _1 + '() called' + (params.empty ? '' : ' with: ' + params) + '\"'", kotlinFunctionName(), functionParameters())" defaultValue="" alwaysStopAt="false" /> | |
| <context> | |
| <option name="KOTLIN_STATEMENT" value="true" /> | |
| </context> | |
| </template> | |
| <template name="logd" value="android.util.Log.d(TAG, "$METHOD_NAME$: $content$")" description="Log.d(String)" toReformat="true" toShortenFQNames="true"> | |
| <variable name="METHOD_NAME" expression="kotlinFunctionName()" defaultValue="" alwaysStopAt="false" /> | |
| <variable name="content" expression="" defaultValue="" alwaysStopAt="true" /> |
OlderNewer