Skip to content

Instantly share code, notes, and snippets.

PratapKumar kprathap23

Block or report user

Report or block kprathap23

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@kprathap23
kprathap23 / Android RadioGroup Cheat Sheet
Created Jan 24, 2018 — forked from jrejaud/Android RadioGroup Cheat Sheet
Android RadioGroup center custom images, keeping aspect ratio, with constant spacing between them
View Android RadioGroup Cheat Sheet
This lets you space out your radio buttons to have a constant space between them while keeping the aspect ratio of an image
<RadioGroup
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<RadioButton
style="@style/radio_button_transport"
android:background="@drawable/transport_mode_button_foot"/>
@kprathap23
kprathap23 / BadgeTabLayout.java
Created Jun 13, 2017 — forked from eneim/BadgeTabLayout.java
A custom TabLayout with badge support for Tabs
View BadgeTabLayout.java
package im.ene.lab.android.widgets;
import android.content.Context;
import android.graphics.PorterDuff;
import android.graphics.drawable.Drawable;
import android.os.Build;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.support.design.widget.TabLayout;
import android.util.AttributeSet;
@kprathap23
kprathap23 / InstagramLikeColorTransition.txt
Created Feb 17, 2017 — forked from deepak786/InstagramLikeColorTransition.txt
Instagram Like Gradient Color Transition in Android
View InstagramLikeColorTransition.txt
/******This Gist explains how to create instagram like Gradient color transition in android.******/
1. Create some gradient color drawables inside drawable Folder.
a) color1.xml
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<gradient
android:startColor="#c44e4e"
android:endColor="#dcb9b9"
android:angle="0"/>
@kprathap23
kprathap23 / EachDirectoryPath.md
Created May 2, 2016 — forked from granoeste/EachDirectoryPath.md
[Android] How to get the each directory path.
View EachDirectoryPath.md

System directories

Method Result
Environment.getDataDirectory() /data
Environment.getDownloadCacheDirectory() /cache
Environment.getRootDirectory() /system

External storage directories

@kprathap23
kprathap23 / gist:524364770faffa96cab0
Created Mar 1, 2016 — forked from pocmo/gist:bc95238e890a185003c4
Android M-Preview 1 - Permissions + Groups + Protection Level
View gist:524364770faffa96cab0
(android.permission-group.CONTACTS) android.permission.READ_CONTACTS dangerous
(android.permission-group.CONTACTS) android.permission.WRITE_CONTACTS dangerous
(android.permission-group.CONTACTS) android.permission.READ_PROFILE dangerous
(android.permission-group.CONTACTS) android.permission.WRITE_PROFILE dangerous
(android.permission-group.CALENDAR) android.permission.READ_CALENDAR dangerous
(android.permission-group.CALENDAR) android.permission.WRITE_CALENDAR dangerous
(android.permission-group.SMS) android.permission.SEND_SMS dangerous
(android.permission-group.SMS) android.permission.RECEIVE_SMS dangerous
(android.permission-group.SMS) android.permission.READ_SMS dangerous
(android.permission-group.SMS) android.permission.RECEIVE_WAP_PUSH dangerous
@kprathap23
kprathap23 / gist:c7b1f817b875b712fa4b
Created Mar 1, 2016 — forked from pocmo/gist:a47e93254ecac0d26695
Android M-Preview 2 - Permissions + Groups + Protection Level
View gist:c7b1f817b875b712fa4b
(android.permission-group.CONTACTS) android.permission.READ_CONTACTS dangerous
(android.permission-group.CONTACTS) android.permission.WRITE_CONTACTS dangerous
(android.permission-group.CONTACTS) android.permission.READ_PROFILE dangerous
(android.permission-group.CONTACTS) android.permission.WRITE_PROFILE dangerous
(android.permission-group.CALENDAR) android.permission.READ_CALENDAR dangerous
(android.permission-group.CALENDAR) android.permission.WRITE_CALENDAR dangerous
(android.permission-group.SMS) android.permission.SEND_SMS dangerous
(android.permission-group.SMS) android.permission.RECEIVE_SMS dangerous
(android
@kprathap23
kprathap23 / Camera2Activity.java
Created Jan 22, 2016 — forked from natevogt/Camera2Activity.java
Quick-n-Dirty Camera2 Activity
View Camera2Activity.java
package com.natevogtphoto.camera2test;
import android.app.Activity;
import android.content.Context;
import android.content.pm.ActivityInfo;
import android.graphics.ImageFormat;
import android.graphics.SurfaceTexture;
import android.hardware.camera2.CameraAccessException;
import android.hardware.camera2.CameraCaptureSession;
import android.hardware.camera2.CameraCaptureSession.CaptureCallback;
View styles.xml
<resources>
<!-- Base application theme. -->
<style name="Theme.AppTheme" parent="android:Theme.Holo.Light.DarkActionBar">
<item name="android:actionBarStyle">@style/Theme.AppTheme.actionBar</item>
<item name="android:actionBarWidgetTheme">@style/Theme.AppTheme.actionBar.widget</item>
<item name="android:editTextStyle">@style/Theme.AppTheme.editText</item>
<item name="android:buttonStyle">@style/Theme.AppTheme.button</item>
<item name="android:checkboxStyle">@style/Theme.AppTheme.checkbox</item>
<item name="android:textViewStyle">@style/Theme.AppTheme.textView</item>
You can’t perform that action at this time.