mirror of
https://github.com/sudoxnym/habitica-android.git
synced 2026-07-18 20:04:11 +00:00
Fix minor issues
This commit is contained in:
parent
009fc24fbd
commit
c6305d9121
26 changed files with 31 additions and 48 deletions
|
|
@ -157,7 +157,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 3214
|
||||
versionCode 3218
|
||||
versionName "3.5"
|
||||
|
||||
targetSdkVersion 32
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android" android:height="14dp" android:viewportHeight="24.0" android:viewportWidth="24.0" android:width="14dp">
|
||||
<path android:fillColor="#432874" android:pathData="M9,16.17L4.83,12l-1.42,1.41L9,19 21,7l-1.41,-1.41z"/>
|
||||
<path android:fillColor="@color/brand_400" android:pathData="M9,16.17L4.83,12l-1.42,1.41L9,19 21,7l-1.41,-1.41z"/>
|
||||
</vector>
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@
|
|||
<item android:state_enabled="false">
|
||||
<shape android:shape="rectangle">
|
||||
<solid
|
||||
android:color="@color/inverted_background_offset">
|
||||
android:color="@color/gray_600">
|
||||
</solid>
|
||||
<corners
|
||||
android:radius="8dp">
|
||||
|
|
@ -36,7 +36,7 @@
|
|||
<item>
|
||||
<shape android:shape="rectangle">
|
||||
<solid
|
||||
android:color="@color/content_background">
|
||||
android:color="@color/white">
|
||||
</solid>
|
||||
<corners
|
||||
android:radius="8dp">
|
||||
|
|
|
|||
|
|
@ -1,11 +1,10 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout 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="match_parent"
|
||||
android:orientation="vertical"
|
||||
tools:context=".ui.activities.PrefsActivity">
|
||||
android:background="?colorContentBackground">
|
||||
|
||||
<com.google.android.material.appbar.AppBarLayout
|
||||
android:layout_width="match_parent"
|
||||
|
|
|
|||
|
|
@ -17,13 +17,13 @@
|
|||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:src="@drawable/adventure_guide_left"
|
||||
android:layout_marginStart="9dp"/>
|
||||
android:layout_marginStart="14dp"/>
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginStart="10dp"
|
||||
android:layout_marginTop="12dp"
|
||||
android:layout_marginEnd="9dp"
|
||||
android:layout_marginEnd="12dp"
|
||||
android:layout_marginBottom="12dp"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="vertical">
|
||||
|
|
@ -34,7 +34,8 @@
|
|||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/onboarding_objectives"
|
||||
style="@style/Body1"
|
||||
style="@style/Subheader3"
|
||||
android:textStyle="bold"
|
||||
android:textColor="@color/text_primary"/>
|
||||
<Space
|
||||
android:layout_width="0dp"
|
||||
|
|
@ -75,6 +76,7 @@
|
|||
android:layout_height="wrap_content"
|
||||
android:textColor="@color/text_brand_neon"
|
||||
android:textStyle="bold"
|
||||
android:layout_marginEnd="6dp"
|
||||
tools:text="2/5" />
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
|
|
|
|||
|
|
@ -239,8 +239,7 @@
|
|||
android:layout_gravity="center_horizontal"
|
||||
android:gravity="center"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="14sp"
|
||||
android:lineSpacingExtra="4dp"
|
||||
style="@style/Caption2"
|
||||
android:drawablePadding="@dimen/spacing_medium"/>
|
||||
</LinearLayout>
|
||||
</FrameLayout>
|
||||
|
|
|
|||
|
|
@ -388,7 +388,6 @@
|
|||
<argument
|
||||
android:name="groupID"
|
||||
app:nullable="true"
|
||||
android:defaultValue=""
|
||||
app:argType="string" />
|
||||
</activity>
|
||||
<action
|
||||
|
|
|
|||
|
|
@ -374,7 +374,7 @@
|
|||
<string name="google_services_missing">Google play services could not be found.</string>
|
||||
<string name="gem_purchase_toolbartitle">Purchase</string>
|
||||
<string name="gem_purchase_title">Buying gems supports the developers and helps keep Habitica running</string>
|
||||
<string name="gem_purchase_subtitle">Gems allow you to buy fun extras for your account, including:</string>
|
||||
<string name="gem_purchase_subtitle">Gems allow you to buy fun extras for your account:</string>
|
||||
<string name="gem_purchase_listitem1">Cool costumes for your avatar</string>
|
||||
<string name="gem_purchase_listitem2">Awesome backgrounds</string>
|
||||
<string name="gem_purchase_listitem3">Quests that reward you with pet eggs</string>
|
||||
|
|
|
|||
|
|
@ -22,6 +22,7 @@ import com.habitrpg.android.habitica.ui.activities.GiftGemsActivity;
|
|||
import com.habitrpg.android.habitica.ui.activities.GiftSubscriptionActivity;
|
||||
import com.habitrpg.android.habitica.ui.activities.GroupFormActivity;
|
||||
import com.habitrpg.android.habitica.ui.activities.GroupInviteActivity;
|
||||
import com.habitrpg.android.habitica.ui.activities.GuidelinesActivity;
|
||||
import com.habitrpg.android.habitica.ui.activities.HabitButtonWidgetActivity;
|
||||
import com.habitrpg.android.habitica.ui.activities.IntroActivity;
|
||||
import com.habitrpg.android.habitica.ui.activities.LoginActivity;
|
||||
|
|
@ -349,4 +350,6 @@ public interface UserComponent {
|
|||
void inject(@NotNull AuthenticationViewModel authenticationViewModel);
|
||||
|
||||
void inject(@NotNull MainActivityViewModel mainActivityViewModel);
|
||||
|
||||
void inject(@NotNull GuidelinesActivity guidelinesActivity);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -27,7 +27,7 @@ import kotlinx.coroutines.launch
|
|||
|
||||
class ShowNotificationInteractor(private val activity: Activity, private val lifecycleScope: LifecycleCoroutineScope) {
|
||||
|
||||
fun handleNotification(notification: Notification) {
|
||||
fun handleNotification(notification: Notification): Boolean {
|
||||
when (notification.type) {
|
||||
Notification.Type.LOGIN_INCENTIVE.type -> showCheckinDialog(notification)
|
||||
Notification.Type.ACHIEVEMENT_PARTY_UP.type -> showAchievementDialog(notification)
|
||||
|
|
@ -67,8 +67,9 @@ class ShowNotificationInteractor(private val activity: Activity, private val lif
|
|||
Notification.Type.ACHIEVEMENT_GENERIC.type -> showAchievementDialog(notification)
|
||||
Notification.Type.ACHIEVEMENT_ONBOARDING_COMPLETE.type -> showAchievementDialog(notification)
|
||||
Notification.Type.FIRST_DROP.type -> showFirstDropDialog(notification)
|
||||
else -> false
|
||||
else -> return false
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
||||
fun showCheckinDialog(notification: Notification) {
|
||||
|
|
@ -122,7 +123,7 @@ class ShowNotificationInteractor(private val activity: Activity, private val lif
|
|||
} else {
|
||||
200
|
||||
}
|
||||
lifecycleScope.launch() {
|
||||
lifecycleScope.launch {
|
||||
delay(delayTime)
|
||||
lifecycleScope.launch(context = Dispatchers.Main) {
|
||||
val dialog = AchievementDialog(activity)
|
||||
|
|
|
|||
|
|
@ -27,9 +27,6 @@ class AdventureGuideActivity : BaseActivity() {
|
|||
private lateinit var achievementTitles: Map<String, String>
|
||||
private lateinit var achievementDescriptions: Map<String, String>
|
||||
|
||||
@Inject
|
||||
internal lateinit var userRepository: UserRepository
|
||||
|
||||
override fun getLayoutResId(): Int {
|
||||
return R.layout.activity_main
|
||||
}
|
||||
|
|
@ -99,7 +96,6 @@ class AdventureGuideActivity : BaseActivity() {
|
|||
|
||||
if (completed > 0) {
|
||||
binding.progressTextview.text = getString(R.string.percent_completed, ((completed / achievements.size.toFloat()) * 100).toInt())
|
||||
binding.progressTextview.setTextColor(ContextCompat.getColor(this, R.color.yellow_5))
|
||||
}
|
||||
|
||||
binding.achievementContainer.removeAllViews()
|
||||
|
|
|
|||
|
|
@ -25,8 +25,10 @@ import com.habitrpg.android.habitica.HabiticaApplication
|
|||
import com.habitrpg.android.habitica.HabiticaBaseApplication
|
||||
import com.habitrpg.android.habitica.R
|
||||
import com.habitrpg.android.habitica.components.UserComponent
|
||||
import com.habitrpg.android.habitica.data.UserRepository
|
||||
import com.habitrpg.android.habitica.extensions.getThemeColor
|
||||
import com.habitrpg.android.habitica.extensions.isUsingNightModeResources
|
||||
import com.habitrpg.android.habitica.extensions.subscribeWithErrorHandler
|
||||
import com.habitrpg.android.habitica.extensions.updateStatusBarColor
|
||||
import com.habitrpg.android.habitica.helpers.LanguageHelper
|
||||
import com.habitrpg.android.habitica.helpers.NotificationsManager
|
||||
|
|
@ -44,6 +46,8 @@ abstract class BaseActivity : AppCompatActivity() {
|
|||
@Inject
|
||||
lateinit var notificationsManager: NotificationsManager
|
||||
@Inject
|
||||
lateinit var userRepository: UserRepository
|
||||
@Inject
|
||||
internal lateinit var analyticsManager: AnalyticsManager
|
||||
|
||||
private var currentTheme: String? = null
|
||||
|
|
@ -92,7 +96,9 @@ abstract class BaseActivity : AppCompatActivity() {
|
|||
compositeSubscription = CompositeDisposable()
|
||||
compositeSubscription.add(notificationsManager.displayNotificationEvents.subscribe(
|
||||
{
|
||||
ShowNotificationInteractor(this, lifecycleScope).handleNotification(it)
|
||||
if (ShowNotificationInteractor(this, lifecycleScope).handleNotification(it)) {
|
||||
compositeSubscription.add(userRepository.retrieveUser(false, true).subscribeWithErrorHandler {})
|
||||
}
|
||||
},
|
||||
RxErrorHandler.handleEmptyError()
|
||||
))
|
||||
|
|
|
|||
|
|
@ -53,8 +53,6 @@ class ChallengeFormActivity : BaseActivity() {
|
|||
internal lateinit var challengeRepository: ChallengeRepository
|
||||
@Inject
|
||||
internal lateinit var socialRepository: SocialRepository
|
||||
@Inject
|
||||
internal lateinit var userRepository: UserRepository
|
||||
@field:[Inject Named(AppModule.NAMED_USER_ID)]
|
||||
internal lateinit var userId: String
|
||||
|
||||
|
|
|
|||
|
|
@ -46,9 +46,6 @@ class ClassSelectionActivity : BaseActivity(), Consumer<User> {
|
|||
private var classWasUnset: Boolean? = false
|
||||
private var shouldFinish: Boolean? = false
|
||||
|
||||
@Inject
|
||||
lateinit var userRepository: UserRepository
|
||||
|
||||
private var progressDialog: HabiticaProgressDialog? = null
|
||||
|
||||
override fun getLayoutResId(): Int {
|
||||
|
|
|
|||
|
|
@ -53,8 +53,6 @@ class FullProfileActivity : BaseActivity() {
|
|||
lateinit var apiClient: ApiClient
|
||||
@Inject
|
||||
lateinit var socialRepository: SocialRepository
|
||||
@Inject
|
||||
lateinit var userRepository: UserRepository
|
||||
|
||||
private var userID = ""
|
||||
private var username: String? = null
|
||||
|
|
|
|||
|
|
@ -33,8 +33,6 @@ class GiftGemsActivity : PurchaseActivity() {
|
|||
@Inject
|
||||
lateinit var socialRepository: SocialRepository
|
||||
@Inject
|
||||
lateinit var userRepository: UserRepository
|
||||
@Inject
|
||||
lateinit var appConfigManager: AppConfigManager
|
||||
@Inject
|
||||
lateinit var purchaseHandler: PurchaseHandler
|
||||
|
|
|
|||
|
|
@ -32,8 +32,6 @@ class GroupInviteActivity : BaseActivity() {
|
|||
lateinit var userId: String
|
||||
@Inject
|
||||
lateinit var socialRepository: SocialRepository
|
||||
@Inject
|
||||
lateinit var userRepository: UserRepository
|
||||
|
||||
internal var fragments: MutableList<PartyInviteFragment> = ArrayList()
|
||||
|
||||
|
|
|
|||
|
|
@ -15,7 +15,9 @@ import java.io.InputStreamReader
|
|||
class GuidelinesActivity : BaseActivity() {
|
||||
override fun getLayoutResId(): Int = R.layout.activity_guidelines
|
||||
|
||||
override fun injectActivity(component: UserComponent?) { /* no-on */ }
|
||||
override fun injectActivity(component: UserComponent?) {
|
||||
component?.inject(this)
|
||||
}
|
||||
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
super.onCreate(savedInstanceState)
|
||||
|
|
|
|||
|
|
@ -49,8 +49,6 @@ class LoginActivity : BaseActivity() {
|
|||
@Inject
|
||||
lateinit var sharedPrefs: SharedPreferences
|
||||
@Inject
|
||||
internal lateinit var userRepository: UserRepository
|
||||
@Inject
|
||||
lateinit var configManager: AppConfigManager
|
||||
|
||||
private var isRegistering: Boolean = false
|
||||
|
|
|
|||
|
|
@ -77,8 +77,6 @@ open class MainActivity : BaseActivity(), TutorialView.OnTutorialReaction, Snack
|
|||
@Inject
|
||||
internal lateinit var taskRepository: TaskRepository
|
||||
@Inject
|
||||
internal lateinit var userRepository: UserRepository
|
||||
@Inject
|
||||
internal lateinit var inventoryRepository: InventoryRepository
|
||||
@Inject
|
||||
internal lateinit var appConfigManager: AppConfigManager
|
||||
|
|
|
|||
|
|
@ -44,8 +44,6 @@ class SetupActivity : BaseActivity(), ViewPager.OnPageChangeListener {
|
|||
@Inject
|
||||
lateinit var hostConfig: HostConfig
|
||||
@Inject
|
||||
lateinit var userRepository: UserRepository
|
||||
@Inject
|
||||
lateinit var inventoryRepository: InventoryRepository
|
||||
@Inject
|
||||
lateinit var taskRepository: TaskRepository
|
||||
|
|
|
|||
|
|
@ -20,8 +20,6 @@ class SkillMemberActivity : BaseActivity() {
|
|||
|
||||
@Inject
|
||||
lateinit var socialRepository: SocialRepository
|
||||
@Inject
|
||||
lateinit var userRepository: UserRepository
|
||||
|
||||
override fun getLayoutResId(): Int {
|
||||
return R.layout.activity_skill_members
|
||||
|
|
|
|||
|
|
@ -48,8 +48,6 @@ class TaskFormActivity : BaseActivity() {
|
|||
private var userScrolled: Boolean = false
|
||||
private var isSaving: Boolean = false
|
||||
@Inject
|
||||
lateinit var userRepository: UserRepository
|
||||
@Inject
|
||||
lateinit var taskRepository: TaskRepository
|
||||
@Inject
|
||||
lateinit var tagRepository: TagRepository
|
||||
|
|
|
|||
|
|
@ -24,9 +24,6 @@ import javax.inject.Inject
|
|||
class VerifyUsernameActivity : BaseActivity() {
|
||||
private lateinit var binding: ActivityVerifyUsernameBinding
|
||||
|
||||
@Inject
|
||||
lateinit var userRepository: UserRepository
|
||||
|
||||
private val displayNameVerificationEvents = PublishSubject.create<String>()
|
||||
private val usernameVerificationEvents = PublishSubject.create<String>()
|
||||
|
||||
|
|
|
|||
|
|
@ -188,7 +188,7 @@ class ChatFragment() : BaseFragment<FragmentChatBinding>() {
|
|||
}
|
||||
|
||||
private fun showFlagConfirmationDialog(chatMessage: ChatMessage) {
|
||||
val directions = MainNavDirections.actionGlobalReportMessageActivity(chatMessage.text ?: "", chatMessage.user ?: "", chatMessage.id)
|
||||
val directions = MainNavDirections.actionGlobalReportMessageActivity(chatMessage.text ?: "", chatMessage.user ?: "", chatMessage.id, chatMessage.groupId)
|
||||
MainNavigationController.navigate(directions)
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -251,7 +251,7 @@ class InboxMessageListFragment : BaseMainFragment<FragmentInboxMessageListBindin
|
|||
}
|
||||
|
||||
private fun showFlagConfirmationDialog(chatMessage: ChatMessage) {
|
||||
val directions = MainNavDirections.actionGlobalReportMessageActivity(chatMessage.text ?: "", chatMessage.user ?: "", chatMessage.id)
|
||||
val directions = MainNavDirections.actionGlobalReportMessageActivity(chatMessage.text ?: "", chatMessage.user ?: "", chatMessage.id, null)
|
||||
MainNavigationController.navigate(directions)
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue