Skip to content

Commit 16a5046

Browse files
committed
Add a DebugJitsiActivity for debug build only. It's quite useless...
1 parent 4515dcd commit 16a5046

File tree

5 files changed

+103
-0
lines changed

5 files changed

+103
-0
lines changed

vector-app/src/debug/AndroidManifest.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
<application>
55
<activity android:name="im.vector.app.features.debug.TestLinkifyActivity" />
66
<activity android:name="im.vector.app.features.debug.DebugPermissionActivity" />
7+
<activity android:name="im.vector.app.features.debug.jitsi.DebugJitsiActivity" />
78
<activity android:name="im.vector.app.features.debug.analytics.DebugAnalyticsActivity" />
89
<activity android:name="im.vector.app.features.debug.settings.DebugPrivateSettingsActivity" />
910
<activity android:name="im.vector.app.features.debug.sas.DebugSasEmojiActivity" />

vector-app/src/debug/java/im/vector/app/features/debug/DebugMenuActivity.kt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ import im.vector.app.core.utils.registerForPermissionsResult
3535
import im.vector.app.core.utils.toast
3636
import im.vector.app.features.debug.analytics.DebugAnalyticsActivity
3737
import im.vector.app.features.debug.features.DebugFeaturesSettingsActivity
38+
import im.vector.app.features.debug.jitsi.DebugJitsiActivity
3839
import im.vector.app.features.debug.leak.DebugMemoryLeaksActivity
3940
import im.vector.app.features.debug.sas.DebugSasEmojiActivity
4041
import im.vector.app.features.debug.settings.DebugPrivateSettingsActivity
@@ -121,6 +122,9 @@ class DebugMenuActivity : VectorBaseActivity<ActivityDebugMenuBinding>() {
121122
views.debugPermission.setOnClickListener {
122123
startActivity(Intent(this, DebugPermissionActivity::class.java))
123124
}
125+
views.debugJitsi.setOnClickListener {
126+
startActivity(Intent(this, DebugJitsiActivity::class.java))
127+
}
124128
}
125129

126130
private fun openPrivateSettings() {
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
/*
2+
* Copyright (c) 2022 New Vector Ltd
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
package im.vector.app.features.debug.jitsi
18+
19+
import android.annotation.SuppressLint
20+
import dagger.hilt.android.AndroidEntryPoint
21+
import im.vector.app.core.platform.VectorBaseActivity
22+
import im.vector.application.databinding.ActivityDebugJitsiBinding
23+
import org.jitsi.meet.sdk.JitsiMeet
24+
25+
@AndroidEntryPoint
26+
class DebugJitsiActivity : VectorBaseActivity<ActivityDebugJitsiBinding>() {
27+
28+
override fun getBinding() = ActivityDebugJitsiBinding.inflate(layoutInflater)
29+
30+
override fun getCoordinatorLayout() = views.coordinatorLayout
31+
32+
@SuppressLint("SetTextI18n")
33+
override fun initUiAndData() {
34+
val isCrashReportingDisabled = JitsiMeet.isCrashReportingDisabled(this)
35+
views.status.text = "Jitsi crash reporting is disabled: $isCrashReportingDisabled"
36+
37+
views.splash.setOnClickListener {
38+
JitsiMeet.showSplashScreen(this)
39+
}
40+
41+
views.dev.setOnClickListener {
42+
JitsiMeet.showDevOptions()
43+
}
44+
}
45+
}
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<androidx.coordinatorlayout.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
3+
xmlns:tools="http://schemas.android.com/tools"
4+
android:id="@+id/coordinatorLayout"
5+
android:layout_width="match_parent"
6+
android:layout_height="match_parent"
7+
tools:context="im.vector.app.features.debug.jitsi.DebugJitsiActivity"
8+
tools:ignore="HardcodedText">
9+
10+
<ScrollView
11+
android:layout_width="match_parent"
12+
android:layout_height="wrap_content">
13+
14+
<LinearLayout
15+
android:layout_width="match_parent"
16+
android:layout_height="wrap_content"
17+
android:divider="@drawable/linear_divider"
18+
android:gravity="center_horizontal"
19+
android:orientation="vertical"
20+
android:padding="@dimen/layout_horizontal_margin"
21+
android:showDividers="middle">
22+
23+
<TextView
24+
android:id="@+id/status"
25+
android:layout_width="match_parent"
26+
android:layout_height="wrap_content"
27+
tools:text="Status" />
28+
29+
<Button
30+
android:id="@+id/splash"
31+
android:layout_width="wrap_content"
32+
android:layout_height="wrap_content"
33+
android:text="Splash"
34+
android:textAllCaps="false" />
35+
36+
<Button
37+
android:id="@+id/dev"
38+
android:layout_width="wrap_content"
39+
android:layout_height="wrap_content"
40+
android:text="Dev options"
41+
android:textAllCaps="false" />
42+
43+
</LinearLayout>
44+
45+
</ScrollView>
46+
47+
</androidx.coordinatorlayout.widget.CoordinatorLayout>

vector-app/src/debug/res/layout/activity_debug_menu.xml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -186,6 +186,12 @@
186186
android:layout_height="wrap_content"
187187
android:text="Permissions" />
188188

189+
<Button
190+
android:id="@+id/debug_jitsi"
191+
android:layout_width="wrap_content"
192+
android:layout_height="wrap_content"
193+
android:text="Jitsi" />
194+
189195
</LinearLayout>
190196

191197
</ScrollView>

0 commit comments

Comments
 (0)