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
import android.content.Context; | |
import android.graphics.Canvas; | |
import android.graphics.Paint; | |
import android.graphics.Path; | |
import android.graphics.PorterDuff; | |
import android.graphics.PorterDuffXfermode; | |
import android.support.annotation.NonNull; | |
import android.support.annotation.Nullable; | |
import android.util.AttributeSet; |
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
public class AppUtils { | |
public static void setupHideKeyboardWhenTouchOutside(View view, Context context) { | |
// Set up touch listener for non-text box views to hide keyboard. | |
if (!(view instanceof EditText)) { | |
view.setOnTouchListener((v, event) -> { | |
hideKeyBoard(v, context); | |
return false; | |
}); |
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
<provider | |
android:name="android.support.v4.content.FileProvider" | |
android:authorities="${applicationId}.fileprovider" | |
android:exported="false" | |
android:grantUriPermissions="true"> | |
<meta-data | |
android:name="android.support.FILE_PROVIDER_PATHS" | |
android:resource="@xml/file_paths" /> | |
</provider> |
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
// https://medium.com/s23nyc-tech/geometric-android-animations-using-the-canvas-dd687c43f3f4 | |
override fun onDraw(canvas: Canvas) { | |
super.onDraw(canvas) | |
canvas.drawCircle(center.x, center.y, width / 2f, wavePaint) | |
val path = createStarPath(width / 2f) | |
canvas.drawPath(path, wavePaint) | |
} |
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
package com.example.geometricpractice | |
import android.animation.ValueAnimator | |
import android.content.Context | |
import android.graphics.* | |
import android.hardware.Sensor | |
import android.hardware.SensorEvent | |
import android.hardware.SensorEventListener | |
import android.hardware.SensorManager | |
import android.util.AttributeSet |
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
package com.example.geometricpractice | |
import android.animation.ValueAnimator | |
import android.content.Context | |
import android.graphics.Canvas | |
import android.graphics.Color | |
import android.graphics.DashPathEffect | |
import android.graphics.Paint | |
import android.util.AttributeSet | |
import android.view.animation.LinearInterpolator |
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
public static String getFormattedCurrencyString(String isoCurrencyCode, double amount){ | |
NumberFormat numberFormat = NumberFormat.getCurrencyInstance(); | |
Currency currency = Currency.getInstance(isoCurrencyCode); | |
numberFormat.setCurrency(currency); | |
return numberFormat.format(amount); | |
} | |
public static String getFormattedCurrencyString(Locale locale, String isoCurrencyCode, double amount){ |
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
class SinusoidalTween extends Animatable<double> { | |
SinusoidalTween({this.min, this.max}); | |
final double min; | |
final double max; | |
@override | |
double evaluate(Animation<double> animation) { | |
if (animation.value == 0 || animation.value == 1) | |
return min; |
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
import 'package:flutter/material.dart'; | |
import 'dart:math' as math; | |
class TestPage extends StatelessWidget { | |
@override | |
Widget build(BuildContext context) { | |
return Scaffold( | |
body: SafeArea( | |
child: Stack( | |
children: <Widget>[ |
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
class SpinnerTextPage extends StatefulWidget { | |
@override | |
_SpinnerTextPageState createState() => _SpinnerTextPageState(); | |
} | |
class _SpinnerTextPageState extends State<SpinnerTextPage> { | |
int count = 0; | |
@override | |
Widget build(BuildContext context) { |
OlderNewer