mirror of
https://github.com/sudoxnym/habitica-android.git
synced 2026-05-20 12:49:02 +00:00
Fix UI Issues
This commit is contained in:
parent
85ca0bcc18
commit
358a89a0f1
11 changed files with 32 additions and 15 deletions
|
|
@ -2,7 +2,8 @@
|
|||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:orientation="vertical"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
android:layout_height="match_parent"
|
||||
android:fitsSystemWindows="true">
|
||||
<androidx.swiperefreshlayout.widget.SwipeRefreshLayout
|
||||
android:id="@+id/swipeRefreshLayout"
|
||||
android:layout_width="match_parent"
|
||||
|
|
|
|||
|
|
@ -88,5 +88,9 @@
|
|||
android:text="@string/read_community_guidelines"
|
||||
style="@style/Caption3"
|
||||
android:textColor="@color/brand_300" />
|
||||
<Space
|
||||
android:id="@+id/spacing"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent" />
|
||||
</LinearLayout>
|
||||
</merge>
|
||||
|
|
@ -818,7 +818,7 @@
|
|||
<string name="two_handed">Two-Handed</string>
|
||||
<string name="usernamePromptTitle">It’s time to set your username!</string>
|
||||
<string name="usernamePromptBody">Login names are now unique usernames that will be visible beside your display name and used for invitations, chat @mentions, and messaging.</string>
|
||||
<string name="usernamePromptWiki">If you’d like to learn more about this change, <a href="">visit our wiki.</a></string>
|
||||
<string name="usernamePromptWiki">If you’d like to learn more about this change, <a href="https://habitica.wikia.com/wiki/Player_Names">visit our wiki.</a></string>
|
||||
<string name="confirmUsername">Confirm Username</string>
|
||||
<string name="usernamePromptDisclaimer">Usernames should conform to our <a href="https://habitica.com/static/terms">Terms of Service</a> and <a href="https://habitica.com/static/community-guidelines">Community Guidelines</a>. If you didn’t previously set a login name, your username was auto-generated.</string>
|
||||
<string name="confirm_username_title">Are you sure you want to confirm your current username?</string>
|
||||
|
|
|
|||
|
|
@ -31,6 +31,8 @@ abstract class BaseActivity : AppCompatActivity() {
|
|||
private val habiticaApplication: HabiticaApplication
|
||||
get() = application as HabiticaApplication
|
||||
|
||||
var isActivityVisible = false
|
||||
|
||||
override fun dispatchTouchEvent(ev: MotionEvent): Boolean {
|
||||
InstabugTrackingDelegate.notifyActivityGotTouchEvent(ev, this)
|
||||
return super.dispatchTouchEvent(ev)
|
||||
|
|
@ -53,6 +55,16 @@ abstract class BaseActivity : AppCompatActivity() {
|
|||
EventBus.getDefault().register(this)
|
||||
}
|
||||
|
||||
override fun onResume() {
|
||||
super.onResume()
|
||||
isActivityVisible = true
|
||||
}
|
||||
|
||||
override fun onPause() {
|
||||
isActivityVisible = false
|
||||
super.onPause()
|
||||
}
|
||||
|
||||
override fun onStop() {
|
||||
if (EventBus.getDefault().isRegistered(this)) {
|
||||
EventBus.getDefault().unregister(this)
|
||||
|
|
|
|||
|
|
@ -406,7 +406,7 @@ open class MainActivity : BaseActivity(), TutorialView.OnTutorialReaction {
|
|||
drawerFragment?.setSettingsCount(if (this.user?.flags?.isVerifiedUsername != true) 1 else 0 )
|
||||
|
||||
if (remoteConfigManager.enableUsernameRelease()) {
|
||||
if (user?.flags?.isVerifiedUsername != true) {
|
||||
if (user?.flags?.isVerifiedUsername != true && isActivityVisible) {
|
||||
val intent = Intent(this, VerifyUsernameActivity::class.java)
|
||||
startActivity(intent)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -42,7 +42,7 @@ import org.greenrobot.eventbus.Subscribe
|
|||
import java.util.*
|
||||
import javax.inject.Inject
|
||||
|
||||
class SetupActivity : BaseActivity(), androidx.viewpager.widget.ViewPager.OnPageChangeListener {
|
||||
class SetupActivity : BaseActivity(), ViewPager.OnPageChangeListener {
|
||||
|
||||
@Inject
|
||||
lateinit var apiClient: ApiClient
|
||||
|
|
@ -248,9 +248,9 @@ class SetupActivity : BaseActivity(), androidx.viewpager.widget.ViewPager.OnPage
|
|||
.subscribe(Consumer { }, RxErrorHandler.handleEmptyError()))
|
||||
}
|
||||
|
||||
private inner class ViewPageAdapter(fm: androidx.fragment.app.FragmentManager) : FragmentPagerAdapter(fm), IconPagerAdapter {
|
||||
private inner class ViewPageAdapter(fm: FragmentManager) : FragmentPagerAdapter(fm), IconPagerAdapter {
|
||||
|
||||
override fun getItem(position: Int): androidx.fragment.app.Fragment {
|
||||
override fun getItem(position: Int): Fragment {
|
||||
return when (position) {
|
||||
1 -> {
|
||||
val fragment = AvatarSetupFragment()
|
||||
|
|
|
|||
|
|
@ -31,7 +31,7 @@ import io.realm.OrderedRealmCollection
|
|||
import io.realm.RealmRecyclerViewAdapter
|
||||
import net.pherth.android.emoji_library.EmojiTextView
|
||||
|
||||
class ChatRecyclerViewAdapter(data: OrderedRealmCollection<ChatMessage>?, autoUpdate: Boolean, private val user: User?, private val isTavern: Boolean, private val releasedUsernames: Boolean) : RealmRecyclerViewAdapter<ChatMessage, androidx.recyclerview.widget.RecyclerView.ViewHolder>(data, autoUpdate) {
|
||||
class ChatRecyclerViewAdapter(data: OrderedRealmCollection<ChatMessage>?, autoUpdate: Boolean, private val user: User?, private val isTavern: Boolean, private val releasedUsernames: Boolean) : RealmRecyclerViewAdapter<ChatMessage, RecyclerView.ViewHolder>(data, autoUpdate) {
|
||||
private var uuid: String = ""
|
||||
private var expandedMessageId: String? = null
|
||||
|
||||
|
|
|
|||
|
|
@ -42,7 +42,7 @@ import kotlinx.android.synthetic.main.tavern_chat_new_entry_item.*
|
|||
import java.util.concurrent.TimeUnit
|
||||
import javax.inject.Inject
|
||||
|
||||
class ChatListFragment : BaseFragment(), androidx.swiperefreshlayout.widget.SwipeRefreshLayout.OnRefreshListener {
|
||||
class ChatListFragment : BaseFragment(), SwipeRefreshLayout.OnRefreshListener {
|
||||
|
||||
@Inject
|
||||
lateinit var socialRepository: SocialRepository
|
||||
|
|
@ -52,7 +52,7 @@ class ChatListFragment : BaseFragment(), androidx.swiperefreshlayout.widget.Swip
|
|||
lateinit var configManager: RemoteConfigManager
|
||||
|
||||
private var isTavern: Boolean = false
|
||||
internal var layoutManager: androidx.recyclerview.widget.LinearLayoutManager? = null
|
||||
internal var layoutManager: LinearLayoutManager? = null
|
||||
internal var groupId: String? = null
|
||||
private var user: User? = null
|
||||
private var userId: String? = null
|
||||
|
|
|
|||
|
|
@ -78,7 +78,6 @@ class InboxMessageListFragment : BaseMainFragment(), androidx.swiperefreshlayout
|
|||
loadMessages()
|
||||
|
||||
communityGuidelinesView.visibility = View.GONE
|
||||
|
||||
}
|
||||
|
||||
override fun onAttach(context: Context?) {
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ import android.view.MotionEvent
|
|||
import android.view.View
|
||||
|
||||
|
||||
class FadingViewPager : androidx.viewpager.widget.ViewPager {
|
||||
class FadingViewPager : ViewPager {
|
||||
var disableFading: Boolean = false
|
||||
|
||||
constructor(context: Context) : super(context) {
|
||||
|
|
|
|||
|
|
@ -12,6 +12,7 @@ import android.view.LayoutInflater
|
|||
import android.view.View
|
||||
import android.view.inputmethod.InputMethodManager
|
||||
import android.widget.*
|
||||
import androidx.core.view.updateLayoutParams
|
||||
import com.habitrpg.android.habitica.R
|
||||
import com.habitrpg.android.habitica.ui.helpers.NavbarUtils
|
||||
import com.habitrpg.android.habitica.ui.helpers.bindView
|
||||
|
|
@ -26,6 +27,7 @@ class ChatBarView : FrameLayout {
|
|||
private val textIndicator: TextView by bindView(R.id.text_indicator)
|
||||
private val indicatorSpacing: View by bindView(R.id.indicator_spacing)
|
||||
private val emojiButton: ImageButton by bindView(R.id.emojiButton)
|
||||
private val spacing: Space by bindView(R.id.spacing)
|
||||
private val popup: EmojiPopup by lazy {
|
||||
EmojiPopup(emojiButton.rootView, context, ContextCompat.getColor(context, R.color.brand))
|
||||
}
|
||||
|
|
@ -131,10 +133,9 @@ class ChatBarView : FrameLayout {
|
|||
navBarAccountedHeightCalculated = true
|
||||
|
||||
val navbarHeight = NavbarUtils.getNavbarHeight(context)
|
||||
val layoutParams = this.layoutParams as? LinearLayout.LayoutParams
|
||||
layoutParams?.setMargins(0, 0, 0, navbarHeight)
|
||||
setLayoutParams(layoutParams)
|
||||
(parent as? View)?.invalidate()
|
||||
spacing.updateLayoutParams<LinearLayout.LayoutParams> {
|
||||
height = navbarHeight
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue