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
/** | |
* Awesome method to create an array from an object using Reflection. Useful for JSON serialization | |
* @return array : array of object properties. | |
*/ | |
public function asArray() | |
{ | |
$reflectionClass = new ReflectionClass(get_class($this)); | |
$array = array(); | |
foreach ($reflectionClass->getProperties() as $property) { | |
$property->setAccessible(true); |
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
/* | |
* From Google IO 2014 app | |
* Copyright 2014 Google Inc. All rights reserved. | |
* | |
* 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 |
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
<style name="AppTheme" parent="android:Theme.Material"> | |
<item name="drawerArrowStyle">@style/DrawerArrowStyle</item> | |
</style> | |
<style name="DrawerArrowStyle" parent="Widget.AppCompat.DrawerArrowToggle"> | |
<item name="spinBars">true</item> | |
<item name="color">@android:color/white</item> | |
</style> |
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
/* | |
* Copyright (C) 2014 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 |
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 android.content.Context; | |
import android.support.v4.widget.SwipeRefreshLayout; | |
import android.util.AttributeSet; | |
/** | |
* Fix for SwipeRefreshLayout, which doesn't display the loading indicator if the onMeasure method hasn't been called. | |
* From https://code.google.com/p/android/issues/detail?id=77712 | |
*/ | |
public class FixedSwipeRefreshLayout extends SwipeRefreshLayout { |
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
multiAutoCompleteTextView.setRawInputType(InputType.TYPE_CLASS_TEXT | |
|InputType.TYPE_TEXT_FLAG_CAP_SENTENCES | |
|InputType.TYPE_TEXT_FLAG_AUTO_CORRECT | |
|InputType.TYPE_TEXT_FLAG_MULTI_LINE); |
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
/** | |
* The MIT License (MIT) | |
* Copyright (c) 2014 David Carver | |
* Permission is hereby granted, free of charge, to any person obtaining | |
* a copy of this software and associated documentation files (the | |
* "Software"), to deal in the Software without restriction, including | |
* without limitation the rights to use, copy, modify, merge, publish, | |
* distribute, sublicense, and/or sell copies of the Software, and to | |
* permit persons to whom the Software is furnished to do so, subject to | |
* the following conditions: |
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
var i18n = { | |
previousMonth : 'Mois précédent', | |
nextMonth : 'Mois prochain', | |
months : ['Janvier','Février', 'Mars','Avril','Mai','Juin','Juillet','Août','Septembre',"Octobre","Novembre","Décembre"], | |
weekdays : ['dimanche'," lundi "," mardi "," mercredi "," jeudi "," vendredi "," samedi "], | |
weekdaysShort : ['Dim', 'Lun', 'Mar', 'Mer', 'Jeu', 'Ven', 'Sam'] | |
}; | |
$("#date").pikaday({ | |
format: "YYYY-MM-DD", //adjust to your liking | |
changeMonth: true, |
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
/** | |
* Compat permissions related methods. | |
*/ | |
public final class PermissionUtils { | |
/** | |
* Private constructor - avoid class instantiation. | |
*/ | |
private PermissionUtils() { | |
throw new UnsupportedOperationException(); | |
} |
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
/** | |
* Base class for all Espresso tests | |
*/ | |
public abstract class BaseActivityTest { | |
protected boolean doesViewExist(@IdRes int id) { | |
try { | |
onView(withId(id)).check(matches(isDisplayed())); | |
return true; | |
} catch (AssertionFailedError er){ | |
return false; |