Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

不能和Material Design 一起使用,如何解决? #7

Open
aiLvXuan opened this issue Apr 2, 2018 · 7 comments
Open

不能和Material Design 一起使用,如何解决? #7

aiLvXuan opened this issue Apr 2, 2018 · 7 comments

Comments

@aiLvXuan
Copy link

aiLvXuan commented Apr 2, 2018

和Material Design 的 属性文件撞一起了。

Information:Gradle tasks [:zhxy:generateDebugSources, :zhxy:generateDebugAndroidTestSources, :zhxy:mockableAndroidJar, :follow:generateDebugSources, :follow:generateDebugAndroidTestSources, :follow:mockableAndroidJar, :chained:generateDebugSources, :chained:generateDebugAndroidTestSources, :chained:mockableAndroidJar]
C:\Users\Administrator.gradle\caches\transforms-1\files-1.1\appcompat-v7-26.1.0.aar\2a6a5fcbca7d820cb35027346122b6d8\res\values\values.xml
Error:(246, 5) Attribute "borderWidth" already defined with incompatible format.
Error:(246, 5) Original attribute defined here.
D:\Android\TestDemo\zhxy\build\intermediates\res\merged\debug\values\values.xml
Error:(540) Attribute "borderWidth" already defined with incompatible format.
Error:(396) Original attribute defined here.
Error:java.util.concurrent.ExecutionException: com.android.ide.common.process.ProcessException: Error while executing process D:\Android\sdk\build-tools\26.0.2\aapt.exe with arguments {package -f --no-crunch -I D:\Android\sdk\platforms\android-26\android.jar -M \?\D:\Android\TestDemo\zhxy\build\intermediates\manifests\full\debug\AndroidManifest.xml -S D:\Android\TestDemo\zhxy\build\intermediates\res\merged\debug -m -J \?\D:\Android\TestDemo\zhxy\build\generated\source\r\debug -F D:\Android\TestDemo\zhxy\build\intermediates\res\debug\resources-debug.ap_ --custom-package com.lsy.zhxy -0 apk --output-text-symbols \?\D:\Android\TestDemo\zhxy\build\intermediates\symbols\debug --no-version-vectors}
Error:com.android.ide.common.process.ProcessException: Error while executing process D:\Android\sdk\build-tools\26.0.2\aapt.exe with arguments {package -f --no-crunch -I D:\Android\sdk\platforms\android-26\android.jar -M \?\D:\Android\TestDemo\zhxy\build\intermediates\manifests\full\debug\AndroidManifest.xml -S D:\Android\TestDemo\zhxy\build\intermediates\res\merged\debug -m -J \?\D:\Android\TestDemo\zhxy\build\generated\source\r\debug -F D:\Android\TestDemo\zhxy\build\intermediates\res\debug\resources-debug.ap_ --custom-package com.lsy.zhxy -0 apk --output-text-symbols \?\D:\Android\TestDemo\zhxy\build\intermediates\symbols\debug --no-version-vectors}
Error:org.gradle.process.internal.ExecException: Process 'command 'D:\Android\sdk\build-tools\26.0.2\aapt.exe'' finished with non-zero exit value 1
Error:Execution failed for task ':zhxy:processDebugResources'.

Failed to execute aapt

@aiLvXuan
Copy link
Author

aiLvXuan commented Apr 4, 2018

提供一个解决方案:
1.单独复制 XRadarView.class, 2.复制R文件的 class styleable{ },放入XRadarView.class,当做一个私有的内部类,然后就可以拿着这个XRadarView.class, 当做一个自定义的布局放心的去使用了。

(现在又遇到个小问题,项目需求图标放在文字下放,而XRadarView 是图标放在文字的右边,这个我想我还需要自己动手做一下补充修改,希望作者可以考虑一下完善,可以自定义图标和文字的相对位置)

——————————————————————分割线——————————————————

学习了属性的定义和使用、aar包的使用,觉得以上做法太蠢了,还有可能潜藏bug,现在是使用修改attrs.xml后生成aar包的方法,完美运行。

截图-->
uc 20180425122856

@hust201010701
Copy link
Owner

1.0.5版本已经解决冲突问题。原来的borderWidth替换为boundaryWidth。

@hust201010701
Copy link
Owner

@aiLvXuan

希望作者可以考虑一下完善,可以自定义图标和文字的相对位置

这里你有什么想法么?基础库如何暴露api给业务方控制图标与文字的相对位置。

@aiLvXuan
Copy link
Author

aiLvXuan commented Jul 6, 2018

@hust201010701

基础库如何暴露api给业务方控制图标与文字的相对位置。

这个还没什么想法,之前项目赶,和ios、设计她们商量一下改了设计图,然后没考虑这个了

@joymingchen
Copy link

我也遇到了这个问题,不过是lineColor这个属性冲突了。也是改了之后当做自定义View来用的,感觉自定义属性还是蛮多坑的

@aiLvXuan
Copy link
Author

aiLvXuan commented Jul 9, 2018

@hust201010701 作者说更新了这个小问题了,应该没什么问题了吧? 主要是没有自己的标识,使用的通用的属性名称,很容易和Google自带Api或者其他第三方库冲突,改一下名字就行了,之前我是把源码下载下来,改完属性做成aar包

@joymingchen
Copy link

没啥大问题,挺好的,我跟你的做法一样

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants