Skip to content

Commit

Permalink
Release Version 0.9.20
Browse files Browse the repository at this point in the history
- fix location permissions
- voice recorder dir exception
- room version
  • Loading branch information
FarshidRoohi committed Mar 12, 2021
1 parent 288b2a9 commit fc3090e
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 12 deletions.
5 changes: 3 additions & 2 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ android {
minSdkVersion 18
targetSdkVersion 29
multiDexEnabled true
versionCode 11
versionName "0.9.11"
versionCode 20
versionName "0.9.20"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
signingConfigs {
Expand Down Expand Up @@ -53,6 +53,7 @@ play {
}

dependencies {

implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version"
implementation 'androidx.appcompat:appcompat:1.2.0'
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.RECORD_AUDIO" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_BACKGROUND_LOCATION"/>
<uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
<uses-permission android:name="android.permission.VIBRATE" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import ir.roohi.farshid.reminderpro.model.VoiceEntity
* ReminderPro | Copyrights 2018.
*/

@Database(entities = [NoteEntity::class, VoiceEntity::class, LocationEntity::class], version = 1)
@Database(entities = [NoteEntity::class, VoiceEntity::class, LocationEntity::class], version = 2)
@TypeConverters(DateConverter::class)
abstract class AppDatabase : RoomDatabase() {

Expand All @@ -38,7 +38,8 @@ abstract class AppDatabase : RoomDatabase() {
if (instance == null) {
instance =
Room.databaseBuilder(context.applicationContext, AppDatabase::class.java, DATABASE_NAME)
.build()
.fallbackToDestructiveMigration()
.build()
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ fun shareVoice(context: Context, path: String) {


fun Context.toast(msg: String) {
Toast.makeText(this, msg, Toast.LENGTH_LONG).show()
Toast.makeText(this, msg.trim(), Toast.LENGTH_LONG).show()
}

fun Context.toast(@StringRes msg: Int) {
Expand Down Expand Up @@ -99,7 +99,7 @@ private fun capitalize(s: String?): String {
}

fun Context.voiceDIR(): String {
return "${pathDir()}/record/voice-${randomName()}.3gp"
return "${pathDir()}/record"
}

fun Context.pathDir(): String {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,13 @@ import android.os.SystemClock
import androidx.lifecycle.ViewModelProviders
import ir.roohi.farshid.reminderpro.R
import ir.roohi.farshid.reminderpro.listener.OnPermissionRequestListener
import ir.roohi.farshid.reminderpro.utility.voiceDIR
import ir.roohi.farshid.reminderpro.utility.initialize
import ir.roohi.farshid.reminderpro.utility.toast
import ir.roohi.farshid.reminderpro.utility.toHumanTime
import ir.roohi.farshid.reminderpro.utility.*
import ir.roohi.farshid.reminderpro.viewModel.VoiceViewModel
import ir.roohi.farshid.reminderpro.views.bottomSheet.NameBottomSheet
import kotlinx.android.synthetic.main.activity_voice_record.*
import java.io.File
import java.io.IOException
import java.sql.Time


/**
Expand Down Expand Up @@ -63,11 +62,15 @@ class VoiceRecordActivity : BaseActivity() {
fabRecord.setImageResource(R.drawable.ic_stop)

try {
this.voiceDIR = this.voiceDIR()
val dir = this.voiceDIR()
File(dir)
.mkdirs()
this.voiceDIR = "$dir/voice-${randomName()}.3gp"
this.mediaRecorder.initialize()
mediaRecorder.setOutputFile(this.voiceDIR)
mediaRecorder.prepare()
mediaRecorder.start()
txtChronometer.base = SystemClock.elapsedRealtime()
txtChronometer.start()
toast(R.string.start_recording)
fabDelete.isEnabled = false
Expand Down

0 comments on commit fc3090e

Please sign in to comment.