Kotlin 项目实记

Kotlin 项目实记

室内地图绘制

  1. 参考 https://github.com/jiahuanyu/SVGMapView

扫描二维码

  1. 参考 http://blog.csdn.net/ericfantastic/article/details/48159411

网络框架

1.参考
以okhttp为基础:
http://ohmerhe.com/2016/06/13/kotlin_config_http_kolley/
使用kolley:
http://blog.csdn.net/sjx19900424/article/details/74529967
Retrofit:
https://github.com/DickyQie/kotlin-network-request
最基础的方法:
https://www.cnblogs.com/Jason-Jan/p/7127082.html
mqtt:
http://blog.csdn.net/axuanqq/article/details/51897427

加载外部SVG地图

Q:如何加载外部svg
A:实现方式就是,先从网络把图片下载到本地进行存储,然后再读取进行展示
https://www.cnblogs.com/_ymw/p/4224381.html

try {
            // SVG图所在路径
            String svg_path = "file://"
                    + Environment.getExternalStorageDirectory()
                    + "/svg/115.svg";

            if (svg_path.contains("#")) {
                svg_path = svg_path.replaceAll("#", "%23");
            }
            webView.loadUrl(svg_path);

        } catch (Exception e) {
            e.printStackTrace();
        }

http://blog.csdn.net/jiabailong/article/details/53736689

final URL url = new URL("http://localhost:8080/commons/m.svg");
            HttpURLConnection urlConnection = (HttpURLConnection) url.openConnection();
            InputStream inputStream = urlConnection.getInputStream();
            SVG svg = SVGParser. getSVGFromInputStream(inputStream);
            Drawable drawable = svg.createPictureDrawable();

侧滑栏DrawerLayout

登录

https://github.com/wangzailfm/LoginForKotlin
https://www.kotlintc.com/articles/424
http://www.jianshu.com/p/dcaa25d33b0c

sweetDialog 不可用

https://github.com/pedant/sweet-alert-dialog/issues/136
大约意思是,跟project的build.gradle的版本号有关系,兼容性问题

data 类型不可编辑

大约的意思就是要初始化这个data类型,之后就可以编辑了

QR 扫描二维码

https://github.com/bingoogolapple/BGAQRCode-Android#%E8%87%AA%E5%AE%9A%E4%B9%89%E5%B1%9E%E6%80%A7%E8%AF%B4%E6%98%8E

FloatingActionButton 修改背景色

http://blog.csdn.net/lmj623565791/article/details/46678867

取消选中颜色,设置itemBackground
使用方法:http://blog.csdn.net/u012702547/article/details/51253222
取消选中:https://segmentfault.com/q/1010000005078737

<android.support.design.widget.NavigationView
        android:id="@+id/navView"
        android:layout_width="wrap_content"
        android:layout_height="match_parent"
        android:layout_gravity="start"
        android:fitsSystemWindows="true"
        app:itemBackground="@android:color/white"
        app:headerLayout="@layout/nav_header"
        app:itemIconTint="@color/textDarkGray"
        app:itemTextColor="@color/textDarkGray"
        app:menu="@menu/activity_map_drawer" />

各种各样的listview

https://github.com/Trinea/android-open-project

dialogFragment

调用
https://www.cnblogs.com/mercuryli/archive/2016/04/09/5372496.html
设置 DialogFragment 的背景颜色透明
http://blog.csdn.net/cc20032706/article/details/51741793
设置全屏透明:http://dev.dafan.info/detail/277411?p=33-18

fragment的使用(Fragment不能跟activity一样直接使用xml的id作为控件名,必须要通过view的findviewbyId才可以使用)

http://blog.csdn.net/wuqingyidongren/article/details/51480412

加密模式不一样,后台有Apache,Android用原生的,但是使用Base64.NO_WRAP.

https://stackoverflow.com/questions/17912119/is-there-any-difference-between-apaches-base64-encodebase64-and-androids-base6

fastjson

官网:http://mvnrepository.com/artifact/com.alibaba/fastjson/1.2.12
调用 :在gradle中添加依赖 compile ‘com.alibaba:fastjson:1.2.10’

deviceId地址

http://blog.csdn.net/qq_32583189/article/details/52623759

passico

圆角圆形
http://blog.csdn.net/xinpengfei521/article/details/73555913

Android studio2.2 app:transformNative_libsWithStripDebugSymbolForDebug

http://blog.csdn.net/worst_hacker/article/details/53080885

fastjson 转换类的时候有问题,提示没有构建器

https://zhuanlan.zhihu.com/p/26030118

在子控件中设置间隔线

https://www.cnblogs.com/Free-Thinker/p/4545506.html

实现阴影效果

http://blog.csdn.net/jakezhang1990/article/details/64920487

