Skip to content

Commit

Permalink
Merge pull request #173 from yashk2000/about
Browse files Browse the repository at this point in the history
Fix #51 Add about screen
  • Loading branch information
yashk2000 committed Aug 23, 2020
2 parents 965d07f + 9aff50b commit 1966e1e
Show file tree
Hide file tree
Showing 16 changed files with 379 additions and 2 deletions.
3 changes: 3 additions & 0 deletions visionppi/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@
<activity
android:name=".ui.computer_vision.ComputerVisionActivity"
android:label="Computer Vision"></activity>
<activity
android:name=".ui.AboutActivity"
android:label="@string/about"/>
<activity
android:name=".ui.activities.SplashActivity"
android:theme="@style/SplashTheme">
Expand Down
10 changes: 9 additions & 1 deletion visionppi/app/src/main/java/org/mifos/visionppi/MainActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,9 @@ import androidx.navigation.ui.AppBarConfiguration
import androidx.navigation.ui.setupActionBarWithNavController
import androidx.navigation.ui.setupWithNavController
import com.google.android.material.bottomnavigation.BottomNavigationView
import kotlinx.android.synthetic.main.toolbar.appToolbar
import kotlinx.android.synthetic.main.toolbar.*
import org.mifos.visionppi.api.local.PreferencesHelper
import org.mifos.visionppi.ui.AboutActivity
import org.mifos.visionppi.ui.activities.LoginActivity
import org.mifos.visionppi.utils.PrefManager

Expand Down Expand Up @@ -48,6 +49,7 @@ class MainActivity : AppCompatActivity() {
prefManager.clear(this, baseContext)
val intent = Intent(applicationContext, LoginActivity::class.java)
startActivity(intent)
finish()
true
}
R.id.share -> {
Expand All @@ -61,6 +63,12 @@ class MainActivity : AppCompatActivity() {
startActivity(sendIntent)
true
}
R.id.about -> {
intent.setClass(this, AboutActivity::class.java)
startActivity(intent)
finish()
true
}
else -> super.onOptionsItemSelected(item)
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
/*
* This project is licensed under the open source MPL V2.
* See https://github.com/openMF/android-client/blob/master/LICENSE.md
*/
package org.mifos.visionppi.api

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
package org.mifos.visionppi.ui

import android.content.Intent
import android.net.Uri
import android.os.Bundle
import android.view.MenuItem
import android.view.View
import androidx.appcompat.app.AppCompatActivity
import kotlinx.android.synthetic.main.toolbar.*
import org.mifos.visionppi.MainActivity
import org.mifos.visionppi.R

class AboutActivity : AppCompatActivity() {
var contributors = "https://github.com/openMF/ppi-vision/graphs/contributors"
var gitHub = "https://github.com/openMF/ppi-vision"
var twitter = "https://twitter.com/mifos"
var license = "https://github.com/openMF/ppi-vision/blob/master/LICENSE"
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_about)

setSupportActionBar(appToolbar)
val actionBar = supportActionBar
actionBar?.title = "About"

actionBar?.setDisplayHomeAsUpEnabled(true)
actionBar?.setDisplayShowHomeEnabled(true)
}

override fun onOptionsItemSelected(item: MenuItem): Boolean {
when (item.getItemId()) {
android.R.id.home -> {
val intent = Intent(this, MainActivity::class.java)
startActivity(intent)
finish()
}
}
return true
}

override fun onBackPressed() {
super.onBackPressed()
val intent = Intent(this, MainActivity::class.java)
startActivity(intent)
finish()
}

fun goToWeb(view: View?) {
link(contributors)
}

fun goToGit(view: View?) {
link(gitHub)
}

fun goToTwitter(view: View?) {
link(twitter)
}

fun goToLicense(view: View?) {
link(license)
}

