Skip to content

Commit 8246496

Browse files
author
A.Badakhshan
committed
0.4.11
1 parent 6f7a8c4 commit 8246496

File tree

3 files changed

+4
-3
lines changed

3 files changed

+4
-3
lines changed

app/src/main/java/com/alirezabdn/whygoogle/MainFragment.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ class MainFragment : WhyGoogleFragment<MainFragmentBinding>() {
1515
accessViews {
1616
testTv.text = "tested now more than once"
1717
go.setOnClickListener {
18-
start(MainFragment())
18+
start(MainFragment(), popAll = true)
1919
}
2020
go2.setOnClickListener {
2121
start(SecondFragment(), true)

whygoogle/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ android {
1111
minSdkVersion 17
1212
targetSdkVersion 30
1313
versionCode 1
14-
versionName "0.4.10"
14+
versionName "0.4.11"
1515
}
1616
buildFeatures {
1717
viewBinding true

whygoogle/src/main/java/ir/ayantech/whygoogle/activity/SwipableWhyGoogleActivity.kt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,8 @@ abstract class SwipableWhyGoogleActivity<T : ViewBinding> : AppCompatActivity(),
115115

116116
@SuppressLint("NotifyDataSetChanged")
117117
override fun start(fragment: WhyGoogleFragment<*>, popAll: Boolean, stack: Boolean) {
118+
if (getFragmentCount() == 1 && fragment.javaClass == getTopFragment()?.javaClass)
119+
return
118120
fragment.asyncInflate { fragment ->
119121
fragmentStack.add(fragment)
120122
val position = getFragmentCount() - 1
@@ -134,7 +136,6 @@ abstract class SwipableWhyGoogleActivity<T : ViewBinding> : AppCompatActivity(),
134136
}
135137
})
136138
}
137-
138139
}
139140
}
140141

0 commit comments

Comments
 (0)