Fix Lint issues:
1. Remove unused resources 2. Correct data type for framebuffer size 3. Use Compat library for drawable and ImageView tint
This commit is contained in:
parent
10b836fd7f
commit
c5dbca3bca
20 changed files with 21 additions and 105 deletions
|
|
@ -262,20 +262,22 @@ static void onFinishedFrameBufferUpdate(rfbClient *client) {
|
|||
*/
|
||||
static rfbBool onMallocFrameBuffer(rfbClient *client) {
|
||||
|
||||
auto allocSize = (uint64_t) client->width * client->height * client->format.bitsPerPixel / 8;
|
||||
auto requestedSize = (uint64_t) client->width * client->height * client->format.bitsPerPixel / 8;
|
||||
|
||||
if (allocSize >= SIZE_MAX) {
|
||||
if (requestedSize >= SIZE_MAX) {
|
||||
rfbClientErr("CRITICAL: cannot allocate frameBuffer, requested size is too large\n");
|
||||
errno = EPROTO;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
auto allocSize = (size_t) requestedSize;
|
||||
|
||||
LOCK(client->fbMutex);
|
||||
{
|
||||
if (client->frameBuffer)
|
||||
free(client->frameBuffer);
|
||||
|
||||
client->frameBuffer = static_cast<uint8_t *>(malloc((size_t) allocSize));
|
||||
client->frameBuffer = static_cast<uint8_t *>(malloc(allocSize));
|
||||
|
||||
if (client->frameBuffer) {
|
||||
client->fbRealWidth = client->width;
|
||||
|
|
|
|||
|
|
@ -8,6 +8,7 @@
|
|||
|
||||
package com.gaurav.avnc.ui.home
|
||||
|
||||
import androidx.core.content.ContextCompat
|
||||
import androidx.fragment.app.Fragment
|
||||
import androidx.fragment.app.FragmentManager
|
||||
import androidx.fragment.app.FragmentPagerAdapter
|
||||
|
|
@ -45,7 +46,7 @@ class TabController(val fragMgr: FragmentManager, private val pager: ViewPager,
|
|||
discoveryTab = tabLayout.getTabAt(1)!!
|
||||
|
||||
pageList.forEachIndexed { i, p ->
|
||||
tabLayout.getTabAt(i)?.icon = tabLayout.context.getDrawable(p.tabIconId)
|
||||
tabLayout.getTabAt(i)?.icon = ContextCompat.getDrawable(tabLayout.context, p.tabIconId)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -58,7 +58,7 @@ abstract class InfoFragment : Fragment() {
|
|||
override fun onCreateOptionsMenu(menu: Menu, inflater: MenuInflater) {
|
||||
menu.add(getString(android.R.string.copy))
|
||||
.setOnMenuItemClickListener { copyToClipboard(); true }
|
||||
.setShowAsAction(MenuItem.SHOW_AS_ACTION_ALWAYS)
|
||||
.setShowAsAction(MenuItem.SHOW_AS_ACTION_IF_ROOM)
|
||||
}
|
||||
|
||||
private fun copyToClipboard() {
|
||||
|
|
|
|||
|
|
@ -52,7 +52,7 @@ object Debugging {
|
|||
val e = KeyEvent(KeyEvent.ACTION_DOWN, i)
|
||||
|
||||
val s = String.format("%4d %-40s %5d %5b %c \n",
|
||||
i, KeyEvent.keyCodeToString(i), e.unicodeChar, e.isPrintingKey, e.displayLabel);
|
||||
i, KeyEvent.keyCodeToString(i), e.unicodeChar, e.isPrintingKey, e.displayLabel)
|
||||
|
||||
builder.append(s)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -39,8 +39,7 @@ class PrefsViewModel(app: Application) : BaseViewModel(app) {
|
|||
* Currently we are only exporting server profiles but preferences can be
|
||||
* exported in future.
|
||||
*
|
||||
* Importing/Exporting is done in background and [isDoingIE], [lastIEResult]
|
||||
* are used to track the work.
|
||||
* Importing/Exporting is done on background thread.
|
||||
**************************************************************************/
|
||||
|
||||
@Serializable
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
@file:Suppress("unused","SpellCheckingInspection")
|
||||
@file:Suppress("unused", "SpellCheckingInspection")
|
||||
|
||||
/**
|
||||
* X Key Symbols.
|
||||
|
|
|
|||
|
|
@ -1,9 +0,0 @@
|
|||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:viewportWidth="24.0"
|
||||
android:viewportHeight="24.0">
|
||||
<path
|
||||
android:fillColor="?colorOnSurface"
|
||||
android:pathData="M3,13h8L11,3L3,3v10zM3,21h8v-6L3,15v6zM13,21h8L21,11h-8v10zM13,3v6h8L21,3h-8z" />
|
||||
</vector>
|
||||
|
|
@ -1,12 +0,0 @@
|
|||
<!-- This Source Code Form is subject to the terms of the Mozilla Public
|
||||
- License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
- file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:viewportWidth="24"
|
||||
android:viewportHeight="24">
|
||||
<path
|
||||
android:fillColor="?colorOnSurface"
|
||||
android:pathData="M12.293,3.293a1,1 0,0 1,1.414 0l8,8a1,1 0,0 1,0 1.414l-8,8a1,1 0,0 1,-1.414 -1.414L18.586,13H3a1,1 0,1 1,0 -2h15.586l-6.293,-6.293a1,1 0,0 1,0 -1.414z" />
|
||||
</vector>
|
||||
|
|
@ -1,9 +0,0 @@
|
|||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:viewportWidth="24"
|
||||
android:viewportHeight="24">
|
||||
<path
|
||||
android:fillColor="?colorOnSurface"
|
||||
android:pathData="M13,3c-4.97,0 -9,4.03 -9,9L1,12l3.89,3.89 0.07,0.14L9,12L6,12c0,-3.87 3.13,-7 7,-7s7,3.13 7,7 -3.13,7 -7,7c-1.93,0 -3.68,-0.79 -4.94,-2.06l-1.42,1.42C8.27,19.99 10.51,21 13,21c4.97,0 9,-4.03 9,-9s-4.03,-9 -9,-9zM12,8v5l4.28,2.54 0.72,-1.21 -3.5,-2.08L13.5,8L12,8z" />
|
||||
</vector>
|
||||
|
|
@ -1,9 +0,0 @@
|
|||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:viewportWidth="24.0"
|
||||
android:viewportHeight="24.0">
|
||||
<path
|
||||
android:fillColor="?colorOnSurface"
|
||||
android:pathData="M10,20v-6h4v6h5v-8h3L12,3 2,12h3v8z" />
|
||||
</vector>
|
||||
|
|
@ -1,9 +0,0 @@
|
|||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:viewportWidth="24"
|
||||
android:viewportHeight="24">
|
||||
<path
|
||||
android:fillColor="?colorOnSurface"
|
||||
android:pathData="M12,8c1.1,0 2,-0.9 2,-2s-0.9,-2 -2,-2 -2,0.9 -2,2 0.9,2 2,2zM12,10c-1.1,0 -2,0.9 -2,2s0.9,2 2,2 2,-0.9 2,-2 -0.9,-2 -2,-2zM12,16c-1.1,0 -2,0.9 -2,2s0.9,2 2,2 2,-0.9 2,-2 -0.9,-2 -2,-2z" />
|
||||
</vector>
|
||||
|
|
@ -1,9 +0,0 @@
|
|||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:viewportWidth="24.0"
|
||||
android:viewportHeight="24.0">
|
||||
<path
|
||||
android:fillColor="?colorOnSurface"
|
||||
android:pathData="M12,22c1.1,0 2,-0.9 2,-2h-4c0,1.1 0.89,2 2,2zM18,16v-5c0,-3.07 -1.64,-5.64 -4.5,-6.32L13.5,4c0,-0.83 -0.67,-1.5 -1.5,-1.5s-1.5,0.67 -1.5,1.5v0.68C7.63,5.36 6,7.92 6,11v5l-2,2v1h16v-1l-2,-2z" />
|
||||
</vector>
|
||||
|
|
@ -1,9 +0,0 @@
|
|||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:viewportWidth="24"
|
||||
android:viewportHeight="24">
|
||||
<path
|
||||
android:fillColor="?colorOnSurface"
|
||||
android:pathData="M9,11.24V7.5C9,6.12 10.12,5 11.5,5S14,6.12 14,7.5v3.74c1.21,-0.81 2,-2.18 2,-3.74C16,5.01 13.99,3 11.5,3S7,5.01 7,7.5C7,9.06 7.79,10.43 9,11.24zM18.84,15.87l-4.54,-2.26c-0.17,-0.07 -0.35,-0.11 -0.54,-0.11H13v-6C13,6.67 12.33,6 11.5,6S10,6.67 10,7.5v10.74c-3.6,-0.76 -3.54,-0.75 -3.67,-0.75c-0.31,0 -0.59,0.13 -0.79,0.33l-0.79,0.8l4.94,4.94C9.96,23.83 10.34,24 10.75,24h6.79c0.75,0 1.33,-0.55 1.44,-1.28l0.75,-5.27c0.01,-0.07 0.02,-0.14 0.02,-0.2C19.75,16.63 19.37,16.09 18.84,15.87z" />
|
||||
</vector>
|
||||
|
|
@ -116,11 +116,11 @@
|
|||
android:layout_height="60dp"
|
||||
android:contentDescription="@string/desc_disconnected_icon"
|
||||
android:src="@drawable/ic_warning"
|
||||
android:tint="?attr/colorError"
|
||||
app:isVisible="@{viewModel.clientState == State.Disconnected}"
|
||||
app:layout_constraintBottom_toTopOf="@id/client_state"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent" />
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:tint="?attr/colorError" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/client_state"
|
||||
|
|
|
|||
|
|
@ -23,8 +23,8 @@
|
|||
android:layout_height="wrap_content"
|
||||
android:layout_margin="@dimen/margin_normal"
|
||||
android:text="@string/msg_loading"
|
||||
android:typeface="monospace"
|
||||
android:textSize="12sp"/>
|
||||
android:textSize="12sp"
|
||||
android:typeface="monospace" />
|
||||
</HorizontalScrollView>
|
||||
</ScrollView>
|
||||
</layout>
|
||||
|
|
@ -167,11 +167,11 @@
|
|||
android:layout_marginStart="@dimen/margin_normal"
|
||||
android:importantForAccessibility="no"
|
||||
android:src="@drawable/ic_shield"
|
||||
android:tint="?colorControlNormal"
|
||||
android:tintMode="src_in"
|
||||
app:layout_constraintBottom_toBottomOf="@id/security"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="@id/security" />
|
||||
app:layout_constraintTop_toTopOf="@id/security"
|
||||
app:tint="?colorControlNormal" />
|
||||
|
||||
<Spinner
|
||||
android:id="@+id/security"
|
||||
|
|
|
|||
|
|
@ -50,12 +50,12 @@
|
|||
android:layout_margin="@dimen/margin_normal"
|
||||
android:importantForAccessibility="no"
|
||||
android:src="@drawable/ic_key"
|
||||
android:tint="?android:textColorSecondary"
|
||||
android:tintMode="src_in"
|
||||
app:isVisible="@{profile.password.length() != 0}"
|
||||
app:layout_constraintBottom_toBottomOf="@id/profile_address"
|
||||
app:layout_constraintStart_toEndOf="@id/profile_address"
|
||||
app:layout_constraintTop_toTopOf="@id/profile_address" />
|
||||
app:layout_constraintTop_toTopOf="@id/profile_address"
|
||||
app:tint="?android:textColorSecondary" />
|
||||
|
||||
<ImageView
|
||||
android:layout_width="@dimen/server_card_hint_icon_size"
|
||||
|
|
@ -63,12 +63,12 @@
|
|||
android:layout_margin="@dimen/margin_normal"
|
||||
android:importantForAccessibility="no"
|
||||
android:src="@drawable/ic_visibility"
|
||||
android:tint="?android:textColorSecondary"
|
||||
android:tintMode="src_in"
|
||||
app:isVisible="@{profile.viewOnly}"
|
||||
app:layout_constraintBottom_toBottomOf="@id/profile_address"
|
||||
app:layout_constraintStart_toEndOf="@id/password_hint_icon"
|
||||
app:layout_constraintTop_toTopOf="@id/profile_address" />
|
||||
app:layout_constraintTop_toTopOf="@id/profile_address"
|
||||
app:tint="?android:textColorSecondary" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
|
|
|
|||
|
|
@ -7,7 +7,6 @@
|
|||
-->
|
||||
|
||||
<resources>
|
||||
<dimen name="appbar_elevation">14dp</dimen>
|
||||
<dimen name="server_card_elevation">1dp</dimen>
|
||||
<dimen name="server_card_stroke_width">1dp</dimen>
|
||||
</resources>
|
||||
|
|
@ -16,7 +16,6 @@
|
|||
<dimen name="action_btn_size">48dp</dimen>
|
||||
<dimen name="toolbar_height">48dp</dimen>
|
||||
<dimen name="toolbar_bg_corner_radius">24dp</dimen>
|
||||
<dimen name="appbar_elevation">4dp</dimen>
|
||||
<dimen name="server_card_elevation">2dp</dimen>
|
||||
<dimen name="server_card_stroke_width">0dp</dimen>
|
||||
<dimen name="server_card_hint_icon_size">16dp</dimen>
|
||||
|
|
|
|||
|
|
@ -13,21 +13,16 @@
|
|||
<string name="title_duplicate">Duplicate</string>
|
||||
<string name="title_edit">Edit</string>
|
||||
<string name="title_delete">Delete</string>
|
||||
<string name="title_copy">Copy</string>
|
||||
<string name="title_copy_host">Copy Host</string>
|
||||
<string name="title_copy_name">Copy Name</string>
|
||||
<string name="title_advanced">Advanced</string>
|
||||
<string name="title_save">Save</string>
|
||||
<string name="title_less">Less</string>
|
||||
<string name="title_settings">Settings</string>
|
||||
<string name="title_edit_server_profile">Edit Server</string>
|
||||
<string name="title_ssh_tunnel">SSH Tunnel</string>
|
||||
<string name="title_undo">Undo</string>
|
||||
<string name="title_cancel">Cancel</string>
|
||||
<string name="title_credentials_required">Credentials required</string>
|
||||
<string name="title_remember">Remember</string>
|
||||
<string name="title_servers">Servers</string>
|
||||
<string name="title_discovery">Discovery</string>
|
||||
<string name="title_export">Export</string>
|
||||
<string name="title_import">Import</string>
|
||||
<string name="title_change">Change</string>
|
||||
|
|
@ -35,24 +30,14 @@
|
|||
<string name="title_unknown_ssh_host">Unknown SSH Host</string>
|
||||
<string name="title_ssh_host_key_changed">Host Key changed!</string>
|
||||
<string name="title_continue">Continue</string>
|
||||
<string name="title_export_passwords">Export Passwords</string>
|
||||
<string name="title_delete_servers_before_import">Delete current Servers before Import</string>
|
||||
|
||||
<string name="label_name">Name</string>
|
||||
<string name="label_host">Host</string>
|
||||
<string name="label_port">Port</string>
|
||||
<string name="label_username">Username</string>
|
||||
<string name="label_password">Password</string>
|
||||
<string name="label_view_only_mode">View-only Mode</string>
|
||||
<string name="label_hide_remote_cursor">Hide Remote Cursor</string>
|
||||
<string name="label_color_quality">Color quality</string>
|
||||
<string name="label_image_quality">Image quality</string>
|
||||
<string name="label_security_type">Security</string>
|
||||
<string name="label_use_repeater">Use Repeater</string>
|
||||
<string name="label_repeater_id">ID</string>
|
||||
<string name="label_private_key">Private Key</string>
|
||||
<string name="label_key_password">Key Password</string>
|
||||
<string name="label_auth_type">Auth Type</string>
|
||||
|
||||
<string name="hint_urlbar">Connect to a Server</string>
|
||||
<string name="hint_server_name">Name (e.g. Work PC)</string>
|
||||
|
|
@ -62,7 +47,6 @@
|
|||
<string name="hint_server_id">Server ID</string>
|
||||
<string name="hint_username">Username</string>
|
||||
<string name="hint_password">Password</string>
|
||||
<string name="hint_private_key">Private Key</string>
|
||||
<string name="hint_key_password">Key Password</string>
|
||||
|
||||
<string name="msg_server_profile_inserted">Server added.</string>
|
||||
|
|
@ -78,7 +62,6 @@
|
|||
<string name="msg_copied_to_clipboard">Copied!</string>
|
||||
<string name="desc_navigation_btn">Open Navigation Drawer</string>
|
||||
<string name="desc_disconnected_icon">Disconnected state indicator icon</string>
|
||||
<string name="desc_connect_btn">Connect to this URL</string>
|
||||
<string name="desc_add_server_btn">Add Server</string>
|
||||
<string name="desc_kb_btn">Show Keyboard</string>
|
||||
<string name="desc_vk_btn">Show Virtual Keys</string>
|
||||
|
|
@ -92,7 +75,6 @@
|
|||
<string name="tip_discovery">Discovery can automatically find supported servers\nrunning on your network.</string>
|
||||
|
||||
<!-- Preference -->
|
||||
<string name="title_pref_activity">Settings</string>
|
||||
<string name="pref_appearance">Appearance</string>
|
||||
<string name="pref_appearance_summary">Look and feel</string>
|
||||
<string name="pref_display">Remote Display</string>
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue