Skip to content

Instantly share code, notes, and snippets.

import 'package:flutter/material.dart';
import 'package:firebase_crashlytics/firebase_crashlytics.dart';
class CrashTest extends StatefulWidget {
CrashTest({Key key}) : super(key: key);
_CrashTestState createState() => _CrashTestState();
}
class _CrashTestState extends State<CrashTest> {
@override
@BindingAdapter("app:touchFeedback")
public static void touchFeedback(View view, ColorDrawable color) {
Drawable colorDrawable;
ViewGroup parent = (ViewGroup) view.getParent();
int index = parent.indexOfChild(view);
parent.removeView(view);
FrameLayout frameLayout = new FrameLayout(view.getContext());
frameLayout.setLayoutParams(view.getLayoutParams());
final Animation fadeIn = new AlphaAnimation(0.0f, 1.0f);
fadeIn.setDuration(2000);
fadeIn.setStartOffset(500);
final Animation fadeOut = new AlphaAnimation(1.0f, 0.0f);
fadeOut.setDuration(2000);
fadeOut.setStartOffset(500);
fadeIn.setAnimationListener(new Animation.AnimationListener(){
private TextView mTvCreate, mTvRestart, mTvStart, mTvResume;
...
mTvCreate = (TextView) findViewById(R.id.create);
mTvRestart = (TextView) findViewById(R.id.restart);
mTvStart = (TextView) findViewById(R.id.start);
mTvResume = (TextView) findViewById(R.id.resume);
@InjectView(R.id.textView2) TextView textView2;
@InjectView(R.id.textView3) TextView textView3;
@InjectView(R.id.textView4) TextView textView4;
@InjectView(R.id.textView5) TextView textView5;
@InjectView(R.id.textView6) TextView textView6;
@InjectView(R.id.button) Button button;
@InjectView(R.id.button2) Button button2;
@Override
private TextView textView2;
private TextView textView3;
private TextView textView4;
private TextView textView5;
private TextView textView6;
private Button button;
private Button button2;
@Override
import android.text.TextUtils;
public String getPhones(ArrayList<Phone> phones) {
ArrayList<String> formattedPhones = new ArrayList<String>();
for (Phone phone: phones) {
formattedPhones.add(phone.getNumber());
}
return TextUtils.join(" / ", formattedPhones);
}
String busca;
busca = Utils.getInstance().normalizerToUnaccent(busca);
anuncios = (ArrayList<Anuncio>) Anuncio
.find(Anuncio.class,
"nome_normalized LIKE ? OR endereco_normalized LIKE ? OR email LIKE ? OR telefones LIKE ? OR site LIKE ? OR descricao_normalized LIKE ? OR cidade_normalized LIKE ?",
new String[] {"%" + busca + "%", "%" + busca + "%", "%" + busca + "%", "%" + busca + "%", "%" + busca + "%", "%" + busca + "%", "%" + busca + "%"});
public String normalizerToUnaccent(String s) {
String normalized = Normalizer.normalize(s, Normalizer.Form.NFD);
return normalized.replaceAll("[^\\p{ASCII}]", "");
}
public class Anuncio extends SugarRecord {
private String nome;
private String nomeNormalized;
private String endereco;
private String enderecoNormalized;
private String descricao;
private String descricaoNormalized;
private String cidade;
private String cidadeNormalized;