Skip to content
Snippets Groups Projects
Commit f5cc50de authored by Vitalii Nikitchyn's avatar Vitalii Nikitchyn
Browse files

unlink device

Change-Id: Ia95acbc1a7ce781920339895f7023610084f8e23
parent e0cf3579
Branches
Tags
No related merge requests found
......@@ -45,17 +45,11 @@ class DeviceAdapter(
notifyDataSetChanged()
}
override fun getCount(): Int {
return mDevices.size
}
override fun getCount(): Int = mDevices.size
override fun getItem(i: Int): Any {
return mDevices[i]
}
override fun getItem(i: Int): Any = mDevices[i]
override fun getItemId(i: Int): Long {
return 0
}
override fun getItemId(i: Int): Long = 0
override fun getView(i: Int, convertView: View?, parent: ViewGroup): View {
val view = convertView ?: LayoutInflater.from(mContext).inflate(R.layout.item_device, parent, false)
......
......@@ -20,7 +20,6 @@ import android.Manifest
import android.animation.Animator
import android.animation.ValueAnimator
import android.app.Activity
import androidx.appcompat.app.AlertDialog
import android.content.Context
import android.content.DialogInterface
import android.content.Intent
......@@ -37,6 +36,7 @@ import android.widget.*
import androidx.activity.OnBackPressedCallback
import androidx.activity.result.PickVisualMediaRequest
import androidx.activity.result.contract.ActivityResultContracts
import androidx.appcompat.app.AlertDialog
import androidx.core.content.ContextCompat
import androidx.core.content.FileProvider
import androidx.core.view.isVisible
......@@ -442,8 +442,7 @@ class JamiAccountSummaryFragment :
}
override fun onUnlockAccount(scheme: String, password: String) {
val context = requireContext()
val cacheDir = File(AndroidFileUtils.getTempShareDir(context), "archives")
val cacheDir = File(AndroidFileUtils.getTempShareDir(requireContext()), "archives")
cacheDir.mkdirs()
if (!cacheDir.canWrite()) Log.w(TAG, "Can't write to: $cacheDir")
val dest = File(cacheDir, mBestName)
......@@ -659,12 +658,13 @@ class JamiAccountSummaryFragment :
.setPositiveButton(R.string.revoke_device_title) { _, _ ->
mAccount?.let { account ->
BiometricHelper.startAccountAuthentication(this, account, getString(R.string.revoke_device_title)) { scheme: String, password: String ->
onUnlockAccount(scheme, password)
presenter.revokeDevice(deviceId, scheme, password)
}
}
}
.setNegativeButton(android.R.string.cancel) { di, _ -> di.dismiss() }
.create()
.show()
}
override fun onDeviceRename() {
......@@ -675,7 +675,6 @@ class JamiAccountSummaryFragment :
}
override fun onDeviceRename(newName: String) {
Log.d(TAG, "onDeviceRename: " + presenter.deviceName + " -> " + newName)
presenter.renameDevice(newName)
}
......@@ -732,7 +731,6 @@ class JamiAccountSummaryFragment :
companion object {
val TAG = JamiAccountSummaryFragment::class.simpleName!!
private val FRAGMENT_DIALOG_REVOCATION = "$TAG.dialog.deviceRevocation"
private val FRAGMENT_DIALOG_RENAME = "$TAG.dialog.deviceRename"
private val FRAGMENT_DIALOG_PASSWORD = "$TAG.dialog.changePassword"
private val FRAGMENT_DIALOG_BACKUP = "$TAG.dialog.backup"
......
......@@ -15,33 +15,31 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
-->
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="wrap_content"
xmlns:tools="http://schemas.android.com/tools"
android:paddingVertical="8dp">
<cx.ring.views.TwoButtonEditText
android:id="@+id/txt_device_id"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:tint="@color/button_border"
android:singleLine="true"
android:enabled="false"
/>
android:singleLine="true"
app:tint="@color/button_border" />
<TextView
android:id="@+id/txt_device_thisflag"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentEnd="true"
android:layout_marginTop="10dp"
android:layout_marginEnd="42dp"
android:text="@string/account_device_this_indicator"
android:textStyle="italic|bold"
android:textColor="@color/colorPrimary"
android:layout_alignParentEnd="true"
android:textSize="11sp"
android:layout_marginEnd="42dp"
android:layout_marginTop="10dp"
android:textStyle="italic|bold"
android:visibility="gone"
tools:visibility="visible"
/>
tools:visibility="visible" />
</RelativeLayout>
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment