I want to connect the compile 'me.grantland library: autofittextview: 0.2. +' In the project for the phone and for the clock. Accordingly, I in the gradle (phone) I connect this library and in the gradle (wear) I also connect and get an error
Error:(148) Attribute "minTextSize" has already been defined Those. the same attribute is duplicated. How can this duplication be avoided?
wear.gradle
apply plugin: 'com.android.application' android { compileSdkVersion 23 buildToolsVersion "23.0.2" defaultConfig { applicationId "com.project" minSdkVersion 15 targetSdkVersion 23 versionCode 1 versionName "1.0" } buildTypes { release { minifyEnabled false proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' } } } dependencies { compile fileTree(dir: 'libs', include: ['*.jar']) compile 'com.google.android.support:wearable:1.3.0' compile 'com.google.android.gms:play-services-wearable:8.4.0' compile 'com.android.support:support-v4:23.1.1' compile 'com.android.support:appcompat-v7:23.1.1' } phone.gradle
apply plugin: 'com.android.application' android { compileSdkVersion 23 buildToolsVersion "23.0.2" defaultConfig { applicationId "com.project" minSdkVersion 15 targetSdkVersion 23 versionCode 1 versionName "1.0" } buildTypes { release { minifyEnabled false proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' } } } dependencies { compile fileTree(dir: 'libs', include: ['*.jar']) testCompile 'junit:junit:4.12' compile 'com.android.support:appcompat-v7:23.1.1' compile 'com.android.support:design:23.1.1' compile 'com.google.android.gms:play-services:8.4.0' //facebook sdk compile 'com.facebook.android:facebook-android-sdk:4.6.0' //MY DEPENDENCIES: //Profress bar's compile 'com.github.lzyzsd:circleprogress:1.1.0@aar' //Auto resize text in TextView compile 'me.grantland:autofittextview:0.2.+' } project.gradle
buildscript { repositories { jcenter() } dependencies { classpath 'com.android.tools.build:gradle:1.5.0' // NOTE: Do not place your application dependencies here; they belong // in the individual module build.gradle files } } allprojects { repositories { jcenter() } } task clean(type: Delete) { delete rootProject.buildDir }
minTextSize- miha_devTextView, in it I redefined theonMeasuremethod. from there would take the width of the container. would get the textgetText()and measure its length withPaint mTextPaint = new Paint(); ... mTextPaint.measureText(mText);Paint mTextPaint = new Paint(); ... mTextPaint.measureText(mText);and already if the width is less than the length of the text consistently reduced the size of the fontmTextPaint.setTextSize(float newValue)- miha_dev