Skip to content

Smoothed rotation by not rounding #7

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 1 addition & 7 deletions .idea/gradle.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -38,5 +38,4 @@ dependencies {
compile 'com.android.support:appcompat-v7:23.1.1'
compile 'com.github.bumptech.glide:glide:3.5.2'
compile project(':carousel')
compile 'com.google.android.gms:play-services:9.2.+'
}
21 changes: 0 additions & 21 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,24 +1,8 @@
<manifest package="com.carouselview"
xmlns:android="http://schemas.android.com/apk/res/android">

<uses-feature
android:glEsVersion="0x00020000"
android:required="true"/>
<uses-permission android:name="com.google.android.providers.gsf.permission.READ_GSERVICES" />
<uses-permission android:name="com.carouselview.permission.MAPS_RECEIVE"/>
<uses-permission android:name="com.carouselview.permission.READ_GSERVICES"/>
<permission
android:name="com.carouselview.permission.MAPS_RECEIVE"
android:protectionLevel="signature" />

<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/>
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>

<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />

<application
android:allowBackup="true"
Expand All @@ -37,11 +21,6 @@
</intent-filter>
</activity>

<meta-data
android:name="com.google.android.maps.v2.API_KEY"
android:value="AIzaSyC_Pp-vwac64qilw-Q7OYxCtptL1dQSZBg"/>

<meta-data android:name="com.google.android.gms.version" android:value="@integer/google_play_services_version" />
</application>


Expand Down
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ buildscript {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:1.5.0'
classpath 'com.android.tools.build:gradle:2.2.3'

// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
Expand Down
4 changes: 2 additions & 2 deletions carousel/src/main/java/com/carousel/Rotator.java
Original file line number Diff line number Diff line change
Expand Up @@ -117,15 +117,15 @@ boolean computeAngleOffset() {
case SCROLL_MODE:

float sc = (float) timePassed / mDurationMillis;
mCurrAngleDeg = mStartAngleDeg + Math.round(mDeltaAngleDeg * sc);
mCurrAngleDeg = mStartAngleDeg + (mDeltaAngleDeg * sc);
break;

case FLING_MODE:

float timePassedSeconds = timePassed / 1000.0f;
float distance = mCoeffVelocity * mVelocity * timePassedSeconds
- (DECELERATION * timePassedSeconds * timePassedSeconds / 2.0f);
mCurrAngleDeg = mStartAngleDeg + Math.round(distance);
mCurrAngleDeg = mStartAngleDeg + distance;
break;
}
return true; // return true because animation still running
Expand Down
4 changes: 2 additions & 2 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#Wed Oct 21 11:34:03 PDT 2015
#Tue Dec 13 09:10:18 GMT 2016
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-2.8-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-2.14.1-all.zip