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
<?xml version="1.0" encoding="utf-8"?> | |
<resources> | |
<!-- google's material design colours from | |
http://www.google.com/design/spec/style/color.html#color-ui-color-palette --> | |
<!--reds--> | |
<color name="md_red_50">#fde0dc</color> | |
<color name="md_red_100">#f9bdbb</color> | |
<color name="md_red_200">#f69988</color> |
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 launchGoogleMaps(Context context, double latitude, | |
double longitude) { | |
try { | |
String format = "geo:0,0?q=" + Double.toString(latitude) + "," | |
+ Double.toString(longitude); | |
Uri uri = Uri.parse(format); | |
Intent intent = new Intent(Intent.ACTION_VIEW, uri); | |
intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP); | |
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); | |
context.startActivity(intent); |
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 setDrawableFromSVG(ImageView imageView, int resource) { | |
SVG svg = new SVGBuilder() | |
.readFromResource(mContext.getResources(), resource) | |
.build(); | |
imageView.setLayerType(View.LAYER_TYPE_SOFTWARE, null); | |
imageView.setImageDrawable(new PictureDrawable(svg.getPicture())); | |
} |
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
/** | |
* verify google play services on the device | |
* */ | |
private boolean checkPlayServices() { | |
int resultCode = GooglePlayServicesUtil | |
.isGooglePlayServicesAvailable(this); | |
if (resultCode != ConnectionResult.SUCCESS) { | |
if (GooglePlayServicesUtil.isUserRecoverableError(resultCode)) { | |
GooglePlayServicesUtil.getErrorDialog(resultCode, this, | |
PLAY_SERVICES_RESOLUTION_REQUEST).show(); |
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); |
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
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
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
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
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' |
OlderNewer