Code Monkey home page Code Monkey logo

chentao0707 / simplifyreader Goto Github PK

View Code? Open in Web Editor NEW
4.6K 4.6K 1.6K 61.33 MB

一款基于Google Material Design设计开发的Android客户端,包括新闻简读,图片浏览,视频爽看 ,音乐轻听以及二维码扫描五个子模块。项目采取的是MVP架构开发,由于还是摸索阶段,可能不是很规范。但基本上应该是这么个套路,至少我个人认为是这样的~恩,就是这样的!

License: Apache License 2.0

Java 99.09% HTML 0.73% Lua 0.18%

simplifyreader's Introduction

说明

由于项目是几年前开发的,很多第三方库都已经更新了,导致安装或者编译失败,如果不能正常运行的,请查看Log自行解决,代码也是几年前的代码,只做参考。

###简阅

一款基于Google Material Design设计开发的Android客户端,包括新闻简读,图片浏览,视频爽看 ,音乐轻听以及二维码扫描五个子模块。项目采取的是MVP架构开发,由于还是摸索阶段,可能不是很规范。但基本上应该是这么个套路,至少我个人认为是这样的~恩,就是这样的!

###效果图

image

image

image

image

###Demo下载 火速跳转 | Download-APK

image

###模块分析

####新闻简读

  • 介绍:API使用的是凤凰新闻客户端的接口,我只是简单的获取了新闻的列表和详情数据,由于api和凤凰新闻客户端完全一致,鉴于侵权问题我就不开源出来了。至于接口是如何获取的?Google,百度,调试获取日志,我能说的只有这么多。

  • 功能:列表页使用自定义的ListView(自动加载更多)显示新闻列表,详情使用的是WebView加载,支持滑动返回。对于多图 新闻的处理,使用的和主流新闻客户端类似,滑动切换多张图片,可双指缩放图片大小!

####图片浏览

  • 介绍:API使用的是百度图片的搜索接口,由于网上有很多的开发者开源了这个接口,所以我也就放出来,如有侵权请及时告知。

  • 功能:列表页使用的瀑布流效果(增加了下拉刷新和上拉加载更多)详情页和列表页的切换增加了一个图片放大或缩小到指定位置的效果,图片也可以双指缩放!

####视频爽看

  • 介绍:API使用的是优酷开放平台的SDK,不过要吐槽的一点是,优酷的SDK真心不好用,还是Eclipse版本的,我是一点点移植到Android Studio平台的,但是它的接口还是很丰富的,好好的利用一下,还是能够做出一个优秀的APP的。

  • 功能:列表页使用了Google的CardView,简单的获取了一些视频的基本数据。播放页使用了优酷提供的视频播放器组件,传入视频ID就可以播放视频了,只要调通了SDK,其他的都是一些简单的数据获取!

####音乐轻听

  • 介绍:API获取的是豆瓣音乐的数据,由于也不是开放API,如有侵权请及时告知。

  • 功能:播放音乐的界面是我自定义的一个唱机的View,很多思路都是从网上学习借鉴过来的,自己重新造了个轮子。UI和网易云音乐对比的话,只能说是形似神不似了,没有人家做的细致!

####二维码扫描

  • 介绍:这个完全是我自己单独开发的类库,之前也有开源出来,这次又再一次重构优化,后期会单独剥离二维码扫描模块,做成类库和Demo的形式,提供Android Studio版本。

  • 功能:扫描界面使用xml进行布局,然后加入属性动画。这样布局更具有优势,更利于多屏幕适配。解码模块使用的是两个主流的开源库Zbar和ZXing,进过多次测试发现,ZBar虽然扫描效率和速度高于ZXing,但是经常扫描出错误的信息,可能由于太灵敏的缘故把,综合二者的优缺点还是建议使用ZXing来解码,并且这个项目还在长期维护更新!

