Skip to content

Commit

Permalink
version 1.01
Browse files Browse the repository at this point in the history
  • Loading branch information
Kasim Rangwala committed Aug 11, 2018
1 parent 7c4a3a4 commit 40bd78b
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 15 deletions.
Binary file modified .idea/caches/build_file_checksums.ser
Binary file not shown.
4 changes: 2 additions & 2 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ android {
applicationId "io.gripxtech.odoojsonrpcclient"
minSdkVersion 17
targetSdkVersion 27
versionCode 1
versionName "1.0"
versionCode 2
versionName "1.01"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
vectorDrawables.useSupportLibrary = true
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ import io.gripxtech.odoojsonrpcclient.*
import io.gripxtech.odoojsonrpcclient.core.Odoo
import io.gripxtech.odoojsonrpcclient.core.OdooUser
import io.gripxtech.odoojsonrpcclient.core.entities.session.authenticate.AuthenticateResult
import io.gripxtech.odoojsonrpcclient.core.utils.android.ktx.subscribeEx
import io.reactivex.Observable
import io.reactivex.Observer
import io.reactivex.android.schedulers.AndroidSchedulers
import io.reactivex.disposables.CompositeDisposable
import io.reactivex.disposables.Disposable
Expand Down Expand Up @@ -139,27 +139,25 @@ class SplashActivity : AppCompatActivity() {
}
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(object : Observer<Boolean> {
override fun onSubscribe(d: Disposable) {
.subscribeEx {
onSubscribe { _: Disposable ->
// Must be complete, not dispose in between
// compositeDisposable.add(d)
}

override fun onNext(t: Boolean) {
onNext { t: Boolean ->
if (t) {
restartApp()
} else {
closeApp()
}
}

override fun onError(e: Throwable) {
e.printStackTrace()
closeApp(message = e.message ?: getString(R.string.generic_error))
onError { error: Throwable ->
error.printStackTrace()
closeApp(message = error.message ?: getString(R.string.generic_error))
}

override fun onComplete() = Unit
})
}
}

private fun startLoginActivity() {
Expand All @@ -168,8 +166,7 @@ class SplashActivity : AppCompatActivity() {
}

private fun startMainActivity() {
// startActivity(Intent(this@SplashActivity, MainActivity::class.java))
startActivity(Intent(this@SplashActivity, SomeActivity::class.java))
startActivity(Intent(this@SplashActivity, MainActivity::class.java))
finish()
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import io.gripxtech.odoojsonrpcclient.App
import io.gripxtech.odoojsonrpcclient.GlideApp
import io.gripxtech.odoojsonrpcclient.R
import io.gripxtech.odoojsonrpcclient.core.OdooUser
import io.gripxtech.odoojsonrpcclient.trimFalse

class NavHeaderViewHolder(view: View) {
val pic: CircleImageView = view.findViewById(R.id.userImage)
Expand All @@ -22,7 +23,7 @@ class NavHeaderViewHolder(view: View) {
fun setUser(user: OdooUser) {
name.text = user.name
email.text = user.login
if (user.imageSmall != "false") {
if (user.imageSmall.trimFalse().isNotEmpty()) {
val byteArray = Base64.decode(user.imageSmall, Base64.DEFAULT)
GlideApp.with(pic.context)
.asBitmap()
Expand Down

0 comments on commit 40bd78b

Please sign in to comment.