Giter Site home page Giter Site logo

yydcdut / photonoter Goto Github PK

View Code? Open in Web Editor NEW
1.6K 60.0 334.0 79.68 MB

:notebook:Material Design风格的开源照片笔记。(MVP+Dagger2+RxJava+AspectJ+Dex处理)

Java 99.10% C 0.52% Groovy 0.20% CMake 0.18%
android rxjava material-design camera2-api animation rxandroid mvp-architecture aspectj dex mvp-android

photonoter's Introduction

照片笔记 PhotoNoter

Material Design风格的开源照片笔记。

GitHub release License Build Status

下载:

编译

'signingConfig.storeFile' does not exist

如果编译不过,错误日志是:

Error:A problem was found with the configuration of task ':app:packagexxxxDebug'.

File ‘/xxxxxxxxxx/debug.keystore' specified for property 'signingConfig.storeFile' does not exist.

将/app/build.gradle中的下面代码注释或者删除

signingConfigs {
	debug {
		//storeFile file("debug.keystore")
	}
}

release.properties (No such file or directory)

如果编译不过,错误日志是:

What went wrong:

A problem occurred evaluating project ':app'.

xxxxxxxx/app/release.properties (No such file or directory)

将/app/build.gradle中的下面代码注释或者删除

signingConfigs {
	release {
		//Properties p = new Properties()
		//p.load(new FileInputStream(project.file('release.properties')))
		//storeFile file(p.storeFile)
        //storePassword p.storePassword
		//keyAlias p.keyAlias
		//keyPassword p.keyPassword
	}
}

NDK

如果编译不过,错误日志是跟NDK有关的:

开发环境的ndk版本是android-ndk-r10e

Others

如果还是不行,请将错误日志issues,谢谢!

应用截图

动画gif

界面

Dribbble

有些界面是模仿Dribbble网站App效果图实现的:

Dribbble

技术点

  1. 整体项目MVP结构(1.2.0版本之前是 MVC )。
  2. Dagger2 。
  3. 相机部分,API >= 21使用 Camera2 ,API < 21使用 Camera 。
  4. 相机的状态机,聚焦状态机。
  5. 照片缓存分为两种,一个是大图,一个是小图,小图是相册界面缩略图的时候加载的,大图是查看图片的时候加载的。
  6. 图片处理。但是在 App 中,发现很多这方面的问题我还没有解决。比如红米1s后置摄像头800W,那么拍一张图是3M左右,但是 Camera 的照片的0度是我们正常手机视角的90度。那么我们需要把这个3M的图片给翻转过来,但是呢又不想失分辨率,就会导致OOM!那么现在的解决办法是设置EXIF信息,然后显示图片通过 Exif 信息去旋转角度。
  7. 沙盒。每次拍完照都是先把数据放到沙盒数据库中,然后再到服务中去作图,做完的话再从数据库中删除掉。作图的 Service 是和 Camera 那个 Activity 绑定的(bind方式),当不再拍照的时候就退出了 Service,然后回到相册界面的时候会去判断沙盒数据库中是否有没有做完的图,没有做完的话另外启一个进程的 Service 继续作图。
  8. Activity 退出和进入的动画。这块弄了很久,主要是想模仿 Android5.0 的那种,但是有些界面做出来超级卡。
  9. 一些 UI 的动画,比如 “ 意见反馈”、 “ 语音输入” 这里面的动画。
  10. 主题设置,沉浸式状态栏(Android 5.0)。
  11. 切换主题。
  12. 可以滑动 item 和可以拖放 item 的 ListView(SlideAndDragListView)。
  13. Android 原生平台的 Markdown,支持 EditText 编辑实时预览 (RxMarkdown)。
  14. RxJava + RxAndroid(RxCategory/ RxPhotoNote/ RxSandBox/ RxFeedBack/ RxUser)。
  15. dex分包处理。第一次开启App的时候 install dex + dexopt 时间很长,所以第一次开启的时候另启进程专门做这个事情,防止主线程因为时间长而发生ANR。以及自己去配置主dex是为了以防自动分包ClassNotFound异常。
  16. Dex自动分包脚本。
  17. 使用 AOP 进行 Android 6.0 权限适配。
  18. NDK && AIDL。

