Skip to content

Commit

Permalink
Fix lint errors that were blocking the build
Browse files Browse the repository at this point in the history
Silence lint about textalignment.

android:textalignment is a new API >= JELLYBEAN_MR1; gravity=center should work on API's before that.

Surpress lint warning about simpledataformat locale

Is already included via DateFOrmatSymbols

Extract string resources

Remove values overriden by gradle script

Disable backup (M) and supress lintwarning about RTL attribute

Shorten logging-tag to 23 chars

Downgrade severity of missing translation to warning
  • Loading branch information
koch-t committed Sep 1, 2015
1 parent 5d80b38 commit 4841fa2
Show file tree
Hide file tree
Showing 7 changed files with 28 additions and 20 deletions.
1 change: 1 addition & 0 deletions library/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ android {
}

lintOptions {
warning 'MissingTranslation'
textReport true
textOutput 'stdout'
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// Copyright 2012 Square, Inc.
package com.squareup.timessquare;

import android.annotation.SuppressLint;
import android.content.Context;
import android.content.res.Resources;
import android.content.res.TypedArray;
Expand Down Expand Up @@ -304,6 +305,7 @@ public FluentInitializer withHighlightedDate(Date date) {
return withHighlightedDates(Arrays.asList(date));
}

@SuppressLint("SimpleDateFormat")
public FluentInitializer setShortWeekdays(String[] newShortWeekdays) {
DateFormatSymbols symbols = new DateFormatSymbols(locale);
symbols.setShortWeekdays(newShortWeekdays);
Expand Down
4 changes: 2 additions & 2 deletions library/src/main/res/values/styles.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<!-- Copyright 2012 Square, Inc. -->
<resources>
<resources xmlns:tools="http://schemas.android.com/tools">
<style name="CalendarTitle">
<item name="android:textSize">@dimen/calendar_text_medium</item>
<item name="android:textStyle">bold</item>
Expand All @@ -9,7 +9,7 @@
<item name="android:layout_width">0dp</item>
<item name="android:layout_weight">1</item>
<item name="android:gravity">center</item>
<item name="android:textAlignment">center</item>
<item name="android:textAlignment" tools:targetApi="jelly_bean_mr1">center</item>
</style>

<style name="CalendarCell.DayHeader">
Expand Down
12 changes: 4 additions & 8 deletions sample/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,18 +1,14 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.squareup.timessquare.sample"
android:versionCode="1"
android:versionName="1.0">

<uses-sdk
android:minSdkVersion="8"
android:targetSdkVersion="17" />
xmlns:tools="http://schemas.android.com/tools"
package="com.squareup.timessquare.sample">

<application
android:label="@string/app_name"
android:icon="@drawable/icon"
android:allowBackup="false"
android:supportsRtl="true"
>
tools:ignore="UnusedAttribute">

<activity
android:name=".SampleTimesSquareActivity"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
import static android.widget.Toast.LENGTH_SHORT;

public class SampleTimesSquareActivity extends Activity {
private static final String TAG = "SampleTimesSquareActivity";
private static final String TAG = "SampleTimesSquareActivi";
private CalendarPickerView calendar;
private AlertDialog theDialog;
private CalendarPickerView dialogView;
Expand Down
18 changes: 9 additions & 9 deletions sample/src/main/res/layout/sample_calendar_picker.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,50 +20,50 @@
android:id="@+id/button_single"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Single"
android:text="@string/Single"
android:enabled="false"/>

<Button
android:id="@+id/button_multi"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Multi"/>
android:text="@string/Multi"/>

<Button
android:id="@+id/button_range"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Range"/>
android:text="@string/Range"/>

<Button
android:id="@+id/button_display_only"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="DisplayOnly"/>
android:text="@string/DisplayOnly"/>

<Button
android:id="@+id/button_dialog"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Dialog"/>
android:text="@string/Dialog"/>

<Button
android:id="@+id/button_customized"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Customized"/>
android:text="@string/Customized"/>

<Button
android:id="@+id/button_decorator"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Decorator"/>
android:text="@string/Decorator"/>

<Button
android:id="@+id/button_rtl"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="RTL"/>
android:text="@string/RTL"/>
</LinearLayout>
</HorizontalScrollView>

Expand All @@ -83,6 +83,6 @@
android:id="@+id/done_button"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Done"
android:text="@string/Done"
/>
</LinearLayout>
9 changes: 9 additions & 0 deletions sample/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="app_name">TimesSquare Sample</string>
<string name="Done">Done</string>
<string name="Customized">Customized</string>
<string name="Decorator">Decorator</string>
<string name="RTL">RTL</string>
<string name="Dialog">Dialog</string>
<string name="DisplayOnly">DisplayOnly</string>
<string name="Range">Range</string>
<string name="Multi">Multi</string>
<string name="Single">Single</string>
</resources>

0 comments on commit 4841fa2

Please sign in to comment.