mirror of
https://github.com/sudoxnym/habitica-android.git
synced 2026-04-14 19:56:32 +00:00
dialog tweaks
This commit is contained in:
parent
b7010191d4
commit
3d89420792
13 changed files with 31 additions and 56 deletions
|
|
@ -3,12 +3,13 @@
|
|||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:orientation="vertical"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
android:layout_height="match_parent"
|
||||
android:background="@color/brand_50012">
|
||||
|
||||
<RelativeLayout
|
||||
android:id="@+id/confetti_container"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"></RelativeLayout>
|
||||
android:layout_height="match_parent" />
|
||||
<LinearLayout
|
||||
android:id="@+id/dialog_wrapper"
|
||||
android:orientation="vertical"
|
||||
|
|
@ -122,4 +123,4 @@
|
|||
android:textColor="?colorAccent"
|
||||
/>
|
||||
</LinearLayout>
|
||||
</RelativeLayout>
|
||||
</RelativeLayout>
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@
|
|||
<com.habitrpg.common.habitica.views.PixelArtView
|
||||
android:id="@+id/icon_view"
|
||||
android:layout_width="40dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_height="40dp"
|
||||
android:layout_margin="8dp" />
|
||||
<LinearLayout
|
||||
android:layout_width="0dp"
|
||||
|
|
|
|||
|
|
@ -21,8 +21,9 @@
|
|||
<ImageView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="18dp"
|
||||
android:layout_marginTop="114dp"
|
||||
android:layout_marginTop="115dp"
|
||||
android:src="@drawable/npc_gradient_banner"
|
||||
android:importantForAccessibility="no"
|
||||
android:scaleType="fitXY"/>
|
||||
|
||||
<TextView
|
||||
|
|
|
|||
|
|
@ -47,8 +47,7 @@
|
|||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:text="@string/dismiss_tutorial"
|
||||
android:textColor="?textColorTintedSecondary"
|
||||
android:theme="@style/DialogButton"/>
|
||||
android:textColor="?textColorTintedSecondary"/>
|
||||
|
||||
<Button
|
||||
android:id="@+id/completeButton"
|
||||
|
|
@ -58,8 +57,7 @@
|
|||
android:layout_gravity="center_vertical"
|
||||
android:layout_weight="1"
|
||||
android:text="@string/complete_tutorial"
|
||||
android:textColor="?textColorTintedSecondary"
|
||||
android:theme="@style/DialogButton" />
|
||||
android:textColor="?textColorTintedSecondary" />
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
|
||||
|
|
@ -83,4 +81,4 @@
|
|||
android:layout_marginStart="21dp"
|
||||
android:layout_marginTop="32dp"
|
||||
android:textStyle="bold" />
|
||||
</FrameLayout>
|
||||
</FrameLayout>
|
||||
|
|
|
|||
|
|
@ -52,7 +52,7 @@
|
|||
<item name="actionOverflowMenuStyle">@style/PopupTheme</item>
|
||||
<item name="android:popupMenuStyle">@style/PopupTheme</item>
|
||||
<item name="android:textColorLink">@color/brand_400</item>
|
||||
<item name="alertDialogTheme">@style/AlertDialogTheme</item>
|
||||
<item name="alertDialogTheme">@style/HabiticaAlertDialogTheme</item>
|
||||
<item name="android:windowTranslucentStatus">false</item>
|
||||
|
||||
<item name="android:statusBarColor">@color/system_bars</item>
|
||||
|
|
@ -473,35 +473,6 @@
|
|||
<item name="android:textSize">20sp</item>
|
||||
</style>
|
||||
|
||||
<style name="DialogButton" parent="android:Widget.Button">
|
||||
<item name="android:background">@android:color/transparent</item>
|
||||
<item name="android:textColor">?colorAccent</item>
|
||||
</style>
|
||||
|
||||
<style name="DialogTheme" parent="Theme.AppCompat.DayNight.Dialog">
|
||||
<item name="android:windowLightStatusBar">true</item>
|
||||
</style>
|
||||
|
||||
<style name="AlertDialogTheme" parent="Theme.AppCompat.DayNight.Dialog.Alert">
|
||||
<item name="colorPrimary">@color/text_brand_neon</item>
|
||||
<item name="colorAccent">@color/color_accent</item>
|
||||
<item name="buttonBarNegativeButtonStyle">@style/NegativeButtonStyle</item>
|
||||
<item name="buttonBarNeutralButtonStyle">@style/PositiveButtonStyle</item>
|
||||
<item name="buttonBarPositiveButtonStyle">@style/PositiveButtonStyle</item>
|
||||
<item name="backgroundTint">@color/dialog_background</item>
|
||||
</style>
|
||||
|
||||
<style name="HabiticaAccountDialogTheme" parent="AppTheme">
|
||||
<item name="android:windowNoTitle">true</item>
|
||||
<item name="android:windowFullscreen">false</item>
|
||||
<item name="android:windowIsFloating">false</item>
|
||||
<item name="android:statusBarColor">@color/gray_2_alpha</item>
|
||||
<item name="android:windowAnimationStyle">@android:style/Animation.Dialog</item>
|
||||
<item name="android:navigationBarColor">@color/account_dialog_bars</item>
|
||||
<item name="android:windowSoftInputMode">adjustResize</item>
|
||||
</style>
|
||||
|
||||
|
||||
<style name="NegativeButtonStyle" parent="Widget.MaterialComponents.Button.TextButton.Dialog">
|
||||
<item name="android:textColor">@color/text_red</item>
|
||||
</style>
|
||||
|
|
@ -510,7 +481,7 @@
|
|||
<item name="android:textColor">@color/dialog_button_text_color</item>
|
||||
</style>
|
||||
|
||||
<style name="HabiticaAlertDialogTheme" parent="Theme.AppCompat.DayNight.Dialog.Alert">
|
||||
<style name="HabiticaAlertDialogTheme" parent="Theme.Material3.DayNight.Dialog.Alert">
|
||||
<item name="colorAccent">@color/brand_400</item>
|
||||
<item name="android:windowFrame">@null</item>
|
||||
<item name="android:windowIsFloating">true</item>
|
||||
|
|
@ -518,6 +489,8 @@
|
|||
<item name="android:windowAnimationStyle">@android:style/Animation.Dialog</item>
|
||||
<item name="android:windowBackground">@color/transparent</item>
|
||||
<item name="android:colorBackgroundCacheHint">@null</item>
|
||||
<item name="android:backgroundDimEnabled">true</item>
|
||||
<item name="android:backgroundDimAmount">0.3</item>
|
||||
</style>
|
||||
|
||||
<style name="SectionTitle">
|
||||
|
|
|
|||
|
|
@ -11,12 +11,12 @@ import com.habitrpg.android.habitica.ui.viewmodels.MainUserViewModel
|
|||
import dagger.Module
|
||||
import dagger.Provides
|
||||
import dagger.hilt.InstallIn
|
||||
import dagger.hilt.android.components.ActivityRetainedComponent
|
||||
import dagger.hilt.android.qualifiers.ApplicationContext
|
||||
import dagger.hilt.components.SingletonComponent
|
||||
import dagger.hilt.android.scopes.ActivityScoped
|
||||
import javax.inject.Named
|
||||
import javax.inject.Singleton
|
||||
|
||||
@InstallIn(SingletonComponent::class)
|
||||
@InstallIn(ActivityRetainedComponent::class)
|
||||
@Module
|
||||
class UserModule {
|
||||
@Provides
|
||||
|
|
@ -39,7 +39,7 @@ class UserModule {
|
|||
}
|
||||
|
||||
@Provides
|
||||
@Singleton
|
||||
@ActivityScoped
|
||||
fun providesUserViewModel(
|
||||
@Named(NAMED_USER_ID) userID: String,
|
||||
userRepository: UserRepository,
|
||||
|
|
|
|||
|
|
@ -47,12 +47,13 @@ import com.habitrpg.common.habitica.helpers.AnalyticsManager
|
|||
import dagger.Module
|
||||
import dagger.Provides
|
||||
import dagger.hilt.InstallIn
|
||||
import dagger.hilt.android.components.ActivityRetainedComponent
|
||||
import dagger.hilt.android.qualifiers.ApplicationContext
|
||||
import dagger.hilt.components.SingletonComponent
|
||||
import dagger.hilt.android.scopes.ActivityScoped
|
||||
import io.realm.Realm
|
||||
import javax.inject.Named
|
||||
|
||||
@InstallIn(SingletonComponent::class)
|
||||
@InstallIn(ActivityRetainedComponent::class)
|
||||
@Module
|
||||
class UserRepositoryModule {
|
||||
@Provides
|
||||
|
|
@ -207,6 +208,7 @@ class UserRepositoryModule {
|
|||
}
|
||||
|
||||
@Provides
|
||||
@ActivityScoped
|
||||
fun providesPurchaseHandler(
|
||||
@ApplicationContext context: Context,
|
||||
analyticsManager: AnalyticsManager,
|
||||
|
|
|
|||
|
|
@ -27,7 +27,7 @@ class HabiticaAccountDialog(private var thisContext: Context) : DialogFragment(R
|
|||
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
super.onCreate(savedInstanceState)
|
||||
setStyle(STYLE_NO_TITLE, R.style.DialogTheme)
|
||||
setStyle(STYLE_NO_TITLE, R.style.HabiticaAlertDialogTheme)
|
||||
}
|
||||
|
||||
override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View {
|
||||
|
|
@ -133,7 +133,7 @@ class HabiticaAccountDialog(private var thisContext: Context) : DialogFragment(R
|
|||
}
|
||||
|
||||
override fun getTheme(): Int {
|
||||
return R.style.HabiticaAccountDialogTheme
|
||||
return R.style.HabiticaAlertDialogTheme
|
||||
}
|
||||
|
||||
interface AccountUpdateConfirmed {
|
||||
|
|
|
|||
|
|
@ -18,7 +18,6 @@ import androidx.compose.ui.Alignment
|
|||
import androidx.compose.ui.Modifier
|
||||
import androidx.compose.ui.res.colorResource
|
||||
import androidx.compose.ui.res.stringResource
|
||||
import androidx.compose.ui.text.font.FontWeight
|
||||
import androidx.compose.ui.text.style.TextAlign
|
||||
import androidx.compose.ui.unit.dp
|
||||
import androidx.compose.ui.unit.sp
|
||||
|
|
@ -41,10 +40,10 @@ import com.habitrpg.android.habitica.helpers.notifications.PushNotificationManag
|
|||
import com.habitrpg.android.habitica.models.user.User
|
||||
import com.habitrpg.android.habitica.prefs.TimePreference
|
||||
import com.habitrpg.android.habitica.ui.activities.ClassSelectionActivity
|
||||
import com.habitrpg.android.habitica.ui.views.HabiticaButton
|
||||
import com.habitrpg.android.habitica.ui.activities.MainActivity
|
||||
import com.habitrpg.android.habitica.ui.activities.PrefsActivity
|
||||
import com.habitrpg.android.habitica.ui.theme.HabiticaTheme
|
||||
import com.habitrpg.android.habitica.ui.views.HabiticaButton
|
||||
import com.habitrpg.android.habitica.ui.views.HabiticaSnackbar
|
||||
import com.habitrpg.android.habitica.ui.views.SnackbarActivity
|
||||
import com.habitrpg.android.habitica.ui.views.dialogs.HabiticaAlertDialog
|
||||
|
|
@ -566,7 +565,6 @@ fun PauseResumeDamageView(
|
|||
stringResource(R.string.resume_damage),
|
||||
color = HabiticaTheme.colors.textSecondary,
|
||||
fontSize = 16.sp,
|
||||
fontWeight = FontWeight.Medium,
|
||||
textAlign = TextAlign.Center,
|
||||
modifier = Modifier
|
||||
.padding(bottom = 18.dp)
|
||||
|
|
@ -616,7 +614,6 @@ fun PauseResumeDamageView(
|
|||
stringResource(R.string.pause_damage),
|
||||
color = HabiticaTheme.colors.textSecondary,
|
||||
fontSize = 16.sp,
|
||||
fontWeight = FontWeight.Medium,
|
||||
textAlign = TextAlign.Center,
|
||||
modifier = Modifier
|
||||
.padding(bottom = 18.dp)
|
||||
|
|
|
|||
|
|
@ -187,7 +187,7 @@ fun PartySeekingListItem(
|
|||
user.stats?.habitClass,
|
||||
fontSize = 14.sp,
|
||||
iconSize = 18.dp,
|
||||
hasClass = user.preferences?.disableClasses == false
|
||||
hasClass = user.hasClass
|
||||
)
|
||||
}
|
||||
Text(
|
||||
|
|
@ -249,7 +249,7 @@ fun PartySeekingView(
|
|||
}
|
||||
}
|
||||
items(users) {
|
||||
PartySeekingListItem(user = it, inviteState = inviteStates[it.id] ?: LoadingButtonState.LOADING, modifier = Modifier.animateItemPlacement()) { member ->
|
||||
PartySeekingListItem(user = it, inviteState = inviteStates[it.id] ?: LoadingButtonState.CONTENT, modifier = Modifier.animateItemPlacement()) { member ->
|
||||
scope.launchCatching({
|
||||
inviteStates[member.id] = LoadingButtonState.FAILED
|
||||
}) {
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@ fun HabiticaButton(
|
|||
onClick : () -> Unit,
|
||||
modifier : Modifier = Modifier,
|
||||
contentPadding : PaddingValues = PaddingValues(8.dp),
|
||||
fontSize : TextUnit = 18.sp,
|
||||
fontSize : TextUnit = 16.sp,
|
||||
content : @Composable () -> Unit
|
||||
) {
|
||||
Box(
|
||||
|
|
|
|||
|
|
@ -18,4 +18,5 @@
|
|||
<color name="text_green">@color/green_100</color>
|
||||
<color name="text_blue">@color/blue_100</color>
|
||||
<color name="text_teal">@color/teal_100</color>
|
||||
<color name="dim_background">#40502B94</color>
|
||||
</resources>
|
||||
|
|
|
|||
|
|
@ -159,4 +159,6 @@
|
|||
<color name="text_blue">@color/blue_10</color>
|
||||
<color name="text_teal">@color/teal_10</color>
|
||||
<color name="divider_color">@color/gray_500</color>
|
||||
|
||||
<color name="dim_background">#40BDA8FF</color>
|
||||
</resources>
|
||||
|
|
|
|||
Loading…
Reference in a new issue