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 / 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;
package com.rogergcc.workplaycontacts.helper;
import android.annotation.SuppressLint;
import android.app.AlertDialog;
import android.app.Service;
import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
import android.location.Location;
import android.location.LocationListener;