Created
July 4, 2019 22:29
-
-
Save jhonata-menezes/c934ff0dfd06486d5a9e4d74355635c4 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 br.gov.sinesp.cidadao.android; | |
import android.app.Activity; | |
import android.app.AlertDialog.Builder; | |
import android.content.ContentValues; | |
import android.content.Context; | |
import android.content.DialogInterface; | |
import android.content.Intent; | |
import android.content.res.Resources; | |
import android.database.Cursor; | |
import android.graphics.Bitmap; | |
import android.graphics.Bitmap.CompressFormat; | |
import android.net.Uri; | |
import android.os.Bundle; | |
import android.os.Handler; | |
import android.os.Message; | |
import android.os.Vibrator; | |
import android.support.annotation.ad; | |
import android.support.v4.app.Fragment; | |
import android.support.v4.app.FragmentActivity; | |
import android.support.v4.content.FileProvider; | |
import android.text.Editable; | |
import android.text.InputFilter; | |
import android.text.InputFilter.AllCaps; | |
import android.text.TextWatcher; | |
import android.util.Log; | |
import android.view.LayoutInflater; | |
import android.view.View; | |
import android.view.View.OnClickListener; | |
import android.view.View.OnFocusChangeListener; | |
import android.view.ViewGroup; | |
import android.view.animation.AnimationSet; | |
import android.view.animation.AnimationUtils; | |
import android.view.inputmethod.InputMethodManager; | |
import android.widget.EditText; | |
import android.widget.ImageView; | |
import android.widget.LinearLayout; | |
import android.widget.ScrollView; | |
import android.widget.TextView; | |
import br.gov.sinesp.cidadao.android.b.c; | |
import br.gov.sinesp.cidadao.android.f.a; | |
import br.gov.sinesp.cidadao.android.h.b; | |
import br.gov.sinesp.cidadao.android.h.d; | |
import br.gov.sinesp.cidadao.android.h.e; | |
import br.gov.sinesp.cidadao.android.h.k; | |
import br.gov.sinesp.cidadao.android.h.n; | |
import com.google.android.gms.tasks.OnFailureListener; | |
import com.google.android.gms.tasks.OnSuccessListener; | |
import com.google.firebase.iid.FirebaseInstanceId; | |
import java.io.File; | |
import java.io.FileOutputStream; | |
import java.util.ArrayList; | |
import java.util.Date; | |
import java.util.List; | |
import java.util.regex.Pattern; | |
import org.a.a.a.y; | |
public class FragmentConsulta extends Fragment { | |
private Boolean A = Boolean.valueOf(false); | |
private b B; | |
private Handler C = new Handler() { | |
public void handleMessage(Message message) { | |
d.a(); | |
c cVar = (c) message.getData().getSerializable("retornoPlaca"); | |
a a2 = a.a((Context) FragmentConsulta.this.getActivity()); | |
ContentValues contentValues = new ContentValues(); | |
StringBuilder sb = new StringBuilder(); | |
sb.append(FragmentConsulta.this.u.getText().toString()); | |
sb.append("-"); | |
sb.append(FragmentConsulta.this.v.getText().toString()); | |
a2.d(sb.toString()); | |
StringBuilder sb2 = new StringBuilder(); | |
sb2.append(FragmentConsulta.this.u.getText().toString()); | |
sb2.append("-"); | |
sb2.append(FragmentConsulta.this.v.getText().toString()); | |
contentValues.put("placa", sb2.toString()); | |
if (cVar != null && cVar.a().intValue() == br.gov.sinesp.cidadao.android.c.a.SemErros.a()) { | |
contentValues.put("situacao", cVar.c()); | |
} | |
a2.a("historico_placa", (String) null, contentValues); | |
if (!(cVar == null || cVar.a() == null)) { | |
if (cVar.a().intValue() == br.gov.sinesp.cidadao.android.c.a.SemErros.a()) { | |
FragmentConsulta.this.u.setOnClickListener(new OnClickListener() { | |
public void onClick(View view) { | |
FragmentConsulta.this.b(); | |
} | |
}); | |
FragmentConsulta.this.u.setOnFocusChangeListener(new OnFocusChangeListener() { | |
public void onFocusChange(View view, boolean z) { | |
FragmentConsulta.this.b(); | |
} | |
}); | |
FragmentConsulta.this.v.setOnClickListener(new OnClickListener() { | |
public void onClick(View view) { | |
FragmentConsulta.this.b(); | |
} | |
}); | |
FragmentConsulta.this.b(cVar); | |
return; | |
} | |
if (cVar.a().intValue() != br.gov.sinesp.cidadao.android.c.a.TimeOut.a()) { | |
if (cVar.a().intValue() == br.gov.sinesp.cidadao.android.c.a.CaptchaInvalido.a()) { | |
d.a((Context) FragmentConsulta.this.getActivity(), cVar.b(), (e) new e() { | |
public void a() { | |
FragmentConsulta.this.z.setText(""); | |
FragmentConsulta.this.z.requestFocus(); | |
k.a(FragmentConsulta.this.z, FragmentConsulta.this.getActivity()); | |
} | |
public void b() { | |
} | |
}); | |
return; | |
} else if (cVar.a().intValue() == br.gov.sinesp.cidadao.android.c.a.VeiculoNaoEncontrado.a()) { | |
d.b(FragmentConsulta.this.getActivity(), cVar.b(), new e() { | |
public void a() { | |
FragmentConsulta.this.a(); | |
} | |
public void b() { | |
} | |
}); | |
return; | |
} else if (!(cVar.a().intValue() == br.gov.sinesp.cidadao.android.c.a.VersaoInvalida.a() || cVar.a().intValue() == br.gov.sinesp.cidadao.android.c.a.InstalacaoInvalida.a())) { | |
if (cVar.a().intValue() == br.gov.sinesp.cidadao.android.c.a.RequisicaoInvalida.a()) { | |
FragmentActivity activity = FragmentConsulta.this.getActivity(); | |
StringBuilder sb3 = new StringBuilder(); | |
sb3.append(FragmentConsulta.this.getString(R.string.mensagem_erro_processamento)); | |
sb3.append(y.a); | |
sb3.append(cVar.b()); | |
d.a((Context) activity, sb3.toString(), (e) null); | |
return; | |
} | |
} | |
} | |
d.a((Context) FragmentConsulta.this.getActivity(), cVar.b(), (e) null); | |
return; | |
} | |
d.a((Context) FragmentConsulta.this.getActivity(), FragmentConsulta.this.getString(R.string.mensagem_erro_processamento), (e) null); | |
} | |
}; | |
private MainActivity a; | |
/* access modifiers changed from: private */ | |
/* renamed from: b reason: collision with root package name */ | |
public ScrollView f232b; | |
private ImageView c; | |
private ImageView d; | |
private ImageView e; | |
private ImageView f; | |
private ImageView g; | |
private ImageView h; | |
private TextView i; | |
private TextView j; | |
private TextView k; | |
private TextView l; | |
private TextView m; | |
private TextView n; | |
private TextView o; | |
private TextView p; | |
private ImageView q; | |
private ImageView r; | |
private LinearLayout s; | |
private LinearLayout t; | |
/* access modifiers changed from: private */ | |
public EditText u; | |
/* access modifiers changed from: private */ | |
public EditText v; | |
private ImageView w; | |
private boolean x = false; | |
/* access modifiers changed from: private */ | |
public ImageView y; | |
/* access modifiers changed from: private */ | |
public EditText z; | |
static { | |
System.loadLibrary("superplacas"); | |
} | |
public static FragmentConsulta a(MainActivity mainActivity) { | |
FragmentConsulta fragmentConsulta = new FragmentConsulta(); | |
fragmentConsulta.setArguments(new Bundle()); | |
fragmentConsulta.a = mainActivity; | |
return fragmentConsulta; | |
} | |
private boolean a(String str, String str2) { | |
Pattern compile = Pattern.compile("^[a-zA-Z]{3}[0-9][0-9a-jA-J][0-9]{2}$"); | |
StringBuilder sb = new StringBuilder(); | |
sb.append(str); | |
sb.append(str2); | |
return compile.matcher(sb.toString()).matches(); | |
} | |
/* access modifiers changed from: private */ | |
public native String b(String str); | |
/* access modifiers changed from: private */ | |
public void b(c cVar) { | |
ImageView imageView; | |
Resources resources = getResources(); | |
if (cVar.c().intValue() == br.gov.sinesp.cidadao.android.c.b.SemRestricao.a() || cVar.c().intValue() == br.gov.sinesp.cidadao.android.c.b.AlertaRouboFurto.a() || cVar.c().intValue() == br.gov.sinesp.cidadao.android.c.b.RouboFurto.a()) { | |
if (cVar.c().intValue() == br.gov.sinesp.cidadao.android.c.b.SemRestricao.a()) { | |
this.f.setVisibility(0); | |
} else { | |
if (cVar.c().intValue() == br.gov.sinesp.cidadao.android.c.b.RouboFurto.a()) { | |
this.d.setVisibility(0); | |
imageView = this.r; | |
} else if (cVar.c().intValue() == br.gov.sinesp.cidadao.android.c.b.AlertaRouboFurto.a()) { | |
this.e.setVisibility(0); | |
imageView = this.q; | |
} | |
imageView.setVisibility(0); | |
((Vibrator) getActivity().getSystemService("vibrator")).vibrate(800); | |
} | |
this.y.setVisibility(8); | |
this.z.setVisibility(8); | |
this.c.setVisibility(8); | |
this.s.setVisibility(0); | |
this.n.setText(String.format(resources.getString(R.string.tx_veiculos_divergencia_renavam), new Object[]{cVar.o()})); | |
this.o.setText(String.format(resources.getString(R.string.tx_veiculos_divergencia_roubofurto), new Object[]{cVar.p()})); | |
this.p.setText(String.format(resources.getString(R.string.tx_veiculos_divergencia_alerta), new Object[]{cVar.q()})); | |
this.i.setVisibility(0); | |
this.i.setText(String.format(resources.getString(R.string.tx_veiculos_marca_modelo), new Object[]{cVar.f(), cVar.h(), cVar.k(), cVar.g()})); | |
this.j.setVisibility(0); | |
this.j.setText(String.format(resources.getString(R.string.tx_veiculos_data_consulta), new Object[]{cVar.j()})); | |
this.k.setVisibility(0); | |
this.k.setText(String.format(resources.getString(R.string.tx_veiculos_cidade_uf), new Object[]{cVar.l(), cVar.m()})); | |
this.l.setVisibility(0); | |
this.l.setText(String.format(resources.getString(R.string.tx_veiculos_chassi), new Object[]{cVar.n()})); | |
StringBuilder sb = new StringBuilder(); | |
sb.append(this.u.getText().toString()); | |
sb.append(this.v.getText().toString()); | |
if (!sb.toString().equalsIgnoreCase(cVar.i())) { | |
this.m.setVisibility(0); | |
this.m.setText(cVar.i()); | |
} | |
this.w.setVisibility(0); | |
this.h.setVisibility(0); | |
} | |
} | |
/* access modifiers changed from: private */ | |
public void c() { | |
this.f232b.post(new Runnable() { | |
public void run() { | |
FragmentConsulta.this.f232b.scrollTo(0, 0); | |
try { | |
View decorView = FragmentConsulta.this.getActivity().getWindow().getDecorView(); | |
decorView.setDrawingCacheEnabled(true); | |
decorView.buildDrawingCache(true); | |
Bitmap drawingCache = decorView.getDrawingCache(); | |
StringBuilder sb = new StringBuilder(); | |
sb.append("consulta_placa_"); | |
sb.append(new Date().getTime()); | |
sb.append(".jpg"); | |
String sb2 = sb.toString(); | |
File file = new File(FragmentConsulta.this.getContext().getFilesDir(), "images"); | |
file.mkdirs(); | |
StringBuilder sb3 = new StringBuilder(); | |
sb3.append(file); | |
sb3.append(File.separator); | |
sb3.append(sb2); | |
FileOutputStream fileOutputStream = new FileOutputStream(sb3.toString()); | |
drawingCache.compress(CompressFormat.JPEG, 50, fileOutputStream); | |
fileOutputStream.flush(); | |
fileOutputStream.close(); | |
decorView.destroyDrawingCache(); | |
Intent intent = new Intent("android.intent.action.SEND"); | |
intent.setType("image/jpg"); | |
Uri uriForFile = FileProvider.getUriForFile(FragmentConsulta.this.getContext(), "br.org.serpro.fileprovider", new File(file, sb2)); | |
intent.addFlags(1); | |
intent.setDataAndType(uriForFile, FragmentConsulta.this.getContext().getContentResolver().getType(uriForFile)); | |
intent.putExtra("android.intent.extra.STREAM", uriForFile); | |
FragmentConsulta.this.startActivityForResult(Intent.createChooser(intent, "Compartilhar via"), 1); | |
} catch (Exception e) { | |
Log.e("Error", e.getMessage()); | |
} | |
} | |
}); | |
} | |
/* access modifiers changed from: private */ | |
public void d() { | |
boolean z2; | |
this.B.a(); | |
if (this.u.getText().length() < 3 || this.v.getText().length() < 4 || !a(this.u.getText().toString(), this.v.getText().toString())) { | |
d.a((Context) getActivity(), getResources().getString(R.string.mensagem_veiculos_placa_invalida), (e) null); | |
z2 = true; | |
} else { | |
z2 = false; | |
} | |
if (!n.a(getActivity())) { | |
d.a((Context) getActivity(), getResources().getString(R.string.mensagem_sem_conexao_internet), (e) null); | |
z2 = true; | |
} | |
if (!z2) { | |
a a2 = a.a((Context) getActivity()); | |
ContentValues contentValues = new ContentValues(); | |
StringBuilder sb = new StringBuilder(); | |
sb.append(this.u.getText().toString().toUpperCase()); | |
sb.append("-"); | |
sb.append(this.v.getText().toString().toUpperCase()); | |
a2.d(sb.toString()); | |
StringBuilder sb2 = new StringBuilder(); | |
sb2.append(this.u.getText().toString().toUpperCase()); | |
sb2.append("-"); | |
sb2.append(this.v.getText().toString().toUpperCase()); | |
contentValues.put("placa", sb2.toString()); | |
a2.a("historico_placa", (String) null, contentValues); | |
} | |
if (!z2) { | |
d.a(getActivity(), getResources().getString(R.string.mensagem_veiculos_consultando)); | |
FirebaseInstanceId.a().e().addOnSuccessListener((Activity) getActivity(), (OnSuccessListener<? super TResult>) new OnSuccessListener<com.google.firebase.iid.a>() { | |
/* renamed from: a */ | |
public void onSuccess(com.google.firebase.iid.a aVar) { | |
String a2 = aVar.a(); | |
String b2 = aVar.b(); | |
StringBuilder sb = new StringBuilder(); | |
sb.append(FragmentConsulta.this.u.getText().toString().toUpperCase()); | |
sb.append(FragmentConsulta.this.v.getText().toString().toUpperCase()); | |
String sb2 = sb.toString(); | |
new br.gov.sinesp.cidadao.android.g.e(FragmentConsulta.this).execute(new String[]{sb2, FragmentConsulta.this.z.getText().toString(), b.a.a.base64ToHex(FragmentConsulta.this.b(sb2)), a2, b2}); | |
} | |
}).addOnFailureListener((Activity) getActivity(), (OnFailureListener) new OnFailureListener() { | |
public void onFailure(@ad Exception exc) { | |
d.a(); | |
String canonicalName = FragmentConsulta.class.getCanonicalName(); | |
StringBuilder sb = new StringBuilder(); | |
sb.append("Falha no FirebaseInstanceId: "); | |
sb.append(exc.getMessage()); | |
Log.d(canonicalName, sb.toString()); | |
d.a((Context) FragmentConsulta.this.getActivity(), FragmentConsulta.this.getResources().getString(R.string.mensagem_erro_google_service), (e) null); | |
} | |
}); | |
} | |
} | |
/* access modifiers changed from: private */ | |
public List<String> e() { | |
Cursor a2 = a.a((Context) getActivity()).a("SELECT * FROM historico_placa ORDER BY _id DESC LIMIT 10", (String[]) null); | |
a2.moveToFirst(); | |
ArrayList arrayList = new ArrayList(); | |
while (!a2.isAfterLast()) { | |
StringBuilder sb = new StringBuilder(); | |
sb.append(a2.getString(1)); | |
sb.append(";"); | |
sb.append(a2.getString(2)); | |
arrayList.add(sb.toString()); | |
a2.moveToNext(); | |
} | |
a2.close(); | |
return arrayList; | |
} | |
private void f() { | |
this.u.setText(""); | |
this.v.setText(""); | |
this.u.setEnabled(true); | |
this.v.setEnabled(true); | |
this.u.requestFocus(); | |
this.n.setText(""); | |
this.o.setText(""); | |
this.p.setText(""); | |
this.f.setVisibility(8); | |
this.q.setVisibility(8); | |
this.r.setVisibility(8); | |
this.s.setVisibility(8); | |
this.i.setVisibility(8); | |
this.j.setVisibility(8); | |
this.k.setVisibility(8); | |
this.l.setVisibility(8); | |
this.m.setVisibility(8); | |
this.w.setVisibility(8); | |
this.h.setVisibility(8); | |
this.d.setVisibility(8); | |
this.e.setVisibility(8); | |
this.v.setOnClickListener(null); | |
this.c.setVisibility(0); | |
this.u.setOnClickListener(new OnClickListener() { | |
public void onClick(View view) { | |
FragmentConsulta.this.g(); | |
} | |
}); | |
this.u.setOnFocusChangeListener(new OnFocusChangeListener() { | |
public void onFocusChange(View view, boolean z) { | |
if (z) { | |
FragmentConsulta.this.g(); | |
} | |
} | |
}); | |
} | |
/* access modifiers changed from: private */ | |
public void g() { | |
this.u.setText(""); | |
this.v.setText(""); | |
} | |
/* access modifiers changed from: private */ | |
public void h() { | |
if (this.u != null && this.v != null && getActivity() != null) { | |
InputMethodManager inputMethodManager = (InputMethodManager) getActivity().getSystemService("input_method"); | |
inputMethodManager.hideSoftInputFromWindow(this.u.getWindowToken(), 0); | |
inputMethodManager.hideSoftInputFromWindow(this.v.getWindowToken(), 0); | |
} | |
} | |
public void a() { | |
f(); | |
k.a(this.u, getActivity()); | |
} | |
public void a(c cVar) { | |
Message message = new Message(); | |
Bundle bundle = new Bundle(); | |
bundle.putSerializable("retornoPlaca", cVar); | |
message.setData(bundle); | |
this.C.sendMessage(message); | |
} | |
public void b() { | |
f(); | |
} | |
public void onActivityCreated(Bundle bundle) { | |
super.onActivityCreated(bundle); | |
MainActivity mainActivity = (MainActivity) getActivity(); | |
TextView textView = (TextView) getActivity().findViewById(R.id.txtInfo); | |
ImageView imageView = (ImageView) getActivity().findViewById(R.id.btnVoltar); | |
ImageView imageView2 = (ImageView) getActivity().findViewById(R.id.imgLogoHeader); | |
((TextView) getActivity().findViewById(R.id.txtHeader)).setText(getResources().getString(R.string.tx_veiculos)); | |
textView.setText(getResources().getString(R.string.tx_veiculos_denatran)); | |
if (imageView.getVisibility() == 8) { | |
imageView.setVisibility(0); | |
imageView.startAnimation((AnimationSet) AnimationUtils.loadAnimation(getActivity(), R.anim.enter_field)); | |
} | |
imageView.setOnClickListener(new OnClickListener() { | |
public void onClick(View view) { | |
FragmentConsulta.this.h(); | |
FragmentConsulta.this.getActivity().onBackPressed(); | |
} | |
}); | |
imageView2.setOnClickListener(new OnClickListener() { | |
public void onClick(View view) { | |
FragmentConsulta.this.h(); | |
FragmentConsulta.this.getActivity().onBackPressed(); | |
} | |
}); | |
} | |
public void onActivityResult(int i2, int i3, Intent intent) { | |
this.x = true; | |
} | |
public View onCreateView(LayoutInflater layoutInflater, ViewGroup viewGroup, Bundle bundle) { | |
View inflate = layoutInflater.inflate(R.layout.fragment_consulta, viewGroup, false); | |
this.f232b = (ScrollView) inflate.findViewById(R.id.scrool); | |
this.c = (ImageView) inflate.findViewById(R.id.imgBtnConsultar); | |
this.u = (EditText) inflate.findViewById(R.id.txPlacaLetra); | |
this.v = (EditText) inflate.findViewById(R.id.txPlacaNumero); | |
this.f = (ImageView) inflate.findViewById(R.id.imgBtnSituacaoLegal); | |
this.d = (ImageView) inflate.findViewById(R.id.imgBtnVeiculoRoubado); | |
this.e = (ImageView) inflate.findViewById(R.id.imgBtnVeiculoAlerta); | |
this.q = (ImageView) inflate.findViewById(R.id.msgSegurancaAlerta); | |
this.r = (ImageView) inflate.findViewById(R.id.msgSegurancaRoubo); | |
this.i = (TextView) inflate.findViewById(R.id.txMarcaModelo); | |
this.j = (TextView) inflate.findViewById(R.id.txDataHoraConsulta); | |
this.s = (LinearLayout) inflate.findViewById(R.id.msgDivergencia); | |
this.k = (TextView) inflate.findViewById(R.id.txMunicipioUF); | |
this.l = (TextView) inflate.findViewById(R.id.txChassi); | |
this.m = (TextView) inflate.findViewById(R.id.txPlacaRetornada); | |
this.w = (ImageView) inflate.findViewById(R.id.imgNovaConsulta); | |
this.h = (ImageView) inflate.findViewById(R.id.btnShare); | |
this.g = (ImageView) inflate.findViewById(R.id.btnHistorico); | |
this.n = (TextView) inflate.findViewById(R.id.txDivergenciaRenavam); | |
this.o = (TextView) inflate.findViewById(R.id.txDivergenciaRouboFurto); | |
this.p = (TextView) inflate.findViewById(R.id.txDivergenciaAlerta); | |
this.y = (ImageView) inflate.findViewById(R.id.imgCaptcha); | |
this.z = (EditText) inflate.findViewById(R.id.txCaptcha); | |
this.t = (LinearLayout) inflate.findViewById(R.id.viewLoadingCaptcha); | |
this.u.addTextChangedListener(new TextWatcher() { | |
public void afterTextChanged(Editable editable) { | |
if (editable.length() == 3) { | |
FragmentConsulta.this.v.requestFocus(); | |
} | |
} | |
public void beforeTextChanged(CharSequence charSequence, int i, int i2, int i3) { | |
} | |
public void onTextChanged(CharSequence charSequence, int i, int i2, int i3) { | |
if (charSequence.length() == 0 || i3 == 0) { | |
} | |
} | |
}); | |
this.u.setFilters(new InputFilter[]{new AllCaps()}); | |
this.v.addTextChangedListener(new TextWatcher() { | |
public void afterTextChanged(Editable editable) { | |
if (editable.length() != 4) { | |
return; | |
} | |
if (FragmentConsulta.this.z.getVisibility() == 0) { | |
FragmentConsulta.this.z.requestFocus(); | |
} else { | |
k.b(FragmentConsulta.this.v, FragmentConsulta.this.getActivity()); | |
} | |
} | |
public void beforeTextChanged(CharSequence charSequence, int i, int i2, int i3) { | |
} | |
public void onTextChanged(CharSequence charSequence, int i, int i2, int i3) { | |
if (charSequence.length() == 0 || i3 == 0) { | |
} | |
} | |
}); | |
this.v.setFilters(new InputFilter[]{new AllCaps()}); | |
this.z.addTextChangedListener(new TextWatcher() { | |
public void afterTextChanged(Editable editable) { | |
if (editable.length() == 5) { | |
k.b(FragmentConsulta.this.v, FragmentConsulta.this.getActivity()); | |
} | |
} | |
public void beforeTextChanged(CharSequence charSequence, int i, int i2, int i3) { | |
} | |
public void onTextChanged(CharSequence charSequence, int i, int i2, int i3) { | |
} | |
}); | |
this.c.setOnClickListener(new OnClickListener() { | |
public void onClick(View view) { | |
FragmentConsulta.this.d(); | |
} | |
}); | |
this.f.setOnClickListener(new OnClickListener() { | |
public void onClick(View view) { | |
FragmentConsulta.this.a(); | |
} | |
}); | |
this.w.setOnClickListener(new OnClickListener() { | |
public void onClick(View view) { | |
FragmentConsulta.this.a(); | |
} | |
}); | |
this.h.setOnClickListener(new OnClickListener() { | |
public void onClick(View view) { | |
FragmentConsulta.this.c(); | |
} | |
}); | |
this.u.setOnClickListener(new OnClickListener() { | |
public void onClick(View view) { | |
FragmentConsulta.this.g(); | |
} | |
}); | |
this.u.setOnFocusChangeListener(new OnFocusChangeListener() { | |
public void onFocusChange(View view, boolean z) { | |
if (z) { | |
FragmentConsulta.this.g(); | |
} | |
} | |
}); | |
this.z.setOnFocusChangeListener(new OnFocusChangeListener() { | |
public void onFocusChange(View view, boolean z) { | |
if (z) { | |
FragmentConsulta.this.z.setText(""); | |
} | |
} | |
}); | |
this.g.setOnClickListener(new OnClickListener() { | |
public void onClick(View view) { | |
List g = FragmentConsulta.this.e(); | |
if (g == null || g.isEmpty()) { | |
d.b(FragmentConsulta.this.getActivity(), FragmentConsulta.this.getResources().getString(R.string.mensagem_veiculos_historico_vazio), null); | |
return; | |
} | |
FragmentConsulta.this.b(); | |
Builder builder = new Builder(FragmentConsulta.this.getActivity()); | |
builder.setTitle("Histórico Placas"); | |
final br.gov.sinesp.cidadao.android.a.c cVar = new br.gov.sinesp.cidadao.android.a.c(FragmentConsulta.this.getActivity(), g); | |
builder.setNegativeButton("Cancelar", new DialogInterface.OnClickListener() { | |
public void onClick(DialogInterface dialogInterface, int i) { | |
dialogInterface.dismiss(); | |
d.a(); | |
FragmentConsulta.this.a(); | |
} | |
}); | |
builder.setAdapter(cVar, new DialogInterface.OnClickListener() { | |
public void onClick(DialogInterface dialogInterface, int i) { | |
String[] split = ((String) cVar.getItem(i)).split("-"); | |
FragmentConsulta.this.u.setText(split[0]); | |
FragmentConsulta.this.v.setText(split[1].substring(0, 4)); | |
d.a(); | |
if (FragmentConsulta.this.y.getVisibility() == 8) { | |
FragmentConsulta.this.d(); | |
} | |
} | |
}); | |
builder.show(); | |
} | |
}); | |
this.B = new b(getContext(), getActivity()); | |
return inflate; | |
} | |
public void onPause() { | |
super.onPause(); | |
h(); | |
} | |
public void onResume() { | |
super.onResume(); | |
((MainActivity) getActivity()).a((Fragment) this); | |
if (!this.x) { | |
a(); | |
} else { | |
this.x = false; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment