项目作者: frogobox

项目描述 :
Frogo SDK - Android SDK Core for Easy Development
高级语言: Kotlin
项目地址: git://github.com/frogobox/frogo-sdk.git
创建时间: 2020-09-08T09:24:38Z
项目社区:https://github.com/frogobox/frogo-sdk

开源协议:Apache License 2.0

下载


ScreenShoot Apps

DEPRECATED

  • Reason Deprecated, Merge library become single library
  • Please Using This : deltadox-android

    #

ScreenShoot Apps

About This Project (release 👷🔧️👷‍♀️⛏)


Android CI
Scan with Detekt
pages-build-deployment

  • SDK for anything your problem to make easier developing android apps
  • Available for android and desktop
  • Privacy Policy Click Here
  • License Click Here

ScreenShoot

















SS 1 SS 2 SS 3 SS 4

Version Release

This Is Latest Release

  1. $version_release = 2.2.9

What’s New??

  1. * SDK Android and Desktop *
  2. * Update latest version library *
  3. * Migrate to libs.version.toml *

Download this project

Step 1. Add the JitPack repository to your build file (build.gradle : Project)

  1. // Add it in your root build.gradle at the end of repositories:
  2. allprojects {
  3. repositories {
  4. ...
  5. maven { url 'https://jitpack.io' }
  6. }
  7. }

  1. // Add it in your root build.gradle.kts at the end of repositories:
  2. allprojects {
  3. repositories {
  4. ...
  5. maven("https://jitpack.io")
  6. }
  7. }

Step 2. Add the dependency (build.gradle : Module)

  1. dependencies {
  2. // library frogo-sdk
  3. implementation 'com.github.frogobox:frogo-sdk:2.2.9'
  4. // library frogo-sdk for desktop
  5. implementation 'com.github.frogobox.frogo-sdk:core-sdk:2.2.9'
  6. }

  1. dependencies {
  2. // library frogo-sdk
  3. implementation("com.github.frogobox:frogo-sdk:2.2.9")
  4. // library frogo-sdk for desktop
  5. implementation("com.github.frogobox.frogo-sdk:core-sdk:2.2.9")
  6. }

  1. [versions]
  2. frogosdk = "2.2.9"
  3. [libraries]
  4. frogo-sdk = { group = "com.github.frogobox", name = "frogo-sdk", version.ref = "frogosdk" }
  5. frogo-sdk-core = { group = "com.github.frogobox.frogo-sdk", name = "core-sdk", version.ref = "frogosdk" }
  6. dependencies {
  7. // library frogo-sdk
  8. implementation(libs.frogo.sdk)
  9. // library frogo-sdk for desktop
  10. implementation(libs.frogo.sdk.core)
  11. }

Step 3. Function from this SDK

All Class SDK (android)

  1. FrogoActivity
  2. FrogoApplication
  3. FrogoComposeActivity
  4. FrogoFragment
  5. FrogoFunc
  6. FrogoMusic
  7. FrogoMutableLiveData
  8. FrogoNavigation
  9. FrogoPagerHelper
  10. FrogoPiracyActivity
  11. FrogoPreference
  12. FrogoSinglePreference
  13. FrogoViewModel

All Class SDK (desktop & android)

  1. FrogoApiClient
  2. FrogoApiModel
  3. FrogoApiObserver
  4. FrogoConstant
  5. FrogoDataResponse
  6. FrogoDate
  7. FrogoLocalObserver
  8. FrogoStateResponse
  9. IFrogoDate

FrogoActivity

  1. fun setupDetailActivity(title: String)
  2. fun setupChildFragment(frameId: Int, fragment: Fragment)
  3. fun showToast(message: String)
  4. fun setupEmptyView(view: View, isEmpty: Boolean)
  5. fun setupProgressView(view: View, isProgress: Boolean)
  6. fun checkExtra(extraKey: String): Boolean
  7. fun <Model> FrogoFragmentNewInstance(
  8. fragment: FrogoFragment<*>,
  9. argumentKey: String,
  10. extraDataResult: Model
  11. )
  12. fun isNetworkConnected(): Boolean
  13. fun setupFullScreen()
  14. fun setupHideSystemUI()
  15. fun shareApp(packageName: String, appName: String)
  16. fun rateApp(packageName: String)

