For four days I'm trying to use this project in my application. By now I created a new, clean project and I was trying to run sample, but the project was from Eclipse, and I'm working on Android Studio. Anyway, I don't want to import the whole project, just want to copy necessary files.
First I'm creating a libs
folder where I put the circularimageview.jar
file - is it a difference between a file from CircularImageView
and CircularImageViewSample
dir?
Then I add this as a library from the Android Studio, so finally I'm getting:
compile 'com.android.support:support-v4:23.0.1'
compile 'com.android.support:appcompat-v7:23.0.1'
compile files(':circularImageView')
in build.gradle.
Next, I'm adding to my activity_main.xml the code from author's site, so it looks like http://pastebin.com/qetJBG6F
Should I change the
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/libs/com.mikhaellopez.circularimageviewsample"
lines?
I'm adding the java code from author's site so my MainActivity.java
looks like:
package info.androidhive.kolka;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.Menu;
import android.view.MenuItem;
import com.mikhaellopez.circularimageview.CircularImageView;
public class MainActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
CircularImageView circularImageView = (CircularImageView)findViewById(R.id.avatar);
circularImageView.setBorderColor(getResources().getColor(R.color.GrayLight));
circularImageView.setBorderWidth(10);
circularImageView.addShadow();
}
What am I missing, why I'm still getting an errors such as
Error:(8) No resource identifier found for attribute 'border' in package 'com.mikhaellopez.circularimageviewsample'
or
java.lang.RuntimeException: Unable to start activity ComponentInfo{info.androidhive.kolka/info.androidhive.kolka.MainActivity}: android.view.InflateException: Binary XML file line #8: Error inflating class com.mikhaellopez.circularimageview.CircularImageView
?
Greetings