Skip to content

Commit

Permalink
fix some errors, clean up, and release app
Browse files Browse the repository at this point in the history
  • Loading branch information
Haf0 committed Jun 15, 2022
1 parent 09e622e commit a0921cb
Show file tree
Hide file tree
Showing 12 changed files with 21 additions and 25 deletions.
4 changes: 2 additions & 2 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ android {
applicationId "com.bangkit.capstone"
minSdk 21
targetSdk 31
versionCode 5
versionName "0.5"
versionCode 6
versionName "2.5"

testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
Expand Down
Binary file modified app/release/app-release.apk
Binary file not shown.
4 changes: 2 additions & 2 deletions app/release/output-metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
"type": "SINGLE",
"filters": [],
"attributes": [],
"versionCode": 5,
"versionName": "0.5",
"versionCode": 6,
"versionName": "2.5",
"outputFile": "app-release.apk"
}
],
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
package com.bangkit.capstone.splash

import android.content.Intent
import androidx.appcompat.app.AppCompatActivity
import android.os.Bundle
import androidx.appcompat.app.AppCompatActivity
import androidx.lifecycle.lifecycleScope
import com.bangkit.capstone.R
import com.bangkit.capstone.databinding.ActivityOnboardingBinding
import com.bangkit.capstone.ui.MainActivity
import com.bangkit.capstone.ui.AccessbilityActivity
import kotlinx.coroutines.launch
import java.util.*
import kotlin.concurrent.schedule
Expand Down Expand Up @@ -38,7 +37,7 @@ class OnboardingActivity : AppCompatActivity() {
}
}
private fun moveActivity() {
val intent = Intent(this, MainActivity::class.java)
val intent = Intent(this, AccessbilityActivity::class.java)
Timer("SettingUp", false).schedule(500) {
startActivity(intent)
finish()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,10 @@ package com.bangkit.capstone.splash

import android.annotation.SuppressLint
import android.content.Intent
import androidx.appcompat.app.AppCompatActivity
import android.os.Bundle
import androidx.appcompat.app.AppCompatActivity
import com.bangkit.capstone.R
import com.bangkit.capstone.ui.AccessbilityActivity
import com.bangkit.capstone.ui.CategoryActivity
import com.bangkit.capstone.ui.MainActivity
import java.util.*
import kotlin.concurrent.schedule

Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
package com.bangkit.capstone.ui

import android.content.Intent
import androidx.appcompat.app.AppCompatActivity
import android.os.Bundle
import androidx.appcompat.app.AppCompatActivity
import androidx.lifecycle.asLiveData
import com.bangkit.capstone.R
import com.bangkit.capstone.databinding.ActivityAccessbilityBinding
import com.bangkit.capstone.splash.Checker
import com.bangkit.capstone.splash.OnboardingActivity
Expand Down
4 changes: 0 additions & 4 deletions app/src/main/java/com/bangkit/capstone/ui/CategoryActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,7 @@ package com.bangkit.capstone.ui
import android.content.Intent
import android.os.Bundle
import androidx.appcompat.app.AppCompatActivity
import androidx.lifecycle.asLiveData
import com.bangkit.capstone.databinding.ActivityCategoryBinding
import com.bangkit.capstone.splash.Checker
import com.bangkit.capstone.splash.OnboardingActivity
import com.bangkit.capstone.splash.PassChecker
import kotlin.properties.Delegates

class CategoryActivity : AppCompatActivity() {
Expand Down
4 changes: 2 additions & 2 deletions app/src/main/java/com/bangkit/capstone/ui/MainActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ class MainActivity : AppCompatActivity() {
if(binding?.isConnected?.visibility == View.GONE){
if (msg!=""){
userChat(msg)
mainViewModel.getBotResponse(msg, category,isAccessbility)
mainViewModel.getBotResponse(msg, category)
binding?.edittextChatLog?.setText("")
}else{
if (isAccessbility){
Expand Down Expand Up @@ -186,7 +186,7 @@ class MainActivity : AppCompatActivity() {

if(spokenText!=null){
userChat(spokenText)
mainViewModel.getBotResponse(spokenText, category,isAccessbility)
mainViewModel.getBotResponse(spokenText, category)
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ class MainViewModel(application: Application) : ViewModel() {
val textMessage: LiveData<String> = _textMessage


fun getBotResponse(message:String, categid:Int, isAccessbility: Boolean){
fun getBotResponse(message:String, categid:Int){
_isLoading.value = true
val client = ApiConfig.getApiService().getResponse(message, categid)
client.enqueue(object : Callback<BotResponse>{
Expand Down
6 changes: 4 additions & 2 deletions app/src/main/res/layout/activity_main.xml
Original file line number Diff line number Diff line change
Expand Up @@ -69,13 +69,15 @@
android:id="@+id/ask_button"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="ask a question" />
android:text="@string/ask_a_question"
android:contentDescription="@string/contentdesc_button_ask"/>

<Button
android:id="@+id/back_button"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Back to category"/>
android:text="@string/back_to_category"
android:contentDescription="@string/back_to_category"/>
</LinearLayout>

<androidx.constraintlayout.widget.ConstraintLayout
Expand Down
3 changes: 1 addition & 2 deletions app/src/main/res/layout/custom_toolbar.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/toolbarCustom"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:foreground="?attr/selectableItemBackground">
android:layout_height="wrap_content">

<RelativeLayout
android:layout_width="match_parent"
Expand Down
5 changes: 4 additions & 1 deletion app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -29,5 +29,8 @@
<string name="category6">Traveloka QR Scanner</string>
<string name="icon_category_desc">Icon Category</string>
<string name="title_Category">Perihal Apa yang Ingin \nDitanyakan?</string>
<string name="bot_name">si Loka</string>
<string name="ask_a_question">ask a question</string>
<string name="back_to_category">Back to category</string>
<string name="contentdesc_button_ask">tanyakan sebuah pertanyaan tombol</string>
<string name="bot_name">SLoka</string>
</resources>

0 comments on commit a0921cb

Please sign in to comment.