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
- [ ] Summary of your question in a sentence or two. | |
- [ ] Detailed explanation: | |
[ ] Provide context i.e. what are you building and what functionality are you trying to achieve? | |
[ ] Your current approach. (that is probably not working or you feel can be optimised) | |
- [ ] Your code snippets. | |
- [ ] Screenshots, if any. (optional) | |
- [ ] Link to your entire codebase. (optional) |
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
# | |
# This ProGuard configuration file illustrates how to process a program | |
# library, such that it remains usable as a library. | |
# Usage: | |
# java -jar proguard.jar @library.pro | |
# | |
# Save the obfuscation mapping to a file, so we can de-obfuscate any stack | |
# traces later on. Keep a fixed source file attribute and all line number | |
# tables to get line numbers in the stack traces. |
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.support.v7.widget.LinearLayoutManager; | |
import android.support.v7.widget.RecyclerView; | |
public abstract class EndlessRecyclerOnScrollListener extends RecyclerView.OnScrollListener { | |
public static String TAG = EndlessRecyclerOnScrollListener.class.getSimpleName(); | |
private int previousTotal = 0; // The total number of items in the dataset after the last load | |
private boolean loading = true; // True if we are still waiting for the last set of data to load. | |
private int visibleThreshold = 5; // The minimum amount of items to have below your current scroll position before loading more. | |
int firstVisibleItem, visibleItemCount, totalItemCount; |
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
<!--- Provide a general summary of your changes in the Title above --> | |
<!--- If there is no changelog entry, label this PR as trivial to bypass the Danger warning --> | |
## Description | |
<!--- Describe your changes in detail --> | |
## Motivation and Context | |
<!--- Why is this change required? What problem does it solve? --> |
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
<application | |
... | |
android:label="${app_name}" | |
...> | |
</application> |
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
defaultConfig { | |
applicationId "com.github.chizoba" | |
} | |
buildTypes { | |
release { | |
... | |
} | |
staging { |
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 HashTable { | |
private static int INITIAL_SIZE = 16; | |
private HashEntry[] entries = new HashEntry[INITIAL_SIZE]; | |
public void put(String key, String value) { | |
int hash = getHash(key); | |
final HashEntry hashEntry = new HashEntry(key, value); | |
if(entries[hash] == null) { | |
entries[hash] = hashEntry; | |
} | |
// If there is already an entry at current hash |
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
Apache License | |
Version 2.0, January 2004 | |
http://www.apache.org/licenses/ | |
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION | |
1. Definitions. | |
"License" shall mean the terms and conditions for use, reproduction, | |
and distribution as defined by Sections 1 through 9 of this document. |
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
GitHubRequest(name).doRequest().observe(this, object : Kobserver<ResponseModel>() { | |
override fun onException(exception: Exception) { | |
// handle exception here | |
when(exception){ | |
is GitHubErrorHandler.ErrorConfig.NetworkException -> { | |
Toast.makeText(this@MainActivity, exception.message, Toast.LENGTH_LONG).show() | |
} | |
is GitHubErrorHandler.ErrorConfig.GitHubException -> { | |
Toast.makeText(this@MainActivity, exception.message, Toast.LENGTH_LONG).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
GitHubRequest(name).doRequest().observe(this, object : Kobserver<ResponseModel>() { | |
override fun onException(exception: Exception) { | |
// handle exception here | |
} | |
override fun onSuccess(data: ResponseModel) { | |
// update UI | |
} | |
}) |
NewerOlder