Skip to content

Commit d42a89e

Browse files
author
Oleksii Shliama
committed
Updated libraries and tools versions.
Set bitmap config RGB_565 to reduce memory allocation.
1 parent bf98c40 commit d42a89e

File tree

10 files changed

+31
-48
lines changed

10 files changed

+31
-48
lines changed

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ Check this [project on Behance] (https://www.behance.net/gallery/20411445/Mobile
1515

1616
1. Include the library as local library project.
1717

18-
``` compile 'com.yalantis:phoenix:1.2.2' ```
18+
``` compile 'com.yalantis:phoenix:1.2.3' ```
1919

2020
2. Include the PullToRefreshView widget in your layout.
2121

build.gradle

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ buildscript {
33
mavenCentral()
44
}
55
dependencies {
6-
classpath 'com.android.tools.build:gradle:1.2.3'
6+
classpath 'com.android.tools.build:gradle:2.0.0-alpha1'
77
}
88
}
99

gradle.properties

+2-2
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@
1717
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
1818
# org.gradle.parallel=true
1919

20-
VERSION_NAME=1.2.2
21-
VERSION_CODE=7
20+
VERSION_NAME=1.2.3
21+
VERSION_CODE=8
2222
GROUP=com.yalantis
2323

2424
POM_DESCRIPTION=Android Library to add beautiful Pull-to-Refresh widget
+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
#Wed Apr 10 15:27:10 PDT 2013
1+
#Mon Nov 30 13:15:11 EET 2015
22
distributionBase=GRADLE_USER_HOME
33
distributionPath=wrapper/dists
44
zipStoreBase=GRADLE_USER_HOME
55
zipStorePath=wrapper/dists
6-
distributionUrl=https\://services.gradle.org/distributions/gradle-2.2.1-all.zip
6+
distributionUrl=https\://services.gradle.org/distributions/gradle-2.8-all.zip

library/build.gradle

+6-6
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
apply plugin: 'com.android.library'
22

