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'; | |
void main() { | |
runApp(MyApp()); | |
} | |
class MyApp extends StatelessWidget { | |
@override | |
Widget build(BuildContext context) { | |
return MaterialApp( |
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:async'; | |
import 'package:flutter/material.dart'; | |
class AnimatedListExample extends StatefulWidget { | |
@override | |
_AnimatedListExampleState createState() => _AnimatedListExampleState(); | |
} | |
class _AnimatedListExampleState extends State<AnimatedListExample> { | |
final List<String> _items = []; |
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:async'; | |
import 'package:flutter/material.dart'; | |
class AnimatedListExample extends StatefulWidget { | |
@override | |
_AnimatedListExampleState createState() => _AnimatedListExampleState(); | |
} | |
class _AnimatedListExampleState extends State<AnimatedListExample> { | |
final List<String> _items = []; |
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:async'; | |
import 'package:flutter/material.dart'; | |
class AnimatedListExample extends StatefulWidget { | |
@override | |
_AnimatedListExampleState createState() => _AnimatedListExampleState(); | |
} | |
class _AnimatedListExampleState extends State<AnimatedListExample> with SingleTickerProviderStateMixin { | |
final List<String> _items = []; |
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
applicationVariants.all { variant -> | |
variant.mergeResources.doLast { | |
def dir = new File("${buildDir}/intermediates/res/merged/${variant.dirName}") //iterating through resources, prepared for including to APK (merged resources) | |
println("Resources dir " + dir) | |
dir.eachFileRecurse { file -> | |
if(file.name.endsWith(".xml")) { //processing only files, which names and with .xml | |
String content = file.getText('UTF-8') | |
if(content != null && content.contains("Bill")) { | |
println("Replacing name in " + file) | |
content = content.replace("Bill", "Will") //replacing all Bill words with Will word in files |
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.util.AttributeSet; | |
import android.view.View; | |
import android.widget.LinearLayout; | |
/** | |
* Created by farhad on 16.2.3. | |
* this is an expandable linear Layout with orientation of Vertivally | |
* it will handle whole calculations and animations for height of View | |
* Your view can have wrap content, it will calculate exact height after adding views to the layout |
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 Observable<String> createObservable(){ | |
return Observable.create((Subscriber<? super String> subscriber) -> { | |
subscriber.onNext(Thread.currentThread().getName()); | |
subscriber.onCompleted(); | |
} | |
); | |
} |
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
# Navigate to AVD | |
cd ~/.android/avd/Nexus5 | |
# Delete old image | |
#rm userdata-qemu.* | |
# Re-size the image | |
e2fsck -f userdata-qemu.img | |
resize2fs userdata.img 512M |
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
buildscript { | |
repositories { | |
mavenCentral() | |
} | |
dependencies { | |
classpath group: 'org.twitter4j', name: 'twitter4j-core', version: '3.0.2' | |
} | |
} | |
import twitter4j.* |
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.app.Activity; | |
import android.view.MotionEvent; | |
import android.view.View; | |
public abstract class ActivitySwipeDetector implements View.OnTouchListener { | |
private Activity activity; | |
static final int MIN_DISTANCE = 100; | |
private float downX, downY, upX, upY; |
NewerOlder