Skip to content

Instantly share code, notes, and snippets.

View androidcodehunter's full-sized avatar

Sharifur Rahaman androidcodehunter

View GitHub Profile
@androidcodehunter
androidcodehunter / Android Privacy Policy Template
Created July 24, 2019 04:28 — forked from alphamu/Android Privacy Policy Template
A template for creating your own privacy policy for Android apps. Look for "[" and "<!--" to see where you need to edit this app in order to create your own privacy olicy.
<html>
<body>
<h2>Privacy Policy</h2>
<p>[Individual or Company Name] built the [App Name] app as a [open source | free | freemium | ad-supported | commercial] app. This SERVICE is provided by [Individual or company name] [at no cost] and is intended
for use as is.</p>
<p>This page is used to inform website visitors regarding [my|our] policies with the collection, use, and
disclosure of Personal Information if anyone decided to use [my|our] Service.</p>
<p>If you choose to use [my|our] Service, then you agree to the collection and use of information in
relation with this policy. The Personal Information that [I|we] collect are used for providing and
improving the Service. [I|We] will not use or share your information with anyone except as described
@androidcodehunter
androidcodehunter / WordDetailAdapterKotlin.kt
Created July 18, 2019 15:49
Kotlin ListAdapter With DiffUtils
package sharif.vocapower.ui.adapter
import android.util.Log
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import androidx.recyclerview.widget.*
import kotlinx.android.synthetic.main.item_primary_word_list.view.*
import kotlinx.android.synthetic.main.list_item_mnemonic.view.*
import sharif.vocapower.R
@androidcodehunter
androidcodehunter / stringtest
Created June 12, 2019 04:53
First method accept a string, and will return true if the first letter of that string is found in the range [A-Z]. Second method is a test method.
/**
* Check first character of a String is a letter [A-Z]. If first character is letter, return true otherwise return false.
*
* @param value input value as String
* @return return true if the first character is in the Range [A-Z]
*/
private boolean isFirstCharacterLetter(String value){
if (value == null || value.isEmpty()){
return false;
}
@androidcodehunter
androidcodehunter / Excel Reader
Last active January 15, 2018 02:50
Excel Reader
package com.parser;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.util.Iterator;
import org.apache.poi.openxml4j.exceptions.InvalidFormatException;
import org.apache.poi.ss.usermodel.Cell;
@androidcodehunter
androidcodehunter / Best Android Resource
Created December 19, 2016 12:04
Best android resources
Understanding Android's LayoutInflater.inflate()
https://www.bignerdranch.com/blog/understanding-androids-layoutinflater-inflate/
A curvy layout like engage layout.
https://github.com/developer-shivam/Crescento
<declare-styleable name="IconButton">
<attr name="iconPadding" format="dimension"/>
</declare-styleable>
public class CenterIconButton extends Button {
protected int drawableWidth;
protected DrawablePositions drawablePosition;
protected int iconPadding;
package com.assignment;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
public class Student {
private int id;
private String name, gender;
private Date dateOfBirth;
<!--
android:colorAccent will affect your text colors of negative or positive buttons.
android:textColor will affect your title text color of dialog.
android:textColorPrimary will affect your message color of dialog.-->
<style name="GGDialog" parent="Theme.AppCompat.Light.Dialog.Alert">
<item name="android:textColor">@color/theme_blue</item>
<item name="android:background">@color/white</item>
<item name="android:textColorPrimary">@color/theme_red</item>
<item name="colorAccent">@color/theme_red</item>
</style>
AlertDialog.Builder builder = new AlertDialog.Builder(this);
builder.setTitle(getString(R.string.new_group));
final FrameLayout input = (FrameLayout) View.inflate(this, R.layout.dialog_profile_name_update, null);
final EditText editText = (EditText) input.findViewById(R.id.et_rename_profile_name);
editText.setHint(getString(R.string.hint_name_this_group_chat));
editText.setText(getString(R.string.label_group));
editText.setSelection(getString(R.string.label_group).length());
builder.setView(input);
builder.setPositiveButton(getString(R.string.dialog_positive_btn_ok), new DialogInterface.OnClickListener() {