/
githubmirror
/
omim
Обзор
Документация
Войти
/
githubmirror
/
omim
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
android/src/com/mapswithme/maps/base/BaseMwmFragment.java
53 строки
1 KB
Александр Зацепин
[android] Migrated code to Android X
22 окт 2019, 15:11
22 окт 2019, 15:11
f2dd324
Код
Авторство
О чём код?
package com.mapswithme.maps.base; import android.content.Context; import androidx.annotation.NonNull; import androidx.fragment.app.Fragment; import android.view.View; import com.mapswithme.util.Utils; public class BaseMwmFragment extends Fragment implements OnBackPressListener { @Override public void onAttach(Context context) { super.onAttach(context); Utils.detachFragmentIfCoreNotInitialized(context, this); } @Override public void onResume() { super.onResume(); org.alohalytics.Statistics.logEvent("$onResume", this.getClass().getSimpleName() + ":" + com.mapswithme.util.UiUtils.deviceOrientationAsString(getActivity())); } @Override public void onPause() { super.onPause(); org.alohalytics.Statistics.logEvent("$onPause", this.getClass().getSimpleName()); } public BaseMwmFragmentActivity getMwmActivity() { return Utils.castTo(getActivity()); } @Override public boolean onBackPressed() { return false; } @NonNull public View getViewOrThrow() { View view = getView(); if (view == null) throw new IllegalStateException("Before call this method make sure that fragment exists"); return view; } }