added license and code of conduct, updated timber logs

This commit is contained in:
Prem Nirmal
2017-09-04 11:22:54 -04:00
parent 2aeea607ab
commit 5ecb35430b
5 changed files with 67 additions and 11 deletions
+46
View File
@@ -0,0 +1,46 @@
# Contributor Covenant Code of Conduct
## Our Pledge
In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to making participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, gender identity and expression, level of experience, nationality, personal appearance, race, religion, or sexual identity and orientation.
## Our Standards
Examples of behavior that contributes to creating a positive environment include:
* Using welcoming and inclusive language
* Being respectful of differing viewpoints and experiences
* Gracefully accepting constructive criticism
* Focusing on what is best for the community
* Showing empathy towards other community members
Examples of unacceptable behavior by participants include:
* The use of sexualized language or imagery and unwelcome sexual attention or advances
* Trolling, insulting/derogatory comments, and personal or political attacks
* Public or private harassment
* Publishing others' private information, such as a physical or electronic address, without explicit permission
* Other conduct which could reasonably be considered inappropriate in a professional setting
## Our Responsibilities
Project maintainers are responsible for clarifying the standards of acceptable behavior and are expected to take appropriate and fair corrective action in response to any instances of unacceptable behavior.
Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful.
## Scope
This Code of Conduct applies both within project spaces and in public spaces when an individual is representing the project or its community. Examples of representing a project or community include using an official project e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. Representation of a project may be further defined and clarified by project maintainers.
## Enforcement
Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at prem.nirmal88@gmail.com. The project team will review and investigate all complaints, and will respond in a way that it deems appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately.
Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project's leadership.
## Attribution
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, available at [http://contributor-covenant.org/version/1/4][version]
[homepage]: http://contributor-covenant.org
[version]: http://contributor-covenant.org/version/1/4/
+12
View File
@@ -0,0 +1,12 @@
# Contributing to StockTicker
If you would like to contribute code you can do so through GitHub by forking the repository and sending a pull request.
When submitting code, please make every effort to follow existing conventions and style in order to keep the code as readable as possible.
The code style used is the [Square Android Code Style](https://github.com/square/java-code-styles)
## License
By contributing your code, you agree to license your contribution under the terms of the MIT license: https://github.com/premnirmal/StockTicker/blob/master/LICENSE.txt
All files are released with the MIT license.
+1 -3
View File
@@ -7,8 +7,6 @@
alt="Get it on F-Droid"
height="80">](https://f-droid.org/app/com.github.premnirmal.tickerwidget)
[iOS version](https://itunes.apple.com/us/app/todaystocks/id993467855?ls=1&mt=8) available on [github](https://github.com/premnirmal/TodayStocks) too
![](https://lh3.googleusercontent.com/R9khJ5kNzXHUjO4BxNw1cNKTx62grZ7FtLRT_F2H0BhC99iuMWDxvuGTYvyydtqE3w=h400-rw)
## Motivation
@@ -33,4 +31,4 @@ This app also shows how to write android unit tests using [mockito](https://gith
MIT
### Author
> [Prem Nirmal](http://premnirmal.me/)
[Prem Nirmal](http://premnirmal.me/)
@@ -30,10 +30,10 @@ internal open class FileExportTask : AsyncTask<List<String>, Void, String>() {
fileOutputStream.flush()
fileOutputStream.close()
} catch (e: FileNotFoundException) {
Timber.w(RuntimeException(e))
Timber.w(Exception(e))
return null
} catch (e: IOException) {
Timber.w(RuntimeException(e))
Timber.w(Exception(e))
return null
}
@@ -40,7 +40,7 @@ class StockWidget() : AppWidgetProvider() {
Injector.appComponent.inject(this)
injected = true
}
Timber.i("onReceive")
Timber.d("onReceive")
super.onReceive(context, intent)
Analytics.INSTANCE.trackWidgetUpdate("onReceive")
if (intent.action == ACTION_NAME) {
@@ -52,7 +52,7 @@ class StockWidget() : AppWidgetProvider() {
appWidgetIds: IntArray) {
Analytics.INSTANCE.trackWidgetUpdate("onUpdate")
for (widgetId in appWidgetIds) {
Timber.i("onUpdate" + widgetId)
Timber.d("onUpdate" + widgetId)
val min_width: Int
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN) {
val options = appWidgetManager.getAppWidgetOptions(widgetId)
@@ -70,7 +70,7 @@ class StockWidget() : AppWidgetProvider() {
override fun onAppWidgetOptionsChanged(context: Context, appWidgetManager: AppWidgetManager,
appWidgetId: Int, newOptions: Bundle) {
super.onAppWidgetOptionsChanged(context, appWidgetManager, appWidgetId, newOptions)
Timber.i("onAppWidgetOptionsChanged" + appWidgetId.toString())
Timber.d("onAppWidgetOptionsChanged" + appWidgetId.toString())
val min_width = getMinWidgetWidth(newOptions)
val remoteViews: RemoteViews = createRemoteViews(context, min_width)
Analytics.INSTANCE.trackWidgetSizeUpdate("${min_width}px")
@@ -83,18 +83,18 @@ class StockWidget() : AppWidgetProvider() {
Injector.appComponent.inject(this)
injected = true
}
Timber.i("onEnabled")
Timber.d("onEnabled")
stocksProvider.schedule()
}
override fun onDisabled(context: Context?) {
super.onDisabled(context)
Timber.i("onDisabled")
Timber.d("onDisabled")
}
override fun onDeleted(context: Context?, appWidgetIds: IntArray?) {
super.onDeleted(context, appWidgetIds)
Timber.i("onDeleted")
Timber.d("onDeleted")
appWidgetIds?.let {
it.forEach { widgetId ->
widgetDataProvider.widgetRemoved(widgetId)