Search in sources :

Example 1 with TranslationsAdapter

use of com.quran.labs.androidquran.ui.adapter.TranslationsAdapter in project quran_android by quran.

the class TranslationManagerActivity method onCreate.

@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    ((QuranApplication) getApplication()).getApplicationComponent().inject(this);
    setContentView(R.layout.translation_manager);
    translationSwipeRefresh = findViewById(R.id.translation_swipe_refresh);
    translationRecycler = findViewById(R.id.translation_recycler);
    RecyclerView.LayoutManager mLayoutManager = new LinearLayoutManager(this);
    translationRecycler.setLayoutManager(mLayoutManager);
    adapter = new TranslationsAdapter(this);
    translationRecycler.setAdapter(adapter);
    databaseDirectory = quranFileUtils.getQuranDatabaseDirectory(this);
    final ActionBar actionBar = getSupportActionBar();
    if (actionBar != null) {
        actionBar.setDisplayHomeAsUpEnabled(true);
        actionBar.setTitle(R.string.prefs_translations);
    }
    quranSettings = QuranSettings.getInstance(this);
    presenter.bind(this);
    presenter.getTranslationsList(false);
    onClickDownloadDisposable = adapter.getOnClickDownloadSubject().subscribe(this::downloadItem);
    onClickRemoveDisposable = adapter.getOnClickRemoveSubject().subscribe(this::removeItem);
    translationSwipeRefresh.setOnRefreshListener(this::onRefresh);
}
Also used : TranslationsAdapter(com.quran.labs.androidquran.ui.adapter.TranslationsAdapter) RecyclerView(android.support.v7.widget.RecyclerView) LinearLayoutManager(android.support.v7.widget.LinearLayoutManager) ActionBar(android.support.v7.app.ActionBar)

Aggregations

ActionBar (android.support.v7.app.ActionBar)1 LinearLayoutManager (android.support.v7.widget.LinearLayoutManager)1 RecyclerView (android.support.v7.widget.RecyclerView)1 TranslationsAdapter (com.quran.labs.androidquran.ui.adapter.TranslationsAdapter)1