Skip to content

Instantly share code, notes, and snippets.

View salihyalcin's full-sized avatar
🎯
Focusing

Salih YALÇIN salihyalcin

🎯
Focusing
View GitHub Profile
@salihyalcin
salihyalcin / iller.json
Last active February 15, 2024 14:19
Türkiye'nin İlleri
{
"1": "ADANA",
"2": "ADIYAMAN",
"3": "AFYONKARAHİSAR",
"4": "AĞRI",
"68": "AKSARAY",
"5": "AMASYA",
"6": "ANKARA",
"7": "ANTALYA",
"75": "ARDAHAN",
public class FlashlightCameraCapturer extends Camera1Capturer {
private FlashlightCameraSession cameraSession;
private final boolean captureToTexture;
public FlashlightCameraCapturer(String cameraName, CameraEventsHandler eventsHandler, boolean captureToTexture) {
super(cameraName, eventsHandler, captureToTexture);
this.captureToTexture = captureToTexture;
}
@salihyalcin
salihyalcin / kotlinparse.kt
Created April 28, 2020 11:03
Kotlin json parsing.
inline fun <reified T> Context.jsonToClass(@RawRes resourceId: Int): T =
Gson().fromJson(resources.openRawResource(resourceId).bufferedReader().use { it.readText() }, T::class.java)
inline fun <reified T> Context.fromRemoteJsonToClass(json : String): T = Gson().fromJson(json, T::class.java)
dependencies {
ext {
// Uygulamada kullanılan kütüphane versiyonları
testCompileVersion = '2.2.2'
supportLibraryVersion = '27.0.0'
constraintLayoutVersion = '1.1.3'
esriAndroidSDKVersion = '100.1.0'
calligraphyVersion = '2.2.0'
butterKnifeVersion = '8.8.1'
@salihyalcin
salihyalcin / calculateNet.swift
Created January 30, 2017 12:22 — forked from fozoglu/calculateNet.swift
YGS - LYS için net hesabı
import UIKit
func calculateNet(correct:Int = 0 , wrong:Int = 0 , count:Int = 0) -> (Float) {
var result : Float = 0
if (correct <= count && correct >= 0) && (wrong <= count && wrong >= 0) {
if (correct + wrong <= count){
result = Float(correct) - Float(wrong)/4
void getAllListData(ListView listView){
int count = listView.getAdapter().getCount();
String[] listData = new String[count];
for (int i = 0; i < count; i++) {
listData[i] = listView.getAdapter().getItem(i).toString();
Log.i(TAG, "onClick: " + listData[i]);
}
}
@salihyalcin
salihyalcin / Main.java
Created February 24, 2016 08:51
MapView Change BackGround Color
mMapView.setMapBackground(Color.parseColor("#ffffff"),Color.parseColor("#ffffff"),0,0);
@salihyalcin
salihyalcin / Adapter.java
Created December 14, 2015 07:43
Refresh Adapter
First, your adapter.notifyDataSetChanged() right before setListAdapter(adapter); in the onCreate() method is useless because the list isn't aware of the data unless you call setListAdapter().
So here is the easy way in you class EventPage :
@Override
protected void onResume()
{
super.onResume();
if (getListView() != null)
@salihyalcin
salihyalcin / BroadcastObservable.java
Created November 23, 2015 14:18 — forked from Diolor/BroadcastObservable.java
Retry with Connection
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
import android.net.ConnectivityManager;
import android.net.NetworkInfo;
import android.os.Looper;
import rx.Observable;
import rx.Scheduler;
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle" >
<corners
android:radius="40dp"
/>
<solid
android:color="#4F4F4F"
/>
<padding
android:left="0dp"