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
@ApplicationScope | |
public class FileHelper { | |
private Context context; | |
@Inject | |
public FileHelper(Context context) { | |
this.context = context; | |
} | |
@Nullable |
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 VerticalTextView extends AppCompatTextView { | |
final boolean topDown; | |
public VerticalTextView(Context context, AttributeSet attrs) { | |
super(context, attrs); | |
final int gravity = getGravity(); | |
if (Gravity.isVertical(gravity) && (gravity & Gravity.VERTICAL_GRAVITY_MASK) == Gravity.BOTTOM) { | |
setGravity((gravity & Gravity.HORIZONTAL_GRAVITY_MASK) | Gravity.TOP); | |
topDown = 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
public class NoneSwipeViewPager extends ViewPager { | |
private boolean canSwipe = false; | |
public void setCanSwipe(boolean canSwipe) { | |
this.canSwipe = canSwipe; | |
} | |
public NoneSwipeViewPager(Context context) { | |
super(context); |
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 NonInterceptScrollView extends ScrollView { | |
public NonInterceptScrollView(Context context) { | |
super(context); | |
} | |
public NonInterceptScrollView(Context context, AttributeSet attrs) { | |
super(context, attrs); | |
} |
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.ewerk.sport.domain.dashboard | |
import android.app.Activity | |
import android.content.Context | |
import androidx.fragment.app.Fragment | |
import com.ewerk.sport.model.FitData | |
import com.google.android.gms.auth.api.signin.GoogleSignIn | |
import com.google.android.gms.fitness.Fitness | |
import com.google.android.gms.fitness.FitnessOptions | |
import com.google.android.gms.fitness.data.DataSource |
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 'dart:math'; | |
import 'package:flutter/material.dart'; | |
void main() { | |
runApp(const MyApp()); | |
} | |
class MyApp extends StatelessWidget { | |
const MyApp({super.key}); |
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
void main() { | |
print("${calculateSimilarity("luong trieu vu", "vu")}"); | |
print("${calculateSimilarity("luong trieu vu", "trieu vu")}"); | |
print("${calculateSimilarity("luong trieu vu", "luong trieu vu")}"); | |
print("${calculateSimilarity("luong trieu vu", "vu.luong")}"); | |
} | |
double calculateSimilarity(String str1, String str2) { | |
str1 = str1.replaceAll(" ", "").toLowerCase(); |
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) { |
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 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; |