浏览代码

Made a few views in layouts focusable

Aidan Follestad 8 年之前
父节点
当前提交
3ff6475e92
共有 25 个文件被更改,包括 196 次插入154 次删除
  1. 1 1
      commons/src/main/res/layout/md_preference_custom.xml
  2. 6 3
      commons/src/main/res/layout/md_simplelist_item.xml
  3. 25 16
      commons/src/main/res/layout/md_stub_colorchooser_custom.xml
  4. 3 2
      commons/src/main/res/layout/md_stub_colorchooser_grid.xml
  5. 13 10
      commons/src/main/res/layout/md_stub_inputpref.xml
  6. 10 10
      core/src/main/res/layout/md_dialog_basic.xml
  7. 8 5
      core/src/main/res/layout/md_dialog_basic_check.xml
  8. 3 3
      core/src/main/res/layout/md_dialog_custom.xml
  9. 9 6
      core/src/main/res/layout/md_dialog_input.xml
  10. 10 7
      core/src/main/res/layout/md_dialog_input_check.xml
  11. 13 13
      core/src/main/res/layout/md_dialog_list.xml
  12. 16 14
      core/src/main/res/layout/md_dialog_list_check.xml
  13. 10 10
      core/src/main/res/layout/md_dialog_progress.xml
  14. 7 7
      core/src/main/res/layout/md_dialog_progress_indeterminate.xml
  15. 3 3
      core/src/main/res/layout/md_dialog_progress_indeterminate_horizontal.xml
  16. 5 2
      core/src/main/res/layout/md_listitem.xml
  17. 6 3
      core/src/main/res/layout/md_listitem_multichoice.xml
  18. 6 3
      core/src/main/res/layout/md_listitem_singlechoice.xml
  19. 4 4
      core/src/main/res/layout/md_stub_actionbuttons.xml
  20. 21 20
      core/src/main/res/layout/md_stub_progress.xml
  21. 4 3
      core/src/main/res/layout/md_stub_progress_indeterminate.xml
  22. 4 3
      core/src/main/res/layout/md_stub_progress_indeterminate_horizontal.xml
  23. 4 3
      core/src/main/res/layout/md_stub_titleframe.xml
  24. 4 3
      core/src/main/res/layout/md_stub_titleframe_lesspadding.xml
  25. 1 0
      core/src/main/res/values/styles.xml

+ 1 - 1
commons/src/main/res/layout/md_preference_custom.xml

@@ -41,7 +41,7 @@
             android:ellipsize="marquee"
             android:fadingEdge="horizontal"
             android:fontFamily="sans-serif"
-            android:singleLine="true"
+            android:lines="1"
             android:textColor="?android:textColorPrimary"
             android:textSize="16sp"
             tools:text="Title" />

+ 6 - 3
commons/src/main/res/layout/md_simplelist_item.xml

@@ -1,9 +1,12 @@
 <?xml version="1.0" encoding="utf-8"?>
-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+<LinearLayout
+    xmlns:android="http://schemas.android.com/apk/res/android"
     xmlns:tools="http://schemas.android.com/tools"
     android:layout_width="match_parent"
     android:layout_height="wrap_content"
     android:background="?selectableItemBackground"
+    android:focusable="true"
+    android:focusableInTouchMode="true"
     android:gravity="start|center_vertical"
     android:minHeight="@dimen/md_simpleitem_height"
     android:orientation="horizontal"
@@ -22,7 +25,7 @@
         android:background="@drawable/gray_circle"
         android:scaleType="fitXY"
         tools:background="#f5f5f5"
-        tools:ignore="ContentDescription" />
+        tools:ignore="ContentDescription"/>
 
     <TextView
         android:id="@android:id/title"
@@ -30,6 +33,6 @@
         android:layout_height="wrap_content"
         android:layout_gravity="center_vertical"
         android:textSize="@dimen/md_simplelist_textsize"
-        tools:text="Title" />
+        tools:text="Title"/>
 
 </LinearLayout>

+ 25 - 16
commons/src/main/res/layout/md_stub_colorchooser_custom.xml

@@ -1,5 +1,6 @@
 <?xml version="1.0" encoding="utf-8"?>
-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+<LinearLayout
+    xmlns:android="http://schemas.android.com/apk/res/android"
     xmlns:tools="http://schemas.android.com/tools"
     android:id="@+id/md_colorChooserCustomFrame"
     android:layout_width="match_parent"
@@ -12,7 +13,7 @@
         android:id="@+id/md_colorIndicator"
         android:layout_width="match_parent"
         android:layout_height="120dp"
-        tools:background="@color/md_material_blue_600" />
+        tools:background="@color/md_material_blue_600"/>
 
     <LinearLayout
         android:layout_width="match_parent"
@@ -31,16 +32,18 @@
             android:textColor="?android:textColorPrimary"
             android:textColorHint="?android:textColorSecondary"
             android:textSize="@dimen/md_title_textsize"
-            tools:ignore="HardcodedText,TextViewEdits" />
+            tools:ignore="HardcodedText,TextViewEdits"/>
 
         <EditText
             android:id="@+id/md_hexInput"
             android:layout_width="wrap_content"
             android:layout_height="wrap_content"
             android:digits="0123456789abcdefABCDEF"
+            android:focusable="true"
+            android:focusableInTouchMode="true"
             android:hint="FF0099CC"
             android:textSize="@dimen/md_title_textsize"
