经验

./gradlew clean -i assembleDebug

发现 连接dl.google.com超时

则使用http://ping.chinaz.com/网站ping下,找到dl.google.com对应的ip

在本地hosts中添加一条记录

203.208.43.66 dl.google.com

再编译就好了

bei

recyclerView.setNestedScrollingEnabled(true);

https://www.jianshu.com/p/635970ac603a

https://hfutfei.iteye.com/blog/988374

https://www.cnblogs.com/frankliiu-java/articles/1759460.html

https://www.cnblogs.com/zhaoyan001/p/6365064.html

https://blog.csdn.net/android_gogogo/article/details/53376178

https://my.oschina.net/djone/blog/145057

https://blog.csdn.net/lv_fq/article/details/77836700

https://github.com/lvfaqiang/AndroidTestCode

https://github.com/osmandapp/Osmand

http://www.justlive.vip/blog/article/details/4199

https://github.com/jiaowenzheng/CustomTextView

http://www.cnblogs.com/TerryBlog/archive/2013/04/02/2994815.html

https://www.cnblogs.com/zhujiabin/p/5808232.html

https://github.com/Luction/AndroidRichText

https://blog.csdn.net/u014620028/article/details/54092723

https://www.cnblogs.com/zhujiabin/p/5808232.html

http://www.cnblogs.com/luction/p/3645210.html

https://www.jianshu.com/p/b87dddf02e04

https://juejin.im/post/5b13a5b8f265da6e3128d501

https://tonnyl.io/Spantastic-Text-Styling-With-Spans/

http://melonteam.com/posts/gei_ni_de_spannablestring_she_zhi_dian_ji_tai/

https://blog.51cto.com/kinbos/1348407

https://blog.csdn.net/c16882599/article/details/52913799

https://segmentfault.com/a/1190000006163046

https://blog.csdn.net/natloc/article/details/50849700

http://blog.hacktons.cn/2015/02/03/porterduff/

https://www.jianshu.com/p/d54e24efbd7b

https://github.com/MrAllRight/BezierView/

https://www.jianshu.com/p/a5c2f0359d31

https://www.jianshu.com/p/016534448bfe

https://www.jianshu.com/p/92627f72c707

https://blog.csdn.net/ccpat/article/details/46717573

Androidbug-java.util.zip.ZipException: duplicate entry(重复依赖多版本的类库)

以上大概意思:重复依赖,重复了条目。

1、清除一下缓存:File->Invalidate Caches/Restart..

注意:
除开Gradle依赖类库之外,还可以在项目中的libs下静态方式添加类库。
若是使用静态方式添加jar类库的,请删除重复的jar

2、编译前clean下

https://blog.csdn.net/hexingen/article/details/74065796

Androidbug-android-sdk-macosx/cmake/3.6.4111459/bin/cmake