更新版本说明

ChangeLog

致谢

License

Copyright 2015 yydcdut

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.

photonoter's People

Contributors

yydcdut 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

photonoter's Issues

大神,编译时出错了

在4.0的模拟器下编译安装出现如下错误:
java.lang.ClassNotFoundException: android.hardware.camera2.CameraAccessException
编译失败。

在6.0的模拟器下,显示
Error:warning: Ignoring InnerClasses attribute for an anonymous inner class然后后面是一大堆error,不过最后能编译成功。。。

动画错位

点击动画过后文字与对应的按钮出现偏差。
我的测试手机型号为:红米2a
device-2016-01-14-095457

bug

主界面Activity,没有配置特定的加载模式,导致几个页面跳转之后,需要按好多次返回键,才能退出程序

编译到手机出错

FAILURE: Build failed with an exception.

  • Where:
    Script 'D:\androidstudioproject\PhotoNoter\gradle\dex.gradle' line: 345

  • What went wrong:
    Execution failed for task ':app:autoSplitDex'.

    Unclosed character class near index 5
    [/]
    ^

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

debug下没有找到对应的allclasses.jar

//build/intermediates/multi-dex/Store360/debug/allclasses.jar
def jarDebugPath = "${projectDir}${File.separator}" +
        "build${File.separator}" +
        "intermediates${File.separator}" +
        "multi-dex${File.separator}" +
        "${flavor}${File.separator}" +
        "${buildType}${File.separator}" +
        "allclasses.jar"

环境:Android Studio 2.1、Gradle 2.10

没有找到dex 这个task

通过命令行grade tasks 里面没有看到dex 开头的task,

afterEvaluate {
    tasks.matching {
        it.name.startsWith('dex')
    }.each { dx ->
        if (dx.additionalParameters == null) {
            dx.additionalParameters = []
        }
        dx.additionalParameters += '--multi-dex'
        dx.additionalParameters += '--set-max-idx-number=35000'
    }
}

好像也没有执行 , android studio 2.1

拉下项目点击运行时报错

Error:Execution failed for task ':app:compileStore360DebugNdk'.

com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command 'D:\ProgramFiles\android-ndk-r10d\ndk-build.cmd'' finished with non-zero exit value 2

请问这个要怎么解决?

分包貌似没起作用啊?

如题,我复制你的部分配置如下:
afterEvaluate {
tasks.matching {
it.name.startsWith('dex')
}.each { dx ->
if (dx.additionalParameters == null) {
dx.additionalParameters = []
}
dx.additionalParameters += '--multi-dex'
dx.additionalParameters += '--set-max-idx-number=48000'
//dx.additionalParameters += "--main-dex-list=$projectDir/multidex.keep".toString()
}
}
我的gradle如下:
dependencies {
/**
*
* Error:(32, 0) Access to the dex task is now impossible, starting with 1.4.0
1.4.0 introduces a new Transform API allowing manipulation of the .class files.
See more information: http://tools.android.com/tech-docs/new-build-system/transform-api
Open File
*/
classpath 'com.android.tools.build:gradle:2.1.2'
classpath 'com.google.gms:google-services:1.3.0'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}

app/build.gradle