-            tools:ignore="HardcodedText" />
+            tools:ignore="HardcodedText"/>
 
     </LinearLayout>
 
@@ -64,7 +67,7 @@
             android:text="A"
             android:textColor="?android:textColorPrimary"
             android:textSize="@dimen/md_content_textsize"
-            tools:ignore="HardcodedText" />
+            tools:ignore="HardcodedText"/>
 
         <SeekBar
             android:id="@+id/md_colorA"
@@ -75,7 +78,9 @@
             android:layout_toLeftOf="@+id/md_colorAValue"
             android:layout_toRightOf="@+id/md_colorALabel"
             android:layout_toStartOf="@+id/md_colorAValue"
-            android:max="255" />
+            android:focusable="true"
+            android:focusableInTouchMode="true"
+            android:max="255"/>
 
         <TextView
             android:id="@+id/md_colorAValue"
@@ -92,7 +97,7 @@
             android:text="0"
             android:textColor="?android:textColorPrimary"
             android:textSize="@dimen/md_content_textsize"
-            tools:ignore="HardcodedText" />
+            tools:ignore="HardcodedText"/>
 
         <!-- Red -->
 
@@ -107,7 +112,7 @@
             android:text="R"
             android:textColor="?android:textColorPrimary"
             android:textSize="@dimen/md_content_textsize"
-            tools:ignore="HardcodedText" />
+            tools:ignore="HardcodedText"/>
 
         <SeekBar
             android:id="@+id/md_colorR"
@@ -119,7 +124,9 @@
             android:layout_toLeftOf="@+id/md_colorRValue"
             android:layout_toRightOf="@+id/md_colorRLabel"
             android:layout_toStartOf="@+id/md_colorRValue"
-            android:max="255" />
+            android:focusable="true"
+            android:focusableInTouchMode="true"
+            android:max="255"/>
 
         <TextView
             android:id="@+id/md_colorRValue"
@@ -136,7 +143,7 @@
             android:text="0"
             android:textColor="?android:textColorPrimary"
             android:textSize="@dimen/md_content_textsize"
-            tools:ignore="HardcodedText" />
+            tools:ignore="HardcodedText"/>
 
         <!-- Green -->
 
@@ -151,7 +158,7 @@
             android:text="G"
             android:textColor="?android:textColorPrimary"
             android:textSize="@dimen/md_content_textsize"
-            tools:ignore="HardcodedText" />
+            tools:ignore="HardcodedText"/>
 
         <SeekBar
             android:id="@+id/md_colorG"
@@ -163,7 +170,9 @@
             android:layout_toLeftOf="@+id/md_colorGValue"
             android:layout_toRightOf="@+id/md_colorGLabel"
             android:layout_toStartOf="@+id/md_colorGValue"
-            android:max="255" />
+            android:focusable="true"
+            android:focusableInTouchMode="true"
+            android:max="255"/>
 
         <TextView
             android:id="@+id/md_colorGValue"
@@ -180,7 +189,7 @@
             android:text="0"
             android:textColor="?android:textColorPrimary"
             android:textSize="@dimen/md_content_textsize"
-            tools:ignore="HardcodedText" />
+            tools:ignore="HardcodedText"/>
 
         <!-- Blue -->
 
@@ -195,7 +204,7 @@
             android:text="B"
             android:textColor="?android:textColorPrimary"
             android:textSize="@dimen/md_content_textsize"
-            tools:ignore="HardcodedText" />
+            tools:ignore="HardcodedText"/>
 
         <SeekBar
             android:id="@+id/md_colorB"
@@ -207,7 +216,7 @@
             android:layout_toLeftOf="@+id/md_colorBValue"
             android:layout_toRightOf="@+id/md_colorBLabel"
             android:layout_toStartOf="@+id/md_colorBValue"
-            android:max="255" />
+            android:max="255"/>
 
         <TextView
             android:id="@+id/md_colorBValue"
@@ -224,7 +233,7 @@
             android:text="0"
             android:textColor="?android:textColorPrimary"
             android:textSize="@dimen/md_content_textsize"
-            tools:ignore="HardcodedText" />
+            tools:ignore="HardcodedText"/>
 
     </RelativeLayout>
 

+ 3 - 2
commons/src/main/res/layout/md_stub_colorchooser_grid.xml

@@ -1,5 +1,6 @@
 <?xml version="1.0" encoding="utf-8"?>
-<com.afollestad.materialdialogs.color.FillGridView xmlns:android="http://schemas.android.com/apk/res/android"
+<com.afollestad.materialdialogs.color.FillGridView
+    xmlns:android="http://schemas.android.com/apk/res/android"
     android:id="@+id/md_grid"
     android:layout_width="match_parent"
     android:layout_height="match_parent"
@@ -11,4 +12,4 @@
     android:orientation="vertical"
     android:padding="16dp"
     android:stretchMode="columnWidth"
-    android:verticalSpacing="8dp" />
+    android:verticalSpacing="8dp"/>

+ 13 - 10
commons/src/main/res/layout/md_stub_inputpref.xml

@@ -1,27 +1,30 @@
 <?xml version="1.0" encoding="utf-8"?>
-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+<LinearLayout
+    xmlns:android="http://schemas.android.com/apk/res/android"
     xmlns:tools="http://schemas.android.com/tools"
-    android:orientation="vertical"
     android:layout_width="match_parent"
     android:layout_height="match_parent"
     android:gravity="start"
+    android:orientation="vertical"
+    android:paddingBottom="@dimen/md_content_padding_bottom"
     android:paddingLeft="@dimen/md_dialog_frame_margin"
     android:paddingRight="@dimen/md_dialog_frame_margin"
-    android:paddingTop="@dimen/md_content_padding_top"
-    android:paddingBottom="@dimen/md_content_padding_bottom">
+    android:paddingTop="@dimen/md_content_padding_top">
 
     <TextView
         android:id="@android:id/message"
         android:layout_width="match_parent"
         android:layout_height="wrap_content"
-        android:fontFamily="sans-serif"
-        android:textSize="@dimen/md_content_textsize"
-        android:layout_marginTop="4dp"
+        android:layout_gravity="center_horizontal"
         android:layout_marginBottom="@dimen/md_content_padding_bottom"
+        android:layout_marginTop="4dp"
+        android:focusable="true"
+        android:focusableInTouchMode="true"
+        android:fontFamily="sans-serif"
         android:paddingLeft="2dp"
         android:paddingRight="2dp"
-        tools:text="Message"
-        android:layout_gravity="center_horizontal"
-        tools:ignore="UnusedAttribute" />
+        android:textSize="@dimen/md_content_textsize"
+        tools:ignore="UnusedAttribute"
+        tools:text="Message"/>
 
 </LinearLayout>

+ 10 - 10
core/src/main/res/layout/md_dialog_basic.xml

@@ -1,21 +1,21 @@
 <com.afollestad.materialdialogs.internal.MDRootLayout
-    android:orientation="vertical"
+    xmlns:android="http://schemas.android.com/apk/res/android"
+    xmlns:app="http://schemas.android.com/apk/res-auto"
+    xmlns:tools="http://schemas.android.com/tools"
     android:layout_width="match_parent"
     android:layout_height="wrap_content"
-    app:md_reduce_padding_no_title_no_buttons="false"
-    xmlns:app="http://schemas.android.com/apk/res-auto"
-    xmlns:android="http://schemas.android.com/apk/res/android"
-    xmlns:tools="http://schemas.android.com/tools">
+    android:orientation="vertical"
+    app:md_reduce_padding_no_title_no_buttons="false">
 
-    <include layout="@layout/md_stub_titleframe" />
+    <include layout="@layout/md_stub_titleframe"/>
 
     <ScrollView
         android:id="@+id/md_contentScrollView"
         android:layout_width="match_parent"
         android:layout_height="wrap_content"
         android:clipToPadding="false"
-        android:paddingTop="@dimen/md_content_padding_top"
-        android:paddingBottom="@dimen/md_content_padding_bottom">
+        android:paddingBottom="@dimen/md_content_padding_bottom"
+        android:paddingTop="@dimen/md_content_padding_top">
 
         <TextView
             android:id="@+id/md_content"
@@ -24,10 +24,10 @@
             android:paddingLeft="@dimen/md_dialog_frame_margin"
             android:paddingRight="@dimen/md_dialog_frame_margin"
             android:textSize="@dimen/md_content_textsize"
-            tools:text="Content" />
+            tools:text="Content"/>
 
     </ScrollView>
 
-    <include layout="@layout/md_stub_actionbuttons" />
+    <include layout="@layout/md_stub_actionbuttons"/>
 
 </com.afollestad.materialdialogs.internal.MDRootLayout>

+ 8 - 5
core/src/main/res/layout/md_dialog_basic_check.xml

@@ -1,4 +1,5 @@
-<com.afollestad.materialdialogs.internal.MDRootLayout xmlns:android="http://schemas.android.com/apk/res/android"
+<com.afollestad.materialdialogs.internal.MDRootLayout
+    xmlns:android="http://schemas.android.com/apk/res/android"
     xmlns:app="http://schemas.android.com/apk/res-auto"
     xmlns:tools="http://schemas.android.com/tools"
     android:layout_width="match_parent"
@@ -6,7 +7,7 @@
     android:orientation="vertical"
     app:md_reduce_padding_no_title_no_buttons="false">
 
-    <include layout="@layout/md_stub_titleframe" />
+    <include layout="@layout/md_stub_titleframe"/>
 
     <LinearLayout
         android:layout_width="match_parent"
@@ -29,7 +30,7 @@
                 android:paddingLeft="@dimen/md_dialog_frame_margin"
                 android:paddingRight="@dimen/md_dialog_frame_margin"
                 android:textSize="@dimen/md_content_textsize"
-                tools:text="Content" />
+                tools:text="Content"/>
 
         </ScrollView>
 
@@ -39,10 +40,12 @@
             android:layout_height="wrap_content"
             android:layout_marginLeft="@dimen/md_notitle_vertical_padding"
             android:layout_marginRight="@dimen/md_notitle_vertical_padding"
-            tools:text="Don't ask again" />
+            android:focusable="true"
+            android:focusableInTouchMode="true"
+            tools:text="Don't ask again"/>
 
     </LinearLayout>
 
-    <include layout="@layout/md_stub_actionbuttons" />
+    <include layout="@layout/md_stub_actionbuttons"/>
 
 </com.afollestad.materialdialogs.internal.MDRootLayout>

+ 3 - 3
core/src/main/res/layout/md_dialog_custom.xml