FrogoFragment

  1. fun setupChildFragment(frameId: Int, fragment: Fragment)
  2. fun checkArgument(argsKey: String): Boolean
  3. fun setupEmptyView(view: View, isEmpty: Boolean)
  4. fun setupProgressView(view: View, isProgress: Boolean)
  5. fun showToast(message: String)
  6. fun <Model> frogoNewInstance(argsKey: String, data: Model)

Ext Function

FrogoRetrofitExt.kt

  1. // Single Api Request
  2. fun <T : Any> Call<T>.doApiRequest(callback: FrogoDataResponse<T>) {
  3. callback.onShowProgress()
  4. enqueue(object : Callback<T> {
  5. override fun onResponse(call: Call<T>, response: Response<T>) {
  6. response.body()?.let { callback.onSuccess(it) }
  7. callback.onHideProgress()
  8. }
  9. override fun onFailure(call: Call<T>, t: Throwable) {
  10. callback.onFailed(500, t.localizedMessage)
  11. callback.onHideProgress()
  12. }
  13. })
  14. }

FrogoRxJavaObservableExt.kt

  1. // Single Api Request with scheduler
  2. fun <T : Any> Observable<T>.doApiRequest(scheduler: Scheduler, callback: FrogoDataResponse<T>) {
  3. subscribeOn(Schedulers.io())
  4. .doOnSubscribe { callback.onShowProgress() }
  5. .doAfterTerminate { callback.onHideProgress() }
  6. .observeOn(scheduler)
  7. .subscribe(object : FrogoApiObserver<T>() {
  8. override fun onSuccess(data: T) {
  9. callback.onSuccess(data)
  10. }
  11. override fun onFailure(code: Int, errorMessage: String) {
  12. callback.onFailed(code, errorMessage)
  13. }
  14. })
  15. }
  16. // -------------------------------------------------------------------------------------------------
  17. // Single Api Request
  18. fun <T : Any> Observable<T>.doApiRequest(callback: FrogoDataResponse<T>) {
  19. doOnSubscribe { callback.onShowProgress() }
  20. .doAfterTerminate { callback.onHideProgress() }
  21. .subscribe(object : FrogoApiObserver<T>() {
  22. override fun onSuccess(data: T) {
  23. callback.onSuccess(data)
  24. }
  25. override fun onFailure(code: Int, errorMessage: String) {
  26. callback.onFailed(code, errorMessage)
  27. }
  28. })
  29. }

FrogoContextActivityExt.kt

  1. inline fun <reified ClassActivity> Context.singleStartActivity() {
  2. FLog.d("Activity : ${ClassActivity::class.java.simpleName}")
  3. startActivity(Intent(this, ClassActivity::class.java))
  4. }
  5. // -------------------------------------------------------------------------------------------------
  6. inline fun <reified ClassActivity, reified Model> Context.singleStartActivity(
  7. extraKey: String,
  8. data: Model
  9. ) {
  10. val intent = Intent(this, ClassActivity::class.java)
  11. val extraData = Gson().toJson(data)
  12. intent.putExtra(extraKey, extraData)
  13. FLog.d("Activity : ${ClassActivity::class.java.simpleName}")
  14. FLog.d("Data : Extra Data (${Model::class.java.simpleName}) : $extraData")
  15. startActivity(intent)
  16. }
  17. // -------------------------------------------------------------------------------------------------
  18. inline fun <reified Model> Activity.singleGetExtraData(extraKey: String): Model {
  19. val extraIntent = intent.getStringExtra(extraKey)
  20. return Gson().fromJson(extraIntent, Model::class.java)
  21. }
  22. // -------------------------------------------------------------------------------------------------
  23. fun Context.singleStartActivityShareApp(subject: String, text: String) {
  24. val intent = Intent(Intent.ACTION_SEND)
  25. intent.type = "text/plain"
  26. intent.putExtra(Intent.EXTRA_SUBJECT, subject)
  27. intent.putExtra(Intent.EXTRA_TEXT, text)
  28. FLog.d("$TAG : Subject Share App : $subject")
  29. FLog.d("$TAG : Message Share App : $text")
  30. startActivity(Intent.createChooser(intent, subject))
  31. }
  32. // -------------------------------------------------------------------------------------------------
  33. fun Context.singleStartActivityOpenApp(url: String) {
  34. FLog.d("$TAG : Url : $url")
  35. startActivity(Intent(Intent.ACTION_VIEW, Uri.parse(url)))
  36. }

