View ElapsedTimeIdlingResource.java
package br.com.trainning.pdv_2016;
import android.support.test.espresso.IdlingResource;
/**
* Created by elcio on 27/03/16.
*/
public class ElapsedTimeIdlingResource implements IdlingResource {
private final long startTime;
private final long waitingTime;
View EspressoTest.java
package br.com.trainning.pdv_2016;
/**
* Created by elcio on 27/03/16.
*/
import android.content.Context;
import android.support.test.InstrumentationRegistry;
import android.support.test.espresso.Espresso;
import android.support.test.espresso.IdlingPolicies;
import android.support.test.espresso.IdlingResource;
View MysqlConnect.java
import com.mysql.jdbc.Connection;
import java.sql.*;
import java.sql.DriverManager;
/**
* @desc A singleton database access class for MySQL
* @author Ramindu
*/
public final class MysqlConnect {
public Connection conn;
private Statement statement;
View list_item.xml
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="wrap_content"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:padding="8dp">
<TextView
android:id="@+id/item_label"
View Exemplo.java
// Exemplo de chamada:
requestPermissions();
@Override
public void onRequestPermissionsResult(int requestCode, @NonNull String[] permissions, @NonNull int[] grantResults) {
switch (requestCode){
case REQUEST_CODE_PERMISSION:
if(grantResults[0] == PackageManager.PERMISSION_GRANTED){
View MainActiity.java
package br.com.trainning.pdv.ui.activity;
import android.content.Intent;
import android.graphics.Color;
import android.graphics.drawable.ColorDrawable;
import android.os.Bundle;
import android.os.Handler;
import android.support.design.widget.CoordinatorLayout;
import android.support.design.widget.FloatingActionButton;
import android.support.design.widget.Snackbar;
View APIClient.java
package br.com.trainning.pdv.domain.network;
import java.util.List;
import br.com.trainning.pdv.domain.model.ListaProdutos;
import br.com.trainning.pdv.domain.model.Produto;
import retrofit.Callback;
import retrofit.RestAdapter;
import retrofit.client.OkClient;
import retrofit.http.Field;
View Base64Util.java
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.util.Base64;
import android.util.Log;
import java.io.ByteArrayOutputStream;
/**
* Created by elcio on 27/11/15.
*/
View CLog.java
import android.util.Log;
/**
* Custom Log - A Facede for Android orignal Log class
* Created by elcio on 14/05/15.
*/
public class CLog {
private static final boolean DEBUG = BuildConfig.BUILD_TYPE.equalsIgnoreCase("debug");
private static String TAG = "YOUR_PROJECT_NAME";