@@ -5,13 +5,13 @@
     android:layout_height="wrap_content"
     android:orientation="vertical">
 
-    <include layout="@layout/md_stub_titleframe" />
+    <include layout="@layout/md_stub_titleframe"/>
 
     <FrameLayout
         android:id="@+id/md_customViewFrame"
         android:layout_width="match_parent"
-        android:layout_height="wrap_content" />
+        android:layout_height="wrap_content"/>
 
-    <include layout="@layout/md_stub_actionbuttons" />
+    <include layout="@layout/md_stub_actionbuttons"/>
 
 </com.afollestad.materialdialogs.internal.MDRootLayout>

+ 9 - 6
core/src/main/res/layout/md_dialog_input.xml

@@ -1,4 +1,5 @@
-<com.afollestad.materialdialogs.internal.MDRootLayout xmlns:android="http://schemas.android.com/apk/res/android"
+<com.afollestad.materialdialogs.internal.MDRootLayout
+    xmlns:android="http://schemas.android.com/apk/res/android"
     xmlns:app="http://schemas.android.com/apk/res-auto"
     xmlns:tools="http://schemas.android.com/tools"
     android:layout_width="match_parent"
@@ -6,7 +7,7 @@
     android:orientation="vertical"
     app:md_reduce_padding_no_title_no_buttons="false">
 
-    <include layout="@layout/md_stub_titleframe" />
+    <include layout="@layout/md_stub_titleframe"/>
 
     <LinearLayout
         android:layout_width="match_parent"
@@ -28,7 +29,7 @@
             android:fontFamily="sans-serif"
             android:textSize="@dimen/md_content_textsize"
             tools:ignore="UnusedAttribute"
-            tools:text="Message" />
+            tools:text="Message"/>
 
         <RelativeLayout
             android:layout_width="match_parent"
@@ -41,8 +42,10 @@
                 android:layout_marginBottom="1dp"
                 android:layout_marginLeft="-2dp"
                 android:layout_marginRight="-2dp"
+                android:focusable="true"
+                android:focusableInTouchMode="true"
                 android:textSize="@dimen/md_content_textsize"
-                tools:ignore="TextFields" />
+                tools:ignore="TextFields"/>
 
             <TextView
                 android:id="@+id/md_minMax"
@@ -59,12 +62,12 @@
                 android:textAlignment="viewEnd"
                 android:textSize="12sp"
                 tools:ignore="RtlSymmetry,UnusedAttribute"
-                tools:text="50/100" />
+                tools:text="50/100"/>
 
         </RelativeLayout>
 
     </LinearLayout>
 
-    <include layout="@layout/md_stub_actionbuttons" />
+    <include layout="@layout/md_stub_actionbuttons"/>
 
 </com.afollestad.materialdialogs.internal.MDRootLayout>

+ 10 - 7
core/src/main/res/layout/md_dialog_input_check.xml

@@ -1,4 +1,5 @@
-<com.afollestad.materialdialogs.internal.MDRootLayout xmlns:android="http://schemas.android.com/apk/res/android"
+<com.afollestad.materialdialogs.internal.MDRootLayout
+    xmlns:android="http://schemas.android.com/apk/res/android"
     xmlns:app="http://schemas.android.com/apk/res-auto"
     xmlns:tools="http://schemas.android.com/tools"
     android:layout_width="match_parent"
@@ -6,7 +7,7 @@
     android:orientation="vertical"
     app:md_reduce_padding_no_title_no_buttons="false">
 
-    <include layout="@layout/md_stub_titleframe" />
+    <include layout="@layout/md_stub_titleframe"/>
 
     <LinearLayout
         android:layout_width="match_parent"
@@ -28,7 +29,7 @@
             android:fontFamily="sans-serif"
             android:textSize="@dimen/md_content_textsize"
             tools:ignore="UnusedAttribute"
-            tools:text="Message" />
+            tools:text="Message"/>
 
         <RelativeLayout
             android:layout_width="match_parent"
@@ -44,7 +45,7 @@
                 android:layout_marginLeft="-2dp"
                 android:layout_marginRight="-2dp"
                 android:textSize="@dimen/md_content_textsize"
-                tools:ignore="TextFields" />
+                tools:ignore="TextFields"/>
 
             <TextView
                 android:id="@+id/md_minMax"
@@ -61,7 +62,7 @@
                 android:textAlignment="viewEnd"
                 android:textSize="12sp"
                 tools:ignore="RtlSymmetry,UnusedAttribute"
-                tools:text="50/100" />
+                tools:text="50/100"/>
 
         </RelativeLayout>
 
@@ -71,10 +72,12 @@
             android:layout_height="wrap_content"
             android:layout_marginLeft="@dimen/md_notitle_vertical_padding_more"
             android:layout_marginRight="@dimen/md_notitle_vertical_padding_more"
-            tools:text="Don't ask again" />
+            android:focusable="true"
+            android:focusableInTouchMode="true"
+            tools:text="Don't ask again"/>
 
     </LinearLayout>
 
-    <include layout="@layout/md_stub_actionbuttons" />
+    <include layout="@layout/md_stub_actionbuttons"/>
 
 </com.afollestad.materialdialogs.internal.MDRootLayout>

+ 13 - 13
core/src/main/res/layout/md_dialog_list.xml

@@ -1,16 +1,16 @@
 <com.afollestad.materialdialogs.internal.MDRootLayout
