Skip to content

Instantly share code, notes, and snippets.

View appukrb's full-sized avatar

Balasubramaniam K R appukrb

View GitHub Profile
@appukrb
appukrb / gist:e344cf188957037b132e129fd3dcec1c
Created July 30, 2018 07:54 — forked from dseerapu/gist:b768728b3b4ccf282c7806a3745d0347
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) {
@appukrb
appukrb / currency_symbols.php
Created April 12, 2018 09:23 — forked from gibbs/currency_symbols.php
An array of currency symbols as HTML entities
<?php
$currency_symbols = array(
'AED' => '&#1583;.&#1573;', // ?
'AFN' => '&#65;&#102;',
'ALL' => '&#76;&#101;&#107;',
'AMD' => '',
'ANG' => '&#402;',
'AOA' => '&#75;&#122;', // ?
'ARS' => '&#36;',
'AUD' => '&#36;',
@appukrb
appukrb / ResizeAnimation.java
Created October 4, 2017 13:05 — forked from rafali/ResizeAnimation.java
Resize animation on Android
public class ResizeAnimation extends Animation {
final int startWidth;
final int targetWidth;
View view;
public ResizeAnimation(View view, int targetWidth) {
this.view = view;
this.targetWidth = targetWidth;
startWidth = view.getWidth();
}
/**
* @author luksprog
*/
public class BusSeatRecycler extends AppCompatActivity {
private RecyclerView recyclerView;
private BusSeatAdapter adapter;
@Override
@appukrb
appukrb / MyApp.java
Created January 8, 2016 06:14 — forked from artem-zinnatullin/MyApp.java
If you need to set one font for all TextViews in android application you can use this solution. It will override ALL TextView's typefaces, includes action bar and other standard components, but EditText's password font won't be overriden.
public class MyApp extends Application {
@Override
public void onCreate() {
TypefaceUtil.overrideFont(getApplicationContext(), "SERIF", "fonts/Roboto-Regular.ttf"); // font from assets: "assets/fonts/Roboto-Regular.ttf
}
}