apply plugin: 'com.android.application'
apply plugin: 'com.google.gms.google-services'
apply from: '../gradle/dex.gradle'
android {
compileSdkVersion 23
buildToolsVersion "23.0.2"

defaultConfig {
    applicationId "com.aa.bb"
    minSdkVersion 10
    targetSdkVersion 23
    versionCode 1
    versionName "1.0"
    //配置为true,表示需要将dex分包,false则不分包
    multiDexEnabled true
    manifestPlaceholders = [
        GETUI_APP_ID : "ddddddddddddddddddd",
        GETUI_APP_KEY : "dddddddddddddddddddd",
        GETUI_APP_SECRET : "dddddddddddddddddddd",
        PACKAGE_NAME : "com.aa.bb"
    ]
}

dexOptions {
    javaMaxHeapSize "2g"
    preDexLibraries = false
}

/* android.applicationVariants.all {
variant ->
dex.doFirst{
dex->
if (dex.additionalParameters == null) {
dex.additionalParameters = []
}
//为了避免在2.2等低端机型上 linearAlloc的bug 这里控制linearAlloc大小<=4m
dex.additionalParameters += '--set-max-idx-number=48000'
}
}*/

afterEvaluate {
tasks.matching {
    it.name.startsWith('dex')
}.each { dx ->
    if (dx.additionalParameters == null) {
        dx.additionalParameters = []
    }
    dx.additionalParameters += '--multi-dex'
    dx.additionalParameters += '--set-max-idx-number=48000'
    //dx.additionalParameters += "--main-dex-list=$projectDir/multidex.keep".toString()
}

}
........

怎么最后apk中只有一个classes。dex文件,而上面注释的那种方式,限定gradle版本必须为1.3.0.请问一下在gradle2.1.2版本的话,配置该怎么写啊?

崩溃

第一次进去,没有写笔记,只按了一下camera,由于相机的问题崩溃了。
第二次进去 isFirstTime()判断为true,接着调用Observable.from(new File(FilePathUtils.getPath()).listFiles()),但是我之前只点了一下相机按钮,没做别的所以.listFiles()为null,之后就出现空指针异常然后崩溃了。这里感觉应该判空一下

private void checkDisks() {

    if (!mLocalStorageUtils.isFirstTime()) {
        Observable.from(new File(FilePathUtils.getPath()).listFiles())
                .subscribeOn(Schedulers.io())
                .observeOn(Schedulers.computation())
                .filter(file1 -> !file1.isDirectory())
                .filter(file -> file.getName().toLowerCase().endsWith(".jpg") ||
                        file.getName().toLowerCase().endsWith(".png") ||
                        file.getName().toLowerCase().endsWith(".jpeg"))
                .count()
                .subscribe(fileNumber -> {
                    mRxSandBox.getNumber()
                            .subscribe(new Action1<Integer>() {
                                @Override
                                public void call(Integer dbNumber) {
                                    if (fileNumber != dbNumber) {
                                        Intent checkIntent = new Intent(mContext, CheckService.class);
                                        mContext.startService(checkIntent);
                                    }
                                }
                            });
                });
    }
}

关于在gradle插件2.1.0后怎么通过gradle查找直接依赖问题?

博主好,之前我在https://github.com/yydcdut/PhotoNoter/issues/13这里发表过?现在这个问题关闭了,只能在这重发问,接着之前的问题,在dex.gradle文件中,之前博主也说过在2.2.0上实现没问题,只是有几个TODO的地方没实现,其中发现了两处:

  1. //todo for test
    flavor = flavor.toLowerCase() 这个估计是test版本需要,所以可以不用实现。

2.def getDependentJava(File file, Set packageJavaSet) {
def content = readFile(file)
def pattern = Pattern.compile("import *");//todo import *$ , XXXXXLINE
def packageJavas = pattern.split(content);
for (int i = 1; i < packageJavas.length - 1; i++) {
def packageJava = packageJavas[i].trim()
//系统的不要
if (packageJava.startsWith("java") || (packageJava.startsWith("android") && !packageJava.startsWith("android.support"))
|| packageJava.startsWith(" ") || packageJava.startsWith("static")) {
continue;
} else {
//去掉分号
packageJavaSet.add(packageJava.substring(0, packageJava.length() - 1))
}
}
def lastOne = packageJavas[packageJavas.length - 1]
def lastPackage = lastOne.split("\n")[0]
if (lastPackage.trim().startsWith("java") || (lastPackage.trim().startsWith("android") && !lastPackage.trim().startsWith("android.support"))
|| lastPackage.trim().startsWith(" ") || lastPackage.trim().startsWith("static")) {
// do nothing
} else {
packageJavaSet.add(lastPackage.trim().substring(0, lastPackage.trim().length() - 1))
}
}
在getDependentJava方法中//todo import *$ , XXXXXLINE,这里应该是寻找内部类,研究了下,由于对gradle掌握的不是很好,所以这里不敢轻易去实现,所以想问博主,这里具体要怎么实现呢?多多指教!

crash in android M

When I use gallery in your app in android M。It is crashed 。The reason crashed in gallery is that can't load photo files。below is the crash log.
image

It is also crash when i use take photo with camera. below is the crash log.
image

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.