recycleView

列表和区块的设置:http://www.jianshu.com/p/675883c26ef2
刷新数据:https://stackoverflow.com/questions/31367599/how-to-update-recyclerview-adapter-data
可下拉刷新的:https://github.com/dinuscxj/RecyclerRefreshLayout
加header:https://github.com/blipinsk/RecyclerViewHeader
http://www.10tiao.com/html/227/201705/2650239745/1.html
http://ocnyang.com/2017/08/03/Recycle/

badgeView

普通https://github.com/AlexLiuSheng/BadgeView
用于FloatingActionButton: compile ‘com.github.andremion:counterfab:1.0.1’
https://github.com/andremion/CounterFab

Dialog

不用翻墙版本:https://www.cnblogs.com/figozhg/p/6854179.html
科学上网版本:https://antonioleiva.com/dialogs-android-anko-kotlin/

imageView 动态设置图片

https://kotlintc.com/articles/3773
用这个更好一点,用setImageDrawable()会有系统版本限制

 imgView.setImageResource()

recycleView 二级列表展示

http://blog.csdn.net/yuhys/article/details/70228591

recycleView 不可滑动

https://www.jianshu.com/p/5dfc90656665
http://blog.csdn.net/lengqi0101/article/details/52874762

recycleView item 多点击事件

http://www.jcodecraeer.com/a/anzhuokaifa/androidkaifa/2015/0327/2647.html

Android软键盘弹出时把布局顶上去的解决方法

http://blog.csdn.net/xww810319/article/details/17397429

list交换位置

http://blog.csdn.net/yedajiang44/article/details/72865398

//data 为List  
Collections.swap(data,index1,index2);  

转换成其他格式

string.toLongOrNull()

数组

http://blog.csdn.net/mrseasons/article/details/46723819#%E7%A9%BA%E6%95%B0%E7%BB%84

启动页

https://www.jianshu.com/p/33a798ac3298

动态设置TextView

https://www.cnblogs.com/hehe520/p/6329960.html

Intent 的Flag

https://www.jianshu.com/p/537aa221eec4

Picasso基本用法

http://www.jb51.net/article/108596.htm

侧边栏动态添加menuItem

http://blog.csdn.net/leven_martin/article/details/65446239
http://jcmels.top/2016/07/22/android-NavigationView-addMenu/

RecycleView 加载更多

http://blog.takwolf.com/2017/06/15/android-refresh-and-load-more-demo/index.html

时间戳转换

http://blog.csdn.net/jackuhan/article/details/38444223

Retrofit 网络参数格式

https://www.jianshu.com/p/7687365aa946

自定义对话框

https://developer.android.com/guide/topics/ui/dialogs.html?hl=zh-cn
https://github.com/xiaoxiaoqingyi/mine-android-repository
https://www.cnblogs.com/xiaoxiaoqingyi/p/6738108.html
http://blog.csdn.net/true100/article/details/43982763

监听键盘

https://www.cnblogs.com/why168888/p/5648993.html

return break continue

http://blog.csdn.net/qq_32115439/article/details/73381825

android 跳转activity,清空之前activity栈

http://592713711.iteye.com/blog/2318725

Android中绘制虚线 canvas

http://blog.csdn.net/small_lee/article/details/52153557

导入包冲突

app 的gradle.build里面去掉第三方导入的jar包

{
        exclude group: 'com.google.code.gson'
        exclude group: 'com.squareup.okhttp3'
        exclude group: 'com.squareup.okio'
    }

BigDecimal

http://blog.csdn.net/qq_36255612/article/details/78203878

推送弹框问题

判断是否是home界面

http://blog.csdn.net/wateryi/article/details/39500521

广播

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

文件下载

https://github.com/lingochamp/FileDownloader
https://www.jianshu.com/p/92bb85fc07e8

轮询

http://huqiji.iteye.com/blog/2319340

server 中的context

https://zhidao.baidu.com/question/584303739.html

权限申请

http://blog.csdn.net/lmj623565791/article/details/50709663
https://www.jianshu.com/p/c83503f0384d

开发者模式

  1. oppo https://jingyan.baidu.com/article/93f9803fed1cfbe0e56f554d.html

不可调试原因 Unknown failure (at com.oppo.color.safe.jni.JniManager.execTransact(Unknown Source))

http://blog.csdn.net/lplj717/article/details/77991365

通知栏

http://www.imooc.com/article/8175

nagitiveView 变色

https://www.jianshu.com/p/810b1767e96b

onActivityForReult Fragment

http://www.barryzhang.com/archives/499

handler

http://blog.csdn.net/duke_knight/article/details/72900814

猜你喜欢

转载自blog.csdn.net/sunyejia/article/details/78716859