Skip to content

Instantly share code, notes, and snippets.

View hardikamal's full-sized avatar
🖥️

Hardik Amal hardikamal

🖥️
View GitHub Profile
@nonamelive
nonamelive / DMNavigationController.m
Last active April 21, 2023 06:56
Prevent UINavigationController from pushing two view controllers at the same time in case of stack inconsistency and crashes
@interface UINavigationController (DMNavigationController)
- (void)didShowViewController:(UIViewController *)viewController animated:(BOOL)animated;
@end
@interface DMNavigationController ()
@property (nonatomic, assign) BOOL shouldIgnorePushingViewControllers;
@slightfoot
slightfoot / MainActivity.java
Last active September 29, 2015 10:55
Fixed Scrolling Header Tab Thingy
package com.example.scrollyheadedlistthingy;
import java.util.ArrayList;
import android.support.v4.app.FragmentActivity;
import android.view.View;
import android.view.ViewGroup.MarginLayoutParams;
import android.widget.AbsListView;
import android.widget.ArrayAdapter;
import android.widget.ListView;
@antoniolg
antoniolg / SwipeRefreshActivity.java
Last active July 29, 2019 11:59
An activity that uses a SwipeRefreshLayout as a container for the layout of the classes that extend it.
/*
* Copyright (C) 2014 Antonio Leiva Gordillo.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
@casevictor
casevictor / table.js
Created April 17, 2014 02:50
A way to implement Titanium.UI.SearchBar with custom UI.tableRows using Alloy ( Android and iOS platforms )
//On iOS the default is 'Search', On Android the default is empty
$.search.hintText = 'Deep Search'
if(OS_IOS){
//Equals to tableRow.js new property
$.table.filterAttribute="filter";
}
if(OS_ANDROID){
@chrisbanes
chrisbanes / FloatLabelLayout.java
Last active December 23, 2025 06:48
FloatLabelLayout
/*
* Copyright 2014 Chris Banes
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
@libinbensin
libinbensin / MainActivity.java
Last active December 9, 2023 14:44
Facebook Popup using PopupWindow
public class MainActivity extends
private PopupWindow popWindow;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
}
@casevictor
casevictor / controller.js
Created May 26, 2014 23:40
How to do a cross-platform loading indicator module.
var loading = require('functions').loading;
loading.setMessage('Autenticando...');
loading.show();
setTimeout(function(){
loading.hide();
},5000);
public class CircularProgressDrawable extends Drawable
implements Animatable {
private static final Interpolator ANGLE_INTERPOLATOR = new LinearInterpolator();
private static final Interpolator SWEEP_INTERPOLATOR = new DecelerateInterpolator();
private static final int ANGLE_ANIMATOR_DURATION = 2000;
private static final int SWEEP_ANIMATOR_DURATION = 600;
private static final int MIN_SWEEP_ANGLE = 30;
private final RectF fBounds = new RectF();
@kevinpelgrims
kevinpelgrims / MainActivity.java
Last active January 12, 2023 04:52
ActionBar tab badge
actionBar.addTab(actionBar.newTab()
.setCustomView(TabUtils.renderTabView(NotificationsActivity.this, R.string.tab_invitations, R.drawable.tab_orange, numberOfNotifications))
.setTabListener(tabListener));
@JakeWharton
JakeWharton / ForegroundImageView.java
Created July 10, 2014 16:42
An ImageView which supports a foreground drawable.
import android.content.Context;
import android.content.res.TypedArray;
import android.graphics.Canvas;
import android.graphics.drawable.Drawable;
import android.util.AttributeSet;
import android.widget.ImageView;
public class ForegroundImageView extends ImageView {
private Drawable foreground;