mirror of
https://github.com/sudoxnym/habitica-android.git
synced 2026-04-14 19:56:32 +00:00
Fix minor issues
This commit is contained in:
parent
79a18eadf6
commit
bbe5bb005c
10 changed files with 19 additions and 17 deletions
|
|
@ -176,7 +176,6 @@
|
|||
<activity
|
||||
android:name=".ui.activities.ChallengeFormActivity"
|
||||
android:parentActivityName=".ui.activities.MainActivity"
|
||||
android:launchMode="singleTask"
|
||||
tools:ignore="UnusedAttribute">
|
||||
<meta-data
|
||||
android:name="android.support.PARENT_ACTIVITY"
|
||||
|
|
|
|||
|
|
@ -146,7 +146,7 @@ android {
|
|||
buildConfigField "String", "TESTING_LEVEL", "\"production\""
|
||||
resConfigs "en", "bg", "de", "en-rGB", "es", "fr", "hr-rHR", "in", "it", "iw", "ja", "ko", "lt", "nl", "pl", "pt-rBR", "pt-rPT", "ru", "tr", "zh", "zh-rTW"
|
||||
|
||||
versionCode 3000
|
||||
versionCode 3006
|
||||
versionName "3.3"
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -398,12 +398,6 @@
|
|||
android:text="@string/profile_achievements"
|
||||
android:textStyle="bold" />
|
||||
|
||||
<ProgressBar
|
||||
android:id="@+id/achievement_progress"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:indeterminate="true" />
|
||||
|
||||
<com.habitrpg.android.habitica.ui.helpers.RecyclerViewEmptySupport
|
||||
android:id="@+id/achievement_group_list"
|
||||
android:layout_width="match_parent"
|
||||
|
|
|
|||
|
|
@ -188,6 +188,7 @@ class RealmSocialLocalRepository(realm: Realm) : RealmBaseLocalRepository(realm)
|
|||
if (liked) {
|
||||
executeTransaction {
|
||||
liveMessage?.likes?.add(ChatMessageLike(userId))
|
||||
liveMessage?.likeCount = liveMessage?.likes?.size ?: 0
|
||||
}
|
||||
} else {
|
||||
liveMessage?.likes?.filter { userId == it.id }?.forEach { like ->
|
||||
|
|
@ -195,6 +196,9 @@ class RealmSocialLocalRepository(realm: Realm) : RealmBaseLocalRepository(realm)
|
|||
like.deleteFromRealm()
|
||||
})
|
||||
}
|
||||
executeTransaction {
|
||||
liveMessage?.likeCount = liveMessage?.likes?.size ?: 0
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -52,8 +52,7 @@ open class ChatMessage : RealmObject(), BaseMainObject {
|
|||
val isSystemMessage: Boolean
|
||||
get() = uuid == "system"
|
||||
|
||||
val likeCount: Int
|
||||
get() = likes?.size ?: 0
|
||||
var likeCount: Int = 0
|
||||
|
||||
var username: String? = null
|
||||
val formattedUsername: String?
|
||||
|
|
|
|||
|
|
@ -28,6 +28,7 @@ import com.habitrpg.android.habitica.models.user.Outfit
|
|||
import com.habitrpg.android.habitica.models.user.Stats
|
||||
import com.habitrpg.android.habitica.ui.AvatarWithBarsViewModel
|
||||
import com.habitrpg.android.habitica.ui.adapter.social.AchievementProfileAdapter
|
||||
import com.habitrpg.android.habitica.ui.helpers.RecyclerViewState
|
||||
import com.habitrpg.android.habitica.ui.helpers.loadImage
|
||||
import com.habitrpg.android.habitica.ui.helpers.setMarkdown
|
||||
import com.habitrpg.android.habitica.ui.views.HabiticaSnackbar
|
||||
|
|
@ -260,7 +261,7 @@ class FullProfileActivity : BaseActivity() {
|
|||
binding.achievementGroupList.layoutManager = layoutManager
|
||||
binding.achievementGroupList.adapter = adapter
|
||||
|
||||
stopAndHideProgress(binding.achievementProgress)
|
||||
binding.achievementGroupList.state = RecyclerViewState.DISPLAYING_DATA
|
||||
}
|
||||
|
||||
private fun fillAchievements(labelID: Int, achievements: List<Achievement>, targetList: MutableList<Any>) {
|
||||
|
|
@ -272,11 +273,6 @@ class FullProfileActivity : BaseActivity() {
|
|||
targetList.addAll(achievementList)
|
||||
}
|
||||
|
||||
private fun stopAndHideProgress(bar: ProgressBar) {
|
||||
bar.isIndeterminate = false
|
||||
bar.visibility = View.GONE
|
||||
}
|
||||
|
||||
private fun getFloorValueString(`val`: Float, roundDown: Boolean): String {
|
||||
return if (roundDown) {
|
||||
floor(`val`.toDouble()).toString()
|
||||
|
|
|
|||
|
|
@ -76,6 +76,8 @@ class GuildListAdapter : BaseRecyclerViewAdapter<Group, RecyclerView.ViewHolder>
|
|||
.contains("summary", constraint.toString(), Case.INSENSITIVE)
|
||||
.endGroup()
|
||||
.findAll()
|
||||
} else {
|
||||
data = it
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@ import com.habitrpg.android.habitica.ui.helpers.KeyboardUtil
|
|||
import com.habitrpg.android.habitica.ui.helpers.SafeDefaultItemAnimator
|
||||
import javax.inject.Inject
|
||||
|
||||
class GuildListFragment : BaseFragment<FragmentRefreshRecyclerviewBinding>(), SearchView.OnQueryTextListener, SwipeRefreshLayout.OnRefreshListener {
|
||||
class GuildListFragment : BaseFragment<FragmentRefreshRecyclerviewBinding>(), SearchView.OnQueryTextListener, SearchView.OnCloseListener, SwipeRefreshLayout.OnRefreshListener {
|
||||
|
||||
@Inject
|
||||
lateinit var socialRepository: SocialRepository
|
||||
|
|
@ -87,4 +87,8 @@ class GuildListFragment : BaseFragment<FragmentRefreshRecyclerviewBinding>(), Se
|
|||
fetchGuilds()
|
||||
}
|
||||
|
||||
override fun onClose(): Boolean {
|
||||
viewAdapter.filter.filter("")
|
||||
return false
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -59,6 +59,9 @@ class GuildOverviewFragment : BaseMainFragment<FragmentViewpagerBinding>(), Sear
|
|||
context?.let { theTextArea?.setHintTextColor(ContextCompat.getColor(it, R.color.white)) }
|
||||
guildSearchView?.queryHint = getString(R.string.guild_search_hint)
|
||||
guildSearchView?.setOnQueryTextListener(this)
|
||||
guildSearchView?.setOnCloseListener {
|
||||
getActiveFragment()?.onClose() ?: true
|
||||
}
|
||||
}
|
||||
|
||||
@Suppress("ReturnCount")
|
||||
|
|
|
|||
|
|
@ -31,6 +31,7 @@ class ChatMessageDeserializer : JsonDeserializer<ChatMessage> {
|
|||
message.likes?.add(ChatMessageLike(key))
|
||||
}
|
||||
}
|
||||
message.likeCount = message.likes?.size ?: 0
|
||||
}
|
||||
if (obj.has("flagCount")) {
|
||||
message.flagCount = obj.get("flagCount").asInt
|
||||
|
|
|
|||
Loading…
Reference in a new issue