Skip to content

Instantly share code, notes, and snippets.

View LOG-TAG's full-sized avatar

Subrahmanya S M LOG-TAG

View GitHub Profile
@commonsguy
commonsguy / LICENSE
Last active July 22, 2024 13:10
deaar: Convert Android AAR Artifacts Into Library Projects
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1. Definitions.
"License" shall mean the terms and conditions for use, reproduction,
@gabrielemariotti
gabrielemariotti / Activity.java
Last active November 27, 2022 09:27
Floating Action Button (requires Android-L preview)
public class MainActivity extends Activity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.layoutfab);
//Outline
int size = getResources().getDimensionPixelSize(R.dimen.fab_size);
Outline outline = new Outline();
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();
@galex
galex / gradle.build for storm-gen
Created June 11, 2014 10:53
build.gradle for storm-gen since it's in Maven Central
// Top-level build.gradle
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:0.11.+'
classpath 'com.neenbedankt.gradle.plugins:android-apt:1.3'
}
@shannah
shannah / NativeFileDialog.java
Last active March 13, 2019 05:12
Example native file dialog for OS X. Uses the Objective-C Cocoa Bridge (https://github.com/shannah/Java-Objective-C-Bridge) and Foxtrot (http://foxtrot.sourceforge.net/) for modal dialogs.
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package ca.weblite.cocoa.ui;
import ca.weblite.objc.NSObject;
import ca.weblite.objc.Proxy;
import java.awt.FileDialog;
import static ca.weblite.objc.RuntimeUtils.msg;
@devunwired
devunwired / ExampleFragment.java
Created May 15, 2014 17:03
Method for animating Android fragment positions during a add/replace/remove transition using custom properties. This method does not require subclassing target views with additional setter methods, but instead requires subclassing the fragment...something you are likely already doing.
/**
* An example of adding these transitions to a Fragment. This simple
* version just applies opposite transitions to any Fragment whether it is
* entering or exiting view. You can also inspect the transit mode parameter
* (i.e. TRANSIT_FRAGMENT_OPEN, TRANSIT_FRAGMENT_CLOSE) in combination to do
* different animations for, say, adding a fragment versus popping the back stack.
*
* Transactions without an explicit transit mode set, in this example, will not
* animate. Allowing the initial fragment add, for example, to simply appear.
*/
@varun-raj
varun-raj / pullJSON.js
Last active March 15, 2025 17:32
Google App Script To Fetch Data From JSON Webservice and Write them to google spreadsheet.
function pullJSON() {
var ss = SpreadsheetApp.getActiveSpreadsheet();
var sheets = ss.getSheets();
var sheet = ss.getActiveSheet();
var url="http://example.com/feeds?type=json"; // Paste your JSON URL here
var response = UrlFetchApp.fetch(url); // get feed
var dataAll = JSON.parse(response.getContentText()); //
@libinbensin
libinbensin / DrawerActivity
Last active March 13, 2021 05:30
Android Navigation Drawer with Activities
public class DrawerActivity extends ActionBarActivity {
private DrawerLayout mDrawerLayout = null;
private ListView mDrawerList = null;
private String[] mDrawerItems;
private ActionBarDrawerToggle mDrawerToggle = null;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_drawer_layout);
@kristopherjohnson
kristopherjohnson / homeAsBack.java
Created April 23, 2014 19:04
Treat Android action-bar Home button as "Back"
@Override
public boolean onOptionsItemSelected(final MenuItem item)
{
final int itemId = item.getItemId();
switch (itemId)
{
case android.R.id.home:
// Action bar home button: go back
finish();
@dzolnai
dzolnai / OAuthClient.java
Last active August 18, 2021 07:23
Retrofit OAuth2 refreshing tokens without modifying all requests.
package com.example.yourapp;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import com.example.yourapp.AuthenticationModel;
import retrofit.client.Header;
import retrofit.client.OkClient;