Skip to content

Instantly share code, notes, and snippets.

View pranavlathigara's full-sized avatar
🤓
Learning

Pranav Lathigara pranavlathigara

🤓
Learning
View GitHub Profile
@gabrielemariotti
gabrielemariotti / MainActivity.java
Last active February 15, 2021 17:32
How to obtain a CardView (support library) with a Image and rounded corners for API<21
ImageView imageView = (ImageView) findViewById(R.id.card_thumbnail_image);
Bitmap mBitmap = BitmapFactory.decodeResource(getResources(), R.drawable.rose);
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP){
//Default
imageView.setBackgroundResource(R.drawable.rose);
} else {
//RoundCorners
RoundCornersDrawable round = new RoundCornersDrawable(mBitmap,
getResources().getDimension(R.dimen.cardview_default_radius), 0); //or your custom radius
@iPaulPro
iPaulPro / include_list_viewpager.xml
Last active March 7, 2024 11:13
CollapsingToolbarLayout with TabLayout
<?xml version="1.0" encoding="utf-8"?><!--
~ Copyright (C) 2015 The Android Open Source Project
~
~ 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
@douo
douo / FloatingActionMenu.java
Created June 23, 2015 08:01
FloatingActionMenu build by android support FloatingActionButton
package com.diaoser.tmr.view;
import android.animation.Animator;
import android.animation.AnimatorSet;
import android.animation.ObjectAnimator;
import android.animation.TimeInterpolator;
import android.animation.ValueAnimator;
import android.content.Context;
import android.graphics.Color;
import android.graphics.drawable.ColorDrawable;
@alphamu
alphamu / SeparatorTextView.java
Last active February 3, 2023 18:54
Demonstration of how to make a custom TextView which has a separator running across it. Screenshot of TextView https://raw.githubusercontent.com/alphamu/RxAndroidDemo/master/app/SeparatorTextViewSample.png
import android.annotation.TargetApi;
import android.content.Context;
import android.graphics.Canvas;
import android.graphics.Paint;
import android.os.Build;
import android.util.AttributeSet;
import android.view.Gravity;
import android.widget.TextView;
/**
* Simple version used in the article:
@SureshCS-50
SureshCS-50 / SlidingTabLayout.java
Last active May 21, 2018 19:00
SlidingTabLayout with both ImageView and TextView support.
/*
/**
* Created by Windows on 16-01-2015.
*/
/*
* Copyright 2014 Google Inc. All rights reserved.
*
* 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
package despotoski.nikola.appbarlayoutsamples.view;
import android.animation.IntEvaluator;
import android.animation.ValueAnimator;
import android.content.Context;
import android.content.res.TypedArray;
import android.support.design.widget.AppBarLayout;
import android.support.design.widget.CoordinatorLayout;
import android.support.v4.view.ViewCompat;
import android.support.v4.view.ViewPropertyAnimatorCompat;
@vishhmakasana
vishhmakasana / IntroVideoView.java
Last active August 10, 2020 14:11
In Android Play mp4 video as a background intro video in your app like latest freelancer app plays it on their intro page of android app.
package com.example.videointro;
import java.io.IOException;
import android.annotation.TargetApi;
import android.content.Context;
import android.content.res.AssetFileDescriptor;
import android.media.MediaPlayer;
import android.os.Build;
import android.util.AttributeSet;
@lopspower
lopspower / README.md
Last active May 2, 2024 13:00
Hexadecimal color code for transparency

Hexadecimal color code for transparency

Twitter

How to set transparency with hex value ?

For example, you want to set 40% alpha transparence to #000000 (black color), you need to add 66 like this #66000000.

Download This sample on Google Play Store

@nickbutcher
nickbutcher / 1_drawable_ic_hash_io16.xml
Last active June 16, 2020 19:28
Animated Stroke. The google I/O website this year (https://google.com/io) has some funky animated lettering. I especially liked the animated stroke around the letters and wondered how you might implement that on Android. Turns out that AnimatedVectorDrawable makes this very easy! Here's how it looks: https://twitter.com/crafty/status/71077957997…
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright 2016 Google Inc.
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
@tasomaniac
tasomaniac / screenrecord.sh
Last active June 28, 2022 22:05 — forked from PaulKinlan/getdeviceart.sh
Screen Record for Android
#!/bin/sh
set -e
if [ -z "$1" ]; then
shot_path=$(date +%Y-%m-%d-%H-%M-%S).mp4
else
shot_path="$*"
fi