Skip to content

Instantly share code, notes, and snippets.

View rogergcc's full-sized avatar
🏠
Working from home

Roger Colquehuanca rogergcc

🏠
Working from home
View GitHub Profile
@rogergcc
rogergcc / Quotes .json
Last active October 2, 2024 04:24
Simpsons Quotes Spanish
[
{
"quote": "A la grande le puse Cuca.",
"author": "Homero Simpson",
"image": "https://cdn.glitch.com/3c3ffadc-3406-4440-bb95-d40ec8fcde72%2FHomerSimpson.png?1497567511939"
},
{
"quote": "¡¿Alguien quiere pensar en los niños?!",
"author": "Helena Alegría",
"image": "https://static.wikia.nocookie.net/lossimpson/images/1/16/Helen_Lovejoy.png"
@rogergcc
rogergcc / BaseApp.kt
Last active January 9, 2024 04:57
Encrypted SharedPreferences
import android.app.Application
import android.util.Log
import com.rogergcc.encryptedsharedpreferencessample.encrypt.EncryptedSharedPreferencesManager
import com.rogergcc.encryptedsharedpreferencessample.encrypt.SharedPreferencesMigrator
import com.rogergcc.encryptedsharedpreferencessample.preferences.SharedPreferencesManager
/**
* Created on enero.
import android.Manifest;
import android.app.Activity;
import android.content.pm.PackageManager;
import androidx.core.app.ActivityCompat;
/**
* Created on septiembre.
* year 2023 .
*/
@rogergcc
rogergcc / ContactAdapter.java
Last active October 2, 2023 00:34
DiffUtil
//In Adapter
public void setContactsList(final List<Contact> contactsList) {
Log.d("LOGG_DEBUG", "setNotes COntactAdapter: ");
ContactsDiffUtilCallback contactsDiffUtilCallback = new ContactsDiffUtilCallback(mContactList, contactsList);
DiffUtil.DiffResult diffResult = DiffUtil.calculateDiff(contactsDiffUtilCallback);
diffResult.dispatchUpdatesTo(this);
mContactList.clear();
mContactList.addAll(contactsList);
}
@rogergcc
rogergcc / Fragment.kt
Last active August 25, 2023 00:28
Manual Inyection VM
private val viewModel by viewModels<MovieViewModel> {
MovieViewModelFactory(
IMovieRepositoryImpl(
RemoteMovieDataSource(RetrofitClient.webservice),
LocalMovieDataSource(AppDatabase.getDatabase(requireContext()).movieDao())
)
)
}
//2 not arguments
@rogergcc
rogergcc / gist:9b3d75a826b9410a344e769d58c05f25
Created July 16, 2023 00:28
Firebase Exploration Android
Firebase Crashlyticss
> https://github.com/ayhanunal/FirebaseCrashlytics
@rogergcc
rogergcc / SplashScreen
Created July 6, 2023 16:20
SplashScreen
android:name=".ui.splashScreen.SplashActivity"
android:configChanges="keyboard|keyboardHidden|orientation|screenSize"
android:screenOrientation="portrait"
android:theme="@style/SplashTheme"
android:windowSoftInputMode="adjustResize"
@rogergcc
rogergcc / MyTrustManagerPinned
Created June 16, 2023 17:41
not self signed
import android.util.Log
import java.security.KeyStore
import java.security.cert.CertificateException
import java.security.cert.X509Certificate
import javax.net.ssl.TrustManagerFactory
import javax.net.ssl.X509TrustManager
class MyTrustManagerPinned : X509TrustManager {
@rogergcc
rogergcc / recipes
Created December 8, 2022 23:10
mock recipe for challenge
[
{
"name": "Crock Pot Roast",
"ingredients": [
{
"quantity": "1",
"name": " beef roast",
"type": "Meat"
},
{
package com.rogergcc.workplaycontacts.ui;
import android.content.Intent;
import android.content.IntentSender;
import android.graphics.BitmapFactory;
import android.location.Location;
import android.os.Bundle;
import android.view.Gravity;
import android.view.View;
import android.view.ViewGroup;