-    android:orientation="vertical"
+    xmlns:android="http://schemas.android.com/apk/res/android"
+    xmlns:tools="http://schemas.android.com/tools"
     android:layout_width="match_parent"
     android:layout_height="wrap_content"
-    xmlns:android="http://schemas.android.com/apk/res/android"
-    xmlns:tools="http://schemas.android.com/tools">
+    android:orientation="vertical">
 
-    <include layout="@layout/md_stub_titleframe_lesspadding" />
+    <include layout="@layout/md_stub_titleframe_lesspadding"/>
 
     <LinearLayout
-        android:orientation="vertical"
         android:layout_width="match_parent"
-        android:layout_height="match_parent">
+        android:layout_height="match_parent"
+        android:orientation="vertical">
 
         <ScrollView
             android:id="@+id/md_contentScrollView"
@@ -22,12 +22,12 @@
                 android:id="@+id/md_content"
                 android:layout_width="match_parent"
                 android:layout_height="wrap_content"
+                android:paddingBottom="@dimen/md_content_padding_bottom"
                 android:paddingLeft="@dimen/md_dialog_frame_margin"
-                android:paddingTop="@dimen/md_content_padding_top"
                 android:paddingRight="@dimen/md_dialog_frame_margin"
-                android:paddingBottom="@dimen/md_content_padding_bottom"
+                android:paddingTop="@dimen/md_content_padding_top"
                 android:textSize="@dimen/md_content_textsize"
-                tools:text="Content" />
+                tools:text="Content"/>
 
         </ScrollView>
 
@@ -40,16 +40,16 @@
                 android:id="@+id/md_contentRecyclerView"
                 android:layout_width="match_parent"
                 android:layout_height="wrap_content"
-                android:scrollbarStyle="outsideOverlay"
-                android:scrollbars="vertical"
                 android:clipToPadding="false"
+                android:paddingBottom="@dimen/md_content_padding_bottom"
                 android:paddingTop="@dimen/md_content_padding_top"
-                android:paddingBottom="@dimen/md_content_padding_bottom" />
+                android:scrollbarStyle="outsideOverlay"
+                android:scrollbars="vertical"/>
 
         </FrameLayout>
 
     </LinearLayout>
 
-    <include layout="@layout/md_stub_actionbuttons" />
+    <include layout="@layout/md_stub_actionbuttons"/>
 
 </com.afollestad.materialdialogs.internal.MDRootLayout>

+ 16 - 14
core/src/main/res/layout/md_dialog_list_check.xml

@@ -1,16 +1,16 @@
 <com.afollestad.materialdialogs.internal.MDRootLayout
-    android:orientation="vertical"
+    xmlns:android="http://schemas.android.com/apk/res/android"
+    xmlns:tools="http://schemas.android.com/tools"
     android:layout_width="match_parent"
     android:layout_height="wrap_content"
-    xmlns:android="http://schemas.android.com/apk/res/android"
-    xmlns:tools="http://schemas.android.com/tools">
+    android:orientation="vertical">
 
-    <include layout="@layout/md_stub_titleframe_lesspadding" />
+    <include layout="@layout/md_stub_titleframe_lesspadding"/>
 
     <LinearLayout
-        android:orientation="vertical"
         android:layout_width="match_parent"
-        android:layout_height="match_parent">
+        android:layout_height="match_parent"
+        android:orientation="vertical">
 
         <ScrollView
             android:id="@+id/md_contentScrollView"
@@ -22,12 +22,12 @@
                 android:id="@+id/md_content"
                 android:layout_width="match_parent"
                 android:layout_height="wrap_content"
+                android:paddingBottom="@dimen/md_content_padding_bottom"
                 android:paddingLeft="@dimen/md_dialog_frame_margin"
-                android:paddingTop="@dimen/md_content_padding_top"
                 android:paddingRight="@dimen/md_dialog_frame_margin"
-                android:paddingBottom="@dimen/md_content_padding_bottom"
+                android:paddingTop="@dimen/md_content_padding_top"
                 android:textSize="@dimen/md_content_textsize"
-                tools:text="Content" />
+                tools:text="Content"/>
 
         </ScrollView>
 
@@ -40,11 +40,11 @@
                 android:id="@+id/md_contentRecyclerView"
                 android:layout_width="match_parent"
                 android:layout_height="wrap_content"
-                android:scrollbarStyle="outsideOverlay"
-                android:scrollbars="vertical"
                 android:clipToPadding="false"
+                android:paddingBottom="@dimen/md_content_padding_bottom"
                 android:paddingTop="@dimen/md_content_padding_top"
-                android:paddingBottom="@dimen/md_content_padding_bottom" />
+                android:scrollbarStyle="outsideOverlay"
+                android:scrollbars="vertical"/>
 
         </FrameLayout>
 
@@ -54,10 +54,12 @@
             android:layout_height="wrap_content"
             android:layout_marginLeft="@dimen/md_notitle_vertical_padding"
             android:layout_marginRight="@dimen/md_notitle_vertical_padding"
-            tools:text="Don't ask again" />
+            android:focusable="true"
+            android:focusableInTouchMode="true"
+            tools:text="Don't ask again"/>
 
     </LinearLayout>
 
-    <include layout="@layout/md_stub_actionbuttons" />
+    <include layout="@layout/md_stub_actionbuttons"/>
 
 </com.afollestad.materialdialogs.internal.MDRootLayout>