Build command failed.
Error while executing process /Users/xx/Documents/software/android-sdk-macosx/cmake/3.6.4111459/bin/cmake with arguments {-H/Users/xx/Documents/qtt/RTC_Android_v1.2.1/qtt_test/app -B/Users/xx/Documents/qtt/RTC_Android_v1.2.1/qtt_test/app/.externalNativeBuild/cmake/debug/armeabi -GAndroid Gradle - Ninja -DANDROID_ABI=armeabi -DANDROID_NDK=/Users/xx/Documents/software/android-sdk-macosx/ndk-bundle -DCMAKE_LIBRARY_OUTPUT_DIRECTORY=/Users/xx/Documents/qtt/RTC_Android_v1.2.1/qtt_test/app/build/intermediates/cmake/debug/obj/armeabi -DCMAKE_BUILD_TYPE=Debug -DCMAKE_MAKE_PROGRAM=/Users/xx/Documents/software/android-sdk-macosx/cmake/3.6.4111459/bin/ninja -DCMAKE_TOOLCHAIN_FILE=/Users/xx/Documents/software/android-sdk-macosx/ndk-bundle/build/cmake/android.toolchain.cmake -DANDROID_PLATFORM=android-16 -DCMAKE_CXX_FLAGS=}
(include) CMakeLists.txt
Open File
CMake Error: CMAKE_C_COMPILER not set, after EnableLanguage
CMake Error: CMAKE_CXX_COMPILER not set, after EnableLanguage
-- Configuring incomplete, errors occurred!
Build command failed.
Error while executing process /Users/xx/Documents/software/android-sdk-macosx/cmake/3.6.4111459/bin/cmake with arguments {-H/Users/xx/Documents/qtt/RTC_Android_v1.2.1/qtt_test/app -B/Users/xx/Documents/qtt/RTC_Android_v1.2.1/qtt_test/app/.externalNativeBuild/cmake/release/armeabi -GAndroid Gradle - Ninja -DANDROID_ABI=armeabi -DANDROID_NDK=/Users/xx/Documents/software/android-sdk-macosx/ndk-bundle -DCMAKE_LIBRARY_OUTPUT_DIRECTORY=/Users/xx/Documents/qtt/RTC_Android_v1.2.1/qtt_test/app/build/intermediates/cmake/release/obj/armeabi -DCMAKE_BUILD_TYPE=Release -DCMAKE_MAKE_PROGRAM=/Users/xx/Documents/software/android-sdk-macosx/cmake/3.6.4111459/bin/ninja -DCMAKE_TOOLCHAIN_FILE=/Users/xx/Documents/software/android-sdk-macosx/ndk-bundle/build/cmake/android.toolchain.cmake -DANDROID_PLATFORM=android-16 -DCMAKE_CXX_FLAGS=}
(include) CMakeLists.txt
Open File
CMake Error: CMAKE_C_COMPILER not set, after EnableLanguage
CMake Error: CMAKE_CXX_COMPILER not set, after EnableLanguage
-- Configuring incomplete, errors occurred!

却换NDK版本,我用了android-ndk-r15b

Glide

Transformation<Bitmap> circleCrop = new CircleCrop();
if (data.imgUrl.endsWith("gif")) {
Glide.with(context)
.asGif()
.diskCacheStrategy(DiskCacheStrategy.NONE)
.load(data.imgUrl)
.into(imageView);
} else if (data.imgUrl.endsWith("webp")) {
Glide.with(context)
.load(data.imgUrl)
.optionalTransform(circleCrop)
.optionalTransform(WebpDrawable.class, new WebpDrawableTransformation(circleCrop))
.into(imageView);
} else {
Glide.with(context)
.load(data.imgUrl)
.into(imageView);
}

文字阴影

<style name="">
    <item name="android:shadowColor">#7f000000</item>
    <item name="android:shadowDx">0</item>
    <item name="android:shadowDy">0</item>
    <item name="android:shadowRadius">5</item>
</style>

Anroid 小记(dp->dx,measure(),PagerAdapter)

android:typeface="monospace"
TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, 6, getResources().getDisplayMetrics());
View childView = createChildView(inflater, resources, BoothCenterItemData.defaultData[0]);
int widthMeasureSpec = View.MeasureSpec.makeMeasureSpec(0, View.MeasureSpec.UNSPECIFIED);
int heightMeasureSpec = View.MeasureSpec.makeMeasureSpec(0, View.MeasureSpec.UNSPECIFIED);
childView.measure(widthMeasureSpec, heightMeasureSpec);
int measuredHeight = childView.getMeasuredHeight();
public class BoothCenterAdapter extends PagerAdapter {
    private final List<BoothCenterItemView> itemViews;

    public BoothCenterAdapter(List<BoothCenterItemView> itemViews) {
        this.itemViews = itemViews;
    }

    @NonNull
    @Override
    public Object instantiateItem(@NonNull ViewGroup container, int position) {
        View view = itemViews.get(position);
        container.addView(view);
        return view;
    }

    @Override
    public void destroyItem(@NonNull ViewGroup container, int position, @NonNull Object object) {
        container.removeView((View) object);
    }

    @Override
    public int getCount() {
        return itemViews.size();
    }

    @Override
    public boolean isViewFromObject(@NonNull View view, @NonNull Object object) {
        return view == object;
    }
}

Android签名

1、创建

keytool -genkey -keystore [签名文件]  -alias bieming -keyalg RSA -validity 10000

2、查看

keytool -list -keystore  [签名文件]

注:当密码中有特殊符号时:keytool -list -v -keystore android.keystore -storepass ‘112&He’

3、修改别名

keytool -changealias -keystore android.keystore -alias [当前别名] -destalias [新别名]