Put xml file "api_keys.xml" in the directory "res/value/".
api_keys.xml
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="THE_MOVIE_DB_API_TOKEN">XXXXX</string>
</resources>
/* | |
* Copyright 2017, 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 |
import android.support.v7.widget.RecyclerView | |
import android.view.View | |
interface OnItemClickListener { | |
fun onItemClicked(position: Int, view: View) | |
} | |
fun RecyclerView.addOnItemClickListener(onClickListener: OnItemClickListener) { | |
this.addOnChildAttachStateChangeListener(object: RecyclerView.OnChildAttachStateChangeListener { | |
override fun onChildViewDetachedFromWindow(view: View?) { |
# The command finds the most recent tag that is reachable from a commit. | |
# If the tag points to the commit, then only the tag is shown. | |
# Otherwise, it suffixes the tag name with the number of additional commits on top of the tagged object | |
# and the abbreviated object name of the most recent commit. | |
git describe | |
# With --abbrev set to 0, the command can be used to find the closest tagname without any suffix: | |
git describe --abbrev=0 | |
# other examples |
/* | |
* Copyright 2015 "Henry Tao <hi@henrytao.me>" | |
* | |
* 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 |
#!/bin/sh | |
if [[ -z "$(head -n1 "$1" | grep -o -E '#[0-9]+')" ]]; then | |
echo >&2 ERROR: Commit message must include issue number. | |
exit 1 | |
fi | |
exit 0 |
private class PathFileObserver extends FileObserver{ | |
static final String TAG="FILEOBSERVER"; | |
/** | |
* should be end with File.separator | |
*/ | |
String rootPath; | |
static final int mask = (FileObserver.CREATE | | |
FileObserver.DELETE | | |
FileObserver.DELETE_SELF | | |
FileObserver.MODIFY | |