我正在尝试将ActionBarCompat集成到我的一个项目中.我使用Gradle构建系统.
我已将依赖项添加为:
dependencies {
compile 'com.android.support:appcompat-v7:18.0.+'
}
Run Code Online (Sandbox Code Playgroud)
我没有使用自定义样式,我在AndroidManifest.xml中设置了主题:
<application
android:icon="@drawable/icon"
android:label="@string/app_name"
android:theme="@style/Theme.AppCompat" >
Run Code Online (Sandbox Code Playgroud)
问题是这是在Android库项目中.ActionBarSherlock工作得很好.但现在我得到以下错误.
LibraryProject/build/res/all/release/values/values.xml:764: error: Error: No resource found that matches the given name: attr 'dropdownListPreferredItemHeight'.
LibraryProject/build/res/all/release/values/values.xml:768: error: Error: No resource found that matches the given name: attr 'popupMenuStyle'.
LibraryProject/build/res/all/release/values/values.xml:813: error: Error: No resource found that matches the given name: attr 'dropdownListPreferredItemHeight'.
LibraryProject/build/res/all/release/values/values.xml:817: error: Error: No resource found that matches the given name: attr 'popupMenuStyle'.
LibraryProject/build/res/all/release/values/values.xml:848: error: Error: No resource found that matches the given name: attr 'dropdownListPreferredItemHeight'.
LibraryProject/build/res/all/release/values/values.xml:852: …Run Code Online (Sandbox Code Playgroud) 我正在尝试使用Gradle替换WAR插件任务中的资源文件.
基本上我有两个资源文件:
database.properties
database.properties.production
Run Code Online (Sandbox Code Playgroud)
我想实现的是替代"database.properties"与"database.properties.production"下最终WAR文件WEB-INF/classes中.
我尝试了很多东西,但对我来说最符合逻辑的是以下哪些不起作用:
war {
webInf {
from ('src/main/resources') {
exclude 'database.properties'
rename('database.properties.production', 'database.properties')
into 'classes'
}
}
}
Run Code Online (Sandbox Code Playgroud)
但是这会导致所有其他资源文件重复,包括重复的database.properties(具有相同名称的两个不同文件),并且数据库中仍然存在database.properties.production.
我需要一个没有重复的干净解决方案,而且WAR中没有database.properties.production.
我很难理解以下代码示例的行为;
Flowable<String> f = Flowable.just(1)
.flatMap(it -> Flowable.create(e -> {
for(int i = 1; i < 1001; ++i) {
log.info("Emitting: " + i);
if(i % 10 == 0) {
Thread.sleep(1000);
}
e.onNext(i);
}
e.onComplete();
}, BackpressureStrategy.BUFFER))
.map(String::valueOf)
.subscribeOn(Schedulers.io())
.observeOn(Schedulers.newThread());
f.subscribe(val -> {
Thread.sleep(100);
log.info("Observing: " + val);
});
Thread.sleep(1000000);
Run Code Online (Sandbox Code Playgroud)
代码运行正常,直到subscribe调用观察到 128 个项目。发射和观察是并行的。但在那之后,Flowable 继续发出项目(显然在某处排队)但直到所有 1000 个项目都发出后才观察到任何项目。在发出所有 1000 个项目后,立即观察其余项目(> 128 个)。
这看起来与 128 的背压 bufferSize 相关,但我仍然希望发射和观察对于整个 1000 个项目是并行的,因为观察者显然不比发射器慢。有什么我在这里想念的吗?我应该怎么做才能修复代码?