Skip to content

Commit

Permalink
- rename and correct file names
Browse files Browse the repository at this point in the history
- ready to release v0.1.0
  • Loading branch information
samanshah committed May 18, 2024
1 parent 14b6318 commit 158d428
Show file tree
Hide file tree
Showing 10 changed files with 27 additions and 28 deletions.
2 changes: 1 addition & 1 deletion PishkhanHelper/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ afterEvaluate {
artifactId = 'pishkhanhelper'

// Version Library Name (Example : "1.0.0")
version = '0.0.1'
version = '0.1.0'
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ import ir.ayantech.ayannetworking.ayanModel.FailureType
import ir.ayantech.pishkhanhelper.PishkhanHelper
import ir.ayantech.pishkhanhelper.R
import ir.ayantech.pishkhanhelper.app.HelperApplication
import ir.ayantech.pishkhanhelper.bottomSheet.ChooseLanguageBottomSheet
import ir.ayantech.pishkhanhelper.bottomSheet.ConfirmationBottomSheet
import ir.ayantech.pishkhanhelper.bottomSheet.ErrorBottomSheet
import ir.ayantech.pishkhanhelper.bottomSheet.WaiterBottomSheet
import ir.ayantech.pishkhanhelper.bottomSheet.HelperChooseLanguageBottomSheet
import ir.ayantech.pishkhanhelper.bottomSheet.HelperConfirmationBottomSheet
import ir.ayantech.pishkhanhelper.bottomSheet.HelperErrorBottomSheet
import ir.ayantech.pishkhanhelper.bottomSheet.HelperWaiterBottomSheet
import ir.ayantech.pishkhanhelper.databinding.HelperDrawerActivityBinding
import ir.ayantech.pishkhanhelper.helper.hideKeyboard
import ir.ayantech.pishkhanhelper.locale.currentLocale
Expand Down Expand Up @@ -53,7 +53,7 @@ abstract class HelperDrawerActivity : LocaleHelperActivity<HelperDrawerActivityB
val appInfo: AppInfo
get() = (applicationContext as HelperApplication).appInfo

private var waiterBottomSheet: WaiterBottomSheet? = null
private var waiterBottomSheet: HelperWaiterBottomSheet? = null

abstract fun logoutPishkhan()

Expand All @@ -70,7 +70,7 @@ abstract class HelperDrawerActivity : LocaleHelperActivity<HelperDrawerActivityB

FailureType.CANCELED -> {
trying {
ErrorBottomSheet(
HelperErrorBottomSheet(
context = this@HelperDrawerActivity,
message = resources.getString(R.string.timeout_error_message),
retry = {
Expand All @@ -83,13 +83,13 @@ abstract class HelperDrawerActivity : LocaleHelperActivity<HelperDrawerActivityB
else -> {
trying {
if (failure.failureCode.startsWith("GOP")) {
ErrorBottomSheet(
HelperErrorBottomSheet(
context = this@HelperDrawerActivity,
message = failure.failureMessage,
retry = {}
).show()
} else {
ErrorBottomSheet(
HelperErrorBottomSheet(
context = this@HelperDrawerActivity,
message = failure.failureMessage,
retry = {
Expand Down Expand Up @@ -146,7 +146,7 @@ abstract class HelperDrawerActivity : LocaleHelperActivity<HelperDrawerActivityB
}

private fun initWaiterBottomSheet() {
waiterBottomSheet = WaiterBottomSheet(this) {
waiterBottomSheet = HelperWaiterBottomSheet(this) {
corePishkhan24AyanApi.cancelCalls()
servicesPishkhan24AyanApi.cancelCalls()
}
Expand All @@ -160,7 +160,7 @@ abstract class HelperDrawerActivity : LocaleHelperActivity<HelperDrawerActivityB

private fun handleAppLanguage() {
if (SavedData.appLanguage.isEmpty()) {
ChooseLanguageBottomSheet(context = this, isFirstTimeOpen = true) { selectedLanguage ->
HelperChooseLanguageBottomSheet(context = this, isFirstTimeOpen = true) { selectedLanguage ->
onNewLanguageSelected(selectedLanguage)
}.show()
} else {
Expand Down Expand Up @@ -243,7 +243,7 @@ abstract class HelperDrawerActivity : LocaleHelperActivity<HelperDrawerActivityB
appLanguageRl.changeVisibility(show = appInfo.flavor == "playstore")
appLanguageRl.setOnClickListener {
onMenuItemClicked {
ChooseLanguageBottomSheet(
HelperChooseLanguageBottomSheet(
context = this@HelperDrawerActivity,
isFirstTimeOpen = false
) { selectedLanguage ->
Expand Down Expand Up @@ -305,7 +305,7 @@ abstract class HelperDrawerActivity : LocaleHelperActivity<HelperDrawerActivityB
}

private fun logout() {
ConfirmationBottomSheet(
HelperConfirmationBottomSheet(
context = this,
description = R.string.logout_confirmation
) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import ir.ayantech.pishkhanhelper.model.KeyValue
import ir.ayantech.whygoogle.adapter.CommonAdapter
import ir.ayantech.whygoogle.adapter.CommonViewHolder

class TermsAndConditionsAdapter(
open class TermsAndConditionsAdapter(
items: List<KeyValue>
) : CommonAdapter<KeyValue, RowTermsAndConditionsBinding>(
items = items
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import ir.ayantech.whygoogle.helper.changeVisibility
import ir.ayantech.whygoogle.helper.isNotNull
import ir.ayantech.whygoogle.helper.viewBinding

abstract class BaseBottomSheet<T : ViewBinding>(context: Context) : BottomSheetDialog(context) {
abstract class HelperBaseBottomSheet<T : ViewBinding>(context: Context) : BottomSheetDialog(context) {

val binding: T by viewBinding(binder)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ import ir.ayantech.pishkhanhelper.databinding.BottomSheetChooseLanguageBinding
import ir.ayantech.pishkhanhelper.storage.SavedData
import ir.ayantech.whygoogle.helper.StringCallBack

class ChooseLanguageBottomSheet(
open class HelperChooseLanguageBottomSheet(
context: Context,
private val isFirstTimeOpen: Boolean,
private val onLanguageSelected: StringCallBack
): BaseBottomSheet<BottomSheetChooseLanguageBinding>(context) {
): HelperBaseBottomSheet<BottomSheetChooseLanguageBinding>(context) {

override val title: String
get() = getString(R.string.choose_language)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@ import ir.ayantech.pishkhanhelper.components.initButtonOutlined
import ir.ayantech.pishkhanhelper.databinding.BottomSheetConfirmationBinding
import ir.ayantech.whygoogle.helper.SimpleCallBack

class ConfirmationBottomSheet(
open class HelperConfirmationBottomSheet(
context: Context,
@StringRes private val description: Int,
private val onConfirmClicked: SimpleCallBack
) : BaseBottomSheet<BottomSheetConfirmationBinding>(context) {
) : HelperBaseBottomSheet<BottomSheetConfirmationBinding>(context) {

override val binder: (LayoutInflater) -> BottomSheetConfirmationBinding
get() = BottomSheetConfirmationBinding::inflate
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@ import ir.ayantech.pishkhanhelper.components.initButtonFilled
import ir.ayantech.pishkhanhelper.databinding.BottomSheetErrorBinding
import ir.ayantech.whygoogle.helper.SimpleCallBack

class ErrorBottomSheet(
open class HelperErrorBottomSheet(
context: Context,
private val message: String,
private val onErrorBottomSheetCancelled: SimpleCallBack? = null,
private val retry: SimpleCallBack
) : BaseBottomSheet<BottomSheetErrorBinding>(context) {
) : HelperBaseBottomSheet<BottomSheetErrorBinding>(context) {

override val title: String
get() = ""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@ import ir.ayantech.pishkhanhelper.rate.showRatingIntent
import ir.ayantech.pishkhanhelper.storage.SavedData
import ir.ayantech.whygoogle.helper.BooleanCallBack

class MarketRatingBottomSheet(
open class HelperMarketRatingBottomSheet(
private val activity: AppCompatActivity,
private val applicationId: String,
private val marketName: String,
private val onOptionsClicked: BooleanCallBack?
) : BaseBottomSheet<BottomSheetRatingBinding>(activity) {
) : HelperBaseBottomSheet<BottomSheetRatingBinding>(activity) {

override val binder: (LayoutInflater) -> BottomSheetRatingBinding
get() = BottomSheetRatingBinding::inflate
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ import ir.ayantech.pishkhanhelper.databinding.BottomSheetWaiterBinding
import ir.ayantech.whygoogle.helper.SimpleCallBack


class WaiterBottomSheet(
open class HelperWaiterBottomSheet(
private val context: Context,
private val onCancelBtnClicked: SimpleCallBack
) : BaseBottomSheet<BottomSheetWaiterBinding>(context) {
) : HelperBaseBottomSheet<BottomSheetWaiterBinding>(context) {

override val title: String?
get() = null
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,11 @@ import com.google.android.gms.tasks.Task
import com.google.android.play.core.review.ReviewInfo
import com.google.android.play.core.review.ReviewManager
import com.google.android.play.core.review.ReviewManagerFactory
import ir.ayantech.pishkhanhelper.bottomSheet.MarketRatingBottomSheet
import ir.ayantech.pishkhanhelper.bottomSheet.HelperMarketRatingBottomSheet
import ir.ayantech.pishkhanhelper.storage.SavedData
import ir.ayantech.whygoogle.helper.BooleanCallBack
import ir.ayantech.whygoogle.helper.openUrl
import ir.ayantech.whygoogle.helper.trying
import java.io.Serializable

@StringDef("cafebazaar", "myket", "playstore", "galaxystore")
@Retention(AnnotationRetention.SOURCE)
Expand All @@ -41,7 +40,7 @@ fun AppCompatActivity.showRatingIntent(applicationId: String, @MarketName market
fun AppCompatActivity.showRatingBottomSheet(applicationId: String, marketName: String, callback: BooleanCallBack? = null) {
if (!SavedData.userHasRated) {
trying {
MarketRatingBottomSheet(
HelperMarketRatingBottomSheet(
activity = this,
applicationId = applicationId,
marketName = marketName,
Expand Down

0 comments on commit 158d428

Please sign in to comment.