我谷歌关于本地aar,每个人都说它可以工作,但它在android studio 1.1.0不起作用.
我尝试使用:
compile fileTree(dir: 'libs', include: ['*.aar'])
Run Code Online (Sandbox Code Playgroud)
但它提示:
Warning:Project app: Only Jar-type local dependencies are supported. Cannot handle: /Users/kycq/AndroidStudioProjects/QingTaJiao/app/libs/KycqBasic-release.aar
Run Code Online (Sandbox Code Playgroud)
我该怎么做才能使用当地的aar?如果我应该使用:
compile 'com.example.library:library:1.0.0@aar'
Run Code Online (Sandbox Code Playgroud)
这该怎么做?
如果我创建一个库并添加普通的drawable int drawable-xxhdpi,那么在app上添加具有相同名称的Resource文件.该应用程序的Reasource将替换库的Resource,就像:
但是,如果我使用svg资源,它将不会替换库的资源,如:
如何替换矢量drawable?
这是我的项目:
animated_path.xml:
<?xml version="1.0" encoding="utf-8"?>
<animated-vector xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:drawable="@drawable/triangle"
tools:targetApi="21">
<target
android:name="t"
android:animation="@animator/path"/>
</animated-vector>
Run Code Online (Sandbox Code Playgroud)
path.xml:
<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android">
<objectAnimator
android:duration="3000"
android:propertyName="pathData"
android:repeatCount="infinite"
android:repeatMode="reverse"
android:valueFrom="M 100 100 L 300 100 L 300 300 L 100 300z"
android:valueTo="M 100 100 L 300 100 L 200 300 L 200 300z"
android:valueType="pathType"/>
</set>
Run Code Online (Sandbox Code Playgroud)
AndroidManifest.xml中:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.kycq.reader">
<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:supportsRtl="true"
android:theme="@style/AppTheme">
<activity
android:name=".LoadingActivity"
android:theme="@style/ActivityTheme">
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
</activity>
<activity android:name=".MainActivity"
android:theme="@style/ActivityTheme">
</activity>
</application>
</manifest> …Run Code Online (Sandbox Code Playgroud) 我的 CI 服务器配置很低。
如果我使用 gradle 守护进程来构建项目,它会抛出一个错误:
* What went wrong:
Gradle build daemon disappeared unexpectedly (it may have been killed or may have crashed)
Run Code Online (Sandbox Code Playgroud)
然后,如果我使用默认关闭 gradle 守护程序的 gradle-2.14.1,我的任务“发布”是 BUILD SUCCESS,但它会附加其他任务来关闭 BUILD FAILURE 的守护程序。
The message received from the daemon indicates that the daemon has disappeared
FAILURE: Build failed with an exception.
* What went wrong:
Gradle build daemon disappeared unexpectedly (it may have been killed or may have crashed)
Run Code Online (Sandbox Code Playgroud)
当然,如果我在 macbookpro 上运行 gradle,则一切正常。
我找到了解决问题的另一种方法, run gradle --stop,然后 run gradle …
这是我需要实现的效果AnimatedVectorDrawableCompat。
vector_drawable_anim.xml
<animated-vector xmlns:android="http://schemas.android.com/apk/res/android"
android:drawable="@drawable/vector_drawable">
<target
android:name="star"
android:animation="@animator/star_anim"/>
</animated-vector>
Run Code Online (Sandbox Code Playgroud)
vector_drawable.xml
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="500px"
android:height="500px"
android:viewportHeight="500"
android:viewportWidth="500">
<group
android:name="star_group"
android:scaleX="5.0"
android:scaleY="5.0">
<path
android:name="star"
android:pathData="M 50.0,90.0 L 82.9193546357,27.2774101308 L 12.5993502926,35.8158045183 Z"
android:strokeColor="@color/colorAccent"
android:strokeWidth="1"/>
</group>
</vector>
Run Code Online (Sandbox Code Playgroud)
star_anim.xml
<set xmlns:android="http://schemas.android.com/apk/res/android"
android:ordering="sequentially">
<objectAnimator
android:duration="1000"
android:propertyName="trimPathStart"
android:valueFrom="1"
android:valueTo="0"/>
<objectAnimator
android:duration="1000"
android:propertyName="trimPathEnd"
android:valueFrom="1"
android:valueTo="0"/>
</set>
Run Code Online (Sandbox Code Playgroud)
但是AnimatorSet不能设置repeatMode。
如果我设置objectAnimator的repeatMode,第二个objectAnimator将不显示。
我该怎么办?

android android-animation android-vectordrawable animatorset
这是我的代码:
// Observable from RxView
RxView.clicks(mBtnLogin)
.throttleFirst(500, TimeUnit.MILLISECONDS)
.subscribe(new Action1<Void>() {
@Override
public void call(Void aVoid) {
String userName = mEditUserName.getText().toString();
String passWord = mEditPassWord.getText().toString();
if (TextUtils.isEmpty(userName)) {
Toast.makeText(LoginActivity.this, R.string.input_user_name, Toast.LENGTH_SHORT).show();
return;
}
if (TextUtils.isEmpty(passWord)) {
Toast.makeText(LoginActivity.this, R.string.input_pass_word, Toast.LENGTH_SHORT).show();
return;
}
LoginAction action = Constants.retrofit().create(LoginAction.class);
// Observable from Retrofit
Observable<String> call = action.login(userName, MD5.encode(passWord));
call.subscribeOn(Schedulers.io())
.subscribe(new Observer<String>() {
@Override
public void onCompleted() {
System.out.println("completed");
}
@Override
public void onError(Throwable e) {
e.printStackTrace();
}
@Override
public void onNext(String s) {
System.out.println("next" …Run Code Online (Sandbox Code Playgroud)