forked from manuelsc/Lunary-Ethereum-Wallet
-
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.
Expert mode for transaction sending (add data, own gas limit)
- Loading branch information
Showing
15 changed files
with
433 additions
and
18 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
68 changes: 68 additions & 0 deletions
68
app/src/main/java/rehanced/com/simpleetherwallet/utils/CollapseAnimator.java
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,68 @@ | ||
package rehanced.com.simpleetherwallet.utils; | ||
|
||
import android.view.View; | ||
import android.view.ViewGroup; | ||
import android.view.animation.Animation; | ||
import android.view.animation.Transformation; | ||
|
||
/** | ||
* By Tom Esterez | ||
* https://stackoverflow.com/a/13381228/2463984 | ||
*/ | ||
|
||
public class CollapseAnimator { | ||
|
||
public static void expand(final View v) { | ||
v.measure(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT); | ||
final int targetHeight = v.getMeasuredHeight(); | ||
|
||
// Older versions of android (pre API 21) cancel animations for views with a height of 0. | ||
v.getLayoutParams().height = 1; | ||
v.setVisibility(View.VISIBLE); | ||
Animation a = new Animation() | ||
{ | ||
@Override | ||
protected void applyTransformation(float interpolatedTime, Transformation t) { | ||
v.getLayoutParams().height = interpolatedTime == 1 | ||
? ViewGroup.LayoutParams.WRAP_CONTENT | ||
: (int)(targetHeight * interpolatedTime); | ||
v.requestLayout(); | ||
} | ||
|
||
@Override | ||
public boolean willChangeBounds() { | ||
return true; | ||
} | ||
}; | ||
|
||
// 1dp/ms | ||
a.setDuration((int)(targetHeight / v.getContext().getResources().getDisplayMetrics().density)); | ||
v.startAnimation(a); | ||
} | ||
|
||
public static void collapse(final View v) { | ||
final int initialHeight = v.getMeasuredHeight(); | ||
|
||
Animation a = new Animation() | ||
{ | ||
@Override | ||
protected void applyTransformation(float interpolatedTime, Transformation t) { | ||
if(interpolatedTime == 1){ | ||
v.setVisibility(View.GONE); | ||
}else{ | ||
v.getLayoutParams().height = initialHeight - (int)(initialHeight * interpolatedTime); | ||
v.requestLayout(); | ||
} | ||
} | ||
|
||
@Override | ||
public boolean willChangeBounds() { | ||
return true; | ||
} | ||
}; | ||
|
||
// 1dp/ms | ||
a.setDuration((int)(initialHeight / v.getContext().getResources().getDisplayMetrics().density)); | ||
v.startAnimation(a); | ||
} | ||
} |
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.
Oops, something went wrong.