###致谢

  • 苦于没有后台支持,找到这些支持JSON数据格式的开放接口可谓是煞费苦心,前前后后尝试了很多次才找到,也感谢网友们提供的接口!

  • 界面的原型都是我自己构思的,后期的切图美化主要是Chris帮忙完成的,很感谢他业余时间和我一起完成这样一个APP!

  • 项目中大量使用了Github上面优秀的开源项目,我会列举出来!其他一些代码片段就不一一致谢了,很感谢这些开放源码的技术大牛们,让我学到了很多!

  • 最后如果觉得我的项目对你有所帮助,请点击我的支付宝付款码请我喝杯咖啡把~当然我也希望你们能够多多fork,多多star,多多follow,这将给我更多的动力开源更多的项目!

###开源项目说明

ButterKnife

AndroidTagGroup

NineOldAndroids

SystemBarTint

Android-Universal-Image-Loader

PhotoView

OkHttp

SmartTabLayout

SwipeBackLayout

ImageBlurring

PinterestLikeAdapterView

Material-Dialogs

EventBus

Gson

Volley

Umeng

Youku

###打赏我

Image

###关于我

###项目主页

http://www.qingcore.com/SimplifyReader/

###License

Copyright (c) 2015 [[email protected] | [email protected]]

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
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

simplifyreader's People

Contributors

chentao0707 avatar iluhcm avatar paul-wiz avatar songzhiyong avatar zhangsr 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  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

simplifyreader's Issues

Implements the BaseLazyFragment,but the method onFirstUserVisible() didn't execute

public class HomeCenterFragment extends BaseFragment implements HomeCenterView{

private HomeCenterPresenterImpl homeCenterPresenter;

@Override
protected void onFirstUserVisible() {
    homeCenterPresenter = new HomeCenterPresenterImpl(mContext, this);
    homeCenterPresenter.refreshData(false);
}

@Override
protected void onUserVisible() {

}

@Override
protected void onUserInvisible() {

}

I'm writting a project which used your some classes,please write me back as soon as possible after you seen this,thanks!

想了解下滑动返回模块

你好,项目中没看见有新闻模块的内容,想了解下滑动返回的处理,不知道哪里可以了解的到?

请教mvp数据保存问题

HI,
看了你的项目感觉学了好多,但是有一点请教下,就是我们在activity和fragment进行转屏的时候需要保存一些数据,那么在mvp模式下应该怎么样去实现呢?麻烦帮忙回答下,感谢~

关于未公开api的问题

弱弱的问下楼主,类似图片,音乐等的未公开api是从哪找到的 我也想学习学习 谢谢楼主

请教

请教一下,你是怎么实现的获取豆瓣音乐的数据并可以在线播放的?看了源码表示没看懂

20150916 pull到本地最新代码,报错

/GitHub/SimplifyReader/library/src/main/java/com/github/obsessive/library/widgets/SmoothImageView.java:173: 错误: 找不到符号
if (getDrawable() instanceof ColorDrawable) return;
^
符号: 类 ColorDrawable
位置: 类 SmoothImageView
注: 某些输入文件使用或覆盖了已过时的 API。
注: 有关详细信息, 请使用 -Xlint:deprecation 重新编译。
注: 某些输入文件使用了未经检查或不安全的操作。
注: 有关详细信息, 请使用 -Xlint:unchecked 重新编译。
1 个错误

:library:compileReleaseJavaWithJavac FAILED

FAILURE: Build failed with an exception.

  • What went wrong:
    Execution failed for task ':library:compileReleaseJavaWithJavac'.

    Compilation failed; see the compiler error output for details.

  • Try:
    Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

dont show news

I open app in about a week ago and first navigation draw show news but i think removed

项目导入出错 cannot find symbol class ColorDrawable

Error:(173, 38) error: cannot find symbol class ColorDrawable
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
Error:Execution failed for task ':library:compileReleaseJavaWithJavac'.
> Compilation failed; see the compiler error output for details.
/Users/xingli/Workspace/Android/SimplifyReader-master/library/src/main/java/com/github/obsessive/library/widgets/SmoothImageView.java:173: error: cannot find symbol
        if (getDrawable() instanceof ColorDrawable) return;
                                     ^
  symbol:   class ColorDrawable
  location: class SmoothImageView
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
1 error

 FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':library:compileReleaseJavaWithJavac'.
> Compilation failed; see the compiler error output for details.

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

BUILD FAILED

Total time: 46.57 secs

应该是'com.github.chrisbanes.photoview:library:1.2.3'出问题了,尝试改成1.2.4,未果.

不知道怎么修改,请指教.

下载apk运行崩溃,log日志如下

FATAL EXCEPTION: main
Process: com.github.obsessive.simplifyreader.application, PID: 1590
java.lang.UnsatisfiedLinkError:
Couldn't load luajava from loader dalvik.system.PathClassLoader[DexPathList[[zip file "/data/app/com.github.obsessive.simplifyreader-1.apk"],
nativeLibraryDirectories=[/data/app-lib/com.github.obsessive.simplifyreader-1, /system/lib]]]: findLibrary returned null
at java.lang.Runtime.loadLibrary(Runtime.java:358)
at java.lang.System.loadLibrary(System.java:526)
at com.luajava.LuaState.(LuaState.java:92)
at com.luajava.LuaStateFactory.newLuaState(LuaStateFactory.java:59)
at com.decapi.DecAPI.(DecAPI.java:27)
at com.youku.player.YoukuPlayerBaseApplication.onCreate(YoukuPlayerBaseApplication.java:35)
at com.github.obsessive.simplifyreader.SimplifyReaderApplication.onCreate(SimplifyReaderApplication.java:38)
at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1007)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4328)
at android.app.ActivityThread.access$1500(ActivityThread.java:135)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1256)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:136)
at android.app.ActivityThread.main(ActivityThread.java:5001)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:785)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:601)
at dalvik.system.NativeStart.main(Native Method)

项目编译出错

Error:(2) Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Widget.Button.Inverse'.

Error:(2) Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Material.Button.Colored'.

找不到相应资源

XViewPager的setEnableScroll()选项没有实际作用

这个函数在HomeActivity中有唯一一次调用,但是不论把enableScroll设置成true还是false 都没有用,viewpager总是可以响应滑动事件。我在XViewPager的onInterceptTouchEvent中添加日志函数,打印出isEnableScroll,发现如果isEnableScroll设置成flase的话,日志中会轮流循环打印false和true。开始不清楚为什么,我怀疑是XViewPager被创建了两个实例。于是我在构造函数中添加了一行代码:
id = Math.random();
然后在onInterceptTouchEvent中打印出ID,发现确实有两个不同的ID,说明至少创建了两次实例。
'''

public boolean onInterceptTouchEvent(MotionEvent ev) {

    System.out.println(id);
    System.out.println("isEnableScroll:"+isEnableScroll);
    if (!isEnableScroll) {
        return false;
    }

    return super.onInterceptTouchEvent(ev);
}

'''
但是使用ViewPager真的会创建两次Viewpager实例吗?也许还不知两次,如果直接在构造函数中添加日志函数,会发现这条语句被执行三次,也就是说有构造了三次。
如何设置才能让程序可以控制ViewPager是否响应事件呢?

终于成功编译了

我的设置
1:api 23 build tools 23.0.2
2:三个build.grade 里面的cardview design appcompont 支持包改成对应的23的
3:这时还会出现Duplicate files copied in APK META-INF 貌似是友盟的锅 我把友盟的全部删掉了

Error retrieving parent for item

导入项目的时候报错
log:
C:\Users\walmand_\Desktop\sample\SimplifyReader-master\library\build\intermediates\exploded-aar\com.android.support\appcompat-v7\23.0.0\res\values-v23\values-v23.xml
Error:(2) Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Widget.Button.Inverse'.
Error:(2) Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Material.Button.Colored'.
Error:Execution failed for task ':library:processReleaseResources'.

com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command 'C:\Users\walmand_\AppData\Local\Android\sdk\build-tools\22.0.1\aapt.exe'' finished with non-zero exit value 1

项目的v7包明明用的是22的版本啊,本地也有22和23的版本,其他项目用22版本也没出现问题,网上的人都说compileSdk版本要跟v7包版本一致,我都是用的版本22啊

魅族Note1移动开发版无法启动应用

