Skip to content

Instantly share code, notes, and snippets.

Caner Yılmaz caneryilmaz

View GitHub Profile
View change text style
<!-- Base application theme. -->
<style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar">
<!-- Customize your theme here. -->
<item name="colorPrimary">@color/login_color</item>
<item name="colorPrimaryDark">@color/login_color</item>
<item name="colorAccent">@color/login_color</item>
<item name="android:windowFullscreen">true</item>
<item name="android:textViewStyle">@style/RobotoTextViewStyle</item>
<item name="buttonStyle">@style/RobotoButtonStyle</item>
<item name="android:editTextStyle">@style/RobotoEditTextStyle</item>
@caneryilmaz
caneryilmaz / anim_slide_out_left
Created Dec 6, 2019
for listview remove item.
View anim_slide_out_left
<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android"
android:shareInterpolator="false">
<translate
android:duration="5000"
android:fromXDelta="0%"
android:toXDelta="-100%" />
<alpha
android:duration="5000"
android:fromAlpha="1.0"
View T.C No Validation
private boolean isTCKNCorrect(String id) {
if (id == null) return false;
if (id.length() != 11) return false;
char[] chars = id.toCharArray();
int[] a = new int[11];
for(int i=0; i<11; i++) {
a[i] = chars[i] - '0';
View GenericRecyclerAdapter
package com.caner.indirimsesi.base;
import android.content.Context;
import android.view.View;
import android.view.ViewGroup;
import androidx.recyclerview.widget.RecyclerView;
import java.util.ArrayList;
import java.util.HashMap;
View BaseResponse
public class BaseResponse<T> {
@SerializedName("message")
private String message;
@SerializedName("data")
private T data;
@SerializedName("errors")
private Error error;
@caneryilmaz
caneryilmaz / Transparent ProgressDialog
Last active Jul 2, 2019
Transparent ProgressDialog
View Transparent ProgressDialog
<!--Transparent dialog -->
<style name="TransparentProgressDialog" parent="Theme.AppCompat.Dialog">
<item name="android:windowFrame">@null</item>
<item name="android:windowBackground">@android:color/transparent</item>
<item name="android:windowIsFloating">true</item>
<item name="android:windowContentOverlay">@null</item>
<item name="android:windowTitleStyle">@null</item>
<item name="android:windowAnimationStyle">@android:style/Animation.Dialog</item>
<item name="android:windowSoftInputMode">stateUnspecified|adjustPan</item>
<item name="android:backgroundDimEnabled">true</item>
View Recyclerview Smoothing with listener
pagerView.setOnScrollListener(new RecyclerView.OnScrollListener() {
private boolean scrollingUp;
@Override
public void onScrolled(RecyclerView recyclerView, int dx, int dy) {
// Or use dx for horizontal scrolling
scrollingUp = dy < 0;
}
@Override
@caneryilmaz
caneryilmaz / SnappingRecyclerView
Created May 27, 2019
for auto complete when user swipe
View SnappingRecyclerView
import android.content.Context;
import android.os.Build;
import android.os.Handler;
import android.support.v4.view.ViewCompat;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.util.AttributeSet;
import android.view.MotionEvent;
import android.view.View;
import android.view.ViewTreeObserver;
View stickyParallaxHeaderUi
<?xml version="1.0" encoding="utf-8"?>
<android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/htab_maincontent"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fitsSystemWindows="true">
<android.support.design.widget.AppBarLayout
View MockConverterUtils.java
import android.content.Context;
import android.util.Log;
import com.caner.fonttext.models.ResponseData;
import com.google.gson.Gson;
import java.io.IOException;
import java.io.InputStream;
You can’t perform that action at this time.