Skip to content

Instantly share code, notes, and snippets.

View tentenponce's full-sized avatar

Tenten Ponce tentenponce

  • https://angkas.com/
View GitHub Profile
@slightfoot
slightfoot / scroll_view_height.dart
Created May 2, 2018 15:38
ScrollView With Height for Flutter. Simple ScrollView with its content having a minimum height of the ScrollView's parent. This allows you to space out your components inside your ScrollView to fit the avaliable space and not have them "squish up" when the soft keyboard (IME) appears.
class ScrollViewWithHeight extends StatelessWidget {
final Widget child;
const ScrollViewWithHeight({Key key, this.child}) : super(key: key);
@override
Widget build(BuildContext context) {
return new LayoutBuilder(builder: (BuildContext context, BoxConstraints constraints) {
return new SingleChildScrollView(
child: new ConstrainedBox(
@almozavr
almozavr / jacoco.gradle
Last active January 5, 2021 12:37
Gradle Jacoco config for Android (3.x plugin) with kotlin and custom excludes support
apply plugin: "jacoco"
jacoco {
toolVersion = deps.test.jacocoVersion
}
tasks.withType(Test) {
jacoco.includeNoLocationClasses = true
}
@shukerullah
shukerullah / Progress Bar.js
Last active September 3, 2022 14:27
React Native Animated Progress Bar
import PropTypes from 'prop-types';
import React from 'react';
import {
View,
Easing,
Animated,
StyleSheet,
Dimensions,
ViewPropTypes,
} from 'react-native';
@dseerapu
dseerapu / gist:b768728b3b4ccf282c7806a3745d0347
Last active October 25, 2022 15:04
Android app inactivity timeout | Android Logout timer
public class LogOutTimerUtil {
public interface LogOutListener {
void doLogout();
}
static Timer longTimer;
static final int LOGOUT_TIME = 600000; // delay in milliseconds i.e. 5 min = 300000 ms or use timeout argument
public static synchronized void startLogoutTimer(final Context context, final LogOutListener logOutListener) {
@theyann
theyann / KeyStoreCompat.java
Created April 15, 2017 20:38
KeyStoreCompat is a simple class that takes care of dealing with KeyStore and using the AndroidKeyStore when it can, or another type if it can't. You're welcome.
package YOUR_PACKAGE;
import android.content.Context;
import android.os.Build;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.security.KeyStore;
import java.security.KeyStoreException;
import java.security.cert.Certificate;
@lopspower
lopspower / README.md
Last active May 29, 2024 10:40
Hexadecimal color code for transparency

Hexadecimal color code for transparency

Twitter

How to set transparency with hex value ?

For example, you want to set 40% alpha transparence to #000000 (black color), you need to add 66 like this #66000000.

Download This sample on Google Play Store

@jkwiecien
jkwiecien / retrofit2_rxjava_proguard_config
Last active September 15, 2020 08:43
Retrofit2 + RxJava proguard config.
########--------Retrofit + RxJava--------#########
-dontwarn retrofit.**
-keep class retrofit.** { *; }
-dontwarn sun.misc.Unsafe
-dontwarn com.octo.android.robospice.retrofit.RetrofitJackson**
-dontwarn retrofit.appengine.UrlFetchClient
-keepattributes Signature
-keepattributes Exceptions
-keepclasseswithmembers class * {
@retrofit.http.* <methods>;
@JakeWharton
JakeWharton / AspectRatioImageView.java
Created June 2, 2012 02:14
ImageView that respects an aspect ratio applied to a specific measurement.
// Copyright 2012 Square, Inc.
package com.squareup.widgets;
import android.content.Context;
import android.content.res.TypedArray;
import android.util.AttributeSet;
import android.widget.ImageView;
/** Maintains an aspect ratio based on either width or height. Disabled by default. */
public class AspectRatioImageView extends ImageView {