Auto-size card id text on card view layout

This commit is contained in:
Branden Archer
2018-02-10 00:36:26 -05:00
parent 891636b51f
commit 6e526de087
3 changed files with 7 additions and 5 deletions

View File

@@ -45,6 +45,7 @@ dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:27.0.2'
compile 'com.android.support:design:27.0.2'
compile 'com.android.support:support-v4:27.0.2'
compile 'com.journeyapps:zxing-android-embedded:3.5.0@aar'
compile 'com.google.zxing:core:3.3.0'
compile 'org.apache.commons:commons-csv:1.5'

View File

@@ -41,7 +41,6 @@
<TextView
android:id="@+id/cardIdView"
android:textSize="42.0sp"
android:layout_width="0dp"
android:layout_height="0dp"
android:layout_marginLeft="10.0dip"
@@ -49,11 +48,11 @@
app:layout_constraintTop_toBottomOf="@id/centerGuideline"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
android:maxLines="1"
android:layout_weight="0.1"
android:textAlignment="center"
android:ellipsize="end"
android:text="1234567890"/>
app:autoSizeTextType="uniform"
app:autoSizeMinTextSize="@dimen/singleCardCardIdTextSizeMin"
app:autoSizeMaxTextSize="@dimen/singleCardCardIdTextSizeMax"
android:ellipsize="end"/>
</android.support.constraint.ConstraintLayout>

View File

@@ -14,6 +14,8 @@
<dimen name="storeNameTextSize">28sp</dimen>
<dimen name="noteTextSize">14sp</dimen>
<dimen name="singleCardCardIdTextSizeMin">15sp</dimen>
<dimen name="singleCardCardIdTextSizeMax">50sp</dimen>
<dimen name="inputBorderThickness">2dip</dimen>
<dimen name="inputBorderDividerThickness">4dip</dimen>
<dimen name="inputPadding">20dip</dimen>