Skip to content

Instantly share code, notes, and snippets.

View hasankucuk's full-sized avatar

Hasan Küçük hasankucuk

View GitHub Profile
@hasankucuk
hasankucuk / MyListViewAdapter
Created April 11, 2018 13:24
MyListViewAdapter - File Templates
#if (${PACKAGE_NAME} && ${PACKAGE_NAME} != "")package ${PACKAGE_NAME};#end
import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import butterknife.BindView;
import butterknife.ButterKnife;
import java.util.List;
@hasankucuk
hasankucuk / MyRecyclerViewAdapter
Created April 11, 2018 13:37
MyRecyclerViewAdapter - File Template
#if (${PACKAGE_NAME} && ${PACKAGE_NAME} != "")package ${PACKAGE_NAME};#end
import android.content.Context;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import java.util.List;
import butterknife.BindView;
import butterknife.ButterKnife;
@hasankucuk
hasankucuk / Android - default Text Size
Created April 11, 2018 14:17
Android default textview text size
float sourceTextSize = defaultTextView.getTextSize();
TextView.setTextSize(sourceTextSize / getResources().getDisplayMetrics().density);
@hasankucuk
hasankucuk / MyTextProgressBar
Created April 11, 2018 14:26
Android - TextProgressBar
#if (${PACKAGE_NAME} && ${PACKAGE_NAME} != "")package ${PACKAGE_NAME};#end
#parse("File Header.java")
import android.content.Context;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Paint;
import android.graphics.Rect;
import android.graphics.Typeface;
import android.util.AttributeSet;
import android.widget.ProgressBar;
@hasankucuk
hasankucuk / RoundCornerProgressBar - xml
Created April 11, 2018 14:29
Android - RoundCornerProgressBar
layout >>> TextProgressBar>>> style="?android:attr/progressBarStyleHorizontal"
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item android:id="@android:id/background">
<shape>
<corners android:radius="8dp"/>
<solid android:color="@color/progresGrey"/>
</shape>
@hasankucuk
hasankucuk / Password Toggle Tint Selector
Created April 11, 2018 14:43
Android - Password Toggle Tint Selector
layout >>>
<android.support.design.widget.TextInputLayout
android:id="@+id/textInputLayoutOldPassword"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:passwordToggleDrawable="@drawable/password_icon_selector"
app:passwordToggleTint="@drawable/password_toggle_tint_selector"
app:passwordToggleEnabled="true"
>
@hasankucuk
hasankucuk / FourDigitCardFormatWatcher
Created April 13, 2018 06:59
FourDigitCardFormatWatcher for Android
mEdtPaymentCreditNumber.addTextChangedListener(new FourDigitCardFormatWatcher());
public static class FourDigitCardFormatWatcher implements TextWatcher {
private static final char space = ' ';
@Override
public void onTextChanged(CharSequence s, int start, int before, int count) {
}
@hasankucuk
hasankucuk / Replace all space
Created April 13, 2018 07:31
Replace all space
String old="123 549 4aa aa"
String new = old.replaceAll("\\s", "");
@hasankucuk
hasankucuk / Sliding Menu Laggy Problem
Created April 13, 2018 11:02
Sliding Menu Laggy Problem Fix
librarry in CustomViewBehind.java
public void scrollBehinTo >>
if(vis==View.INVISIBLE){}
<REPLACE TO>
if(vis!=View.INVISIBLE){setVisibility(vis);}
@hasankucuk
hasankucuk / Android- TextAllCaps
Created April 13, 2018 11:41
To make all uppercase
mEdtText.setFilters(new InputFilter[]{new InputFilter.AllCaps()}); //Girilen karakterleri büyük harf olarak tanımlamak için