Permalink
Browse files

Material design: Use the AppCompat textAppearance styles.

Because that is what this advises:
http://android-developers.blogspot.de/2014/10/implementing-material-design-in-your.html
Though I am not convinced that this is different than using the
normal attr styles such as "?android:attr/textAppearanceLarge".

Along the way, QuestinHelpFragment/fragment_question_help.xml got some textAppearance
styles where it had none.
  • Loading branch information...
murraycu committed Oct 25, 2014
1 parent 658635b commit 89a927707a192f00c3b37d072db50fad78d5c7a0
@@ -499,7 +499,7 @@ private static void insertButtonInRow(final Context context, final TableRow row,
}

private void makeButtonTextSmall(final Activity activity, final Button button) {
button.setTextAppearance(activity, android.R.style.TextAppearance_Small);
button.setTextAppearance(activity, R.style.TextAppearance_AppCompat_Small);

//Set a background color.
//Otherwise we get the default background drawable,
@@ -101,6 +101,7 @@ private void addRowForAnswer(Activity activity, TableLayout tableLayout, Decisio
layoutVertical.setOrientation(LinearLayout.VERTICAL);

final TextView textViewAnswer = new TextView(activity);
textViewAnswer.setTextAppearance(activity, R.style.TextAppearance_AppCompat_Subhead);
textViewAnswer.setText(answer.getText());
layoutVertical.addView(textViewAnswer,
new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT, LinearLayout.LayoutParams.WRAP_CONTENT));
@@ -2,7 +2,7 @@
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/table_detail"
style="?android:attr/textAppearanceLarge"
style="@style/TextAppearance.AppCompat.Large"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:textIsSelectable="true"
@@ -2,7 +2,7 @@
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/table_detail"
style="?android:attr/textAppearanceLarge"
style="@style/TextAppearance.AppCompat.Large"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
@@ -9,15 +9,15 @@
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceMedium"
android:textAppearance="@style/TextAppearance.AppCompat.Medium"
android:text="@string/about_text"
android:id="@+id/textViewAbout"
android:layout_marginBottom="@dimen/activity_vertical_margin" />

<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceMedium"
android:textAppearance="@style/TextAppearance.AppCompat.Medium"
android:id="@+id/textViewVersion" />

</LinearLayout>
@@ -44,7 +44,7 @@
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceLarge"
android:textAppearance="@style/TextAppearance.AppCompat.Title"
android:text="@string/login_hint"
android:id="@+id/textView" />

@@ -75,19 +75,19 @@
android:layout_height="wrap_content"
android:layout_gravity="right|end"
android:text="@string/forgot_password_button_text"
android:textAppearance="?android:attr/textAppearanceMedium" />
android:textAppearance="@style/TextAppearance.AppCompat.Medium" />

<TextView
android:id="@+id/textViewRegister"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="right|end"
android:text="@string/register_button_text"
android:textAppearance="?android:attr/textAppearanceMedium" />
android:textAppearance="@style/TextAppearance.AppCompat.Medium" />

<Button
android:id="@+id/username_sign_in_button"
style="?android:textAppearanceSmall"
style="@style/TextAppearance.AppCompat.Small"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="16dp"
@@ -2,7 +2,7 @@
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/table_detail"
style="?android:attr/textAppearanceLarge"
style="@style/TextAppearance.AppCompat.Large"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:textIsSelectable="true"
@@ -2,7 +2,7 @@
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/table_list"
style="?android:attr/textAppearanceLarge"
style="@style/TextAppearance.AppCompat.Large"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
@@ -2,7 +2,7 @@
<com.murrayc.galaxyzoo.app.QuestionLinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/table_detail"
style="?android:attr/textAppearanceLarge"
style="@style/TextAppearance.AppCompat.Large"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
@@ -13,14 +13,14 @@
android:id="@+id/textViewTitle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceLarge" />
android:textAppearance="@style/TextAppearance.AppCompat.Title" />

<TextView
android:id="@+id/textViewText"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingBottom="@dimen/standard_margin"
android:textAppearance="?android:attr/textAppearanceMedium"
android:textAppearance="@style/TextAppearance.AppCompat.Medium"
android:minLines="2" />

<TableLayout
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
style="?android:attr/textAppearanceLarge"
style="@style/TextAppearance.AppCompat.Large"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:padding="16dp"
@@ -14,7 +14,8 @@
<TextView
android:id="@+id/textView"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
android:layout_height="wrap_content"
android:textAppearance="@style/TextAppearance.AppCompat.Medium" />

<TextView
android:id="@+id/textViewExamples"
@@ -23,7 +24,7 @@
android:layout_below="@+id/textView"
android:layout_marginTop="@dimen/activity_vertical_margin"
android:text="@string/title_examples"
android:textAppearance="?android:attr/textAppearanceMedium"
android:textAppearance="@style/TextAppearance.AppCompat.Title"
android:layout_marginBottom="@dimen/standard_large_margin" />

<TableLayout
@@ -2,7 +2,7 @@
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/table_detail"
style="?android:attr/textAppearanceLarge"
style="@style/TextAppearance.AppCompat.Large"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:textIsSelectable="true"
@@ -2,7 +2,7 @@
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/table_detail"
style="?android:attr/textAppearanceLarge"
style="@style/TextAppearance.AppCompat.Large"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
@@ -23,13 +23,13 @@
android:paddingRight="@dimen/activity_horizontal_margin"
android:singleLine="true"
android:text="@string/title_zooniverse_id"
android:textAppearance="?android:attr/textAppearanceLarge" />
android:textAppearance="@style/TextAppearance.AppCompat.Title" />

<TextView
android:id="@+id/textViewZooniverseId"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceLarge" />
android:textAppearance="@style/TextAppearance.AppCompat.Title" />
</LinearLayout>

<LinearLayout
@@ -2,7 +2,7 @@
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/table_detail"
style="?android:attr/textAppearanceLarge"
style="@style/TextAppearance.AppCompat.Large"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:textIsSelectable="true"
@@ -56,7 +56,7 @@
android:focusableInTouchMode="false"
android:src="@drawable/ic_small_accept"
android:text=""
android:textAppearance="?android:attr/textAppearanceSmall"
android:textAppearance="@style/TextAppearance.AppCompat.Small"
android:layout_gravity="bottom|right|end" />


@@ -71,7 +71,7 @@
android:focusableInTouchMode="false"
android:src="@drawable/ic_small_upload"
android:text=""
android:textAppearance="?android:attr/textAppearanceSmall"
android:textAppearance="@style/TextAppearance.AppCompat.Small"
android:layout_gravity="bottom|right|end" />

<ImageView
@@ -84,7 +84,7 @@
android:focusableInTouchMode="false"
android:src="@drawable/ic_small_favorite"
android:text=""
android:textAppearance="?android:attr/textAppearanceSmall"
android:textAppearance="@style/TextAppearance.AppCompat.Small"
android:layout_gravity="bottom" />
</LinearLayout>

@@ -27,7 +27,7 @@
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceMedium"
android:textAppearance="@style/TextAppearance.AppCompat.Medium"
android:text="@string/progress_loading_text"
android:id="@+id/textViewProgress"
android:layout_gravity="center_horizontal"

0 comments on commit 89a9277

Please sign in to comment.