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 / FragmentFirst.java
Created February 18, 2015 16:29
InterFragment Communication
package example.fragmentcommu;
import android.app.Activity;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Button;
@Override
public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser) {
float value = ((float)progress/100);
comm.respond(value);
}
@Override
public void onStartTrackingTouch(SeekBar seekBar) {
}
@salihyalcin
salihyalcin / DynamicListview
Created May 28, 2015 07:06
DynamicListview
/*
* Copyright (C) 2013 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
@salihyalcin
salihyalcin / NavigationDrawer
Created May 28, 2015 07:08
NavigationDrawer
package test.cbsmobil.ibb;
import android.content.SharedPreferences;
import android.content.res.Configuration;
import android.os.Bundle;
import android.preference.PreferenceManager;
import android.support.v4.app.ActionBarDrawerToggle;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentTransaction;
@salihyalcin
salihyalcin / NavigationDrawerListViewAdapter
Created May 28, 2015 07:54
NavigationDrawerListViewAdapter
package test.cbsmobil.ibb;
import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.Button;
import android.widget.TextView;
public class NavigationDrawerListViewAdapter extends BaseAdapter {
private LayoutInflater mInflater;
public ArrayList<NavigationDrawerFragment.ListItem> myItems;
final int INVALID_ID = -1;
public Integer intSeekBarValue;
public NavigationDrawerListViewAdapter(Context activity, ArrayList<NavigationDrawerFragment.ListItem> layers) {
mInflater = (LayoutInflater) activity.getSystemService(
Context.LAYOUT_INFLATER_SERVICE);
myItems = layers;
<?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"
@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;
@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 / Main.java
Created February 24, 2016 08:51
MapView Change BackGround Color
mMapView.setMapBackground(Color.parseColor("#ffffff"),Color.parseColor("#ffffff"),0,0);