Skip to content

Instantly share code, notes, and snippets.

View TheMaxCoder's full-sized avatar
👨‍💻
Busy coding

Atiq Ur Rehman TheMaxCoder

👨‍💻
Busy coding
View GitHub Profile
@mwolfson
mwolfson / Color.kt
Last active March 27, 2024 07:28
Material Design Color Resources for Jetpack Compose
import androidx.compose.ui.graphics.Color
// Material Color Resources
val amber_050 = Color(0xFFfff8e1) // Use with black text
val amber_100 = Color(0xFFffecb3) // Use with black text
val amber_200 = Color(0xFFffe082) // Use with black text
val amber_300 = Color(0xFFffd54f) // Use with black text
val amber_400 = Color(0xFFffca28) // Use with black text
val amber_500 = Color(0xFFffc107) // Use with black text
@donnfelker
donnfelker / .gitconfig
Last active December 3, 2023 14:16
Git and Fish
[user]
name = Your Name
email = you@youremail.com
[alias]
A = add -A
a = add
aa = add --all
ae = add --edit
ai = add --interactive
amend = commit --amend -C HEAD
@gabrielemariotti
gabrielemariotti / README.MD
Last active March 7, 2024 07:50
How to use the ShapeableImageView.

The Material Components Library introduced with the 1.2.0-alpha03 the new ShapeableImageView.

In your layout you can use:

 <com.google.android.material.imageview.ShapeableImageView
      android:id="@+id/image_view"
      app:srcCompat="@drawable/..." />

Then in your code apply the ShapeAppearanceModel to define your custom corners:

@miquelbeltran
miquelbeltran / Accordion.java
Created April 10, 2019 19:03
Code I wrote in 2010 as an attempt to create a solitarie game, decompiled from a classes.dex, do not take as example of how to do things
package com.miquelbeltran.accordion;
import android.app.Activity;
import android.os.Bundle;
import android.view.Menu;
import android.view.MenuItem;
import android.widget.TextView;
public class Accordion extends Activity {
private static final int MENU_NEW_GAME = 1;
@florina-muntenescu
florina-muntenescu / BaseDao.kt
Last active July 8, 2024 12:48
Use Dao inheritance to reduce the amount of boilerplate code - https://medium.com/google-developers/7-pro-tips-for-room-fbadea4bfbd1
/*
* Copyright (C) 2017 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
@The-LoneWolf
The-LoneWolf / colors.xml
Created January 16, 2017 14:47
Android Material Design Colors
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="colorPrimary">@color/md_blue_500</color>
<color name="colorPrimaryDark">@color/md_blue_700</color>
<color name="colorPrimaryDeepDark">@color/md_blue_900</color>
<color name="colorAccent">@color/md_red_500</color>
<color name="md_red_50">#FFEBEE</color>
<color name="md_red_100">#FFCDD2</color>
<color name="md_red_200">#EF9A9A</color>
@YuriHeupa
YuriHeupa / AdmobAdapter.java
Created December 24, 2016 17:06
Example of an ads adapter allowing to hide ads.
public class AdmobAdapter extends AbstractWrapAdapter<AdItem> {
private static final int SPAN = 10;
private boolean mShowAds = true;
public AdmobAdapter() {
super(Collections.singletonList(new AdItem()));
}
@Override
public boolean shouldInsertItemAtPosition(int position) {
@cesarferreira
cesarferreira / RxJava.md
Last active February 2, 2022 07:28
Party tricks with RxJava, RxAndroid & Retrolambda

View Click

Instead of the verbose setOnClickListener:

RxView.clicks(submitButton).subscribe(o -> log("submit button clicked!"));

Filter even numbers

Observable
    .just(1, 2, 3, 4, 5, 6, 7, 8, 9, 10)
@staltz
staltz / introrx.md
Last active July 15, 2024 15:43
The introduction to Reactive Programming you've been missing
@cesco89
cesco89 / FragmentPageAdapter
Last active January 11, 2022 02:56
Add Fragments dynamically to ViewPager
import java.util.ArrayList;
import java.util.List;
import android.content.Context;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;
public class MyFragmentPageAdapter extends FragmentPagerAdapter {