Skip to content

Instantly share code, notes, and snippets.

View tank777's full-sized avatar
🎯
Focusing

Bhavesh Tank tank777

🎯
Focusing
  • Surat, Gujarat, India
View GitHub Profile
@tank777
tank777 / AndroidManifest.xml
Created June 14, 2017 17:32 — forked from BrandonSmith/AndroidManifest.xml
Quick example of how to schedule a notification in the future using AlarmManager
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.cards.notification">
<uses-sdk
android:minSdkVersion="17"
android:targetSdkVersion="17" />
<application
android:allowBackup="true"
package com.bgt.viewtopdf;
import android.graphics.Bitmap;
import android.graphics.Canvas;
import android.media.MediaScannerConnection;
import android.net.Uri;
import android.os.Environment;
import android.support.v4.widget.NestedScrollView;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
package com.qoppa.qpdf.samples;
import com.bta.android.pdfProcess.PDFCanvas;
import com.bta.android.pdfProcess.PDFDocument;
import com.bta.android.pdfProcess.PDFFontStandard;
import com.bta.android.pdfProcess.PDFFontStandard.PDFFontFamily;
import com.bta.android.pdfProcess.PDFPa
import com.bta.android.pdfProcess.PDFPaint;
import com.bta.android.pdfViewer.fonts.StandardFontTF;
<!-- ripple effect API 21 -->
<?xml version="1.0" encoding="utf-8"?>
<ripple
xmlns:android="http://schemas.android.com/apk/res/android"
android:color="@color/colorRipple"> <!-- ripple color -->
<!-- for Button -->
<item>
<shape android:shape="rectangle">
public class VerticalTransformer implements ViewPager.PageTransformer {
private float yPosition;
@Override
public void transformPage(View view, float position) {
view.setTranslationX(view.getWidth() * -position);
yPosition = position * view.getHeight();
view.setTranslationY(yPosition);
}
}

Make your multiple type view adapter with annotations!

Gist for Making a Multiple View Types Adapter With Annotations

Pretty easy to use.

  1. Create your delegate adapters, implementing DelegateAdapter, and with the annotation DelegateAdapterType. e.g:
@DelegateAdapterType(itemType = 0)
@tank777
tank777 / countries.json
Created August 4, 2017 16:09 — forked from keeguon/countries.json
A list of countries in JSON
[
{name: 'Afghanistan', code: 'AF'},
{name: 'Åland Islands', code: 'AX'},
{name: 'Albania', code: 'AL'},
{name: 'Algeria', code: 'DZ'},
{name: 'American Samoa', code: 'AS'},
{name: 'AndorrA', code: 'AD'},
{name: 'Angola', code: 'AO'},
{name: 'Anguilla', code: 'AI'},
{name: 'Antarctica', code: 'AQ'},
@tank777
tank777 / README.md
Created September 11, 2017 17:40 — forked from gabrielemariotti/README.md
A SectionedGridRecyclerViewAdapter: use this class to realize a simple sectioned grid `RecyclerView.Adapter`.

You can use this class to realize a simple sectioned grid RecyclerView.Adapter without changing your code.

Screen

The RecyclerView has to use a GridLayoutManager.

This is a porting of the class SimpleSectionedListAdapter provided by Google

If you are looking for a sectioned list RecyclerView.Adapter you can take a look here

private Bitmap addWaterMark(Bitmap src, Bitmap waterMark) {
if (src == null || waterMark == null) {
return null;
}
try {
int w = src.getWidth();
int h = src.getHeight();
private class FetchContacts extends AsyncTask<Void, Void, ArrayList<Contact>> {
private final String DISPLAY_NAME = Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB ?
ContactsContract.Contacts.DISPLAY_NAME_PRIMARY : ContactsContract.Contacts.DISPLAY_NAME;
private final String FILTER = DISPLAY_NAME + " NOT LIKE '%@%'";
private final String ORDER = String.format("%1$s COLLATE NOCASE", DISPLAY_NAME);
@SuppressLint("InlinedApi")