Skip to content

Commit

Permalink
Moved listview, added padding to listview, fixed colouring issue
Browse files Browse the repository at this point in the history
[Ref]: Moved the listview into its own file for easier maintaince
[Fix][Mod]: Added vertical padding to bottom of listview & fixed
flashing listview issue in 2.3.3
  • Loading branch information
iamovrhere committed Nov 4, 2014
1 parent 086e2ec commit e7515bd
Show file tree
Hide file tree
Showing 6 changed files with 48 additions and 12 deletions.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 3 additions & 2 deletions res/layout-w720dp/fragment_main.xml
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,11 @@
android:layout_marginRight="@dimen/activity_horizontal_margin"
/>

<ListView android:id="@+id/currConv_main_listView"
<include android:id="@+id/currConv_main_listView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1.0"
android:cacheColorHint="@color/currconv_listFade"

layout="@layout/viewstub_currency_listview"
/>
</LinearLayout>
5 changes: 3 additions & 2 deletions res/layout-xlarge/fragment_main.xml
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,11 @@
android:layout_marginRight="@dimen/activity_horizontal_margin"
/>

<ListView android:id="@+id/currConv_main_listView"
<include android:id="@+id/currConv_main_listView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1.0"
android:cacheColorHint="@color/currconv_listFade"

layout="@layout/viewstub_currency_listview"
/>
</LinearLayout>
11 changes: 6 additions & 5 deletions res/layout/fragment_main.xml
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,11 @@
android:layout_marginLeft="@dimen/activity_horizontal_margin"
android:layout_marginRight="@dimen/activity_horizontal_margin"
/>

<ListView android:id="@+id/currConv_main_listView"
android:layout_width="match_parent"
<include android:id="@+id/currConv_main_listView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/currConv_main_listView_topPadding"
android:cacheColorHint="@color/currconv_listFade" />

layout="@layout/viewstub_currency_listview"
/>
</LinearLayout>
32 changes: 32 additions & 0 deletions res/layout/viewstub_currency_listview.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright 2014 Jason J.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<!-- "footerDividersEnabled" + "clipToPadding" allows for better padding
of the last element. The fadingEdge needs to be removed because
a) it is not "used" as expected because b) it overlaps the bottom elements
(likely due to "clipToPadding" being false) -->
<ListView xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/currConv_main_listView_topPadding"

android:footerDividersEnabled="false"
android:clipToPadding="false"
android:fadingEdge="none"
android:paddingBottom="@dimen/activity_vertical_margin"

android:cacheColorHint="@android:color/transparent"
/>
7 changes: 4 additions & 3 deletions res/values/colors.xml
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,15 @@
<resources>
<!-- The approximation of black for this project. -->
<color name="currConv_black">#080808</color>
<!-- The dark grey for this project -->
<color name="currConv_darkgrey">#888888</color>

<!-- Background color -->
<color name="currconv_background">#e8f6f7</color>
<!-- Action bar color -->
<!-- <color name="currConv_actionBar">#BAE6EA</color> -->
<color name="currconv_actionBar">#333</color>
<!-- List fade color -->
<color name="currconv_listFade">@color/currconv_background</color>


<!-- The colour used for warnings. -->
<color name="currconv_warningColor">#aa1111</color>
Expand All @@ -34,5 +35,5 @@
<color name="currconv_outputEven">#99c6f1f4</color>
<!-- Currency output list colours: The colour for odd rows.
Starting in first row. Transparent-->
<color name="currconv_outputOdd">#0fff</color>
<color name="currconv_outputOdd">@android:color/transparent</color>
</resources>

0 comments on commit e7515bd

Please sign in to comment.