Skip to content

Instantly share code, notes, and snippets.

View PauloCeami's full-sized avatar

Paulo Ceami PauloCeami

  • SEA - sistemas e apps
  • Uberlândia - MG
View GitHub Profile
@PauloCeami
PauloCeami / Context is not working in activity
Created March 15, 2019 19:52
Context is not working in activity
package br.com.captresources.app.receitasefaz.pauloceami.activityes;
import android.annotation.SuppressLint;
import android.content.res.Configuration;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import br.com.captresources.app.receitasefaz.pauloceami.R;
FATAL EXCEPTION: main
Process: br.com.pauloceami.ateliermaisprojetos, PID: 4149
android.content.res.Resources$NotFoundException: Resource ID #0x0
at android.content.res.Resources.getValue(Resources.java:1351)
at android.content.res.Resources.getColor(Resources.java:963)
at android.content.Context.getColor(Context.java:441)
at android.support.v4.content.ContextCompat.getColor(ContextCompat.java:409)
at agen
package br.com.app.centralmetadevendasoficial.appvendas.Util;
import android.content.Context;
import android.support.v7.widget.RecyclerView;
import android.view.GestureDetector;
import android.view.MotionEvent;
import android.view.View;
public class RecyclerTouchListener implements RecyclerView.OnItemTouchListener {
public List<Produto_SqliteBean> getAll(String field, String query) {
List<Produto_SqliteBean> listadeprodutos = new ArrayList<>();
SQLiteDatabase db = new Db(ctx).getReadableDatabase();
try {
cursor = db.rawQuery("select * from PRODUTOS where " + field + " like '%" + query + "%'", null);
while (cursor.moveToNext()) {
Produto_SqliteBean prd = new Produto_SqliteBean();
package br.com.app.centralmetadevendasoficial.appvendas.Adapters;
import android.content.Context;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import java.math.RoundingMode;
import java.util.List;
package br.com.app.centralmetadevendasoficial.appvendas.ViewHolders;
import android.support.v7.widget.RecyclerView;
import android.view.View;
import android.widget.TextView;
import br.com.app.centralmetadevendasoficial.appvendas.R;
public class ProdutoViewHolders extends RecyclerView.ViewHolder {
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:card_view="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<android.support.v7.widget.CardView
android:id="@+id/card_view"
android:layout_width="match_parent"
android:layout_height="90dp"
android:layout_margin="@dimen/card_margin"
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_margin="5dp"
android:orientation="vertical">
<LinearLayout
android:id="@+id/linear_buttom"
@PauloCeami
PauloCeami / ImageLoaderAdapter.java
Created September 6, 2017 14:47
Carregamento de imagem com a lib Universal Image Loader
crie um adapter pra receber os dados do server com , é neste arquivo que as imagens serão impressas
package br.com.app.centralmetadevendasoficial.appvendas.Adapters;
import android.content.Context;
import android.graphics.Bitmap;
import android.util.Log;
import android.view.LayoutInflater;
@PauloCeami
PauloCeami / getAllClientes.js
Created August 28, 2017 04:29
trabalhar com lista de objetos fora do escopo subscribe
import { ClienteService } from './../clientes.service';
import { ClienteModel } from './../cliente';
import { Component, OnInit, Input, Output, EventEmitter } from '@angular/core';
import { ActivatedRoute } from '@angular/router';
@Component({
selector: 'app-clientes-lista',
templateUrl: './clientes-lista.component.html',
styleUrls: ['./clientes-lista.component.css'],