Skip to content

Commit

Permalink
add label to bottom nav && add TAFSEER WITH SERVIC
Browse files Browse the repository at this point in the history
  • Loading branch information
MahmoudMabrok committed Jun 28, 2019
1 parent bfda7e5 commit 4aefc91
Show file tree
Hide file tree
Showing 12 changed files with 29 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -384,7 +384,7 @@ public void onViewClicked() {
// actual end is updated with one as query return result excluded one item
ayahsToListen = repository.getAyahSInRange(actualStart+1, actualEnd+1);
Log.d(TAG, "onViewClicked: start log after first select "+ ayahsToListen.size());
logAyahs();
logAyahs();
// traverse ayahs to check if it downloaded or not
for (AyahItem ayahItem : ayahsToListen) {
if (ayahItem.getAudioPath() == null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
import education.mahmoud.quranyapp.data_layer.local.room.SuraItem;
import education.mahmoud.quranyapp.data_layer.model.full_quran.Ayah;
import education.mahmoud.quranyapp.data_layer.model.full_quran.Surah;
import education.mahmoud.quranyapp.data_layer.model.tafseer.CompleteTafseer;
import education.mahmoud.quranyapp.model.Quran;
import education.mahmoud.quranyapp.model.Sura;

Expand Down Expand Up @@ -41,9 +42,11 @@ private void loadQuranTafseer() {
Log.d(TAG, "loadQuranTafseer: before");
Store(surahs);
Log.d(TAG, "loadQuranTafseer: after");
updateAyahsWithTafseer();
stopSelf();
}

//<editor-fold desc="quran">
private void Store(List<Surah> surahs) {
SuraItem suraItem;
AyahItem ayahItem;
Expand Down Expand Up @@ -87,4 +90,27 @@ private void Store(List<Surah> surahs) {
}
}
}
//</editor-fold>

private void updateAyahsWithTafseer() {
AyahItem ayahItem = null;
CompleteTafseer completeTafseer = Util.getCompleteTafseer(this);
if (completeTafseer != null) {
List<education.mahmoud.quranyapp.data_layer.model.tafseer.Surah> surahs = completeTafseer.getData().getSurahs();
for (education.mahmoud.quranyapp.data_layer.model.tafseer.Surah surah1 : surahs) {
for (education.mahmoud.quranyapp.data_layer.model.tafseer.Ayah ayah : surah1.getAyahs()) {
ayahItem = repository.getAyahByIndex(ayah.getNumber());
ayahItem.setTafseer(ayah.getText());
try {
repository.updateAyahItem(ayahItem);
} catch (Exception e) {
e.printStackTrace();
}
}

Log.d(TAG, "updateAyahsWithTafseer: ");
}
}

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ private void startServices() {
private void askPermissionForApp() {
askForPermissions(new String[]{Manifest.permission.WRITE_EXTERNAL_STORAGE,
Manifest.permission.READ_EXTERNAL_STORAGE,
Manifest.permission.RECORD_AUDIO}, getSlides().size());
Manifest.permission.RECORD_AUDIO}, 5);
}

private void initSlides() {
Expand Down Expand Up @@ -75,7 +75,7 @@ private void initSlides() {
sliderPage = new SliderPage();
sliderPage.setTitle("Quran Test as text");
sliderPage.setDescription("HollyQuranApp");
sliderPage.setImageDrawable(R.mipmap.ic_launcher);
sliderPage.setImageDrawable(R.mipmap.jump);
sliderPage.setBgColor(R.color.bg_green);
addSlide(AppIntro2Fragment.newInstance(sliderPage));

Expand Down
Binary file added app/src/main/res/mipmap-hdpi/jump.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/src/main/res/mipmap-hdpi/list.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/src/main/res/mipmap-hdpi/tafseer.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/src/main/res/mipmap-ldpi/jump.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/src/main/res/mipmap-ldpi/list.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/src/main/res/mipmap-ldpi/tafseer.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/src/main/res/mipmap-mdpi/jump.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/src/main/res/mipmap-mdpi/list.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/src/main/res/mipmap-mdpi/tafseer.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 4aefc91

Please sign in to comment.