Skip to content

Commit

Permalink
Merge pull request #74 from amardeshbd/develop
Browse files Browse the repository at this point in the history
Release for v1.3
  • Loading branch information
hossain-khan authored Jun 10, 2020
2 parents 7c572ab + 9c314cd commit 14a2001
Show file tree
Hide file tree
Showing 51 changed files with 11,788 additions and 202 deletions.
31 changes: 31 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
---
name: Bug report
about: Create a report to help us improve
title: ''
labels: bug, help wanted, question
assignees: ''

---

**Describe the bug**
A clear and concise description of what the bug is.

**To Reproduce**
Steps to reproduce the behavior:
1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error

**Expected behavior**
A clear and concise description of what you expected to happen.

**Screenshots**
If applicable, add screenshots to help explain your problem.

**Smartphone (please complete the following information):**
- Device: [e.g. Galaxy S9+]
- OS Version: [e.g. 9.0]

**Additional context**
Add any other context about the problem here.
17 changes: 17 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
---
name: Feature request
about: Suggest an idea for this project
title: ''
labels: enhancement, help wanted
assignees: ''

---

**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

**Describe the solution you'd like**
A clear and concise description of what you want to happen.

**Additional context**
Add any other context or screenshots about the feature request here.
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,13 @@ Android client app for https://github.com/2020PB/police-brutality (Repository co
<img src="https://raw.githubusercontent.com/amardeshbd/android-police-brutality-incidents/develop/resources/poster/github-repository-social-preview.png" width="50%">
</p>

