Created
February 20, 2017 09:22
-
-
Save cthulhuplush/fda732864bf3b807b9f5a6d53c9d678e to your computer and use it in GitHub Desktop.
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
public class MainActivity extends AppCompatActivity | |
{ | |
private static final long MOVE_DEFAULT_TIME = 1000; | |
private static final long FADE_DEFAULT_TIME = 300; | |
private FragmentManager mFragmentManager; | |
private Handler mDelayedTransactionHandler = new Handler(); | |
private Runnable mRunnable = this::performTransition; | |
@Override | |
protected void onCreate(Bundle savedInstanceState) | |
{ | |
super.onCreate(savedInstanceState); | |
setContentView(R.layout.activity_main); | |
ButterKnife.bind(this); | |
mFragmentManager = getSupportFragmentManager(); | |
loadInitialFragment(); | |
mDelayedTransactionHandler.postDelayed(mRunnable, 1000); | |
} | |
private void loadInitialFragment() | |
{ | |
Fragment initialFragment = Fragment1.newInstance(); | |
FragmentTransaction fragmentTransaction = mFragmentManager.beginTransaction(); | |
fragmentTransaction.replace(R.id.fragment_container, initialFragment); | |
fragmentTransaction.commit(); | |
} | |
private void performTransition() | |
{ | |
} | |
@Override | |
protected void onDestroy() | |
{ | |
super.onDestroy(); | |
mDelayedTransactionHandler.removeCallbacks(mRunnable); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment