Code Monkey home page Code Monkey logo

jiandan's Introduction

JianDan客户端高仿版


##效果图

废话不多说,先上效果图

GIF

##项目介绍

对煎蛋客户端进行优化,API用的是煎蛋官方的。

项目虽小,五脏俱全,学习这个项目,你将学到

  • Android Studio开发Android的基本配置
  • 对MD风格的Theme兼容
  • 对Volley网络请求库的封装和自定义
  • Application、Activity和Fragment基类的基本设计
  • MVC架构的使用
  • 对超长图片加载的解决方案
  • WebView与JS通信,及加载本地缓存图片的实现
  • RecyclerView自动加载、加载完成回调,以及item进入动画
  • 多楼层回复自定义控件的实现
  • 严格模式(StrictMode)的设置及用法
  • 使用GreenDao对数据进行本地缓存
  • 对网络状态的实时检测
  • 对UIL的个性化设置、封装和基本使用
  • 使用LeakCanary检测内存泄露

##其他分支

##优化的功能

  • 添加加载等待动画
  • 添加加载失败提示
  • 添加评论楼层过多隐藏
  • 添加网络状态检测
  • 优化无聊图列表显示,非WIFI状态下,显示GIF缩略图,点击后下载
  • 加载模式全自动智能切换,显著提高加载速度,节省大量流量
  • 修改图片详情页为完全沉浸效果
  • 添加图片列表滚动检测,滚动状态暂停加载,进一步提高加载速度,减少卡顿
  • 添加图片加载默认图片
  • 添加当前栏目标志,避免重复切换
  • 修改新鲜事列表页效果为CardView
  • 由于小视频接口有问题,当加载成功的数据少于10条时,会自动加载下一页,直到大于10条为止
  • 添加新鲜事大图模式切换功能

##关于我

##使用到的开源框架

jiandan's People

Contributors

cellzer avatar rowandjj avatar shenhualxt avatar zhaokaiqiang avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

jiandan's Issues

How to solves this problem?

F:\gh_project\JianDan-master\app\build\intermediates\res\merged\debug\values-v23\values-v23.xml
Error:(4) Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Widget.Button.Inverse'.
Error:(34) Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Material.Button.Colored'.
Error:(4) Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Widget.Button.Inverse'.
Error:(34) Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Material.Button.Colored'.
F:\gh_project\JianDan-master\app\build\intermediates\res\merged\debug\values-v24\values-v24.xml
Error:(3) Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Widget.Button.Borderless.Colored'.
Error:(4) Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Widget.Button.Colored'.
Error:(3) Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Widget.Button.Borderless.Colored'.
Error:(4) Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Widget.Button.Colored'.
Error:Execution failed for task ':app:processDebugResources'.

com.android.ide.common.process.ProcessException: Failed to execute aapt

图片缩放

图片貌似无法缩放,但看到确实使用了PhotoView控件,不解

评论列表优化

在学习您的源码的时候,看到您的博客里说的,评论布局里的RecycleView用了setIsRecyclable(false),不然复用会导致布局混乱。自己分析了一下,对代码进行了一点修改,解决了这个问题。看楼主的博客,受益匪浅,赞一个
[code=java]
if (commentator.getFloorNum() > 1) { //CommentListActivity的228行
//添加这句,当有楼层的子View复用没有楼层的子View时也会正常显示
holder.floors_parent.setVisibility(View.VISIBLE);
.....
} else {
holder.floors_parent.setVisibility(View.GONE);
}
//在FloorView的init方法里添加removeAllViews();方法清空需复用的楼层里的评论
public void init() {
if (null == datas.iterator())
return;
removeAllViews();
...
[/code]

第一次进入且无网络时闪退

当第一次安装,无网络连接时,闪退,空指针异常

图片怎么显示不出来。。贴代码
java.lang.NullPointerException
at com.socks.jiandan.ui.fragment.FreshNewsFragment$FreshNewsAdapter.onBindViewHolder(FreshNewsFragment.java:222)
at com.socks.jiandan.ui.fragment.FreshNewsFragment$FreshNewsAdapter.onBindViewHolder(FreshNewsFragment.java:173)

数据加载失败

我不知道你代码怎么回事,显示数据加载失败,你服务器炸了?

更新material-dialogs到0.7.3.1到最新才编译好

凯子哥,我是重新下载调试你的煎蛋客户端,一开始就显示无法加载material-dialogs为依赖,我想你是以前有用的,三天前这个material-dialogs更新了。我不清楚我的0.7.2.0为什么down不下来。或许其他人没问题。

列表加载动画

"列表加载动画(虽然试过好多次,但是都不能实现首次加载,CardView进入时的动画效果,如果你能知道我如何实现,我将非常感激)"

hi, 不了解你说的是不是这个: LayoutAnimation。

具体的例子,可以查看%android_sdk%\samples\android-15\ApiDemos\src\com\example\android\apis\animation里的例子, 这个例子里,ListView的每个子项加载进来都是有动画的

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.