33
android {
4-
compileSdkVersion 22
5-
buildToolsVersion "22.0.1"
4+
compileSdkVersion 23
5+
buildToolsVersion '23.0.2'
66

77
defaultConfig {
88
minSdkVersion 9
9-
targetSdkVersion 22
10-
versionCode 7
11-
versionName "1.2.2"
9+
targetSdkVersion 23
10+
versionCode 8
11+
versionName "1.2.3"
1212
}
1313
compileOptions {
1414
sourceCompatibility JavaVersion.VERSION_1_7
@@ -18,7 +18,7 @@ android {
1818

1919
dependencies {
2020
compile fileTree(dir: 'libs', include: ['*.jar'])
21-
compile 'com.android.support:support-v4:22.2.0'
21+
compile 'com.android.support:support-v4:23.1.1'
2222
}
2323

2424
apply from: '../mavenpush.gradle'

library/src/main/AndroidManifest.xml

+1-4
Original file line numberDiff line numberDiff line change
@@ -1,4 +1 @@
1-
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
2-
package="com.yalantis.phoenix">
3-
<application android:allowBackup="true" />
4-
</manifest>
1+
<manifest package="com.yalantis.phoenix"/>

library/src/main/java/com/yalantis/phoenix/PullToRefreshView.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -417,8 +417,8 @@ public void setOnRefreshListener(OnRefreshListener listener) {
417417
mListener = listener;
418418
}
419419

420-
public static interface OnRefreshListener {
421-
public void onRefresh();
420+
public interface OnRefreshListener {
421+
void onRefresh();
422422
}
423423

424424
}

library/src/main/java/com/yalantis/phoenix/refresh_view/SunRefreshView.java

+6-20
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,7 @@
44
import android.graphics.Bitmap;
55
import android.graphics.BitmapFactory;
66
import android.graphics.Canvas;
7-
import android.graphics.ColorFilter;
87
import android.graphics.Matrix;
9-
import android.graphics.PixelFormat;
108
import android.graphics.Rect;
119
import android.graphics.drawable.Animatable;
1210
import android.view.animation.Animation;
@@ -105,11 +103,14 @@ public void initiateDimens(int viewWidth) {
105103
}
106104

107105
private void createBitmaps() {
108-
mSky = BitmapFactory.decodeResource(getContext().getResources(), R.drawable.sky);
106+
final BitmapFactory.Options options = new BitmapFactory.Options();
107+
options.inPreferredConfig = Bitmap.Config.RGB_565;
108+
109+
mSky = BitmapFactory.decodeResource(getContext().getResources(), R.drawable.sky, options);
109110
mSky = Bitmap.createScaledBitmap(mSky, mScreenWidth, mSkyHeight, true);
110-
mTown = BitmapFactory.decodeResource(getContext().getResources(), R.drawable.buildings);
111+
mTown = BitmapFactory.decodeResource(getContext().getResources(), R.drawable.buildings, options);
111112
mTown = Bitmap.createScaledBitmap(mTown, mScreenWidth, (int) (mScreenWidth * TOWN_RATIO), true);
112-
mSun = BitmapFactory.decodeResource(getContext().getResources(), R.drawable.sun);
113+
mSun = BitmapFactory.decodeResource(getContext().getResources(), R.drawable.sun, options);
113114
mSun = Bitmap.createScaledBitmap(mSun, mSunSize, mSunSize, true);
114115
}
115116

@@ -272,21 +273,6 @@ public void setBounds(int left, int top, int right, int bottom) {
272273
super.setBounds(left, top, right, mSkyHeight + top);
273274
}
274275

275-
@Override
276-
public void setAlpha(int alpha) {
277-
278-
}
279-
280-
@Override
281-
public void setColorFilter(ColorFilter colorFilter) {
282-
283-
}
284-
285-
@Override
286-
public int getOpacity() {
287-
return PixelFormat.TRANSLUCENT;
288-
}
289-
290276
@Override
291277
public boolean isRunning() {
292278
return false;

sample/build.gradle

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
apply plugin: 'com.android.application'
22

33
android {
4-
compileSdkVersion 22
5-
buildToolsVersion "22.0.1"
4+
compileSdkVersion 23
5+
buildToolsVersion '23.0.2'
66

77
defaultConfig {
88
applicationId "com.yalantis.phoenix.sample"
99
minSdkVersion 9
10-
targetSdkVersion 22
10+
targetSdkVersion 23
1111
versionCode 2
1212
versionName "2.0"
1313
}
@@ -18,7 +18,7 @@ android {
1818
}
1919

2020
dependencies {
21-
compile 'com.android.support:design:22.2.0'
22-
compile 'com.android.support:recyclerview-v7:22.2.0'
21+
compile 'com.android.support:design:23.1.1'
22+
compile 'com.android.support:recyclerview-v7:23.1.1'
2323
compile project(':library')
2424
}

sample/src/main/AndroidManifest.xml

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,20 @@
11
<?xml version="1.0" encoding="utf-8"?>
2-
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
3-
package="com.yalantis.phoenix.sample" >
2+
<manifest package="com.yalantis.phoenix.sample"
3+
xmlns:android="http://schemas.android.com/apk/res/android">
44

55
<application
66
android:allowBackup="true"
77
android:icon="@drawable/lib_icon"
88
android:label="@string/app_name"
9-
android:theme="@style/AppTheme" >
9+
android:theme="@style/AppTheme">
1010
<activity
1111
android:name=".PullToRefreshActivity"
1212
android:label="@string/app_name"
1313
android:screenOrientation="portrait">
1414
<intent-filter>
15-
<action android:name="android.intent.action.MAIN" />
15+
<action android:name="android.intent.action.MAIN"/>
1616

17-
<category android:name="android.intent.category.LAUNCHER" />
17+
<category android:name="android.intent.category.LAUNCHER"/>
1818
</intent-filter>
1919
</activity>
2020
</application>

0 commit comments

Comments
 (0)