fun link(url: String?) {
val intent = Intent(Intent.ACTION_VIEW)
intent.data = Uri.parse(url)
startActivity(intent)
}
}
11 changes: 11 additions & 0 deletions visionppi/app/src/main/res/drawable-anydpi/ic_info.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24"
android:tint="#333333"
android:alpha="0.6">
<path
android:fillColor="@android:color/white"
android:pathData="M12,2C6.48,2 2,6.48 2,12s4.48,10 10,10 10,-4.48 10,-10S17.52,2 12,2zM13,17h-2v-6h2v6zM13,9h-2L11,7h2v2z"/>
</vector>
Binary file added visionppi/app/src/main/res/drawable-hdpi/ic_info.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added visionppi/app/src/main/res/drawable-mdpi/ic_info.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 9 additions & 0 deletions visionppi/app/src/main/res/drawable/ic_github.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportHeight="24"
android:viewportWidth="24">
<path
android:fillColor="#000"
android:pathData="M12,2A10,10 0 0,0 2,12C2,16.42 4.87,20.17 8.84,21.5C9.34,21.58 9.5,21.27 9.5,21C9.5,20.77 9.5,20.14 9.5,19.31C6.73,19.91 6.14,17.97 6.14,17.97C5.68,16.81 5.03,16.5 5.03,16.5C4.12,15.88 5.1,15.9 5.1,15.9C6.1,15.97 6.63,16.93 6.63,16.93C7.5,18.45 8.97,18 9.54,17.76C9.63,17.11 9.89,16.67 10.17,16.42C7.95,16.17 5.62,15.31 5.62,11.5C5.62,10.39 6,9.5 6.65,8.79C6.55,8.54 6.2,7.5 6.75,6.15C6.75,6.15 7.59,5.88 9.5,7.17C10.29,6.95 11.15,6.84 12,6.84C12.85,6.84 13.71,6.95 14.5,7.17C16.41,5.88 17.25,6.15 17.25,6.15C17.8,7.5 17.45,8.54 17.35,8.79C18,9.5 18.38,10.39 18.38,11.5C18.38,15.32 16.04,16.16 13.81,16.41C14.17,16.72 14.5,17.33 14.5,18.26C14.5,19.6 14.5,20.68 14.5,21C14.5,21.27 14.66,21.59 15.17,21.5C19.14,20.16 22,16.42 22,12A10,10 0 0,0 12,2Z" />
</vector>
4 changes: 4 additions & 0 deletions visionppi/app/src/main/res/drawable/ic_license.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<vector android:height="24dp" android:viewportHeight="100"
android:viewportWidth="100" android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android">
<path android:fillColor="#FF000000" android:pathData="M13,52.4c1,3.1 3.4,5.5 6.5,6.4c2.1,0.6 3.5,2.6 3.5,4.8c0,2.7 1,5.2 2.9,7.1c2.7,2.7 6.7,3.6 10.3,2.4c2.1,-0.7 4.4,0 5.7,1.8c1.9,2.7 4.9,4.2 8.1,4.2c3.2,0 6.3,-1.6 8.1,-4.2c1.3,-1.8 3.6,-2.5 5.7,-1.8c3.6,1.2 7.6,0.2 10.3,-2.4c1.9,-1.9 2.9,-4.5 2.9,-7.1c0,-2.2 1.4,-4.2 3.5,-4.8c3.1,-0.9 5.6,-3.3 6.6,-6.4c1,-3.1 0.4,-6.4 -1.5,-9c-1.3,-1.8 -1.3,-4.2 0,-5.9c1.9,-2.6 2.5,-5.9 1.5,-9c-1,-3.1 -3.4,-5.5 -6.5,-6.4c-2.1,-0.6 -3.5,-2.6 -3.5,-4.8c0,-2.7 -1,-5.3 -2.9,-7.2c-2.7,-2.7 -6.7,-3.6 -10.3,-2.5c-2.1,0.7 -4.4,-0.1 -5.6,-1.8c-1.9,-2.6 -4.9,-4.2 -8.1,-4.2c-3.2,0 -6.3,1.5 -8.1,4.2c-1.3,1.8 -3.6,2.5 -5.7,1.8C35.2,7.2 34.1,7 33,7l0,0c-2.7,0 -5.2,1.1 -7.1,3C24,11.9 23,14.5 23,17.1c0,2.2 -1.4,4.2 -3.5,4.8c-3.1,0.9 -5.6,3.3 -6.6,6.4c-1,3.1 -0.4,6.4 1.5,9c1.3,1.8 1.3,4.2 0,5.9C12.5,45.9 12,49.3 13,52.4zM18.5,34.4c-1.6,-2.2 -1.2,-5.4 1.1,-7c0.4,-0.3 0.9,-0.6 1.4,-0.7c4.2,-1.3 7.1,-5.2 7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-2.5,2.3 -4.1,2.3c-0.2,0 -0.5,0 -0.7,0c-1.9,-0.3 -3.5,-1.6 -4,-3.5l-2.2,-7.6l-7.8,1.3C8.5,89 6.6,88.2 5.5,86.5L5.5,86.5zM85.7,67.2l8.8,14c1.5,2.3 0.8,5.3 -1.5,6.8c-1,0.7 -2.3,0.9 -3.5,0.7l-7.8,-1.3L79.5,95c-0.5,1.9 -2.1,3.2 -4,3.5c-0.2,0 -0.5,0 -0.7,0c-1.7,0 -3.3,-0.9 -4.1,-2.3l-9,-14.2c-0.7,-1.2 -0.3,-2.7 0.9,-3.4c1.1,-0.7 2.6,-0.3 3.3,0.8l8.8,14.1l2.2,-7.7c0.7,-2.3 2.9,-3.7 5.2,-3.3l7.9,1.3l-8.7,-13.8c-0.8,-1.1 -0.5,-2.7 0.7,-3.5c1.1,-0.8 2.7,-0.5 3.5,0.7C85.6,67.1 85.7,67.2 85.7,67.2L85.7,67.2zM45.7,62.2c1.4,0.3 2.9,0.4 4.3,0.4c12.3,0 22.3,-10 22.3,-22.3s-10,-22.3 -22.3,-22.3s-22.3,10 -22.3,22.3C27.7,51 35.3,60.1 45.7,62.2zM33,37c1.6,-8.1 8.7,-13.9 17,-13.9c1.1,0 2.2,0.1 3.3,0.3c9.4,1.8 15.4,10.9 13.6,20.3C65.1,53.1 56,59.1 46.6,57.3C37.3,55.4 31.2,46.4 33,37C33,37 33,37 33,37zM40.2,39.2c0.7,-1.2 2.2,-1.6 3.4,-0.9c1.4,0.8 2.7,1.8 3.8,3c2.6,-3.1 5.5,-5.9 8.9,-8.2c1.1,-0.8 2.7,-0.5 3.5,0.6s0.5,2.7 -0.6,3.5l0,0c-3.8,2.6 -7.1,5.9 -9.7,9.7c-0.5,0.7 -1.2,1.1 -2,1.1h-0.1c-0.9,0 -1.6,-0.5 -2.1,-1.2c-1,-1.7 -2.4,-3.1 -4.1,-4.1C39.9,42 39.5,40.5 40.2,39.2L40.2,39.2z"/>
</vector>
9 changes: 9 additions & 0 deletions visionppi/app/src/main/res/drawable/ic_twitter.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportHeight="486.392"
android:viewportWidth="486.392">
<path
android:fillColor="#010002"
android:pathData="M395.2,0H91.2C40.8,0 0,40.8 0,91.2v304c0,50.4 40.8,91.2 91.2,91.2h304c50.4,0 91.2,-40.8 91.2,-91.2V91.2C486.4,40.8 445.6,0 395.2,0zM364.2,188.6l0.2,7.8c0,79.2 -60.2,170.4 -170.4,170.4c-33.8,0 -65.3,-9.9 -91.8,-26.9c4.7,0.5 9.5,0.9 14.3,0.9c28.1,0 53.9,-9.6 74.4,-25.6c-26.2,-0.5 -48.3,-17.8 -55.9,-41.6c3.7,0.7 7.4,1 11.3,1c5.5,0 10.8,-0.7 15.8,-2.1c-27.4,-5.5 -48,-29.7 -48,-58.7v-0.8c8.1,4.5 17.3,7.2 27.1,7.5c-16.1,-10.7 -26.6,-29.1 -26.6,-49.8c0,-11 2.9,-21.2 8.1,-30.1c29.5,36.2 73.7,60.1 123.4,62.6c-1,-4.4 -1.5,-9 -1.5,-13.6c0,-33 26.8,-59.9 59.9,-59.9c17.2,0 32.8,7.3 43.7,18.9c13.6,-2.7 26.4,-7.7 38,-14.5c-4.5,14 -14,25.7 -26.3,33.1c12.1,-1.4 23.7,-4.7 34.4,-9.4C386.1,169.7 375.9,180.2 364.2,188.6z" />
</vector>

0 comments on commit 1966e1e

Please sign in to comment.