Miscellaneous fixes:

- Suppress compiler warning in VncClient.kt
- Remove unused attributes in activity_url.xml
- Remove memory constraints for Gradle (now using global config)
This commit is contained in:
Gaurav Ujjwal 2021-05-05 14:30:37 +05:30
parent 0141a42cc2
commit 79ef7ee505
5 changed files with 10 additions and 10 deletions

View file

@ -49,7 +49,7 @@ class HomeActivity : AppCompatActivity() {
//Observers
viewModel.editProfileEvent.observe(this) { showProfileEditor() }
viewModel.profileInsertedEvent.observe(this) { onProfileInserted() }
viewModel.profileInsertedEvent.observe(this) { onProfileInserted(it) }
viewModel.profileDeletedEvent.observe(this) { showProfileDeletedMsg(it) }
viewModel.newConnectionEvent.observe(this) { startVncActivity(this, it) }
viewModel.discovery.servers.observe(this) { updateDiscoveryBadge(it) }
@ -88,9 +88,12 @@ class HomeActivity : AppCompatActivity() {
ProfileEditorFragment().show(supportFragmentManager, "ProfileEditor")
}
private fun onProfileInserted() {
private fun onProfileInserted(profile: ServerProfile) {
tabController.showSavedServers()
Snackbar.make(binding.root, R.string.msg_server_profile_inserted, Snackbar.LENGTH_SHORT).show()
// Only show snackbar for new servers
if (profile.ID == 0L)
Snackbar.make(binding.root, R.string.msg_server_profile_inserted, Snackbar.LENGTH_SHORT).show()
}
/**

View file

@ -280,6 +280,7 @@ class VncClient(private val observer: Observer) {
private fun cbBell() = Unit // observer.onBell()
@Keep
@Suppress("UNUSED_PARAMETER")
private fun cbHandleCursorPos(x: Int, y: Int) = true //observer.onCursorMoved(x, y)

View file

@ -11,14 +11,11 @@
<FrameLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
android:layout_height="match_parent">
<com.google.android.material.appbar.AppBarLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:elevation="14dp"
android:fitsSystemWindows="true">
android:layout_height="wrap_content">
<LinearLayout
style="@style/UrlBar"

View file

@ -72,7 +72,7 @@
<string name="desc_back_btn">Go Back</string>
<string name="desc_clear_url_btn">Clear URL</string>
<string name="desc_server_url">Enter address of VNC server</string>
<string name="tip_empty_server_list">Server list is empty.\nUse the \'<b>+</b>\' button to add a Server, or\nUse the top urlbar to directly connect to a server.</string>
<string name="tip_empty_server_list">Server list is empty.\nUse the \'<b>+</b>\' button to add a Server, or\nUse the top Urlbar to directly connect to a server.</string>
<string name="tip_urlbar">You can enter hostname or IP address.\n\'vnc://\' URIs are also supported.</string>
<string name="tip_discovery">Discovery can automatically find supported servers\nrunning on your network.</string>

View file

@ -13,4 +13,3 @@
#Fri Apr 16 20:25:09 IST 2021
android.enableJetifier=true
android.useAndroidX=true
org.gradle.jvmargs=-Xmx1024M -Dkotlin.daemon.jvm.options\="-Xmx512M"