+ 10 - 10
core/src/main/res/layout/md_dialog_progress.xml

@@ -1,27 +1,27 @@
 <com.afollestad.materialdialogs.internal.MDRootLayout
-    android:orientation="vertical"
+    xmlns:android="http://schemas.android.com/apk/res/android"
+    xmlns:app="http://schemas.android.com/apk/res-auto"
     android:layout_width="match_parent"
     android:layout_height="wrap_content"
-    app:md_reduce_padding_no_title_no_buttons="false"
-    xmlns:android="http://schemas.android.com/apk/res/android"
-    xmlns:app="http://schemas.android.com/apk/res-auto">
+    android:orientation="vertical"
+    app:md_reduce_padding_no_title_no_buttons="false">
 
-    <include layout="@layout/md_stub_titleframe" />
+    <include layout="@layout/md_stub_titleframe"/>
 
     <LinearLayout
-        android:orientation="vertical"
         android:layout_width="match_parent"
         android:layout_height="wrap_content"
         android:layout_weight="1"
+        android:orientation="vertical"
+        android:paddingBottom="@dimen/md_content_padding_bottom"
         android:paddingLeft="@dimen/md_dialog_frame_margin"
         android:paddingRight="@dimen/md_dialog_frame_margin"
-        android:paddingTop="@dimen/md_content_padding_top"
-        android:paddingBottom="@dimen/md_content_padding_bottom">
+        android:paddingTop="@dimen/md_content_padding_top">
 
-        <include layout="@layout/md_stub_progress" />
+        <include layout="@layout/md_stub_progress"/>
 
     </LinearLayout>
 
-    <include layout="@layout/md_stub_actionbuttons" />
+    <include layout="@layout/md_stub_actionbuttons"/>
 
 </com.afollestad.materialdialogs.internal.MDRootLayout>

+ 7 - 7
core/src/main/res/layout/md_dialog_progress_indeterminate.xml

@@ -1,15 +1,15 @@
 <com.afollestad.materialdialogs.internal.MDRootLayout
-    android:orientation="vertical"
+    xmlns:android="http://schemas.android.com/apk/res/android"
+    xmlns:app="http://schemas.android.com/apk/res-auto"
     android:layout_width="match_parent"
     android:layout_height="wrap_content"
-    app:md_reduce_padding_no_title_no_buttons="false"
-    xmlns:android="http://schemas.android.com/apk/res/android"
-    xmlns:app="http://schemas.android.com/apk/res-auto">
+    android:orientation="vertical"
+    app:md_reduce_padding_no_title_no_buttons="false">
 
-    <include layout="@layout/md_stub_titleframe" />
+    <include layout="@layout/md_stub_titleframe"/>
 
-    <include layout="@layout/md_stub_progress_indeterminate" />
+    <include layout="@layout/md_stub_progress_indeterminate"/>
 
-    <include layout="@layout/md_stub_actionbuttons" />
+    <include layout="@layout/md_stub_actionbuttons"/>
 
 </com.afollestad.materialdialogs.internal.MDRootLayout>

+ 3 - 3
core/src/main/res/layout/md_dialog_progress_indeterminate_horizontal.xml

@@ -6,7 +6,7 @@
     android:orientation="vertical"
     app:md_reduce_padding_no_title_no_buttons="false">
 
-    <include layout="@layout/md_stub_titleframe" />
+    <include layout="@layout/md_stub_titleframe"/>
 
     <LinearLayout
         android:layout_width="match_parent"
@@ -18,10 +18,10 @@
         android:paddingRight="@dimen/md_dialog_frame_margin"
         android:paddingTop="@dimen/md_content_padding_top">
 
-        <include layout="@layout/md_stub_progress_indeterminate_horizontal" />
+        <include layout="@layout/md_stub_progress_indeterminate_horizontal"/>
 
     </LinearLayout>
 
-    <include layout="@layout/md_stub_actionbuttons" />
+    <include layout="@layout/md_stub_actionbuttons"/>
 
 </com.afollestad.materialdialogs.internal.MDRootLayout>

+ 5 - 2
core/src/main/res/layout/md_listitem.xml

@@ -1,8 +1,11 @@
-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+<LinearLayout
+    xmlns:android="http://schemas.android.com/apk/res/android"
     xmlns:tools="http://schemas.android.com/tools"
     android:layout_width="match_parent"
     android:layout_height="wrap_content"
     android:background="?selectableItemBackground"
+    android:focusable="true"
+    android:focusableInTouchMode="true"
     android:gravity="center_vertical|start"
     android:minHeight="@dimen/md_listitem_height"
     android:orientation="horizontal">
@@ -20,6 +23,6 @@
         android:paddingBottom="@dimen/md_listitem_vertical_margin"
         android:paddingTop="@dimen/md_listitem_vertical_margin"
         android:textSize="@dimen/md_listitem_textsize"
-        tools:text="Item" />
+        tools:text="Item"/>
 
 </LinearLayout>

+ 6 - 3
core/src/main/res/layout/md_listitem_multichoice.xml

@@ -1,9 +1,12 @@
-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+<LinearLayout
+    xmlns:android="http://schemas.android.com/apk/res/android"
     xmlns:tools="http://schemas.android.com/tools"
     android:layout_width="match_parent"
     android:layout_height="wrap_content"
     android:background="?selectableItemBackground"
     android:descendantFocusability="blocksDescendants"
