use of me.zhanghai.android.douya.ui.KonamiCodeDetector in project Douya by DreaminginCodeZH.
the class AboutFragment method onActivityCreated.
@Override
public void onActivityCreated(@Nullable Bundle savedInstanceState) {
super.onActivityCreated(savedInstanceState);
ScalpelHelperFragment.attachTo(this);
AppCompatActivity activity = (AppCompatActivity) getActivity();
activity.setSupportActionBar(mToolbar);
activity.getSupportActionBar().setTitle(null);
// Seems that ScrollView intercepts touch event, so we have to set the onTouchListener on a
// view inside it.
mContainerLayout.setOnTouchListener(new KonamiCodeDetector(activity) {
@Override
public void onDetected() {
onEnableScalpel();
}
});
mVersionText.setText(getString(R.string.about_version_format, BuildConfig.VERSION_NAME));
mDoubanButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
Activity activity = getActivity();
activity.startActivity(ProfileActivity.makeIntent("douban-douya", activity));
}
});
}
Aggregations