Skip to content

Instantly share code, notes, and snippets.

@Antarix
Antarix / bg_card.xml
Created Nov 20, 2013
Android ListView item design background like Google+ card
View bg_card.xml
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<!-- Use this color for listview background or your layout #e5e5e5 -->
<item>
<shape android:shape="rectangle"
android:dither="true">
<corners android:radius="2dp"/>
<solid android:color="#ccc" />
@Antarix
Antarix / DialogExamples.java
Last active Jan 3, 2016
Snippnets for opening differnt Dialog's in android
View DialogExamples.java
public class DialogExamples{
private ArrayList<Integer> mSelectedDays;
public DialogExamples(){
super();
}
//Alert dialog example
public void alert(String message) {
@Antarix
Antarix / git-feature-workflow.md
Created Mar 29, 2016 — forked from blackfalcon/git-feature-workflow.md
Git basics - a general workflow
View git-feature-workflow.md

There are many Git workflows out there, I heavily suggest also reading the atlassian.com [Git Workflow][article] article as there is more detail then presented here.

The two prevailing workflows are [Gitflow][gitflow] and [feature branches][feature]. IMHO, being more of a subscriber to continuous integration, I feel that the feature branch workflow is better suited.

When using Bash in the command line, it leaves a bit to be desired when it comes to awareness of state. I would suggest following these instructions on [setting up GIT Bash autocompletion][git-auto].

Basic branching

When working with a centralized workflow the concepts are simple, master represented the official history and is always deployable. With each now scope of work, aka feature, the developer is to create a new branch. For clarity, make sure to use descriptive names like transaction-fail-message or github-oauth for your branches.

View ApiCall.java
import android.util.Log;
import org.json.JSONObject;
import java.io.IOException;
import okhttp3.MediaType;
import okhttp3.OkHttpClient;
import okhttp3.RequestBody;
import okhttp3.Response;
@Antarix
Antarix / Imaging.php
Last active Nov 24, 2016
Create thumbnail of image while uploading
View Imaging.php
<?php
class Imaging
{
// Variables
private $img_input;
private $img_output;
private $img_src;
private $format;
@Antarix
Antarix / Android Studio .gitignore
Last active Nov 24, 2016 — forked from iainconnor/Android Studio .gitignore
A .gitignore for use in Android Studio
View Android Studio .gitignore
# Built application files
/*/build/
# Crashlytics configuations
com_crashlytics_export_strings.xml
# Local configuration file (sdk path, etc)
local.properties
# Gradle generated files
@Antarix
Antarix / card_friend.xml
Last active Nov 24, 2016 — forked from fpopic/card_friend.xml
material list avatar two textviews and icon
View card_friend.xml
<?xml version="1.0" encoding="utf-8"?>
<android.support.v7.widget.CardView
android:id="@+id/card_view_friend"
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:card_view="http://schemas.android.com/apk/res-auto"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
card_view:cardCornerRadius="4dp"
card_view:cardUseCompatPadding="true">
View AnimatedActivity.java
public class AnimatedActivity extends Activity
{
@Override
protected void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
//opening transition animations
overridePendingTransition(R.anim.activity_open_translate,R.anim.activity_close_scale);
}
View SearchViewStyle.java
/*
* Copyright (C) 2015 Jared Rummler <jared.rummler@gmail.com>
*
* 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
@Antarix
Antarix / AudioFileFilter.java
Created Jan 23, 2015
AudioFileFilter for android (For folder wise music)
View AudioFileFilter.java
import java.io.File;
import java.io.FileFilter;
import java.io.FilenameFilter;
import java.util.ArrayList;
import com.designfuture.framework.util.LogHelper;
public class AudioFileFilter implements FileFilter {
protected static final String TAG = "AudioFileFilter";