+    android:focusable="true"
+    android:focusableInTouchMode="true"
     android:minHeight="@dimen/md_listitem_height"
     android:orientation="horizontal"
     android:paddingEnd="@dimen/md_dialog_frame_margin"
@@ -20,7 +23,7 @@
         android:clickable="false"
         android:focusable="false"
         android:focusableInTouchMode="false"
-        android:gravity="center_vertical" />
+        android:gravity="center_vertical"/>
 
     <TextView
         android:id="@+id/md_title"
@@ -34,6 +37,6 @@
         android:paddingTop="@dimen/md_listitem_vertical_margin_choice"
         android:textSize="@dimen/md_listitem_textsize"
         tools:ignore="NewApi,RtlSymmetry"
-        tools:text="Item" />
+        tools:text="Item"/>
 
 </LinearLayout>

+ 6 - 3
core/src/main/res/layout/md_listitem_singlechoice.xml

@@ -1,9 +1,12 @@
-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+<LinearLayout
+    xmlns:android="http://schemas.android.com/apk/res/android"
     xmlns:tools="http://schemas.android.com/tools"
     android:layout_width="match_parent"
     android:layout_height="wrap_content"
     android:background="?selectableItemBackground"
     android:descendantFocusability="blocksDescendants"
+    android:focusable="true"
+    android:focusableInTouchMode="true"
     android:minHeight="@dimen/md_listitem_height"
     android:orientation="horizontal"
     android:paddingEnd="@dimen/md_dialog_frame_margin"
@@ -20,7 +23,7 @@
         android:clickable="false"
         android:focusable="false"
         android:focusableInTouchMode="false"
-        android:gravity="center_vertical" />
+        android:gravity="center_vertical"/>
 
     <TextView
         android:id="@+id/md_title"
@@ -34,6 +37,6 @@
         android:paddingTop="@dimen/md_listitem_vertical_margin_choice"
         android:textSize="@dimen/md_listitem_textsize"
         tools:ignore="NewApi,RtlSymmetry"
-        tools:text="Item" />
+        tools:text="Item"/>
 
 </LinearLayout>

+ 4 - 4
core/src/main/res/layout/md_stub_actionbuttons.xml

@@ -1,23 +1,23 @@
 <merge xmlns:android="http://schemas.android.com/apk/res/android"
-    xmlns:tools="http://schemas.android.com/tools">
+       xmlns:tools="http://schemas.android.com/tools">
 
     <com.afollestad.materialdialogs.internal.MDButton
         android:id="@+id/md_buttonDefaultNeutral"
         style="@style/MD_ActionButton.Text"
-        tools:text="Neutral" />
+        tools:text="Neutral"/>
 
     <com.afollestad.materialdialogs.internal.MDButton
         android:id="@+id/md_buttonDefaultNegative"
         style="@style/MD_ActionButton.Text"
         tools:layout_alignParentLeft="true"
         tools:layout_alignParentStart="true"
-        tools:text="Negative" />
+        tools:text="Negative"/>
 
     <com.afollestad.materialdialogs.internal.MDButton
         android:id="@+id/md_buttonDefaultPositive"
         style="@style/MD_ActionButton.Text"
         tools:layout_alignParentLeft="true"
         tools:layout_alignParentStart="true"
-        tools:text="Positive" />
+        tools:text="Positive"/>
 
 </merge>

+ 21 - 20
core/src/main/res/layout/md_stub_progress.xml

@@ -1,5 +1,6 @@
 <?xml version="1.0" encoding="utf-8"?>
-<merge xmlns:android="http://schemas.android.com/apk/res/android"
+<merge
+    xmlns:android="http://schemas.android.com/apk/res/android"
     xmlns:tools="http://schemas.android.com/tools"
     tools:ignore="UnusedAttribute">
 
@@ -7,12 +8,12 @@
         android:id="@+id/md_content"
         android:layout_width="match_parent"
         android:layout_height="wrap_content"
+        android:layout_gravity="center_horizontal"
+        android:layout_marginBottom="20dp"
+        android:layout_marginTop="4dp"
         android:fontFamily="sans-serif"
         android:textSize="@dimen/md_content_textsize"
-        android:layout_marginTop="4dp"
-        android:layout_marginBottom="20dp"
-        tools:text="Message"
-        android:layout_gravity="center_horizontal" />
+        tools:text="Message"/>
 
     <RelativeLayout
         android:layout_width="match_parent"
@@ -20,37 +21,37 @@
 
         <ProgressBar
             android:id="@android:id/progress"
+            style="?android:progressBarStyleHorizontal"
             android:layout_width="match_parent"
             android:layout_height="wrap_content"
-            style="?android:progressBarStyleHorizontal"
-            android:paddingBottom="2dp" />
+            android:paddingBottom="2dp"/>
 
         <TextView
             android:id="@+id/md_label"
             android:layout_width="wrap_content"
             android:layout_height="wrap_content"
-            android:minWidth="36dp"
-            tools:text="100%"
-            android:textStyle="bold"
-            android:textSize="@dimen/md_content_textsize"
-            android:gravity="start"
-            android:textAlignment="viewStart"
             android:layout_alignLeft="@android:id/progress"
             android:layout_alignStart="@android:id/progress"