我有两个测试机,一个是魅族Note1,一个是酷派大神F1(刷的MIUI),在魅族手机上安装应用后无法打开,点击应用图标无法启动应用,在酷派手机上可正常打开应用,但是只有首次进入的时候可以正常获取数据,上下拉操作后就无法正常获取数据了。

编译错误

先是找不到资源,

Error:(2) Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Widget.Button.Inverse'.

Error:(2) Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Material.Button.Colored'.

找不到相应资源

然后我照你的说的,把sdk版本设置最新,设为23
还是出错
Error:(22, 24) 错误: 找不到符号
符号: 类 AndroidHttpClient
位置: 程序包 android.net.http

安卓5.0.1模拟器停止运行

java.lang.UnsatisfiedLinkError: dalvik.system.PathClassLoader[DexPathList[[zip file "/data/app/com.github.obsessive.simplifyreader-1/base.apk"],nativeLibraryDirectories=[/data/app/com.github.obsessive.simplifyreader-1b/x86, endorb, /systemb]]] couldn't find "libluajava.so"

BaseLazyFragment的几个问题

1.成员变量isPrepared有什么用,感觉没有啥用?
2.setUserVisibleHint里面的逻辑不明白是啥意思,能解释一下吗?
多谢!

编译library时找不到org.apache.http.XXX的方法。是不是gradle里少东西

library编译出错。找不到org.apache.http.XXX的一些方法,是不是gradle里少了什么包
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:23.0.0'
compile 'com.android.support:cardview-v7:23.0.0'
compile 'com.android.support:design:23.0.0'
compile 'com.jakewharton:butterknife:5.1.1'
compile 'com.google.code.gson:gson:2.2.4'
compile 'me.gujun.android.taggroup:library:1.4@aar'
compile 'com.nineoldandroids:library:2.4.0'
compile 'com.readystatesoftware.systembartint:systembartint:1.0.3'
compile 'com.nostra13.universalimageloader:universal-image-loader:1.9.3'
compile 'com.github.chrisbanes.photoview:library:1.2.2'
compile 'com.afollestad:material-dialogs:0.7.9.1'
compile 'de.greenrobot:eventbus:2.4.0'
compile 'com.squareup.okhttp:okhttp:2.4.0'

用的是 SDK 22 ,build-tools 是22.0.1,supportV7包是22.1.0

导进去控制台报错了,帮忙看看

Error:Unable to start the daemon process.
This problem might be caused by incorrect configuration of the daemon.
For example, an unrecognized jvm option is used.
Please refer to the user guide chapter on the daemon at http://gradle.org/docs/2.4/userguide/gradle_daemon.html

Please read the following process output to find out more:

Error occurred during initialization of VM
Could not reserve enough space for 2097152KB object heap
Java HotSpot(TM) Client VM warning: ignoring option MaxPermSize=512m; support was removed in 8.0

导入工程后,一启动就崩溃

java.lang.ExceptionInInitializerError
at com.youku.player.YoukuPlayerBaseApplication.onCreate(YoukuPlayerBaseApplication.java:35)
at com.github.obsessive.simplifyreader.SimplifyReaderApplication.onCreate(SimplifyReaderApplication.java:38)
at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1000)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4391)
at android.app.ActivityThread.access$1300(ActivityThread.java:141)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1294)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:5041)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:511)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:793)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:560)
at dalvik.system.NativeStart.main(Native Method)
Caused by: java.lang.ExceptionInInitializerError
at com.luajava.LuaStateFactory.newLuaState(LuaStateFactory.java:59)
at com.decapi.DecAPI.(DecAPI.java:27)
            at com.youku.player.YoukuPlayerBaseApplication.onCreate(YoukuPlayerBaseApplication.java:35)
            at com.github.obsessive.simplifyreader.SimplifyReaderApplication.onCreate(SimplifyReaderApplication.java:38)
            at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1000)
            at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4391)
            at android.app.ActivityThread.access$1300(ActivityThread.java:141)
            at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1294)
            at android.os.Handler.dispatchMessage(Handler.java:99)
            at android.os.Looper.loop(Looper.java:137)
            at android.app.ActivityThread.main(ActivityThread.java:5041)
            at java.lang.reflect.Method.invokeNative(Native Method)
            at java.lang.reflect.Method.invoke(Method.java:511)
            at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:793)
            at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:560)
            at dalvik.system.NativeStart.main(Native Method)
