Skip to content

Commit

Permalink
all: smoother dialogs (fixes #3729) (#3730)
Browse files Browse the repository at this point in the history
Co-authored-by: dogi <[email protected]>
  • Loading branch information
ewhang5 and dogi authored Jul 1, 2024
1 parent 45a922b commit b8ff436
Show file tree
Hide file tree
Showing 8 changed files with 20 additions and 10 deletions.
4 changes: 2 additions & 2 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ android {
applicationId "org.ole.planet.myplanet"
minSdkVersion 21
targetSdkVersion 34
versionCode 1638
versionName "0.16.38"
versionCode 1639
versionName "0.16.39"
ndkVersion '21.3.6528147'
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
vectorDrawables.useSupportLibrary = true
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package org.ole.planet.myplanet.base

import android.R
import org.ole.planet.myplanet.R
import android.os.Bundle
import androidx.fragment.app.DialogFragment

Expand All @@ -9,7 +9,7 @@ abstract class BaseDialogFragment : DialogFragment() {
var id: String? = null
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setStyle(STYLE_NO_TITLE, R.style.Theme_Holo_Light_Dialog_NoActionBar_MinWidth)
setStyle(STYLE_NO_TITLE, R.style.AppTheme_Dialog_NoActionBar_MinWidth)
if (arguments != null) {
id = requireArguments().getString(key)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ class FeedbackFragment : DialogFragment(), View.OnClickListener {

override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setStyle(STYLE_NO_TITLE, android.R.style.Theme_Holo_Light_Dialog_NoActionBar_MinWidth)
setStyle(STYLE_NO_TITLE, R.style.AppTheme_Dialog_NoActionBar_MinWidth)
}

override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ import org.ole.planet.myplanet.databinding.FragmentRatingBinding
import org.ole.planet.myplanet.datamanager.DatabaseService
import org.ole.planet.myplanet.model.RealmRating
import org.ole.planet.myplanet.model.RealmUserModel
import org.ole.planet.myplanet.ui.sync.SyncActivity
import org.ole.planet.myplanet.utilities.Constants.PREFS_NAME
import org.ole.planet.myplanet.utilities.Utilities
import java.util.Date
Expand All @@ -40,7 +39,7 @@ class RatingFragment : DialogFragment() {

override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setStyle(STYLE_NO_TITLE, android.R.style.Theme_Holo_Light_Dialog_NoActionBar_MinWidth)
setStyle(STYLE_NO_TITLE, R.style.AppTheme_Dialog_NoActionBar_MinWidth)
if (arguments != null) {
id = requireArguments().getString("id")
type = requireArguments().getString("type")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import kotlin.collections.ArrayList
import kotlin.collections.HashMap
import kotlin.collections.List
import io.realm.Realm
import org.ole.planet.myplanet.R

class CollectionsFragment : DialogFragment(), TagExpandableAdapter.OnClickTagItem, CompoundButton.OnCheckedChangeListener {
private lateinit var fragmentCollectionsBinding: FragmentCollectionsBinding
Expand All @@ -32,7 +33,7 @@ class CollectionsFragment : DialogFragment(), TagExpandableAdapter.OnClickTagIte

override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setStyle(STYLE_NO_TITLE, android.R.style.Theme_Holo_Light_Dialog_NoActionBar_MinWidth)
setStyle(STYLE_NO_TITLE, R.style.AppTheme_Dialog_NoActionBar_MinWidth)
dbType = arguments?.getString("dbType")
}

Expand Down
6 changes: 4 additions & 2 deletions app/src/main/res/layout/fragment_feedback.xml
Original file line number Diff line number Diff line change
Expand Up @@ -112,15 +112,17 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/button_cancel"
android:textSize="@dimen/text_size_mid" />
android:textSize="@dimen/text_size_mid"
android:textColor="@color/primary" />

<Button
android:id="@+id/btn_submit"
style="@style/Widget.MaterialComponents.Button.TextButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/button_submit"
android:textSize="@dimen/text_size_mid" />
android:textSize="@dimen/text_size_mid"
android:textColor="@color/primary" />

</LinearLayout>

Expand Down
2 changes: 2 additions & 0 deletions app/src/main/res/values/dimens.xml
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,6 @@
<dimen name="_30dp">30dp</dimen>
<dimen name="_50dp">50dp</dimen>
<dimen name="_1000dp">1000dp</dimen>
<dimen name="dialog_min_width_major">65%</dimen>
<dimen name="dialog_min_width_minor">95%</dimen>
</resources>
6 changes: 6 additions & 0 deletions app/src/main/res/values/styles.xml
Original file line number Diff line number Diff line change
Expand Up @@ -157,4 +157,10 @@
<style name="MyMaterialTheme.AppBarOverlay" parent="ThemeOverlay.AppCompat.Dark.ActionBar" />

<style name="MyMaterialTheme.PopupOverlay" parent="ThemeOverlay.AppCompat.Light" />

<style name="AppTheme.Dialog.NoActionBar.MinWidth" parent="Theme.AppCompat.Light.Dialog">
<item name="windowNoTitle">true</item>
<item name="android:windowMinWidthMajor">@dimen/dialog_min_width_major</item>
<item name="android:windowMinWidthMinor">@dimen/dialog_min_width_minor</item>
</style>
</resources>

0 comments on commit b8ff436

Please sign in to comment.