-            android:layout_below="@android:id/progress" />
+            android:layout_below="@android:id/progress"
+            android:gravity="start"
+            android:minWidth="36dp"
+            android:textAlignment="viewStart"
+            android:textSize="@dimen/md_content_textsize"
+            android:textStyle="bold"
+            tools:text="100%"/>
 
         <TextView
             android:id="@+id/md_minMax"
             android:layout_width="wrap_content"
             android:layout_height="wrap_content"
-            android:minWidth="48dp"
-            tools:text="100%"
-            android:textSize="@dimen/md_content_textsize"
+            android:layout_alignEnd="@android:id/progress"
+            android:layout_alignRight="@android:id/progress"
+            android:layout_below="@android:id/progress"
             android:gravity="end"
+            android:minWidth="48dp"
             android:textAlignment="viewEnd"
-            android:layout_alignRight="@android:id/progress"
-            android:layout_alignEnd="@android:id/progress"
-            android:layout_below="@android:id/progress" />
+            android:textSize="@dimen/md_content_textsize"
+            tools:text="100%"/>
 
     </RelativeLayout>
 

+ 4 - 3
core/src/main/res/layout/md_stub_progress_indeterminate.xml

@@ -1,5 +1,6 @@
 <?xml version="1.0" encoding="utf-8"?>
-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+<LinearLayout
+    xmlns:android="http://schemas.android.com/apk/res/android"
     xmlns:tools="http://schemas.android.com/tools"
     android:layout_width="match_parent"
     android:layout_height="wrap_content"
@@ -14,7 +15,7 @@
         android:id="@android:id/progress"
         android:layout_width="wrap_content"
         android:layout_height="wrap_content"
-        android:indeterminate="true" />
+        android:indeterminate="true"/>
 
     <TextView
         android:id="@+id/md_content"
@@ -27,6 +28,6 @@
         android:textAlignment="viewStart"
         android:textSize="@dimen/md_content_textsize"
         tools:ignore="NewApi,RtlSymmetry,UnusedAttribute"
-        tools:text="Message" />
+        tools:text="Message"/>
 
 </LinearLayout>

+ 4 - 3
core/src/main/res/layout/md_stub_progress_indeterminate_horizontal.xml

@@ -1,5 +1,6 @@
 <?xml version="1.0" encoding="utf-8"?>
-<merge xmlns:android="http://schemas.android.com/apk/res/android"
+<merge
+    xmlns:android="http://schemas.android.com/apk/res/android"
     xmlns:tools="http://schemas.android.com/tools"
     tools:ignore="UnusedAttribute">
 
@@ -12,13 +13,13 @@
         android:layout_marginTop="4dp"
         android:fontFamily="sans-serif"
         android:textSize="@dimen/md_content_textsize"
-        tools:text="Message" />
+        tools:text="Message"/>
 
     <ProgressBar
         android:id="@android:id/progress"
         style="?android:progressBarStyleHorizontal"
         android:layout_width="match_parent"
         android:layout_height="wrap_content"
-        android:paddingBottom="2dp" />
+        android:paddingBottom="2dp"/>
 
 </merge>

+ 4 - 3
core/src/main/res/layout/md_stub_titleframe.xml

@@ -1,4 +1,5 @@
-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+<LinearLayout
+    xmlns:android="http://schemas.android.com/apk/res/android"
     xmlns:tools="http://schemas.android.com/tools"
     android:id="@+id/md_titleFrame"
     android:layout_width="match_parent"
@@ -17,13 +18,13 @@
         android:layout_marginEnd="@dimen/md_icon_margin"
         android:layout_marginRight="@dimen/md_icon_margin"
         android:scaleType="fitXY"
-        tools:ignore="ContentDescription" />
+        tools:ignore="ContentDescription"/>
 
     <TextView
         android:id="@+id/md_title"
         android:layout_width="match_parent"
         android:layout_height="wrap_content"
         android:textSize="@dimen/md_title_textsize"
-        tools:text="Title" />
+        tools:text="Title"/>
 
 </LinearLayout>

+ 4 - 3
core/src/main/res/layout/md_stub_titleframe_lesspadding.xml

@@ -1,4 +1,5 @@
-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+<LinearLayout
+    xmlns:android="http://schemas.android.com/apk/res/android"
     xmlns:tools="http://schemas.android.com/tools"
     android:id="@+id/md_titleFrame"
     android:layout_width="match_parent"
@@ -17,13 +18,13 @@
         android:layout_marginEnd="@dimen/md_icon_margin"
         android:layout_marginRight="@dimen/md_icon_margin"
         android:scaleType="fitXY"
-        tools:ignore="ContentDescription" />
+        tools:ignore="ContentDescription"/>
 
     <TextView
         android:id="@+id/md_title"
         android:layout_width="match_parent"
         android:layout_height="wrap_content"
         android:textSize="@dimen/md_title_textsize"
-        tools:text="Title" />
+        tools:text="Title"/>
 
 </LinearLayout>

+ 1 - 0
core/src/main/res/values/styles.xml

@@ -39,6 +39,7 @@
         <item name="android:layout_height">@dimen/md_button_height</item>
         <item name="android:layout_gravity">center_vertical</item>
         <item name="android:focusable">true</item>
+        <item name="android:focusableInTouchMode">true</item>
     </style>
 
     <style name="MD_ActionButton.Text" tools:ignore="NewApi">