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
public interface Api { | |
///// 传统阻塞式API | |
List<Cat> queryCats(String query); | |
String store(Cat cat); | |
//// 非阻塞式API | |
void queryCats(String query, CatsQueryCallback callback); | |
void store(Cat cat, CatsStoreCallback callback); |
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
public class BorderItemDecoration extends RecyclerView.ItemDecoration { | |
public static final int HORIZONTAL = LinearLayout.HORIZONTAL; | |
public static final int VERTICAL = LinearLayout.VERTICAL; | |
private static final int[] ATTRS = new int[]{ android.R.attr.listDivider }; | |
private Drawable mDivider; | |
private final Rect mBounds = new Rect(); |
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
// https://stackoverflow.com/questions/25216749/softkeyboard-open-and-close-listener-in-an-activity-in-android | |
public class SoftKeyboardMonitor { | |
private final BaseActivity mActivity; | |
private KeyboardListener mKeyboardListener; | |
private View rootLayout; | |
private boolean isOpened; | |
public SoftKeyboardMonitor(BaseActivity activity) { |
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
/** | |
* Created by zhy on 15/9/21. | |
* http://blog.csdn.net/lmj623565791/article/details/48649563 | |
*/ | |
public class StatusBarCompat | |
{ | |
private static final int INVALID_VAL = -1; | |
private static final int COLOR_DEFAULT = Color.parseColor("#20000000"); | |
@TargetApi(Build.VERSION_CODES.LOLLIPOP) |
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
/** | |
* 上传腾讯云cos. | |
* <p> | |
* Created by 410063005 on 2018/1/31. | |
*/ | |
// Config: https://cloud.tencent.com/document/product/436/12159 | |
// Usage: | |
// File file = new File(Environment.getExternalStorageDirectory(), "hello.png"); | |
// CosClient.create(IndexActivity.this, getAssets().open("heap.json")).upload(file); | |
public class CosClient { |
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
import os | |
import os.path | |
import hashlib | |
import sys | |
hash_array = {} | |
def file_md5(file_path): | |
md5 = hashlib.md5() | |
with file(file_path, "rb") as f: |
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
/* | |
* Copyright (C) 2016 Google Inc. | |
* | |
* Licensed under the Apache License, Version 2.0 (the "License"); | |
* you may not use this file except in compliance with the License. | |
* You may obtain a copy of the License at | |
* | |
* http://www.apache.org/licenses/LICENSE-2.0 | |
* | |
* Unless required by applicable law or agreed to in writing, software |
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
// usage: Choreographer.getInstance().postFrameCallback(new Helper()); | |
public class Helper implements Choreographer.FrameCallback { | |
private static final String TAG = "IndexHelper"; | |
private Field messagesField; | |
private Field nextField; | |
public Helper() { | |
try { |
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"?> | |
<manifest xmlns:android="http://schemas.android.com/apk/res/android" | |
package="com.example.demo_glide"> | |
<uses-permission android:name="android.permission.INTERNET" /> | |
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" /> | |
<application | |
android:name=".MyApp" | |
android:allowBackup="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
#include "op.h" | |
#include <dlfcn.h> | |
#include <stdio.h> | |
typedef int (*CACULATE_FUNC)(int, int); | |
int main(int argc, char* argv[]) | |
{ | |
dlerror(); |
OlderNewer