Skip to content
This repository was archived by the owner on Jun 7, 2020. It is now read-only.

Commit

Permalink
Update app dependencies version.
Browse files Browse the repository at this point in the history
  • Loading branch information
philipbrito committed Jul 23, 2019
1 parent 5d68bf6 commit 8497f7f
Show file tree
Hide file tree
Showing 10 changed files with 38 additions and 35 deletions.
8 changes: 4 additions & 4 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ android {
applicationId "chat.rocket.android"
minSdkVersion versions.minSdk
targetSdkVersion versions.targetSdk
versionCode 2073
versionCode 2074
versionName "3.5.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
multiDexEnabled true
Expand Down Expand Up @@ -164,17 +164,17 @@ dependencies {
implementation libraries.glide
implementation libraries.glideTransformations

implementation(libraries.jitsi) { transitive = true }
implementation (libraries.jitsi) { transitive = true }

implementation 'com.google.code.findbugs:jsr305:3.0.2'

// Proprietary libraries
playImplementation libraries.fcm
playImplementation libraries.firebaseAnalytics
playImplementation (libraries.firebaseCrashlytics) { transitive = true }
playImplementation (libraries.firebaseAnswers) { transitive = true }
playImplementation libraries.dynamiclinks
playImplementation libraries.playServicesAuth
playImplementation('com.crashlytics.sdk.android:crashlytics:2.9.8@aar') { transitive = true }
playImplementation('com.crashlytics.sdk.android:answers:1.4.6@aar') { transitive = true }

testImplementation libraries.junit
testImplementation libraries.truth
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,11 @@ import chat.rocket.common.model.Token
import com.squareup.moshi.Moshi
import timber.log.Timber


class SharedPreferencesTokenRepository(private val prefs: SharedPreferences, moshi: Moshi) : TokenRepository {
private var servers = prefs.getStringSet(KEY_SERVERS, emptySet()).toMutableSet()
private var servers = prefs.getStringSet(KEY_SERVERS, emptySet())?.toMutableSet()
private var currentUrl: String? = null
private var currentToken: Token? = null
private val adapter = moshi.adapter<TokenModel>(TokenModel::class.java)
private val adapter = moshi.adapter(TokenModel::class.java)

override fun get(url: String): Token? {
if (currentToken != null && url == currentUrl) {
Expand Down Expand Up @@ -42,7 +41,7 @@ class SharedPreferencesTokenRepository(private val prefs: SharedPreferences, mos
val model = TokenModel(token.userId, token.authToken)
val str = adapter.toJson(model)

servers.add(url)
servers?.add(url)

prefs.edit {
putString(tokenKey(url), str)
Expand All @@ -58,18 +57,18 @@ class SharedPreferencesTokenRepository(private val prefs: SharedPreferences, mos
}

override fun remove(url: String) {
servers.remove(url)
servers?.remove(url)
prefs.edit {
remove(url)
putStringSet(KEY_SERVERS, servers)
}
}

override fun clear() {
servers.forEach { server ->
servers?.forEach { server ->
prefs.edit { remove(server) }
}
servers.clear()
servers?.clear()
prefs.edit {
remove(KEY_SERVERS)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,8 @@ class ChatDetailsFragment : Fragment(), ChatDetailsView {
AndroidSupportInjection.inject(this)

arguments?.run {
chatRoomId = getString(BUNDLE_CHAT_ROOM_ID)
chatRoomType = getString(BUNDLE_CHAT_ROOM_TYPE)
chatRoomId = getString(BUNDLE_CHAT_ROOM_ID, "")
chatRoomType = getString(BUNDLE_CHAT_ROOM_TYPE, "")
isSubscribed = getBoolean(BUNDLE_IS_SUBSCRIBED)
isFavorite = getBoolean(BUNDLE_IS_FAVORITE)
disableMenu = getBoolean(BUNDLE_DISABLE_MENU)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,19 +85,19 @@ class MessageViewHolder(
}
}

override fun unscheduleDrawable(who: Drawable?, what: Runnable?) {
override fun unscheduleDrawable(who: Drawable, what: Runnable) {
with(itemView) {
text_content.removeCallbacks(what)
}
}

override fun invalidateDrawable(p0: Drawable?) {
override fun invalidateDrawable(p0: Drawable) {
with(itemView) {
text_content.invalidate()
}
}

override fun scheduleDrawable(who: Drawable?, what: Runnable?, w: Long) {
override fun scheduleDrawable(who: Drawable, what: Runnable, w: Long) {
with(itemView) {
text_content.postDelayed(what, w)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1175,15 +1175,15 @@ class ChatRoomFragment : Fragment(), ChatRoomView, EmojiKeyboardListener, EmojiR
}
}

override fun unscheduleDrawable(who: Drawable?, what: Runnable?) {
override fun unscheduleDrawable(who: Drawable, what: Runnable) {
text_message?.removeCallbacks(what)
}

override fun invalidateDrawable(who: Drawable?) {
override fun invalidateDrawable(who: Drawable) {
text_message?.invalidate()
}

override fun scheduleDrawable(who: Drawable?, what: Runnable?, `when`: Long) {
override fun scheduleDrawable(who: Drawable, what: Runnable, `when`: Long) {
text_message?.postDelayed(what, `when`)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ class ChatRoomsFragment : Fragment(), ChatRoomsView {
private var isGroupByFavorites = false

private val handler = Handler()
private val dismissConnectionState by lazy { text_connection_status.fadeOut() }
private val dismissConnectionState by lazy { text_connection_status?.fadeOut() }
private var lastConnectionState: State? = null

override fun onCreate(savedInstanceState: Bundle?) {
Expand Down
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ buildscript {
}

dependencies {
classpath 'com.android.tools.build:gradle:3.4.1'
classpath 'com.android.tools.build:gradle:3.4.2'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:${versions.kotlin}"
classpath "org.jetbrains.dokka:dokka-gradle-plugin:${versions.dokka}"
classpath 'com.google.gms:google-services:4.3.0'
Expand Down
10 changes: 7 additions & 3 deletions dependencies.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,16 @@ ext {
minSdk : 21,
compileSdk : 28,
targetSdk : 28,
buildTools : '28.0.3',
buildTools : '29.0.1',
dokka : '0.9.16',

// For app
kotlin : '1.3.31',
kotlin : '1.3.41',
coroutine : '1.1.1',

appCompat : '1.0.2',
recyclerview : '1.0.0',
constraintLayout : '2.0.0-alpha2',
constraintLayout : '2.0.0-alpha3',
cardview : '1.0.0',
browser : '1.0.0',
androidKtx : '1.0.0',
Expand Down Expand Up @@ -58,6 +58,8 @@ ext {
// Proprietary libraries
firebaseCloudMessage : '19.0.1',
firebaseAnalytics : '17.0.0',
firebaseCrashlytics : '2.10.1@aar',
firebaseAnswers : '1.4.7@aar',
firebaseDynamicLinks : '18.0.0',
playServicesAuth : '16.0.1',

Expand Down Expand Up @@ -133,6 +135,8 @@ ext {
// Proprietary libraries
fcm : "com.google.firebase:firebase-messaging:${versions.firebaseCloudMessage}",
firebaseAnalytics : "com.google.firebase:firebase-core:${versions.firebaseAnalytics}",
firebaseCrashlytics : "com.crashlytics.sdk.android:crashlytics:${versions.firebaseCrashlytics}",
firebaseAnswers : "com.crashlytics.sdk.android:answers:${versions.firebaseAnswers}",
dynamiclinks : "com.google.firebase:firebase-dynamic-links:${versions.firebaseDynamicLinks}",
playServicesAuth : "com.google.android.gms:play-services-auth:${versions.playServicesAuth}",

Expand Down
2 changes: 2 additions & 0 deletions util/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ dependencies {

implementation libraries.rxBinding

implementation libraries.threeTenABP

// TODO This is a dependency from the core module, but the util module are unable to get that dependencies. Check why it is occurring since transitive is enable by default
implementation libraries.lifecycleExtensions
kapt libraries.lifecycleCompiler
Expand Down
20 changes: 9 additions & 11 deletions util/src/main/java/chat/rocket/android/util/extension/Image.kt
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,7 @@ import java.io.ByteArrayOutputStream
import java.io.InputStream
import java.io.IOException
import java.io.File
import java.text.SimpleDateFormat
import java.util.*
import org.threeten.bp.LocalDateTime

/**
* Compress a [Bitmap] image.
Expand Down Expand Up @@ -104,20 +103,19 @@ fun Fragment.dispatchImageSelection(requestCode: Int) {
}

fun Fragment.dispatchTakePicture(requestCode: Int) {
val takePictureIntent = Intent(MediaStore.ACTION_IMAGE_CAPTURE)
if (takePictureIntent.resolveActivity(context?.packageManager) != null) {
startActivityForResult(takePictureIntent, requestCode)
context?.packageManager?.let { packageManager ->
val takePictureIntent = Intent(MediaStore.ACTION_IMAGE_CAPTURE)
if (takePictureIntent.resolveActivity(packageManager) != null) {
startActivityForResult(takePictureIntent, requestCode)
}
}
}

@Throws(IOException::class)
fun FragmentActivity.createImageFile(): File {
// Create an image file name
val timeStamp: String = SimpleDateFormat("yyyyMMdd_HHmmss").format(Date())
val storageDir: File = getExternalFilesDir(Environment.DIRECTORY_PICTURES)
return File.createTempFile(
"PNG_${timeStamp}_", /* prefix */
".png", /* suffix */
storageDir /* directory */
"${LocalDateTime.now()}_",
".png",
getExternalFilesDir(Environment.DIRECTORY_PICTURES)
)
}

0 comments on commit 8497f7f

Please sign in to comment.