Skip to content

Instantly share code, notes, and snippets.

View arifix's full-sized avatar
🏠
Working from home

Arif Khan arifix

🏠
Working from home
View GitHub Profile
@arifix
arifix / Class.java
Created November 25, 2017 21:37
Movable/Draggable Floating Action Button (FAB)
package com.example;
import android.content.Context;
import android.support.design.widget.FloatingActionButton;
import android.util.AttributeSet;
import android.view.MotionEvent;
import android.view.View;
public class MovableFloatingActionButton extends FloatingActionButton implements View.OnTouchListener {
@arifix
arifix / fab.xml
Created November 25, 2017 21:38
Movable/Draggable Floating Action Button (FAB)
<com.example.MovableFloatingActionButton
android:id="@+id/fab"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="bottom|end"
android:layout_margin="@dimen/fab_margin"
android:src="@drawable/ic_navigate_next_white_24dp"/>
@arifix
arifix / MainActivity.java
Last active November 27, 2017 16:00
Android take Run-time Call Permission & Make Call
package khan.arif.practise;
import android.Manifest;
import android.content.Intent;
import android.content.pm.PackageManager;
import android.net.Uri;
import android.support.annotation.NonNull;
import android.support.v4.app.ActivityCompat;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
@arifix
arifix / progress_bar.xml
Last active October 17, 2018 18:52
Progress Bar with Gradient Background
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item android:id="@android:id/progress">
<shape
android:innerRadiusRatio="3"
android:shape="ring"
android:thicknessRatio="7.0"
android:useLevel="true">
<gradient
android:endColor="#87CEEB"