diff --git a/.idea/jarRepositories.xml b/.idea/jarRepositories.xml
index 0fdcd11..53dd05a 100644
--- a/.idea/jarRepositories.xml
+++ b/.idea/jarRepositories.xml
@@ -61,5 +61,15 @@
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/misc.xml b/.idea/misc.xml
index 23089d7..963310c 100644
--- a/.idea/misc.xml
+++ b/.idea/misc.xml
@@ -14,6 +14,7 @@
+
diff --git a/app/build.gradle b/app/build.gradle
index 504fcfd..c22cd6d 100644
--- a/app/build.gradle
+++ b/app/build.gradle
@@ -14,8 +14,8 @@ android {
applicationId "ir.ham3da.darya"
minSdkVersion 21
targetSdkVersion 31
- versionCode 44
- versionName "2.8.4"
+ versionCode 48
+ versionName "2.8.5"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
buildTypes {
@@ -40,12 +40,12 @@ android {
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
- implementation "androidx.appcompat:appcompat:1.4.0"
+ implementation "androidx.appcompat:appcompat:1.4.1"
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
- implementation 'com.google.android.material:material:1.4.0'
+ implementation 'com.google.android.material:material:1.5.0'
implementation 'androidx.recyclerview:recyclerview:1.2.1'
implementation 'androidx.cardview:cardview:1.0.0'
- implementation 'androidx.constraintlayout:constraintlayout:2.1.2'
+ implementation 'androidx.constraintlayout:constraintlayout:2.1.3'
implementation 'androidx.annotation:annotation:1.3.0'
implementation 'androidx.lifecycle:lifecycle-extensions:2.2.0'
implementation 'androidx.viewpager2:viewpager2:1.0.0'
@@ -56,8 +56,8 @@ dependencies {
implementation 'com.google.firebase:firebase-analytics'
implementation 'com.mindorks.android:prdownloader:0.6.0'
- implementation 'androidx.lifecycle:lifecycle-livedata-ktx:2.4.0'
- implementation 'androidx.lifecycle:lifecycle-viewmodel-ktx:2.4.0'
+ implementation 'androidx.lifecycle:lifecycle-livedata-ktx:2.4.1'
+ implementation 'androidx.lifecycle:lifecycle-viewmodel-ktx:2.4.1'
//implementation group: 'commons-io', name: 'commons-io', version: '20030203.000550'
testImplementation 'junit:junit:4.13.2'
@@ -65,7 +65,7 @@ dependencies {
androidTestImplementation 'androidx.test:runner:1.4.0'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
implementation 'com.github.koji-1009:ChronoDialogPreference:2.1.0'
- implementation 'com.google.android.play:core:1.10.2'
+ implementation 'com.google.android.play:core:1.10.3'
implementation 'com.android.volley:volley:1.2.1'
- implementation 'androidx.preference:preference:1.1.1'
+ implementation 'androidx.preference:preference:1.2.0'
}
\ No newline at end of file
diff --git a/app/src/main/assets/donate_en.htm b/app/src/main/assets/donate_en.htm
deleted file mode 100644
index 02238cc..0000000
--- a/app/src/main/assets/donate_en.htm
+++ /dev/null
@@ -1,64 +0,0 @@
-
-
-
-
- About...
-
-
-
-
-Dear friend, we need your donation to further develop this application.
-International donation
-Bitcoin Address: bc1qdrjpcxnnay42jfc56hze4vrpkrf5s5c45xd5va
- Ethereum Address: 0xcD7be5D82805f851CbeBBF67ea434cB02f6e2436
-Perfect Money Account: U21873528
-Donate in Iran
-Sheba account number: IR190120020000005006181561
-Bank card number: 6104-3379-5124-7251
-Account number: 5006181561
-Account holder name: Javad Ahshamian
-Bank Name: Bank Mellat
-
-
\ No newline at end of file
diff --git a/app/src/main/assets/donate_fa.htm b/app/src/main/assets/donate_fa.htm
deleted file mode 100644
index 7df70b7..0000000
--- a/app/src/main/assets/donate_fa.htm
+++ /dev/null
@@ -1,62 +0,0 @@
-
-
-
-
- درباره...
-
-
-
-
-دوستان ارجمند برای توسعه هر چه بیشتر این نرمافزار میتوانید با حمایتهای مالی خود ما را
-همراهی کنید.
-شماره حساب شبا: IR190120020000005006181561
-شماره کارت بانکی: 6104-3379-5124-7251
-شماه حساب: 5006181561
-نام صاحب حساب: جواد احشامیان
-نام بانک: بانک ملت
-
-
-
-
-
\ No newline at end of file
diff --git a/app/src/main/java/ir/ham3da/darya/ActivityAudioCollection.java b/app/src/main/java/ir/ham3da/darya/ActivityAudioCollection.java
index fb620c6..f4de8d2 100644
--- a/app/src/main/java/ir/ham3da/darya/ActivityAudioCollection.java
+++ b/app/src/main/java/ir/ham3da/darya/ActivityAudioCollection.java
@@ -58,7 +58,6 @@
import ir.ham3da.darya.utility.AppSettings;
-
import ir.ham3da.darya.ganjoor.GanjoorAudioInfo;
import ir.ham3da.darya.utility.MyDialogs;
import ir.ham3da.darya.utility.PoemAudio;
@@ -199,6 +198,7 @@ private void reloadItems()
scrollListener.resetState();
loadItems();
}
+
private void downloadMarkedAudio()
{
scheduleAudioList = new ArrayList<>();
@@ -684,23 +684,24 @@ public void loadItems()
}
this.page_number = calc_page_num();
- Log.e(TAG, " this.page_number: "+ this.page_number);
+ Log.e(TAG, " this.page_number: " + this.page_number);
downloadJsonPoemAudios(getAudioListUrl(dl_type));
}
private int calc_page_num()
{
- if(can_load_new_page())
+ if (can_load_new_page())
{
- double newPage = ((double) listXmlItems.size() / page_size) +1;
+ double newPage = ((double) listXmlItems.size() / page_size) + 1;
int newPage2 = (int) Math.ceil(newPage);
return newPage2;
}
else
{
- return 1;
+ return 1;
}
}
+
private boolean can_load_new_page()
{
return (listXmlItems != null && listXmlItems.size() >= page_size);
@@ -715,28 +716,28 @@ private boolean can_load_new_page()
private boolean checkExistAudio(GanjoorAudioInfo ganjoorAudioInfo)
{
boolean result = false;
- if (dl_type == GanjoorAudioInfo.DOWNLOAD_POEM)
+ boolean existInDatabase = _DbBrowser.IsSoundExist(ganjoorAudioInfo.audio_fchecksum);
+ boolean fileExist = _DbBrowser.checkAudioFileExist(ganjoorAudioInfo.audio_fchecksum, dl_path);
+
+ if (existInDatabase)
{
- for (PoemAudio PoemAudio1 : existAudioList)
+ if (fileExist)
{
- if (PoemAudio1.poemID == ganjoorAudioInfo.audio_post_ID && ganjoorAudioInfo.audio_fchecksum.equals(PoemAudio1.fchksum))
- {
- result = true;
- break;
- }
-
+ result = true;
}
- if(!result)
+ else
{
- reAddSoundData(ganjoorAudioInfo);
+ _DbBrowser.deleteSound(ganjoorAudioInfo.audio_fchecksum);
+ result = false;
}
+
}
else
{
- result = _DbBrowser.checkAudioFileExist(ganjoorAudioInfo.audio_fchecksum, dl_path);
- if(result)
+ if (fileExist)
{
reAddSoundData(ganjoorAudioInfo);
+ result = true;
}
}
@@ -746,14 +747,13 @@ private boolean checkExistAudio(GanjoorAudioInfo ganjoorAudioInfo)
private void reAddSoundData(GanjoorAudioInfo ganjoorAudioInfo)
{
- if(!_DbBrowser.IsSoundExist(ganjoorAudioInfo.audio_fchecksum))
+ if (!_DbBrowser.IsSoundExist(ganjoorAudioInfo.audio_fchecksum))
{
_DbBrowser.addToSound(ganjoorAudioInfo);
}
}
-
private void downloadJsonPoemAudios(String jsonUrl)
{
@@ -785,13 +785,13 @@ private void parseAudioListJsonData(String JsonString)
try
{
JSONArray jsonArray = new JSONArray(JsonString);
- if(jsonArray.length() > 0)
+ if (jsonArray.length() > 0)
{
List ganjoorAudioInfos1 = new ArrayList<>();
int new_index = 0;
- if(listXmlItems != null)
+ if (listXmlItems != null)
{
- new_index = listXmlItems.size();
+ new_index = listXmlItems.size();
}
for (int i = 0; i < jsonArray.length(); i++)
@@ -827,7 +827,7 @@ private void parseAudioListJsonData(String JsonString)
new_index++;
GanjoorAudioInfo ganjoorAudioInfo1 = new GanjoorAudioInfo(audio_post_ID, audio_order,
- audio_xml,null, audio_mp3, audio_title, audio_artist,
+ audio_xml, null, audio_mp3, audio_title, audio_artist,
audio_artist_url, audio_src, audio_src_url, audio_guid,
audio_fchecksum, audio_mp3bsize, audio_oggbsize, audio_date, false,
new_index, false);
@@ -861,32 +861,32 @@ private void parseAudioListJsonData(String JsonString)
}
- no_item_textview.setVisibility(View.GONE);
-
- if (listXmlItems == null)
- {
- Log.e(TAG, "parseAudioListJsonData: listXmlItems is null");
- listXmlItems = ganjoorAudioInfos1;
- GanjoorPoet ganjoorPoet = null;
- if (dl_type == GanjoorAudioInfo.DOWNLOAD_POET_POEMS)
- {
- ganjoorPoet = _DbBrowser.getPoet(poet_id);
- }
- adaptorAudio = new AdaptorAudio(listXmlItems, this, dl_type, ganjoorPoet);
- recycler_audio.setAdapter(adaptorAudio);
- recycler_audio.scrollToPosition(0);
- }
- else
- {
- Log.e(TAG, "parseAudioListJsonData: listXmlItems is not null");
- listXmlItems.addAll(ganjoorAudioInfos1);
- this.adaptorAudio.notifyItemRangeInserted(this.listXmlItems.size(), this.listXmlItems.size() - 1);
- }
+ no_item_textview.setVisibility(View.GONE);
+ if (listXmlItems == null)
+ {
+ Log.e(TAG, "parseAudioListJsonData: listXmlItems is null");
+ listXmlItems = ganjoorAudioInfos1;
+ GanjoorPoet ganjoorPoet = null;
+ if (dl_type == GanjoorAudioInfo.DOWNLOAD_POET_POEMS)
+ {
+ ganjoorPoet = _DbBrowser.getPoet(poet_id);
+ }
+ adaptorAudio = new AdaptorAudio(listXmlItems, this, dl_type, ganjoorPoet);
+ recycler_audio.setAdapter(adaptorAudio);
+ recycler_audio.scrollToPosition(0);
+ }
+ else
+ {
+ Log.e(TAG, "parseAudioListJsonData: listXmlItems is not null");
+ listXmlItems.addAll(ganjoorAudioInfos1);
+ this.adaptorAudio.notifyItemRangeInserted(this.listXmlItems.size(), this.listXmlItems.size() - 1);
+ }
}
- else{
+ else
+ {
Toast.makeText(this, getString(R.string.nothing_found), Toast.LENGTH_SHORT).show();
}
diff --git a/app/src/main/java/ir/ham3da/darya/admob/MainAdMobFragment.java b/app/src/main/java/ir/ham3da/darya/admob/MainAdMobFragment.java
index 96266ca..79b8aff 100644
--- a/app/src/main/java/ir/ham3da/darya/admob/MainAdMobFragment.java
+++ b/app/src/main/java/ir/ham3da/darya/admob/MainAdMobFragment.java
@@ -38,7 +38,7 @@ public class MainAdMobFragment extends Fragment
Context mContext;
Button btn_view_ad;
-// InterstitialAd mInterstitialAd;
+ // InterstitialAd mInterstitialAd;
ProgressBar progress_bar;
String TAG = "MainAdMobFragment";
UtilFunctions UtilFunctions1;
@@ -79,23 +79,23 @@ public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup c
Button btn_donate_github = root.findViewById(R.id.btn_donate_github);
Button btn_donate_collections = root.findViewById(R.id.btn_donate_collections);
- Button btn_donate_pay = root.findViewById(R.id.btn_donate_pay);
Button btn_donate_crypto = root.findViewById(R.id.btn_donate_crypto);
View rv_pay = root.findViewById(R.id.rv_pay);
- if (UtilFunctions.isGooglePlayVersion())
- {
- rv_pay.setVisibility(View.VISIBLE);
- }
- else
- {
- rv_pay.setVisibility(View.GONE);
- }
+// if (UtilFunctions.isGooglePlayVersion())
+// {
+// rv_pay.setVisibility(View.VISIBLE);
+// }
+// else
+// {
+// rv_pay.setVisibility(View.GONE);
+// }
+ rv_pay.setVisibility(View.GONE);
btn_view_ad.setOnClickListener(v ->
{
- // displayInterstitial();
+ // displayInterstitial();
displayCustomAdWeb();
});
@@ -109,15 +109,6 @@ public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup c
});
- btn_donate_pay.setOnClickListener(v ->
- {
- String title = getString(R.string.donation);
- String file_name = "donate_" + CurrentLang + ".htm";
- String text = UtilFunctions.getHtmlFromAssetsFile(mContext, file_name);
- UtilFunctions.showWebAct(mContext, title, text);
-
- });
-
btn_donate_crypto.setOnClickListener(v ->
{
Intent intent = new Intent(mContext, ActivityDonateCrypto.class);
@@ -130,16 +121,16 @@ public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup c
}
-
public void displayCustomAdWeb()
{
- Intent intent = new Intent(mContext, ActivityWeb.class);
- intent.putExtra("title", getString(R.string.our_products));
- intent.putExtra("fromUrl", true);
- intent.putExtra("url", getString(R.string.our_products_url));
-
- startActivity(intent);
- Bungee.card(mContext);
+ UtilFunctions1.openUrl(getString(R.string.our_products_url));
+// Intent intent = new Intent(mContext, ActivityWeb.class);
+// intent.putExtra("title", getString(R.string.our_products));
+// intent.putExtra("fromUrl", true);
+// intent.putExtra("url", getString(R.string.our_products_url));
+//
+// startActivity(intent);
+// Bungee.card(mContext);
}
diff --git a/app/src/main/java/ir/ham3da/darya/ganjoor/GanjoorDbBrowser.java b/app/src/main/java/ir/ham3da/darya/ganjoor/GanjoorDbBrowser.java
index 5e15ffd..43d8ca3 100644
--- a/app/src/main/java/ir/ham3da/darya/ganjoor/GanjoorDbBrowser.java
+++ b/app/src/main/java/ir/ham3da/darya/ganjoor/GanjoorDbBrowser.java
@@ -1462,6 +1462,24 @@ public void deleteSound(int PoemID, int id)
}
}
+ /**
+ *
+ * @param fchecksum String checksum
+ */
+ public void deleteSound(String fchecksum)
+ {
+ if (getIsConnected())
+ {
+ try
+ {
+ _db.delete("poemsnd", "fchksum = ?", new String[]{String.valueOf(fchecksum)});
+ } catch (Exception ex)
+ {
+ Log.e("addToSound", "err: " + ex.getMessage());
+ }
+ }
+ }
+
public void addToFavorites(int PoemId)
{
addToFavorites(PoemId, -1);
diff --git a/app/src/main/java/ir/ham3da/darya/utility/UtilFunctions.java b/app/src/main/java/ir/ham3da/darya/utility/UtilFunctions.java
index 40a4a6e..c24fbe4 100644
--- a/app/src/main/java/ir/ham3da/darya/utility/UtilFunctions.java
+++ b/app/src/main/java/ir/ham3da/darya/utility/UtilFunctions.java
@@ -92,7 +92,7 @@ public void openMyTelegram()
public static boolean isGooglePlayVersion()
{
return (getAppStoreCode() == VarTypes.GOOGLE_PLAY_VER);
- }
+}
/**
* get AppStore Code
diff --git a/app/src/main/res/layout/donate_crypto.xml b/app/src/main/res/layout/donate_crypto.xml
index 9b11ce0..fa20db2 100644
--- a/app/src/main/res/layout/donate_crypto.xml
+++ b/app/src/main/res/layout/donate_crypto.xml
@@ -26,6 +26,7 @@
android:layout_centerVertical="true"
android:background="@drawable/circle"
app:tooltipText="@string/bitcoin"
+ android:contentDescription="@string/bitcoin"
android:scaleType="fitCenter"
app:srcCompat="@drawable/ic_btc_24" />
@@ -48,14 +49,15 @@
android:id="@+id/address_btc_copy"
android:layout_width="48dp"
android:layout_height="48dp"
- android:layout_centerHorizontal="true"
android:layout_alignParentRight="true"
+ android:layout_centerHorizontal="true"
+ android:background="@drawable/circle"
android:backgroundTint="@color/btnColor"
+ android:contentDescription="@string/copy1"
android:padding="10dp"
- app:tooltipText="@string/copy1"
android:src="@drawable/ic_content_copy_white_24dp"
- android:background="@drawable/circle"
- android:textColor="@color/primaryTextColor" />
+ android:textColor="@color/primaryTextColor"
+ app:tooltipText="@string/copy1" />
@@ -77,12 +79,14 @@
android:id="@+id/avatar_eth"
android:layout_width="48dp"
android:layout_height="48dp"
- app:tooltipText="@string/ethereum"
android:layout_alignParentLeft="true"
android:layout_centerVertical="true"
android:background="@drawable/circle"
android:scaleType="fitCenter"
- app:srcCompat="@drawable/ic_eth_24" />
+ app:srcCompat="@drawable/ic_eth_24"
+ app:tooltipText="@string/ethereum"
+ android:contentDescription="@string/ethereum"
+ />
+
+ app:srcCompat="@drawable/ic_pm_24"
+ android:contentDescription="@string/perfect_money"
+ app:tooltipText="@string/perfect_money" />
+ app:tooltipText="@string/copy1"
+ android:contentDescription="@string/copy1"/>
@@ -178,16 +185,18 @@
android:background="@drawable/rounded_border_tv"
android:layoutDirection="ltr"
android:padding="5dp">
+
+ app:srcCompat="@drawable/ic_trx"
+ android:contentDescription="@string/tron"
+ app:tooltipText="@string/tron" />
+ app:tooltipText="@string/copy1"
+ />
diff --git a/app/src/main/res/layout/fragment_admob.xml b/app/src/main/res/layout/fragment_admob.xml
index 97cc933..d2a2da8 100644
--- a/app/src/main/res/layout/fragment_admob.xml
+++ b/app/src/main/res/layout/fragment_admob.xml
@@ -81,12 +81,13 @@
android:layout_below="@+id/btn_donate_collections"
android:layout_marginTop="10dp"
android:lineSpacingExtra="8sp"
- android:text="@string/donate_with"
+ android:text="@string/our_products"
android:textColor="@color/textColor"
android:textSize="16sp" />
@@ -109,24 +110,6 @@
android:textSize="16sp"
app:drawableTint="@color/white" />
-
-