mirror of
https://github.com/nextcloud/talk-android
synced 2025-06-19 19:49:33 +01:00
codacy and analysis
Signed-off-by: rapterjet2004 <juliuslinus1@gmail.com>
This commit is contained in:
parent
3d9f8366c8
commit
7285c0ae44
@ -727,12 +727,4 @@ public interface NcApi {
|
|||||||
@DELETE
|
@DELETE
|
||||||
Observable<GenericOverall> unbanActor(@Header("Authorization") String authorization,
|
Observable<GenericOverall> unbanActor(@Header("Authorization") String authorization,
|
||||||
@Url String url);
|
@Url String url);
|
||||||
|
|
||||||
@POST
|
|
||||||
Observable<GenericOverall> archiveConversation(@Header("Authorization") String authorization,
|
|
||||||
@Url String url);
|
|
||||||
|
|
||||||
@DELETE
|
|
||||||
Observable<GenericOverall> unarchiveConversation(@Header("Authorization") String authorization,
|
|
||||||
@Url String url);
|
|
||||||
}
|
}
|
@ -22,6 +22,7 @@ import android.view.View
|
|||||||
import android.view.View.GONE
|
import android.view.View.GONE
|
||||||
import android.view.View.VISIBLE
|
import android.view.View.VISIBLE
|
||||||
import androidx.appcompat.app.AlertDialog
|
import androidx.appcompat.app.AlertDialog
|
||||||
|
import androidx.core.content.res.ResourcesCompat
|
||||||
import androidx.fragment.app.FragmentTransaction
|
import androidx.fragment.app.FragmentTransaction
|
||||||
import androidx.lifecycle.ViewModelProvider
|
import androidx.lifecycle.ViewModelProvider
|
||||||
import androidx.lifecycle.lifecycleScope
|
import androidx.lifecycle.lifecycleScope
|
||||||
@ -752,12 +753,13 @@ class ConversationInfoActivity :
|
|||||||
if (conversation!!.hasArchived) {
|
if (conversation!!.hasArchived) {
|
||||||
viewModel.unarchiveConversation(conversationUser, conversationToken)
|
viewModel.unarchiveConversation(conversationUser, conversationToken)
|
||||||
binding.archiveConversationIcon
|
binding.archiveConversationIcon
|
||||||
.setImageDrawable(resources.getDrawable(R.drawable.outline_archive_24))
|
.setImageDrawable(ResourcesCompat.getDrawable(resources, R.drawable.outline_archive_24, null))
|
||||||
binding.archiveConversationText.text = resources.getString(R.string.archive_conversation)
|
binding.archiveConversationText.text = resources.getString(R.string.archive_conversation)
|
||||||
binding.archiveConversationTextHint.text = resources.getString(R.string.archive_hint)
|
binding.archiveConversationTextHint.text = resources.getString(R.string.archive_hint)
|
||||||
} else {
|
} else {
|
||||||
viewModel.archiveConversation(conversationUser, conversationToken)
|
viewModel.archiveConversation(conversationUser, conversationToken)
|
||||||
binding.archiveConversationIcon.setImageDrawable(resources.getDrawable(R.drawable.ic_eye))
|
binding.archiveConversationIcon
|
||||||
|
.setImageDrawable(ResourcesCompat.getDrawable(resources, R.drawable.ic_eye, null))
|
||||||
binding.archiveConversationText.text = resources.getString(R.string.unarchive_conversation)
|
binding.archiveConversationText.text = resources.getString(R.string.unarchive_conversation)
|
||||||
binding.archiveConversationTextHint.text = resources.getString(R.string.unarchive_hint)
|
binding.archiveConversationTextHint.text = resources.getString(R.string.unarchive_hint)
|
||||||
}
|
}
|
||||||
@ -765,11 +767,13 @@ class ConversationInfoActivity :
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (conversation!!.hasArchived) {
|
if (conversation!!.hasArchived) {
|
||||||
binding.archiveConversationIcon.setImageDrawable(resources.getDrawable(R.drawable.ic_eye))
|
binding.archiveConversationIcon
|
||||||
|
.setImageDrawable(ResourcesCompat.getDrawable(resources, R.drawable.ic_eye, null))
|
||||||
binding.archiveConversationText.text = resources.getString(R.string.unarchive_conversation)
|
binding.archiveConversationText.text = resources.getString(R.string.unarchive_conversation)
|
||||||
binding.archiveConversationTextHint.text = resources.getString(R.string.unarchive_hint)
|
binding.archiveConversationTextHint.text = resources.getString(R.string.unarchive_hint)
|
||||||
} else {
|
} else {
|
||||||
binding.archiveConversationIcon.setImageDrawable(resources.getDrawable(R.drawable.outline_archive_24))
|
binding.archiveConversationIcon
|
||||||
|
.setImageDrawable(ResourcesCompat.getDrawable(resources, R.drawable.outline_archive_24, null))
|
||||||
binding.archiveConversationText.text = resources.getString(R.string.archive_conversation)
|
binding.archiveConversationText.text = resources.getString(R.string.archive_conversation)
|
||||||
binding.archiveConversationTextHint.text = resources.getString(R.string.archive_hint)
|
binding.archiveConversationTextHint.text = resources.getString(R.string.archive_hint)
|
||||||
}
|
}
|
||||||
|
@ -9,6 +9,7 @@ package com.nextcloud.talk.data.source.local
|
|||||||
import android.util.Log
|
import android.util.Log
|
||||||
import androidx.room.migration.Migration
|
import androidx.room.migration.Migration
|
||||||
import androidx.sqlite.db.SupportSQLiteDatabase
|
import androidx.sqlite.db.SupportSQLiteDatabase
|
||||||
|
import java.sql.SQLException
|
||||||
|
|
||||||
@Suppress("MagicNumber")
|
@Suppress("MagicNumber")
|
||||||
object Migrations {
|
object Migrations {
|
||||||
@ -251,7 +252,7 @@ object Migrations {
|
|||||||
"ALTER TABLE Conversations " +
|
"ALTER TABLE Conversations " +
|
||||||
"ADD `hasArchived` INTEGER;"
|
"ADD `hasArchived` INTEGER;"
|
||||||
)
|
)
|
||||||
} catch (e: Exception) {
|
} catch (e: SQLException) {
|
||||||
Log.i("Migrations", "hasArchived already exists")
|
Log.i("Migrations", "hasArchived already exists")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user