### Early BETA Testing
### Early BETA Testing 🚧
If you want to try the app as it is being developed, you can get the latest Android APK in 2 different ways:
* GitHub Releases - See [current release](https://github.com/amardeshbd/android-police-brutality-incidents/releases) with APK bundled with it.
* Firebase App Distribution - Subscribe to new updates via email. Use this [open-beta testing](https://appdistribution.firebase.dev/i/5d2cb8359305f7e7) process. The invite email will be sent on next release, not immediately.

> NOTE: App will be available in Google Play in few days after it's reviewed and approved.
## Objective

The objective of the app is to be front-end of the data that is collected and exposed by [police-brutality](https://github.com/2020PB/police-brutality) repository.
Expand Down
5 changes: 5 additions & 0 deletions android-app/.idea/codeStyles/Project.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 8 additions & 3 deletions android-app/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ android {
applicationId "com.blacklivesmatter.policebrutality"
minSdkVersion rootProject.minSdkVersion
targetSdkVersion rootProject.targetSdkVersion
versionCode 3
versionName "1.2"
versionCode 4
versionName "1.3"

testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"

Expand All @@ -48,7 +48,9 @@ android {

buildTypes {
release {
minifyEnabled false
// https://developer.android.com/studio/build/shrink-code
minifyEnabled true // Enables code shrinking, obfuscation, and optimization
shrinkResources true // Enables resource shrinking
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
signingConfig signingConfigs.config
}
Expand Down Expand Up @@ -81,6 +83,7 @@ dependencies {
implementation "androidx.constraintlayout:constraintlayout:$rootProject.constraintLayoutVersion"
implementation "androidx.cardview:cardview:$rootProject.cardViewVersion"
implementation "androidx.preference:preference:$rootProject.preferenceVersion"
implementation "androidx.swiperefreshlayout:swiperefreshlayout:1.1.0-rc01"

// Firebase
implementation "com.google.firebase:firebase-analytics:$rootProject.firebaseAnalyticsVersion"
Expand Down Expand Up @@ -115,6 +118,8 @@ dependencies {

implementation "com.jakewharton.timber:timber:$rootProject.timberVersion"

implementation "org.threeten:threetenbp:1.4.4" // https://www.threeten.org/threetenbp/

// debugImplementation because LeakCanary should only run in debug builds.
debugImplementation "com.squareup.leakcanary:leakcanary-android:2.3"

Expand Down
10 changes: 9 additions & 1 deletion android-app/app/proguard-rules.pro
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,12 @@

# If you keep the line number information, uncomment this to
# hide the original source file name.
#-renamesourcefileattribute SourceFile
#-renamesourcefileattribute SourceFile

# Ignore following warnings:
# AGPBI: {"kind":"warning","text":"Missing class: java.util.concurrent.Flow$Processor","sources":[{}],"tool":"R8"}
# https://github.com/ReactiveX/RxJava/issues/6698
-dontwarn org.reactivestreams.FlowAdapters
-dontwarn org.reactivestreams.**
-dontwarn java.util.concurrent.Flow.**
-dontwarn java.util.concurrent.**
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
{
"formatVersion": 1,
"database": {
"version": 3,
"identityHash": "a6e8d2dedfed1c349fbc1f85a78b8ab8",
"entities": [
{
"tableName": "incidents",
"createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`_id` INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, `incident_id` TEXT, `state` TEXT, `edit_url` TEXT, `city` TEXT, `name` TEXT, `date` TEXT, `date_text` TEXT, `links` TEXT NOT NULL)",
"fields": [
{
"fieldPath": "_id",
"columnName": "_id",
"affinity": "INTEGER",
"notNull": true
},
{
"fieldPath": "incident_id",
"columnName": "incident_id",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "state",
"columnName": "state",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "edit_at",
"columnName": "edit_url",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "city",
"columnName": "city",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "name",
"columnName": "name",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "date",
"columnName": "date",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "date_text",
"columnName": "date_text",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "links",
"columnName": "links",
"affinity": "TEXT",
"notNull": true
}
],
"primaryKey": {
"columnNames": [
"_id"
],
"autoGenerate": true
},
"indices": [],
"foreignKeys": []
}
],
"views": [],
"setupQueries": [
"CREATE TABLE IF NOT EXISTS room_master_table (id INTEGER PRIMARY KEY,identity_hash TEXT)",
"INSERT OR REPLACE INTO room_master_table (id,identity_hash) VALUES(42, 'a6e8d2dedfed1c349fbc1f85a78b8ab8')"
]
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
{
"formatVersion": 1,
"database": {
"version": 4,
"identityHash": "242e3b94374f61870cfc739505c6ed2c",
"entities": [
{
"tableName": "incidents",
"createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` TEXT NOT NULL, `incident_id` TEXT, `state` TEXT, `city` TEXT, `name` TEXT, `date` TEXT, `geocoding` TEXT NOT NULL, `links` TEXT NOT NULL, PRIMARY KEY(`id`))",
"fields": [
{
"fieldPath": "id",
"columnName": "id",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "incident_id",
"columnName": "incident_id",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "state",
"columnName": "state",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "city",
"columnName": "city",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "name",
"columnName": "name",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "date",
"columnName": "date",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "geocoding",
"columnName": "geocoding",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "links",
"columnName": "links",
"affinity": "TEXT",
"notNull": true
}
],
"primaryKey": {
"columnNames": [
"id"
],
"autoGenerate": false
},
"indices": [
{
"name": "index_incidents_incident_id",
"unique": false,
"columnNames": [
"incident_id"
],
"createSql": "CREATE INDEX IF NOT EXISTS `index_incidents_incident_id` ON `${TABLE_NAME}` (`incident_id`)"
}
],
"foreignKeys": []
}
],
"views": [],
"setupQueries": [
"CREATE TABLE IF NOT EXISTS room_master_table (id INTEGER PRIMARY KEY,identity_hash TEXT)",
"INSERT OR REPLACE INTO room_master_table (id,identity_hash) VALUES(42, '242e3b94374f61870cfc739505c6ed2c')"
]
}
}

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,16 @@ import android.os.Bundle
import androidx.databinding.DataBindingUtil
import androidx.lifecycle.ViewModelProvider
import androidx.navigation.findNavController
import androidx.navigation.ui.AppBarConfiguration
import androidx.navigation.ui.setupWithNavController
import com.blacklivesmatter.policebrutality.databinding.ActivityMainBinding
import com.google.android.material.bottomnavigation.BottomNavigationView
import dagger.android.support.DaggerAppCompatActivity
import javax.inject.Inject

/**
* The container activity for the app using "single-activity" pattern.
* This activity hosts fragments and the flow is managed by AndroidX Jetpack navigation library.
*/
class MainActivity : DaggerAppCompatActivity() {

@Inject
Expand All @@ -27,16 +30,6 @@ class MainActivity : DaggerAppCompatActivity() {
val navView: BottomNavigationView = findViewById(R.id.nav_view)

val navController = findNavController(R.id.nav_host_fragment)
// Passing each menu ID as a set of Ids because each
// menu should be considered as top level destinations.
val appBarConfiguration = AppBarConfiguration(
setOf(
R.id.navigation_menu_incident,
R.id.navigation_menu_report,
R.id.navigation_menu_more_info
)
)
// setupActionBarWithNavController(navController, appBarConfiguration)
navView.setupWithNavController(navController)
}
}
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
package com.blacklivesmatter.policebrutality

import androidx.lifecycle.ViewModel
import com.blacklivesmatter.policebrutality.data.IncidentRepository
import javax.inject.Inject
import timber.log.Timber
import javax.inject.Inject

class MainViewModel @Inject constructor(
private val incidentRepository: IncidentRepository
) : ViewModel() {
/**
* The ViewModel for [MainActivity].
* For now there is nothing special going on here. All actions are managed in Fragments.
*/
class MainViewModel @Inject constructor() : ViewModel() {
init {
Timber.d("Got incident repo: $incidentRepository")
Timber.d("Main ViewModel loaded.")
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
package com.blacklivesmatter.policebrutality.api

import com.blacklivesmatter.policebrutality.data.model.Incident
import com.blacklivesmatter.policebrutality.data.model.IncidentsSource
import retrofit2.http.GET
import retrofit2.http.Path
import retrofit2.http.Query

/**
* Retrofit API service class for https://github.com/949mac/846-backend#api
*/
interface IncidentApi {
companion object {
const val INCLUDE_TYPE_EVIDENCE = "evidence"
}

/**
* List all catalog Incidents of Police Assault
* The [includeType] can be [INCLUDE_TYPE_EVIDENCE] to include Video Evidence on all the incidents
*
* Examples:
* - https://api.846policebrutality.com/api/incidents
* - https://api.846policebrutality.com/api/incidents?include=evidence
*/
@GET("incidents")
suspend fun getAllIncidents(@Query("include") includeType: String? = null): IncidentsSource

/**
* Provides a Single Incident of Police Assault
* The [includeType] can be [INCLUDE_TYPE_EVIDENCE] to include Video Evidence on the Incident
*
* Examples:
* - https://api.846policebrutality.com/api/incidents/7b060ec0-a9d6-11ea-ab9b-7579ddf3de22
* - https://api.846policebrutality.com/api/incidents/7b060ec0-a9d6-11ea-ab9b-7579ddf3de22?include=evidence
*/
@GET("incidents/{id}")
suspend fun getIncident(@Path("id") id: String, @Query("include") includeType: String? = null): Incident
}
Loading

0 comments on commit 14a2001

Please sign in to comment.