properly fix missing cardview padding on 5.0, duh

This commit is contained in:
Andrew Dolgov 2014-11-13 16:18:07 +03:00
parent 876b31b410
commit 25622e2761
7 changed files with 9 additions and 21 deletions

View File

@ -329,14 +329,6 @@ public class HeadlinesFragment extends Fragment implements OnItemClickListener,
ListView list = (ListView)view.findViewById(R.id.headlines_list); ListView list = (ListView)view.findViewById(R.id.headlines_list);
// thanks google
if (android.os.Build.VERSION.SDK_INT <= android.os.Build.VERSION_CODES.KITKAT) {
list.setDividerHeight(0);
int px = m_activity.dpToPx(4);
list.setPadding(px, px, px, px);
}
if (m_prefs.getBoolean("headlines_mark_read_scroll", false)) { if (m_prefs.getBoolean("headlines_mark_read_scroll", false)) {
WindowManager wm = (WindowManager) m_activity.getSystemService(Context.WINDOW_SERVICE); WindowManager wm = (WindowManager) m_activity.getSystemService(Context.WINDOW_SERVICE);
Display display = wm.getDefaultDisplay(); Display display = wm.getDefaultDisplay();

View File

@ -307,14 +307,6 @@ public class OfflineHeadlinesFragment extends Fragment implements OnItemClickLis
ListView list = (ListView)view.findViewById(R.id.headlines_list); ListView list = (ListView)view.findViewById(R.id.headlines_list);
// thanks google
if (android.os.Build.VERSION.SDK_INT <= android.os.Build.VERSION_CODES.KITKAT) {
list.setDividerHeight(0);
int px = m_activity.dpToPx(4);
list.setPadding(px, px, px, px);
}
if (m_prefs.getBoolean("headlines_mark_read_scroll", false)) { if (m_prefs.getBoolean("headlines_mark_read_scroll", false)) {
WindowManager wm = (WindowManager) m_activity.getSystemService(Context.WINDOW_SERVICE); WindowManager wm = (WindowManager) m_activity.getSystemService(Context.WINDOW_SERVICE);
Display display = wm.getDefaultDisplay(); Display display = wm.getDefaultDisplay();

View File

@ -10,12 +10,12 @@
android:layout_height="match_parent" > android:layout_height="match_parent" >
<ListView <ListView
android:padding="8dp" android:padding="4dp"
android:id="@+id/headlines_list" android:id="@+id/headlines_list"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layoutAnimation="@anim/layout_headline" android:layoutAnimation="@anim/layout_headline"
android:dividerHeight="8dp" android:dividerHeight="0dp"
android:divider="@android:color/transparent" android:divider="@null"
android:layout_height="match_parent" > android:layout_height="match_parent" >
</ListView> </ListView>
</android.support.v4.widget.SwipeRefreshLayout> </android.support.v4.widget.SwipeRefreshLayout>

View File

@ -7,6 +7,7 @@
android:layout_width="fill_parent" android:layout_width="fill_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
card_view:cardElevation="2dp" card_view:cardElevation="2dp"
card_view:cardUseCompatPadding="true"
card_view:cardBackgroundColor="?headlineNormalBackground" card_view:cardBackgroundColor="?headlineNormalBackground"
tools:ignore="HardcodedText" > tools:ignore="HardcodedText" >

View File

@ -7,6 +7,7 @@
android:layout_width="fill_parent" android:layout_width="fill_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
card_view:cardElevation="2dp" card_view:cardElevation="2dp"
card_view:cardUseCompatPadding="true"
card_view:cardBackgroundColor="?headlineSelectedBackground" card_view:cardBackgroundColor="?headlineSelectedBackground"
tools:ignore="HardcodedText" > tools:ignore="HardcodedText" >

View File

@ -6,7 +6,8 @@
android:id="@+id/headlines_row" android:id="@+id/headlines_row"
android:layout_width="fill_parent" android:layout_width="fill_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
card_view:cardElevation="2dp" card_view:cardElevation="4dp"
card_view:cardUseCompatPadding="true"
card_view:cardBackgroundColor="?headlineSelectedBackground" card_view:cardBackgroundColor="?headlineSelectedBackground"
tools:ignore="HardcodedText" > tools:ignore="HardcodedText" >

View File

@ -6,7 +6,8 @@
android:id="@+id/headlines_row" android:id="@+id/headlines_row"
android:layout_width="fill_parent" android:layout_width="fill_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
card_view:cardElevation="2dp" card_view:cardElevation="4dp"
card_view:cardUseCompatPadding="true"
card_view:cardBackgroundColor="?headlineUnreadBackground" card_view:cardBackgroundColor="?headlineUnreadBackground"
tools:ignore="HardcodedText" > tools:ignore="HardcodedText" >