FrogoContextFragmentExt.kt

  1. fun <Model> Fragment.singleNewInstance(argsKey: String, data: Model) {
  2. val argsData = Gson().toJson(data)
  3. val bundleArgs = Bundle().apply {
  4. putString(argsKey, argsData)
  5. }
  6. this.arguments = bundleArgs
  7. }
  8. // -------------------------------------------------------------------------------------------------
  9. inline fun <reified Model> Fragment.singleGetInstance(argsKey: String): Model {
  10. val argsData = this.arguments?.getString(argsKey)
  11. return Gson().fromJson(argsData, Model::class.java)
  12. }

FrogoImageViewExt.kt

  1. fun ImageView.glideLoad(data: Any?) {
  2. FLog.d("$TAG : Params : $data")
  3. FLog.d("$TAG : Glide Load Ext")
  4. Glide.with(context).load(data).into(this)
  5. }

FrogoViewExt.kt

  1. fun View.visible() {
  2. FLog.d("$TAG : View Visible")
  3. visibility = View.VISIBLE
  4. }
  5. // -------------------------------------------------------------------------------------------------
  6. fun View.gone() {
  7. FLog.d("$TAG : View Gone")
  8. visibility = View.GONE
  9. }
  10. // -------------------------------------------------------------------------------------------------
  11. fun View.invisible() {
  12. FLog.d("$TAG : View Invisible")
  13. visibility = View.INVISIBLE
  14. }
  15. // -------------------------------------------------------------------------------------------------
  16. fun View.progressViewHandle(isProgressState: Boolean) {
  17. FLog.d("$TAG : isProgressState >> $isProgressState")
  18. if (isProgressState) {
  19. visible()
  20. } else {
  21. gone()
  22. }
  23. }
  24. // -------------------------------------------------------------------------------------------------
  25. fun View.emptyViewHandle(isEmptyState: Boolean) {
  26. FLog.d("$TAG : isEmptyState >> $isEmptyState")
  27. if (isEmptyState) {
  28. visible()
  29. } else {
  30. gone()
  31. }
  32. }

FrogoContextExt.kt

  1. fun Context.getAppVersionCode(): Int? {
  2. try {
  3. return packageManager?.getPackageInfo(packageName, 0)
  4. ?.let { PackageInfoCompat.getLongVersionCode(it).toInt() }
  5. } catch (ex: Exception) {
  6. FLog.e("$TAG : ${ex.message.orEmpty()}")
  7. }
  8. return null
  9. }
  10. // -------------------------------------------------------------------------------------------------
  11. fun Context.showToast(
  12. message: String,
  13. duration: Int = Toast.LENGTH_SHORT
  14. ) {
  15. Toast.makeText(this, message, duration).show()
  16. }
  17. // -------------------------------------------------------------------------------------------------
  18. fun Context.hasCameraPermission(): Boolean =
  19. ContextCompat.checkSelfPermission(
  20. this,
  21. Manifest.permission.CAMERA
  22. ) == PackageManager.PERMISSION_GRANTED
  23. // -------------------------------------------------------------------------------------------------
  24. fun Context.hasReadExtStoragePermission(): Boolean {
  25. return ContextCompat.checkSelfPermission(
  26. this,
  27. Manifest.permission.READ_EXTERNAL_STORAGE
  28. ) == PackageManager.PERMISSION_GRANTED
  29. }
  30. fun Context.hasWriteExtStoragePermission(): Boolean {
  31. return ContextCompat.checkSelfPermission(
  32. this,
  33. Manifest.permission.WRITE_EXTERNAL_STORAGE
  34. ) == PackageManager.PERMISSION_GRANTED
  35. }

Added Function

FrogoLog

  • SDK for your Log problem to make easier developing android apps
  • frogo-log is Long Term Service
  • Line number show
  • Toast for easy develop and debug

Screenshoot Result














SS 1 SS 2 SS 3 SS 4


### Screenshoot Library Sample

ScreenShoot Apps

### FrogoLog (with line code)

kotlin // Function Log Debug FrogoLog.d("Debug") // Function Log Info FrogoLog.i("Info") // Function Log Verbose FrogoLog.v("Verbose") // Function Log Warn FrogoLog.w("Warn") // Function Log Error FrogoLog.e("Error") // Function Log Simple Debug without message params FrogoLog.d()

### FrogoLog (with line code and Toast)

