forked from Yalantis/JellyToolbar
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Ira
committed
Nov 25, 2016
1 parent
c92c2ae
commit c06d95f
Showing
48 changed files
with
592 additions
and
180 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,43 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
|
||
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" | ||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" | ||
xmlns:app="http://schemas.android.com/apk/res-auto" | ||
android:layout_width="800dp" | ||
android:layout_height="match_parent"> | ||
android:layout_width="match_parent" | ||
android:layout_height="match_parent" | ||
android:orientation="vertical"> | ||
|
||
<android.support.v7.widget.Toolbar | ||
android:layout_width="415dp" | ||
android:layout_height="?attr/actionBarSize" | ||
android:background="@color/startColor" | ||
app:title="@string/app_name" | ||
<com.yalantis.jellytoolbar.widget.JellyToolbar | ||
android:id="@+id/toolbar" | ||
android:layout_width="match_parent" | ||
android:layout_height="wrap_content" | ||
android:background="@color/colorPrimary" | ||
app:cancelIcon="@drawable/ic_close" | ||
app:endColor="#8463d4" | ||
app:icon="@drawable/ic_search" | ||
app:startColor="#cb5ed9" | ||
app:title=" News feed" | ||
app:titleTextColor="@android:color/white" /> | ||
|
||
<com.yalantis.jellytoolbar.JellyEditText xmlns:android="http://schemas.android.com/apk/res/android" | ||
android:id="@+id/jellyEditText" | ||
android:layout_width="800dp" | ||
android:layout_height="?attr/actionBarSize" | ||
android:layout_marginLeft="300dp" /> | ||
</FrameLayout> | ||
<ScrollView | ||
android:layout_width="match_parent" | ||
android:layout_height="wrap_content"> | ||
|
||
<LinearLayout | ||
android:layout_width="match_parent" | ||
android:layout_height="wrap_content" | ||
android:orientation="vertical"> | ||
|
||
<ImageView | ||
android:layout_width="match_parent" | ||
android:layout_height="wrap_content" | ||
android:layout_marginTop="@dimen/activity_horizontal_margin" | ||
android:src="@drawable/content" /> | ||
|
||
<ImageView | ||
android:layout_width="match_parent" | ||
android:layout_height="wrap_content" | ||
android:layout_marginTop="@dimen/activity_horizontal_margin" | ||
android:src="@drawable/content" /> | ||
|
||
</LinearLayout> | ||
</ScrollView> | ||
</LinearLayout> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<android.support.v7.widget.AppCompatEditText xmlns:android="http://schemas.android.com/apk/res/android" | ||
android:layout_width="match_parent" | ||
android:layout_height="match_parent" | ||
android:background="@color/colorTransparent" | ||
android:textColor="#7fffffff" /> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<resources> | ||
<color name="colorPrimary">#3F51B5</color> | ||
<color name="colorPrimaryDark">#303F9F</color> | ||
<color name="colorPrimary">#7e6fe2</color> | ||
<color name="colorPrimaryDark">#8a53cf</color> | ||
<color name="colorAccent">#FF4081</color> | ||
<color name="colorTransparent">#00ffffff</color> | ||
</resources> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1 @@ | ||
<manifest xmlns:android="http://schemas.android.com/apk/res/android" | ||
package="com.yalantis.jellytoolbar"> | ||
|
||
<application | ||
android:allowBackup="true" | ||
android:icon="@mipmap/ic_launcher" | ||
android:label="@string/app_name" | ||
android:supportsRtl="true" | ||
android:theme="@style/AppTheme"> | ||
|
||
</application> | ||
|
||
</manifest> | ||
<manifest package="com.yalantis.jellytoolbar" /> |
10 changes: 10 additions & 0 deletions
10
library/src/main/java/com/yalantis/jellytoolbar/Constant.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
package com.yalantis.jellytoolbar | ||
|
||
/** | ||
* Created by irinagalata on 11/24/16. | ||
*/ | ||
object Constant { | ||
|
||
val ANIMATION_DURATION = 1000L | ||
|
||
} |
105 changes: 0 additions & 105 deletions
105
library/src/main/java/com/yalantis/jellytoolbar/JellyEditText.kt
This file was deleted.
Oops, something went wrong.
10 changes: 10 additions & 0 deletions
10
library/src/main/java/com/yalantis/jellytoolbar/extensions.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
package com.yalantis.jellytoolbar | ||
|
||
import android.support.annotation.DimenRes | ||
import android.view.View | ||
|
||
/** | ||
* Created by irinagalata on 11/23/16. | ||
*/ | ||
|
||
fun View.getDimen(@DimenRes res: Int) = context.resources.getDimensionPixelOffset(res).toFloat() |
33 changes: 33 additions & 0 deletions
33
library/src/main/java/com/yalantis/jellytoolbar/interpolator/BounceInterpolator.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
package com.yalantis.jellytoolbar.interpolator | ||
|
||
import android.view.animation.Interpolator | ||
|
||
/** | ||
* Created by irinagalata on 11/23/16. | ||
*/ | ||
class BounceInterpolator : Interpolator { | ||
val ROTATION_TIME = 0.46667f | ||
val FIRST_BOUNCE_TIME = 0.26666f | ||
|
||
override fun getInterpolation(t: Float): Float { | ||
if (t < ROTATION_TIME) | ||
return rotation(t) | ||
else if (t < ROTATION_TIME + FIRST_BOUNCE_TIME) | ||
return firstBounce(t) | ||
else | ||
return secondBounce(t) | ||
} | ||
|
||
private fun rotation(t: Float): Float { | ||
return 4.592f * t * t | ||
} | ||
|
||
private fun firstBounce(t: Float): Float { | ||
return 2.5f * t * t - 3f * t + 1.85556f | ||
} | ||
|
||
private fun secondBounce(t: Float): Float { | ||
return 0.625f * t * t - 1.083f * t + 1.458f | ||
} | ||
|
||
} |
Oops, something went wrong.