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
@fjfish
fjfish / SearchableAdapter.java
Created June 30, 2012 15:48
Simple String Adapter for Android ListView that has a filter that gives whatever it finds and ignores word boundaries
package com.yourco.yourapp;
import java.util.ArrayList;
import java.util.List;
import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
@iainconnor
iainconnor / Android Studio .gitignore
Created January 24, 2014 20:20
A .gitignore for use in Android Studio
# Built application files
/*/build/
# Crashlytics configuations
com_crashlytics_export_strings.xml
# Local configuration file (sdk path, etc)
local.properties
# Gradle generated files
@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 {
@staltz
staltz / introrx.md
Last active July 15, 2024 15:43
The introduction to Reactive Programming you've been missing
@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)
@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) {
@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>
@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
@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;
@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: