This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class App extends Application { | |
private static final AtomicReference<App> INSTANCE = new AtomicReference<>(); | |
public static Context getContext() { | |
return INSTANCE.get(); | |
} | |
@Override | |
public void onCreate() { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public final class StethoUtil { | |
private static boolean init = false; | |
private StethoUtil() { | |
} | |
public static void init(Context context) { | |
if (BuildConfig.DEBUG) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[user] | |
email = [email protected] | |
name = Salim KAYABAŞI | |
[core] | |
autocrlf = true | |
editor = 'C:/Program Files (x86)/Notepad++/notepad++.exe' -multiInst -notabbar -nosession -noPlugin | |
[color] | |
diff = auto | |
status = auto | |
branch = auto |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import com.squareup.otto.Bus; | |
/** | |
* Created by muratcanbur on 23/06/15. | |
*/ | |
public class BusProvider { | |
private static final Bus BUS = new Bus(); | |
public static Bus getInstance() { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
apply plugin: 'com.android.application' | |
Properties local_properties = new Properties() | |
File localPropertiesFile = project.rootProject.file('local.properties') | |
if (localPropertiesFile.exists()) { | |
local_properties.load(localPropertiesFile.newDataInputStream()) | |
} | |
def STRING = 'String' | |
def GIT_SHA = 'GIT_SHA' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class ServiceHandler { | |
static String response = null; | |
public final static int GET = 1; | |
public final static int POST = 2; | |
public ServiceHandler() { | |
} | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class VolleySingleton { | |
public static final String TAG = VolleySingleton.class | |
.getSimpleName(); | |
private static VolleySingleton mInstance; | |
private RequestQueue mRequestQueue; | |
private ImageLoader mImageLoader; | |
private static Context mCtx; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private void initRecyclerView(View view) { | |
RecyclerView recyclerView = (RecyclerView) view.findViewById(R.id.recyclerView); | |
recyclerView.setLayoutManager(new LinearLayoutManager(getActivity())); | |
RecyclerAdapter recyclerAdapter = new RecyclerAdapter(); | |
recyclerView.setAdapter(recyclerAdapter); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private void initToolbar(View view) { | |
mToolbar = (Toolbar) view.findViewById(R.id.toolbar); | |
((ActionBarActivity) getActivity()).setSupportActionBar(mToolbar); | |
mToolbar.setTitle(getString(R.string.app_name)); | |
mToolbar.setTitleTextColor(getResources().getColor(android.R.color.white)); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public void remove(PhotoCard card) { | |
int position = getItemPosition(card); | |
if (position != -1) { | |
mPhotoCards.remove(position); | |
notifyItemRemoved(position); | |
} | |
} | |
public void add(PhotoCard card, int position) { | |
mPhotoCards.add(position, card); |