kotlin // Function Log Debug (adding context params) FrogoLog.d("Debug", this@MainActivity) // Function Log Info (adding context params) FrogoLog.i("Info", this@MainActivity) // Function Log Verbose FrogoLog.v("Verbose", this@MainActivity) // Function Log Warn (adding context params) FrogoLog.w("Warn", this@MainActivity) // Function Log Error (adding context params) FrogoLog.e("Error", this@MainActivity) // Function Log Simple Debug without message params FrogoLog.d(this@MainActivity)

### FLog (without line code)

kotlin // Function Log Debug FLog.d("Debug") // Function Log Info FLog.i("Info") // Function Log Verbose FLog.v("Verbose") // Function Log Warn FLog.w("Warn") // Function Log Error FLog.e("Error") // Function Log Simple Debug without message params FLog.d()

### Flog (without line code with toast)

kotlin // Function Log Debug (adding context params) FLog.d("Debug", this@MainActivity) // Function Log Info (adding context params) FLog.i("Info", this@MainActivity) // Function Log Verbose FLog.v("Verbose", this@MainActivity) // Function Log Warn (adding context params) FLog.w("Warn", this@MainActivity) // Function Log Error (adding context params) FLog.e("Error", this@MainActivity) // Function Log Simple Debug without message params FLog.d(this@MainActivity)

### Result FrogoLog

ScreenShoot Apps

## FrogoNotification

- SDK for your notification problem to make easier developing android apps
- frogo-notification is under huge large development
- Notification with singleton method
- Simple and eazy to use
- With many feature
- Full documentation
- Custom Layout Notification

### Screen shot Sample














Simple Notification Stack Notification Custom Notification (1) Custom Notification (2)
  1. FrogoNotification.Inject(this) // Intialize for Context
  2. .setChannelId(CHANNEL_ID) // Intialize for Channel ID
  3. .setChannelName(CHANNEL_NAME) // Initialize for Channel Name
  4. .setContentIntent(pendingIntent) // Initialize for Content Intent
  5. .setSmallIcon(R.drawable.ic_frogo_notif) // Initialize for Small Icon
  6. .setLargeIcon(R.drawable.ic_frogo_notif) // Initialize for Large Icon
  7. .setContentTitle(resources.getString(R.string.content_title)) // Initialize for Content Title
  8. .setContentText(resources.getString(R.string.content_text)) // Initialize for Content Text
  9. .setSubText(resources.getString(R.string.subtext)) // Initialize for Sub Text
  10. .setupAutoCancel() // Initialize for Auto Cancel
  11. .build() // Build the Frogo Notification
  12. .launch(NOTIFICATION_ID) // Notify the Frogo Notification

Simple Notification

  1. FrogoNotification.Inject(this) // Intialize for Context
  2. .setChannelId(CHANNEL_ID) // Intialize for Channel ID
  3. .setChannelName(CHANNEL_NAME) // Initialize for Channel Name
  4. .setContentIntent(pendingIntent) // Initialize for Content Intent
  5. .setSmallIcon(R.drawable.ic_frogo_notif) // Initialize for Small Icon
  6. .setLargeIcon(R.drawable.ic_frogo_notif) // Initialize for Large Icon
  7. .setContentTitle(resources.getString(R.string.content_title)) // Initialize for Content Title
  8. .setContentText(resources.getString(R.string.content_text)) // Initialize for Content Text
  9. .setSubText(resources.getString(R.string.subtext)) // Initialize for Sub Text
  10. .setupAutoCancel() // Initialize for Auto Cancel
  11. .build() // Build the Frogo Notification
  12. .launch(NOTIFICATION_ID) // Notify the Frogo Notification

Custom Layout (NEW FEATURE)

  1. val collapsed = object : FrogoNotifCustomContentViewListener {
  2. override fun setupCustomView(): Int {
  3. return R.layout.notification_collapsed
  4. }
  5. override fun setupComponent(context: Context, customView: RemoteViews) {
  6. customView.apply {
  7. setTextViewText(R.id.text_view_collapsed_1, "Hello World!")
  8. }
  9. }
  10. }
  11. val expanded = object : FrogoNotifCustomContentViewListener {
  12. override fun setupCustomView(): Int {
  13. return R.layout.notification_expanded
  14. }
  15. override fun setupComponent(context: Context, customView: RemoteViews) {
  16. customView.apply {
  17. setImageViewResource(R.id.image_view_expanded, R.drawable.ic_android)
  18. setOnClickPendingIntent(R.id.image_view_expanded, clickPendingIntent)
  19. }
  20. }
  21. }
  22. FrogoNotification.Inject(this) // Intialize for Context
  23. .setChannelId(FrogoApp.CHANNEL_ID) // Intialize for Channel ID
  24. .setChannelName(FrogoApp.CHANNEL_NAME) // Initialize for Channel Name
  25. .setSmallIcon(R.drawable.ic_android) // Initialize for Small Icon
  26. .setCustomContentView(collapsed)
  27. .setCustomBigContentView(expanded)
  28. .build() // Build the Frogo Notification
  29. .launch(FrogoApp.NOTIFICATION_ID) // Notify the Frogo Notification

