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

Commit 18f2ed9

Browse files
authored
Merge pull request #2168 from RocketChat/beta
[RELEASE] Merge BETA into MASTER
2 parents b342f3c + afe6775 commit 18f2ed9

File tree

205 files changed

+4471
-2137
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

205 files changed

+4471
-2137
lines changed

README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,8 @@ cd Rocket.Chat.Android/app
4343

4444
## Bug report & Feature request
4545

46-
Are you having a technical issue trying to compile the app, or setting up Push Notifications? Please use our Community Support channel for that: https://forums.rocket.chat/c/community-support. The issues are only suppose to be used for bugs, improvements and features in the native Android application.
46+
Are you having a technical issue trying to compile the app, or setting up Push Notifications? Please use our Community Support channel for that: https://forums.rocket.chat/c/community-support. The issues are only supposed to be used for bugs, improvements, and features in the native Android application.
4747

4848
## Coding Style
4949

50-
Please follow the official [Kotlin coding convections](https://kotlinlang.org/docs/reference/coding-conventions.html) when contributing.
50+
Please follow the official [Kotlin coding conventions](https://kotlinlang.org/docs/reference/coding-conventions.html) when contributing.

app/build.gradle

+35-23
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,9 @@ def taskRequests = getGradle().getStartParameter().getTaskRequests().toString()
22
def isPlay = !(taskRequests.contains("Foss") || taskRequests.contains("foss"))
33

44
apply plugin: 'com.android.application'
5-
if (isPlay) { apply plugin: 'io.fabric' }
5+
if (isPlay) {
6+
apply plugin: 'io.fabric'
7+
}
68
apply plugin: 'kotlin-android'
79
apply plugin: 'kotlin-android-extensions'
810
apply plugin: 'kotlin-kapt'
@@ -16,20 +18,30 @@ android {
1618
applicationId "chat.rocket.android"
1719
minSdkVersion versions.minSdk
1820
targetSdkVersion versions.targetSdk
19-
versionCode 2057
20-
versionName "3.2.0"
21+
versionCode 2059
22+
versionName "3.3.0"
2123
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
2224
multiDexEnabled true
2325

2426
def gitSha = 'git rev-parse --short HEAD'.execute([], project.rootDir).text.trim()
25-
def buildTime = new GregorianCalendar().format("MM-dd-yyyy' 'h:mm:ss a z")
2627
buildConfigField "String", "GIT_SHA", "\"${gitSha}\""
2728

2829
javaCompileOptions {
2930
annotationProcessorOptions {
3031
arguments = ["room.schemaLocation": "$projectDir/schemas".toString()]
3132
}
3233
}
34+
35+
// For Jitsi
36+
compileOptions {
37+
sourceCompatibility JavaVersion.VERSION_1_8
38+
targetCompatibility JavaVersion.VERSION_1_8
39+
}
40+
41+
// For Jitsi
42+
ndk {
43+
abiFilters "armeabi-v7a", "x86"
44+
}
3345
}
3446

3547
signingConfigs {
@@ -73,7 +85,7 @@ android {
7385
dimension "type"
7486
}
7587

76-
// only foss
88+
// only FOSS
7789
foss {
7890
dimension "type"
7991
}
@@ -83,6 +95,10 @@ android {
8395
exclude 'META-INF/core.kotlin_module'
8496
exclude 'META-INF/main.kotlin_module'
8597
}
98+
99+
lintOptions {
100+
lintConfig file("src/main/res/xml/lint.xml")
101+
}
86102
}
87103

88104
dependencies {
@@ -96,7 +112,7 @@ dependencies {
96112
implementation project(':suggestions')
97113

98114
implementation libraries.kotlin
99-
implementation libraries.coroutines
115+
implementation libraries.coroutinesCore
100116
implementation libraries.coroutinesAndroid
101117

102118
implementation libraries.appCompat
@@ -123,6 +139,8 @@ dependencies {
123139
implementation libraries.viewmodelKtx
124140
implementation libraries.workmanager
125141

142+
implementation libraries.livedataKtx
143+
126144
implementation libraries.rxKotlin
127145
implementation libraries.rxAndroid
128146

@@ -133,56 +151,50 @@ dependencies {
133151
implementation libraries.timber
134152
implementation libraries.threeTenABP
135153

154+
kapt libraries.kotshiCompiler
155+
implementation libraries.kotshiApi
156+
136157
implementation libraries.fresco
137158
api libraries.frescoOkHttp
138159
implementation libraries.frescoAnimatedGif
139160
implementation libraries.frescoWebP
140161
implementation libraries.frescoAnimatedWebP
141162

142-
implementation libraries.glide
143-
implementation libraries.glideTransformations
144-
145-
kapt libraries.kotshiCompiler
146-
implementation libraries.kotshiApi
147-
148163
implementation libraries.frescoImageViewer
149164

150165
implementation libraries.markwon
151166

152167
implementation libraries.aVLoadingIndicatorView
153168

154-
implementation libraries.livedataKtx
169+
implementation libraries.glide
170+
implementation libraries.glideTransformations
171+
172+
implementation(libraries.jitsi) { transitive = true }
155173

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

158176
// Proprietary libraries
159177
playImplementation libraries.fcm
160178
playImplementation libraries.firebaseAnalytics
161179
playImplementation libraries.playServicesAuth
162-
playImplementation('com.crashlytics.sdk.android:crashlytics:2.9.5@aar') { transitive = true }
163-
playImplementation('com.crashlytics.sdk.android:answers:1.4.3@aar') { transitive = true }
180+
playImplementation('com.crashlytics.sdk.android:crashlytics:2.9.8@aar') { transitive = true }
181+
playImplementation('com.crashlytics.sdk.android:answers:1.4.6@aar') { transitive = true }
164182

165183
testImplementation libraries.junit
166184
testImplementation libraries.truth
167185
androidTestImplementation libraries.espressoCore
168186
androidTestImplementation libraries.espressoIntents
169187
}
170188

171-
kotlin {
172-
experimental {
173-
coroutines "enable"
174-
}
175-
}
176-
177189
androidExtensions {
178190
experimental = true
179191
}
180192

181193
// FIXME - build and install the sdk into the app/libs directory
182194
// We were having some issues with the kapt generated files from the sdk when importing as a module
183195

184-
def sdk_location=project.properties['sdk_location'] ?: ""
185-
task compileSdk(type:Exec) {
196+
def sdk_location = project.properties['sdk_location'] ?: ""
197+
task compileSdk(type: Exec) {
186198
if (System.getProperty('os.name').toLowerCase(Locale.ROOT).contains('windows')) {
187199
commandLine 'cmd', '/c', 'build-sdk.sh', sdk_location
188200
} else {

app/src/main/AndroidManifest.xml

+7
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66
<uses-permission android:name="android.permission.INTERNET" />
77
<uses-permission android:name="android.permission.VIBRATE" />
88
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
9+
<uses-permission android:name="android.permission.CAMERA" />
10+
<uses-permission android:name="android.permission.RECORD_AUDIO" />
911

1012
<application
1113
android:name=".app.RocketChatApplication"
@@ -73,6 +75,11 @@
7375
android:theme="@style/AppTheme"
7476
android:windowSoftInputMode="adjustResize|stateAlwaysHidden" />
7577

78+
<activity
79+
android:name=".videoconference.ui.VideoConferenceActivity"
80+
android:theme="@style/AppTheme"
81+
android:windowSoftInputMode="adjustResize|stateAlwaysHidden" />
82+
7683
<activity
7784
android:name=".chatroom.ui.ChatRoomActivity"
7885
android:theme="@style/AppTheme"

app/src/main/java/chat/rocket/android/about/ui/AboutFragment.kt

+5-1
Original file line numberDiff line numberDiff line change
@@ -34,12 +34,16 @@ class AboutFragment : Fragment() {
3434

3535
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
3636
super.onViewCreated(view, savedInstanceState)
37-
setupToolbar()
3837
setupViews()
3938

4039
analyticsManager.logScreenView(ScreenViewEvent.About)
4140
}
4241

42+
override fun onResume() {
43+
super.onResume()
44+
setupToolbar()
45+
}
46+
4347
private fun setupViews() {
4448
text_version_name.text = BuildConfig.VERSION_NAME
4549
text_build_number.text = getString(

app/src/main/java/chat/rocket/android/analytics/Analytics.kt

+63
Original file line numberDiff line numberDiff line change
@@ -71,4 +71,67 @@ interface Analytics {
7171
* @param resetPasswordSucceeded True if successful reset password, false otherwise.
7272
*/
7373
fun logResetPassword(resetPasswordSucceeded: Boolean) {}
74+
75+
/**
76+
* Logs the video conference event.
77+
*
78+
* @param event The [SubscriptionTypeEvent] to log.
79+
* @param serverUrl The server URL to log.
80+
*/
81+
fun logVideoConference(event: SubscriptionTypeEvent, serverUrl: String) {}
82+
83+
/**
84+
* Logs the add reaction message action.
85+
*/
86+
fun logMessageActionAddReaction() {}
87+
88+
/**
89+
* Logs the replay message action.
90+
*/
91+
fun logMessageActionReply() {}
92+
93+
/**
94+
* Logs the quote message action.
95+
*/
96+
fun logMessageActionQuote() {}
97+
98+
/**
99+
* Logs the permalink message action.
100+
*/
101+
fun logMessageActionPermalink() {}
102+
103+
/**
104+
* Logs the copy message action.
105+
*/
106+
fun logMessageActionCopy() {}
107+
108+
/**
109+
* Logs the edit message action.
110+
*/
111+
fun logMessageActionEdit() {}
112+
113+
/**
114+
* Logs the info message action.
115+
*/
116+
fun logMessageActionInfo() {}
117+
118+
/**
119+
* Logs the star message action.
120+
*/
121+
fun logMessageActionStar() {}
122+
123+
/**
124+
* Logs the pin message action.
125+
*/
126+
fun logMessageActionPin() {}
127+
128+
/**
129+
* Logs the report message action.
130+
*/
131+
fun logMessageActionReport() {}
132+
133+
/**
134+
* Logs the delete message action.
135+
*/
136+
fun logMessageActionDelete() {}
74137
}

app/src/main/java/chat/rocket/android/analytics/AnalyticsManager.kt

+72
Original file line numberDiff line numberDiff line change
@@ -76,4 +76,76 @@ class AnalyticsManager @Inject constructor(
7676
analytics.forEach { it.logResetPassword(resetPasswordSucceeded) }
7777
}
7878
}
79+
80+
fun logVideoConference(event: SubscriptionTypeEvent) {
81+
if (analyticsTrackingInteractor.get() && serverUrl != null) {
82+
analytics.forEach { it.logVideoConference(event, serverUrl) }
83+
}
84+
}
85+
86+
fun logMessageActionAddReaction() {
87+
if (analyticsTrackingInteractor.get()) {
88+
analytics.forEach { it.logMessageActionAddReaction() }
89+
}
90+
}
91+
92+
fun logMessageActionReply() {
93+
if (analyticsTrackingInteractor.get()) {
94+
analytics.forEach { it.logMessageActionReply() }
95+
}
96+
}
97+
98+
fun logMessageActionQuote() {
99+
if (analyticsTrackingInteractor.get()) {
100+
analytics.forEach { it.logMessageActionQuote() }
101+
}
102+
}
103+
104+
fun logMessageActionPermalink() {
105+
if (analyticsTrackingInteractor.get()) {
106+
analytics.forEach { it.logMessageActionPermalink() }
107+
}
108+
}
109+
110+
fun logMessageActionCopy() {
111+
if (analyticsTrackingInteractor.get()) {
112+
analytics.forEach { it.logMessageActionCopy() }
113+
}
114+
}
115+
116+
fun logMessageActionEdit() {
117+
if (analyticsTrackingInteractor.get()) {
118+
analytics.forEach { it.logMessageActionEdit() }
119+
}
120+
}
121+
122+
fun logMessageActionInfo() {
123+
if (analyticsTrackingInteractor.get()) {
124+
analytics.forEach { it.logMessageActionInfo() }
125+
}
126+
}
127+
128+
fun logMessageActionStar() {
129+
if (analyticsTrackingInteractor.get()) {
130+
analytics.forEach { it.logMessageActionStar() }
131+
}
132+
}
133+
134+
fun logMessageActionPin() {
135+
if (analyticsTrackingInteractor.get()) {
136+
analytics.forEach { it.logMessageActionPin() }
137+
}
138+
}
139+
140+
fun logMessageActionReport() {
141+
if (analyticsTrackingInteractor.get()) {
142+
analytics.forEach { it.logMessageActionReport() }
143+
}
144+
}
145+
146+
fun logMessageActionDelete() {
147+
if (analyticsTrackingInteractor.get()) {
148+
analytics.forEach { it.logMessageActionDelete() }
149+
}
150+
}
79151
}

app/src/main/java/chat/rocket/android/app/AppLifecycleObserver.kt

+3-7
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,11 @@ package chat.rocket.android.app
33
import androidx.lifecycle.Lifecycle
44
import androidx.lifecycle.LifecycleObserver
55
import androidx.lifecycle.OnLifecycleEvent
6-
import chat.rocket.android.server.domain.GetAccountInteractor
76
import chat.rocket.android.server.domain.GetCurrentServerInteractor
87
import chat.rocket.android.server.infraestructure.ConnectionManagerFactory
9-
import chat.rocket.android.server.infraestructure.RocketChatClientFactory
10-
import chat.rocket.common.RocketChatException
118
import chat.rocket.common.model.UserStatus
12-
import chat.rocket.core.internal.realtime.setTemporaryStatus
13-
import kotlinx.coroutines.experimental.launch
14-
import timber.log.Timber
9+
import kotlinx.coroutines.GlobalScope
10+
import kotlinx.coroutines.launch
1511
import javax.inject.Inject
1612

1713
class AppLifecycleObserver @Inject constructor(
@@ -33,7 +29,7 @@ class AppLifecycleObserver @Inject constructor(
3329
}
3430

3531
private fun changeTemporaryStatus(userStatus: UserStatus) {
36-
launch {
32+
GlobalScope.launch {
3733
serverInteractor.get()?.let { currentServer ->
3834
factory.create(currentServer).setTemporaryStatus(userStatus)
3935
}

0 commit comments

Comments
 (0)