Search in sources :

Example 1 with TabletView

use of com.quran.labs.androidquran.widgets.TabletView in project quran_android by quran.

the class TabletFragment method onCreateView.

@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    final Context context = getActivity();
    mainView = new TabletView(context);
    if (mode == Mode.ARABIC) {
        mainView.init(TabletView.QURAN_PAGE, TabletView.QURAN_PAGE);
        leftImageView = ((QuranImagePageLayout) mainView.getLeftPage()).getImageView();
        rightImageView = ((QuranImagePageLayout) mainView.getRightPage()).getImageView();
        mainView.setPageController(this, pageNumber, pageNumber - 1);
    } else if (mode == Mode.TRANSLATION) {
        mainView.init(TabletView.TRANSLATION_PAGE, TabletView.TRANSLATION_PAGE);
        leftTranslation = ((QuranTranslationPageLayout) mainView.getLeftPage()).getTranslationView();
        rightTranslation = ((QuranTranslationPageLayout) mainView.getRightPage()).getTranslationView();
        PagerActivity pagerActivity = (PagerActivity) context;
        leftTranslation.setTranslationClickedListener(v -> pagerActivity.toggleActionBar());
        rightTranslation.setTranslationClickedListener(v -> pagerActivity.toggleActionBar());
        leftTranslation.setOnTranslationActionListener(this);
        rightTranslation.setOnTranslationActionListener(this);
        mainView.setPageController(null, pageNumber, pageNumber - 1);
    }
    return mainView;
}
Also used : Context(android.content.Context) Context(android.content.Context) Bundle(android.os.Bundle) AyahBounds(com.quran.labs.androidquran.common.AyahBounds) PageController(com.quran.labs.androidquran.ui.util.PageController) ImageView(android.widget.ImageView) StringRes(android.support.annotation.StringRes) NonNull(android.support.annotation.NonNull) TranslationPresenter(com.quran.labs.androidquran.presenter.translation.TranslationPresenter) Inject(javax.inject.Inject) EventType(com.quran.labs.androidquran.ui.helpers.AyahSelectedListener.EventType) QuranAyahInfo(com.quran.labs.androidquran.common.QuranAyahInfo) OnTranslationActionListener(com.quran.labs.androidquran.ui.translation.OnTranslationActionListener) AyahSelectedListener(com.quran.labs.androidquran.ui.helpers.AyahSelectedListener) QuranTranslationPageLayout(com.quran.labs.androidquran.widgets.QuranTranslationPageLayout) MotionEvent(android.view.MotionEvent) HighlightingImageView(com.quran.labs.androidquran.widgets.HighlightingImageView) Map(java.util.Map) View(android.view.View) AyahTranslationTrackerItem(com.quran.labs.androidquran.presenter.quran.ayahtracker.AyahTranslationTrackerItem) PagerActivity(com.quran.labs.androidquran.ui.PagerActivity) QuranPageScreen(com.quran.labs.androidquran.presenter.quran.QuranPageScreen) QuranSettings(com.quran.labs.androidquran.util.QuranSettings) AyahTrackerItem(com.quran.labs.androidquran.presenter.quran.ayahtracker.AyahTrackerItem) TabletView(com.quran.labs.androidquran.widgets.TabletView) AyahTrackerPresenter(com.quran.labs.androidquran.presenter.quran.ayahtracker.AyahTrackerPresenter) RectF(android.graphics.RectF) Bookmark(com.quran.labs.androidquran.dao.Bookmark) QuranPagePresenter(com.quran.labs.androidquran.presenter.quran.QuranPagePresenter) LayoutInflater(android.view.LayoutInflater) TranslationView(com.quran.labs.androidquran.ui.translation.TranslationView) AyahImageTrackerItem(com.quran.labs.androidquran.presenter.quran.ayahtracker.AyahImageTrackerItem) Fragment(android.support.v4.app.Fragment) QuranPageModule(com.quran.labs.androidquran.module.fragment.QuranPageModule) BitmapDrawable(android.graphics.drawable.BitmapDrawable) QuranImagePageLayout(com.quran.labs.androidquran.widgets.QuranImagePageLayout) QuranScreenInfo(com.quran.labs.androidquran.util.QuranScreenInfo) Lazy(dagger.Lazy) ViewGroup(android.view.ViewGroup) Timber(timber.log.Timber) QuranPage(com.quran.labs.androidquran.ui.helpers.QuranPage) AyahTracker(com.quran.labs.androidquran.ui.helpers.AyahTracker) List(java.util.List) CompositeDisposable(io.reactivex.disposables.CompositeDisposable) Bitmap(android.graphics.Bitmap) QuranInfo(com.quran.labs.androidquran.data.QuranInfo) Nullable(android.support.annotation.Nullable) Activity(android.app.Activity) QuranTranslationPageLayout(com.quran.labs.androidquran.widgets.QuranTranslationPageLayout) TabletView(com.quran.labs.androidquran.widgets.TabletView) PagerActivity(com.quran.labs.androidquran.ui.PagerActivity)

Aggregations

Activity (android.app.Activity)1 Context (android.content.Context)1 Bitmap (android.graphics.Bitmap)1 RectF (android.graphics.RectF)1 BitmapDrawable (android.graphics.drawable.BitmapDrawable)1 Bundle (android.os.Bundle)1 NonNull (android.support.annotation.NonNull)1 Nullable (android.support.annotation.Nullable)1 StringRes (android.support.annotation.StringRes)1 Fragment (android.support.v4.app.Fragment)1 LayoutInflater (android.view.LayoutInflater)1 MotionEvent (android.view.MotionEvent)1 View (android.view.View)1 ViewGroup (android.view.ViewGroup)1 ImageView (android.widget.ImageView)1 AyahBounds (com.quran.labs.androidquran.common.AyahBounds)1 QuranAyahInfo (com.quran.labs.androidquran.common.QuranAyahInfo)1 Bookmark (com.quran.labs.androidquran.dao.Bookmark)1 QuranInfo (com.quran.labs.androidquran.data.QuranInfo)1 QuranPageModule (com.quran.labs.androidquran.module.fragment.QuranPageModule)1