-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #15 from Teknasyon-Teknoloji/feature/refactor
Feature/refactor
- Loading branch information
Showing
50 changed files
with
1,088 additions
and
1,773 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
33 changes: 0 additions & 33 deletions
33
desk360/src/main/java/com/teknasyon/desk360/Desk360Application.kt
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 changes: 10 additions & 0 deletions
10
desk360/src/main/java/com/teknasyon/desk360/helper/BindingExt.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
package com.teknasyon.desk360.helper | ||
|
||
import android.app.Activity | ||
import androidx.annotation.LayoutRes | ||
import androidx.databinding.DataBindingUtil | ||
import androidx.databinding.ViewDataBinding | ||
|
||
fun <T : ViewDataBinding> Activity.binding( | ||
@LayoutRes resId: Int | ||
): Lazy<T> = lazy { DataBindingUtil.setContentView(this, resId) } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 0 additions & 1 deletion
1
desk360/src/main/java/com/teknasyon/desk360/helper/Desk360Config.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
23 changes: 20 additions & 3 deletions
23
desk360/src/main/java/com/teknasyon/desk360/helper/Desk360Helper.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,39 @@ | ||
package com.teknasyon.desk360.helper | ||
|
||
import android.os.Build | ||
import android.text.TextUtils | ||
import com.teknasyon.desk360.model.Desk360Register | ||
import com.teknasyon.desk360.modelv2.Desk360ConfigRequestModel | ||
import java.util.* | ||
|
||
object Desk360Helper { | ||
|
||
fun createDesk360ConfigRequestModel() = Desk360ConfigRequestModel().apply { | ||
language_code = Desk360Constants.manager?.languageCode.toString() | ||
language_code_tag = Desk360Constants.manager?.languageTag | ||
language_code_tag = getLanguageTag() | ||
country_code = Desk360Constants.manager?.countryCode?.toUpperCase() | ||
} | ||
|
||
fun createDesk360RegisterRequestModel() = Desk360Register().apply { | ||
app_key = Desk360Constants.manager?.appKey | ||
device_id = Desk360Config.instance.getDesk360Preferences()?.adId | ||
app_platform = if (Desk360Constants.manager?.platform == Platform.HUAWEI) "Huawei" else "Android" | ||
app_platform = | ||
if (Desk360Constants.manager?.platform == Platform.HUAWEI) "Huawei" else "Android" | ||
app_version = Desk360Constants.manager?.appVersion | ||
language_code = Desk360Constants.manager?.languageCode | ||
time_zone = Desk360Constants.manager?.timeZone | ||
} | ||
|
||
private fun getLanguageTag() = | ||
if (Desk360Constants.manager?.languageCode.isNullOrEmpty() && Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) | ||
Locale.getDefault().toLanguageTag().toLowerCase() | ||
else | ||
null | ||
|
||
fun checkNotEmpty(value: String?, errorMessage: Any): String? { | ||
return if (TextUtils.isEmpty(value)) { | ||
throw IllegalArgumentException(errorMessage.toString()) | ||
} else { | ||
value | ||
} | ||
} | ||
} |
Oops, something went wrong.