From 13bb21240d15d87af4008d09e8ab5449fe6af2ef Mon Sep 17 00:00:00 2001 From: Alexey Kulish Date: Sat, 5 Mar 2016 15:20:24 +0300 Subject: [PATCH] Fixed icons in Live Updates reports. Added GridLayout support library --- OsmAnd/build.gradle | 1 + OsmAnd/project.properties | 1 + OsmAnd/res/layout/fragment_reports.xml | 36 ++-- .../plus/liveupdates/ReportsFragment.java | 6 +- eclipse-compile/gridlayout/.classpath | 8 + eclipse-compile/gridlayout/.project | 33 +++ .../gridlayout/AndroidManifest.xml | 20 ++ eclipse-compile/gridlayout/README.txt | 66 ++++++ eclipse-compile/gridlayout/build.gradle | 26 +++ .../libs/android-support-v7-gridlayout.jar | Bin 0 -> 42747 bytes eclipse-compile/gridlayout/project.properties | 15 ++ .../gridlayout/res/values/attrs.xml | 193 ++++++++++++++++++ .../gridlayout/res/values/dimens.xml | 7 + eclipse-compile/gridlayout/src/.readme | 2 + settings.gradle | 1 + 15 files changed, 394 insertions(+), 21 deletions(-) create mode 100644 eclipse-compile/gridlayout/.classpath create mode 100644 eclipse-compile/gridlayout/.project create mode 100644 eclipse-compile/gridlayout/AndroidManifest.xml create mode 100644 eclipse-compile/gridlayout/README.txt create mode 100644 eclipse-compile/gridlayout/build.gradle create mode 100644 eclipse-compile/gridlayout/libs/android-support-v7-gridlayout.jar create mode 100644 eclipse-compile/gridlayout/project.properties create mode 100644 eclipse-compile/gridlayout/res/values/attrs.xml create mode 100644 eclipse-compile/gridlayout/res/values/dimens.xml create mode 100644 eclipse-compile/gridlayout/src/.readme diff --git a/OsmAnd/build.gradle b/OsmAnd/build.gradle index b11b12f844..615f4114b0 100644 --- a/OsmAnd/build.gradle +++ b/OsmAnd/build.gradle @@ -358,6 +358,7 @@ dependencies { compile project(path: ':OsmAnd-java', configuration: 'android') compile project(':eclipse-compile:design') compile project(':eclipse-compile:cardview') + compile project(':eclipse-compile:gridlayout') // compile project(":eclipse-compile:recyclerview") compile fileTree(include: ['*.jar'], exclude: ['QtAndroid-bundled.jar', 'QtAndroidAccessibility-bundled.jar', 'OsmAndCore_android.jar', 'OsmAndCore_wrapper.jar', 'android-support-multidex.jar'], dir: 'libs') // compile "com.github.ksoichiro:android-observablescrollview:1.5.0" diff --git a/OsmAnd/project.properties b/OsmAnd/project.properties index 888b636da6..6129b595fa 100644 --- a/OsmAnd/project.properties +++ b/OsmAnd/project.properties @@ -15,3 +15,4 @@ dex.force.jumbo=true android.library.reference.1=../eclipse-compile/appcompat android.library.reference.2=../eclipse-compile/design android.library.reference.3=../eclipse-compile/cardview +android.library.reference.4=../eclipse-compile/gridlayout diff --git a/OsmAnd/res/layout/fragment_reports.xml b/OsmAnd/res/layout/fragment_reports.xml index 01107fce82..94dee37462 100644 --- a/OsmAnd/res/layout/fragment_reports.xml +++ b/OsmAnd/res/layout/fragment_reports.xml @@ -14,16 +14,16 @@ - + osmand:columnCount="2"> @@ -105,7 +105,7 @@ @@ -115,7 +115,7 @@ style="?android:attr/progressBarStyleHorizontal" android:layout_width="match_parent" android:layout_height="9dp" - android:layout_columnSpan="2" + osmand:layout_columnSpan="2" android:indeterminate="true"/> @@ -153,7 +153,7 @@ + android:src="@drawable/ic_map"/> @@ -192,13 +192,13 @@ android:layout_width="56dp" android:layout_height="60dp" android:scaleType="center" - android:src="@drawable/ic_action_message"/> + android:src="@drawable/ic_action_bitcoin"/> @@ -220,7 +220,7 @@ @@ -254,7 +254,7 @@ android:textColor="?android:textColorPrimary"/> - + diff --git a/OsmAnd/src/net/osmand/plus/liveupdates/ReportsFragment.java b/OsmAnd/src/net/osmand/plus/liveupdates/ReportsFragment.java index b40a9f8bc1..95f1200550 100644 --- a/OsmAnd/src/net/osmand/plus/liveupdates/ReportsFragment.java +++ b/OsmAnd/src/net/osmand/plus/liveupdates/ReportsFragment.java @@ -136,7 +136,7 @@ public class ReportsFragment extends BaseOsmAndFragment implements CountrySelect donationsIcon = (ImageView) view.findViewById(R.id.donationsIcon); setThemedDrawable(numberOfContributorsIcon, R.drawable.ic_group); setThemedDrawable(numberOfRecipientsIcon, R.drawable.ic_group); - setThemedDrawable(donationsIcon, R.drawable.ic_action_message); + setThemedDrawable(donationsIcon, R.drawable.ic_action_bitcoin); setThemedDrawable(numberOfEditsIcon, R.drawable.ic_map); @@ -344,7 +344,7 @@ public class ReportsFragment extends BaseOsmAndFragment implements CountrySelect numberOfContributorsIcon.setImageDrawable(getPaintedContentIcon(R.drawable.ic_group, inactiveColor)); numberOfEditsIcon.setImageDrawable(getPaintedContentIcon(R.drawable.ic_map, inactiveColor)); numberOfRecipientsIcon.setImageDrawable(getPaintedContentIcon(R.drawable.ic_group, inactiveColor)); - donationsIcon.setImageDrawable(getPaintedContentIcon(R.drawable.ic_action_message, inactiveColor)); + donationsIcon.setImageDrawable(getPaintedContentIcon(R.drawable.ic_action_bitcoin, inactiveColor)); numberOfContributorsTitle.setTextColor(inactiveColor); numberOfEditsTitle.setTextColor(inactiveColor); @@ -364,7 +364,7 @@ public class ReportsFragment extends BaseOsmAndFragment implements CountrySelect numberOfContributorsIcon.setImageDrawable(getContentIcon(R.drawable.ic_group)); numberOfEditsIcon.setImageDrawable(getContentIcon(R.drawable.ic_map)); numberOfRecipientsIcon.setImageDrawable(getContentIcon(R.drawable.ic_group)); - donationsIcon.setImageDrawable(getContentIcon(R.drawable.ic_action_message)); + donationsIcon.setImageDrawable(getContentIcon(R.drawable.ic_action_bitcoin)); numberOfContributorsTitle.setTextColor(textColorSecondary); numberOfEditsTitle.setTextColor(textColorSecondary); diff --git a/eclipse-compile/gridlayout/.classpath b/eclipse-compile/gridlayout/.classpath new file mode 100644 index 0000000000..a4763d1eec --- /dev/null +++ b/eclipse-compile/gridlayout/.classpath @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/eclipse-compile/gridlayout/.project b/eclipse-compile/gridlayout/.project new file mode 100644 index 0000000000..1e67516d0d --- /dev/null +++ b/eclipse-compile/gridlayout/.project @@ -0,0 +1,33 @@ + + + android-support-v7-gridlayout + + + + + + com.android.ide.eclipse.adt.ResourceManagerBuilder + + + + + com.android.ide.eclipse.adt.PreCompilerBuilder + + + + + org.eclipse.jdt.core.javabuilder + + + + + com.android.ide.eclipse.adt.ApkBuilder + + + + + + com.android.ide.eclipse.adt.AndroidNature + org.eclipse.jdt.core.javanature + + diff --git a/eclipse-compile/gridlayout/AndroidManifest.xml b/eclipse-compile/gridlayout/AndroidManifest.xml new file mode 100644 index 0000000000..97f7be8d2c --- /dev/null +++ b/eclipse-compile/gridlayout/AndroidManifest.xml @@ -0,0 +1,20 @@ + + + + + + diff --git a/eclipse-compile/gridlayout/README.txt b/eclipse-compile/gridlayout/README.txt new file mode 100644 index 0000000000..a67bf2a189 --- /dev/null +++ b/eclipse-compile/gridlayout/README.txt @@ -0,0 +1,66 @@ +Library Project including compatibility GridLayout. + +This can be used by an Android project to provide +access to GridLayout on applications running on API 7+. + +There is technically no source, but the src folder is necessary +to ensure that the build system works. The content is actually +located in libs/android-support-v7-gridlayout.jar. +The accompanying resources must also be included in the application. + + +USAGE: + +Make sure you use in your +layouts instead of . +Same for instead of . + +Additionally, all of GridLayout's attributes should be put in the +namespace of the app, as those attributes have been redefined in +the library so that it can run on older platforms that don't offer +those attributes in their namespace. + +To know which attributes need the application namespace, look at +the two declare-styleable declared in res/values/attrs.xml + + + +For instance: + + + <===== notice how we're using app:columnCount here, not android:columnCount! + +