Caused by: java.lang.UnsatisfiedLinkError: Couldn't load luajava from loader dalvik.system.PathClassLoader[dexPath=/data/app/com.github.obsessive.simplifyreader-1.apk,libraryPath=/data/app-lib/com.github.obsessive.simplifyreader-1]: findLibrary returned null
at java.lang.Runtime.loadLibrary(Runtime.java:365)
at java.lang.System.loadLibrary(System.java:535)
at com.luajava.LuaState.(LuaState.java:92)
            at com.luajava.LuaStateFactory.newLuaState(LuaStateFactory.java:59)
            at com.decapi.DecAPI.(DecAPI.java:27)
            at com.youku.player.YoukuPlayerBaseApplication.onCreate(YoukuPlayerBaseApplication.java:35)
            at com.github.obsessive.simplifyreader.SimplifyReaderApplication.onCreate(SimplifyReaderApplication.java:38)
            at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1000)
            at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4391)
            at android.app.ActivityThread.access$1300(ActivityThread.java:141)
            at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1294)
            at android.os.Handler.dispatchMessage(Handler.java:99)
            at android.os.Looper.loop(Looper.java:137)
            at android.app.ActivityThread.main(ActivityThread.java:5041)
            at java.lang.reflect.Method.invokeNative(Native Method)

图片未加载完成,点击奔溃

java.lang.ClassCastException: android.graphics.drawable.ColorDrawable cannot be cast to android.graphics.drawable.BitmapDrawable
at com.github.obsessive.library.widgets.SmoothImageView.initTransform(SmoothImageView.java:172)
at com.github.obsessive.library.widgets.SmoothImageView.onDraw(SmoothImageView.java:279)
at android.view.View.draw(View.java:14493)

libluajava.so

java.lang.UnsatisfiedLinkError: dalvik.system.PathClassLoader[DexPathList[[zip file "/data/app/com.github.obsessive.simplifyreader-1/base.apk"],nativeLibraryDirectories=[/data/app/com.github.obsessive.simplifyreader-1/lib/arm64, /vendor/lib64, /system/lib64]]] couldn't find "libluajava.so"
at java.lang.Runtime.loadLibrary(Runtime.java:366)
at java.lang.System.loadLibrary(System.java:989)
at com.luajava.LuaState.(LuaState.java:92)
at com.luajava.LuaStateFactory.newLuaState(LuaStateFactory.java:59)
at com.decapi.DecAPI.(DecAPI.java:27)
at com.youku.player.YoukuPlayerBaseApplication.onCreate(YoukuPlayerBaseApplication.java:35)
at com.github.obsessive.simplifyreader.SimplifyReaderApplication.onCreate(SimplifyReaderApplication.java:38)
at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1011)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4545)
at android.app.ActivityThread.access$1500(ActivityThread.java:147)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1353)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:135)
at android.app.ActivityThread.main(ActivityThread.java:5250)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:911)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:706)

终于成功编译了

我的设置
1:api 23 build tools 23.0.2
2:三个build.grade 里面的cardview design appcompont 支持包改成对应的23的
3:这时还会出现Duplicate files copied in APK META-INF 貌似是友盟的锅 我把友盟的全部删掉了

Nexus 5x扫码的蛋疼问题

最近买了5x,可是他的照相问题确实蛋疼啊。首先扫码预览图是倒着的,这个查看官方文档设置setDisplayOrientation可以迅速兼容起来。原本以为这样就开开心心解决了,但是总是事与愿违PreviewCallback返回的数据确实是横屏,但是横屏的方向也与其他种类的手机相反,别人返回的是头朝左,5x返回的是头朝右;也就是说我把data翻转过来5x的图像与预览的图像是反着的;这样导致你扫码的时候明明把二维码放到了框中却解析不了。

目前我自己解决办法:
因为不知道是5x或者6p手机的原因还是api 23的问题,那么我目前为止是判断是否是5x,并且在decodeCrop方法中传入的top坐标为cameraHieght - mCropRect.top - mCropRect.height(),这样可以顺利解决;