With Action Replay

  1. FrogoNotification.Inject(this)
  2. .setChannelId(CHANNEL_ID)
  3. .setChannelName(CHANNEL_NAME as String)
  4. .setSmallIcon(R.drawable.ic_frogo_notif)
  5. .setContentTitle(getString(R.string.notif_title))
  6. .setContentText(getString(R.string.notif_content))
  7. .setupShowWhen()
  8. .setupActionRemoteInput(object : FrogoNotifActionRemoteInputListener {
  9. override fun setRemoteInputResultKey(): String {
  10. return KEY_REPLY
  11. }
  12. override fun setRemoteInputLabel(): String {
  13. return getString(R.string.notif_action_reply)
  14. }
  15. override fun setActionIcon(): Int {
  16. return R.drawable.ic_frogo_send
  17. }
  18. override fun setActionTitle(): String {
  19. return getString(R.string.notif_action_reply)
  20. }
  21. override fun setActionIntent(): PendingIntent? {
  22. return getReplyPendingIntent()
  23. }
  24. override fun setAllowGeneratedReplies(): Boolean {
  25. return true
  26. }
  27. })
  28. .build()
  29. .launch(mNotificationId)

With Inbox Style (Stack)

  1. val frogoNotification = FrogoNotification.Inject(this)
  2. .setChannelId(CHANNEL_ID)
  3. .setChannelName(CHANNEL_NAME)
  4. .setSmallIcon(R.drawable.ic_frogo_email)
  5. .setGroup(GROUP_KEY_EMAILS)
  6. .setContentIntent(pendingIntent)
  7. .setupAutoCancel()
  8. // Check if NotificationID is smaller than Max Notif
  9. if (idNotification < MAX_NOTIFICATION) {
  10. stackNotif[idNotification].message?.let {
  11. frogoNotification
  12. .setContentTitle("New Email from " + stackNotif[idNotification].sender)
  13. .setContentText(it)
  14. .setLargeIcon(R.drawable.ic_frogo_notif)
  15. }
  16. } else {
  17. frogoNotification
  18. .setContentTitle("$idNotification new emails")
  19. .setContentText("mail@frogobox.com")
  20. .setGroupSummary()
  21. .setupInboxStyle(object : FrogoNotifInboxStyleListener {
  22. override fun addLine1(): String {
  23. return "New Email from " + stackNotif[idNotification].sender
  24. }
  25. override fun addLine2(): String {
  26. return "New Email from " + stackNotif[idNotification - 1].sender
  27. }
  28. override fun setBigContentTitle(): String {
  29. return "$idNotification new emails"
  30. }
  31. override fun setSummaryText(): String {
  32. return "mail@frogobox"
  33. }
  34. })
  35. }
  36. frogoNotification
  37. .build()
  38. .launch(idNotification)

With Frogo Style

  1. FrogoNotification.Inject(this) // Intialize for Context
  2. .setSmallIcon(R.drawable.ic_frogo_notif) // Initialize for Small Icon
  3. .setupWithFrogoStyle()
  4. .build() // Build the Frogo Notification
  5. .launch(NOTIFICATION_ID) // Notify the Frogo Notification

For Documentation

Colaborator

Very open to anyone, I’ll write your name under this, please contribute by sending an email to me

  • Mail To faisalamircs@gmail.com
  • Subject : Github [Github-Username-Account] [Language] _ [Repository-Name]
  • Example : Github_amirisback_kotlin_admob-helper-implementation

Name Of Contribute

  • Muhammad Faisal Amir
  • Waiting List
  • Waiting List

Waiting for your contribute

Attention !!!

  • Please enjoy and don’t forget fork and give a star
  • Don’t Forget Follow My Github Account

ScreenShoot Apps