Skip to content

Instantly share code, notes, and snippets.

View Parag2385's full-sized avatar
💻

Parag Pawar Parag2385

💻
View GitHub Profile
@codinginflow
codinginflow / MainActivity.kt
Created April 8, 2021 15:54
Circular Determinate ProgressBar with Background and Text Tutorial
package com.codinginflow.circulardeterminateprogressbar
import androidx.appcompat.app.AppCompatActivity
import android.os.Bundle
import kotlinx.android.synthetic.main.activity_main.*
class MainActivity : AppCompatActivity() {
private var progr = 0
override fun onCreate(savedInstanceState: Bundle?) {
@Veeyikpong
Veeyikpong / MiddleDividerItemDecoration.kt
Last active July 15, 2023 11:54
MiddleDividerItemDecoration, suitable for both LinearLayoutManager and GridLayoutManager.
/*
* Copyright 2018 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
@filipkowicz
filipkowicz / HeaderItemDecoration.kt
Last active April 19, 2024 15:37
Item Decorator for sticky headers in Kotlin
package com.filipkowicz.headeritemdecorator
/*
solution based on - based on Sevastyan answer on StackOverflow
changes:
- take to account views offsets
- transformed to Kotlin
- now works on viewHolders
@jonjack
jonjack / add-update-refresh-github-access-token-on-mac.md
Last active May 31, 2024 15:57
Adding & Updating GitHub Access Token on Mac

Using an Access Token for the first time

Follow the instructions on Github to Create an Access Token in Github

Configure Git to use the osxkeychain

By default, git credentials are not cached so you need to tell Git if you want to avoid having to provide them each time Github requires you to authenticate. On Mac, Git comes with an “osxkeychain” mode, which caches credentials in the secure keychain that’s attached to your system account.

You can tell Git you want to store credentials in the osxkeychain by running the following:-

@saber-solooki
saber-solooki / SimpleRecyclerView.java
Created July 7, 2018 18:40
Sticky Header RecyclerView
package com.saber.customstickyheader;
import android.graphics.Color;
import android.support.annotation.NonNull;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;
@groverankush
groverankush / MainActivity.java
Created July 7, 2017 19:49
Collapsing toolbar in one fragment, Normal toolbar in others
import android.os.Bundle;
import android.support.design.widget.FloatingActionButton;
import android.support.design.widget.Snackbar;
import android.support.v4.app.FragmentTransaction;
import android.support.v4.content.ContextCompat;
import android.support.v4.view.MarginLayoutParamsCompat;
import android.view.View;
import android.support.design.widget.NavigationView;
import android.support.v4.view.GravityCompat;
import android.support.v4.widget.DrawerLayout;
@JosiasSena
JosiasSena / DeCryptor.java
Last active September 12, 2023 12:40
Encryptor and Decryptor for data encryption.decryption using the Android KeyStore.
/**
_____ _____ _
| __ \ / ____| | |
| | | | ___| | _ __ _ _ _ __ | |_ ___ _ __
| | | |/ _ \ | | '__| | | | '_ \| __/ _ \| '__|
| |__| | __/ |____| | | |_| | |_) | || (_) | |
|_____/ \___|\_____|_| \__, | .__/ \__\___/|_|
__/ | |
|___/|_|
*/
@jeffaburt
jeffaburt / CGFloat+PixelConversion.swift
Last active December 31, 2023 12:32
Converts pixels to points based on the screen scale
import UIKit
public extension CGFloat {
/**
Converts pixels to points based on the screen scale. For example, if you
call CGFloat(1).pixelsToPoints() on an @2x device, this method will return
0.5.
- parameter pixels: to be converted into points
@sc0rch
sc0rch / MainActivity.java
Created July 9, 2016 01:45
Clear focus on touch outside for all EditText inputs.
public class MainActivity extends Activity
// ... any code
/**
* Clear focus on touch outside for all EditText inputs.
*/
@Override
public boolean dispatchTouchEvent(MotionEvent event) {
if (event.getAction() == MotionEvent.ACTION_DOWN) {
View v = getCurrentFocus();
@lopspower
lopspower / README.md
Last active May 31, 2024 12:19
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