Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
25 changed files
with
113 additions
and
54 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
#Thu Sep 27 15:42:22 MSK 2018 | ||
#Fri Jan 25 22:04:15 MSK 2019 | ||
distributionBase=GRADLE_USER_HOME | ||
distributionPath=wrapper/dists | ||
zipStoreBase=GRADLE_USER_HOME | ||
zipStorePath=wrapper/dists | ||
distributionUrl=https\://services.gradle.org/distributions/gradle-4.10.1-all.zip | ||
distributionUrl=https\://services.gradle.org/distributions/gradle-5.1-milestone-1-all.zip |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 2 additions & 1 deletion
3
...java/android/support/v4/app/Fragment.java → .../java/androidx/fragment/app/Fragment.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...roid/support/v4/app/FragmentActivity.java → ...droidx/fragment/app/FragmentActivity.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
package android.support.v4.app; | ||
package androidx.fragment.app; | ||
|
||
import android.app.Activity; | ||
|
||
|
2 changes: 1 addition & 1 deletion
2
...droid/support/v4/app/FragmentManager.java → ...ndroidx/fragment/app/FragmentManager.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...d/support/v4/app/FragmentTransaction.java → ...idx/fragment/app/FragmentTransaction.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 4 additions & 4 deletions
8
sample/src/main/java/ru/terrakok/cicerone/sample/ui/animations/ProfileActivity.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
sample/src/main/java/ru/terrakok/cicerone/sample/ui/animations/profile/ProfileFragment.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
sample/src/main/java/ru/terrakok/cicerone/sample/ui/bottom/ForwardFragment.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
sample/src/main/java/ru/terrakok/cicerone/sample/ui/bottom/TabContainerFragment.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
39 changes: 39 additions & 0 deletions
39
sample/src/main/java/ru/terrakok/cicerone/sample/ui/main/BaseFragment.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
package ru.terrakok.cicerone.sample.ui.main; | ||
|
||
import android.content.Context; | ||
import androidx.fragment.app.Fragment; | ||
import androidx.fragment.app.FragmentActivity; | ||
import com.arellomobile.mvp.MvpAppCompatFragment; | ||
|
||
import java.lang.ref.WeakReference; | ||
import java.util.Iterator; | ||
import java.util.List; | ||
|
||
public abstract class BaseFragment extends MvpAppCompatFragment { | ||
|
||
@Override | ||
public void onAttach(Context context) { | ||
super.onAttach(context); | ||
FragmentActivity activity = getActivity(); | ||
if (activity instanceof ChainHolder) { | ||
((ChainHolder) activity).getChain().add(new WeakReference<Fragment>(this)); | ||
} | ||
} | ||
|
||
@Override | ||
public void onDetach() { | ||
FragmentActivity activity = getActivity(); | ||
if (activity instanceof ChainHolder) { | ||
List<WeakReference<Fragment>> chain = ((ChainHolder) activity).getChain(); | ||
for (Iterator<WeakReference<Fragment>> it = chain.iterator(); it.hasNext();) { | ||
WeakReference<Fragment> fragmentReference = it.next(); | ||
Fragment fragment = fragmentReference.get(); | ||
if (fragment != null && fragment == this) { | ||
it.remove(); | ||
break; | ||
} | ||
} | ||
} | ||
super.onDetach(); | ||
} | ||
} |
10 changes: 10 additions & 0 deletions
10
sample/src/main/java/ru/terrakok/cicerone/sample/ui/main/ChainHolder.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
package ru.terrakok.cicerone.sample.ui.main; | ||
|
||
import androidx.fragment.app.Fragment; | ||
|
||
import java.lang.ref.WeakReference; | ||
import java.util.List; | ||
|
||
public interface ChainHolder { | ||
List<WeakReference<Fragment>> getChain(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.