其实以上方式不大好,感觉正确的应该是根据data来判断orientation;当然目前没有找到对byte直接返回orientation的方法或者开源的项目;本人去zxing项目翻了好几页的issue也只是找到了解决5x预览正确;

可能有人会说先把data转成Bitmap然后对方向进行调整(因为我们可以对Bitmap的方向做调整),然后扫码解析的时候再把Bitmap转成data,我不知道这样行不行,但至少效率太低;

不知道 @SkillCollege 有什么好的办法

Translate to English

Hi
i love your great project but i have a problem

would you Please translate your comments in English
thanks alot

建议

感谢,很有参考的一个例子,但是代码结构有点乱,而且注释太少;建议把项目结构以图的形式给出,并加入一些注释

扫码模块在android版本2.3.7上面出现异常,求助,是不是扫码功能只兼容3.0以上的手机

04-02 19:51:39.830 2381-2381/com.github.obsessive.simplifyreader.application E/AndroidRuntime: FATAL EXCEPTION: main
04-02 19:51:39.830 2381-2381/com.github.obsessive.simplifyreader.application E/AndroidRuntime: java.lang.NoSuchMethodError: android.hardware.Camera$Parameters.isVideoStabilizationSupported
04-02 19:51:39.830 2381-2381/com.github.obsessive.simplifyreader.application E/AndroidRuntime: at com.github.obsessive.simplifyreader.ui.activity.qrcode.camera.CameraConfigurationUtils.setVideoStabilization(CameraConfigurationUtils.java:199)
04-02 19:51:39.830 2381-2381/com.github.obsessive.simplifyreader.application E/AndroidRuntime: at com.github.obsessive.simplifyreader.ui.activity.qrcode.camera.CameraConfigurationManager.setDesiredCameraParameters(CameraConfigurationManager.java:101)
04-02 19:51:39.830 2381-2381/com.github.obsessive.simplifyreader.application E/AndroidRuntime: at com.github.obsessive.simplifyreader.ui.activity.qrcode.camera.CameraManager.openDriver(CameraManager.java:86)
04-02 19:51:39.830 2381-2381/com.github.obsessive.simplifyreader.application E/AndroidRuntime: at com.github.obsessive.simplifyreader.ui.activity.qrcode.CaptureActivity.initCamera(CaptureActivity.java:434)
04-02 19:51:39.830 2381-2381/com.github.obsessive.simplifyreader.application E/AndroidRuntime: at com.github.obsessive.simplifyreader.ui.activity.qrcode.CaptureActivity.surfaceChanged(CaptureActivity.java:390)
04-02 19:51:39.830 2381-2381/com.github.obsessive.simplifyreader.application E/AndroidRuntime: at android.view.SurfaceView.updateWindow(SurfaceView.java:558)
04-02 19:51:39.830 2381-2381/com.github.obsessive.simplifyreader.application E/AndroidRuntime: at android.view.SurfaceView.dispatchDraw(SurfaceView.java:350)
04-02 19:51:39.830 2381-2381/com.github.obsessive.simplifyreader.application E/AndroidRuntime: at android.view.ViewGroup.drawChild(ViewGroup.java:1647)
04-02 19:51:39.830 2381-2381/com.github.obsessive.simplifyreader.application E/AndroidRuntime: at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1376)
04-02 19:51:39.830 2381-2381/com.github.obsessive.simplifyreader.application E/AndroidRuntime: at android.view.View.draw(View.java:6883)
04-02 19:51:39.830 2381-2381/com.github.obsessive.simplifyreader.application E/AndroidRuntime: at android.view.ViewGroup.drawChild(ViewGroup.java:1649)
04-02 19:51:39.830 2381-2381/com.github.obsessive.simplifyreader.application E/AndroidRuntime: at com.github.obsessive.library.swipeback.SwipeBackLayout.drawChild(SwipeBackLayout.java:374)
04-02 19:51:39.830 2381-2381/com.github.obsessive.simplifyreader.application E/AndroidRuntime: at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1376)
04-02 19:51:39.830 2381-2381/com.github.obsessive.simplifyreader.application E/AndroidRuntime: at android.view.ViewGroup.drawChild(ViewGroup.java:1647)
04-02 19:51:39.830 2381-2381/com.github.obsessive.simplifyreader.application E/AndroidRuntime: at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1376)
04-02 19:51:39.830 2381-2381/com.github.obsessive.simplifyreader.application E/AndroidRuntime: at android.view.View.draw(View.java:6883)
04-02 19:51:39.830 2381-2381/com.github.obsessive.simplifyreader.application E/AndroidRuntime: at android.widget.FrameLayout.draw(FrameLayout.java:357)
04-02 19:51:39.830 2381-2381/com.github.obsessive.simplifyreader.application E/AndroidRuntime: at android.view.ViewGroup.drawChild(ViewGroup.java:1649)
04-02 19:51:39.830 2381-2381/com.github.obsessive.simplifyreader.application E/AndroidRuntime: at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1376)
04-02 19:51:39.830 2381-2381/com.github.obsessive.simplifyreader.application E/AndroidRuntime: at android.view.ViewGroup.drawChild(ViewGroup.java:1647)
04-02 19:51:39.830 2381-2381/com.github.obsessive.simplifyreader.application E/AndroidRuntime: at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1376)
04-02 19:51:39.830 2381-2381/com.github.obsessive.simplifyreader.application E/AndroidRuntime: at android.view.ViewGroup.drawChild(ViewGroup.java:1647)
04-02 19:51:39.830 2381-2381/com.github.obsessive.simplifyreader.application E/AndroidRuntime: at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1376)
04-02 19:51:39.830 2381-2381/com.github.obsessive.simplifyreader.application E/AndroidRuntime: at android.view.View.draw(View.java:6883)
04-02 19:51:39.830 2381-2381/com.github.obsessive.simplifyreader.application E/AndroidRuntime: at android.widget.FrameLayout.draw(FrameLayout.java:357)
04-02 19:51:39.830 2381-2381/com.github.obsessive.simplifyreader.application E/AndroidRuntime: at com.android.internal.policy.impl.PhoneWindow$DecorView.draw(PhoneWindow.java:1866)
04-02 19:51:39.830 2381-2381/com.github.obsessive.simplifyreader.application E/AndroidRuntime: at android.view.ViewRoot.draw(ViewRoot.java:1528)
04-02 19:51:39.830 2381-2381/com.github.obsessive.simplifyreader.application E/AndroidRuntime: at android.view.ViewRoot.performTraversals(ViewRoot.java:1258)
04-02 19:51:39.830 2381-2381/com.github.obsessive.simplifyreader.application E/AndroidRuntime: at android.view.ViewRoot.handleMessage(ViewRoot.java:1865)
04-02 19:51:39.830 2381-2381/com.github.obsessive.simplifyreader.application E/AndroidRuntime: at android.os.Handler.dispatchMessage(Handler.java:99)
04-02 19:51:39.830 2381-2381/com.github.obsessive.simplifyreader.application E/AndroidRuntime: at android.os.Looper.loop(Looper.java:130)
04-02 19:51:39.830 2381-2381/com.github.obsessive.simplifyreader.application E/AndroidRuntime: at android.app.ActivityThread.main(ActivityThread.java:3822)
04-02 19:51:39.830 2381-2381/com.github.obsessive.simplifyreader.application E/AndroidRuntime: at java.lang.reflect.Method.invokeNative(Native Method)
04-02 19:51:39.830 2381-2381/com.github.obsessive.simplifyreader.application E/AndroidRuntime: at java.lang.reflect.Method.invoke(Method.java:507)
04-02 19:51:39.830 2381-2381/com.github.obsessive.simplifyreader.application E/AndroidRuntime: at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)
04-02 19:51:39.830 2381-2381/com.github.obsessive.simplifyreader.application E/AndroidRuntime: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)
04-02 19:51:39.830 2381-2381/com.github.obsessive.simplifyreader.application E/AndroidRuntime: at dalvik.system.NativeStart.main(Native Method)

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.