Skip to content

Commit

Permalink
Fix openMF#144 Add toolbar for ComputerVision activity
Browse files Browse the repository at this point in the history
  • Loading branch information
yashk2000 committed Jul 18, 2020
1 parent ae4cbd3 commit 9c8abbf
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
package org.mifos.visionppi.ui.new_survey

import android.content.Intent
import android.os.Bundle
import android.view.View
import android.widget.Toast
import androidx.fragment.app.Fragment
import androidx.fragment.app.FragmentActivity
Expand All @@ -12,6 +14,7 @@ import org.jetbrains.anko.uiThread
import org.mifos.visionppi.R
import org.mifos.visionppi.objects.PPISurvey
import org.mifos.visionppi.objects.Response
import org.mifos.visionppi.ui.computer_vision.ComputerVisionActivity

class NewPPISurveyActivity : FragmentActivity(), NewSurveyMVPView {

Expand All @@ -36,6 +39,11 @@ class NewPPISurveyActivity : FragmentActivity(), NewSurveyMVPView {
}
}

fun launchCVActivity(v: View) {
val intent = Intent(applicationContext, ComputerVisionActivity::class.java)
startActivity(intent)
}

override fun getSurveyQuestions() {
mPPISurvey = mNewSurveyPresenter.getSurvey(1, applicationContext, this)
}
Expand Down
1 change: 1 addition & 0 deletions visionppi/app/src/main/res/layout/new_survey_toolbar.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
android:layout_height="40dp"
android:src="@drawable/eye"
android:scaleType="fitCenter"
android:onClick="launchCVActivity"
android:background="@color/cardview_light_background"
style="@style/Button"
android:id="@+id/computer_vision"/>
Expand Down
5 changes: 5 additions & 0 deletions visionppi/app/src/main/res/layout/ppi_question_layout.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@
android:layout_width="match_parent"
android:layout_height="match_parent">

<include
layout="@layout/new_survey_toolbar"
android:layout_width="match_parent"
android:layout_height="wrap_content"/>

<TextView
android:text=""
android:id="@+id/question"
Expand Down

0 comments on commit 9c8abbf

Please sign in to comment.