Skip to content
This repository has been archived by the owner on Sep 9, 2024. It is now read-only.

Commit

Permalink
Add CC BY-NC-SA 3.0 as possible license
Browse files Browse the repository at this point in the history
  • Loading branch information
cyb3rko committed May 24, 2021
1 parent 7138b85 commit dc371dd
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 20 deletions.
2 changes: 1 addition & 1 deletion library/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ dependencies {
implementation 'androidx.core:core-ktx:1.3.2'
implementation 'androidx.recyclerview:recyclerview:1.1.0'
implementation 'com.afollestad.material-dialogs:bottomsheets:3.3.0'
implementation 'com.github.cyb3rko:android-licenses-library:1.2.0'
implementation 'com.github.cyb3rko:android-licenses-library:1.3.0'
implementation 'com.github.GrenderG:Toasty:1.5.0'
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-core:1.3.9'
Expand Down
23 changes: 13 additions & 10 deletions library/src/main/java/com/cyb3rko/abouticons/IconInfoActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -66,18 +66,21 @@ internal class IconInfoActivity: AppCompatActivity() {
} else {
modified_container.visibility = View.GONE
}
when (license) {
"" -> license_container.visibility = View.GONE
"apache_2.0" -> license_name.text = "Apache 2.0"
"mit" -> license_name.text = "MIT License"
"cc_by_3.0" -> license_name.text = "CC BY 3.0"
"cc_by_sa_3.0" -> license_name.text = "CC BY-SA 3.0"
"cc_by_4.0" -> license_name.text = "CC BY 4.0"
"cc_by_sa_4.0" -> license_name.text = "CC BY-SA 4.0"
"cc_by_nc_3.0" -> license_name.text = "CC BY-NC 3.0"
else -> license_name.text = "Not found"
license_name.text = when (license) {
"" -> ""
"apache_2.0" -> "Apache 2.0"
"mit" -> "MIT License"
"cc_by_3.0" -> "CC BY 3.0"
"cc_by_sa_3.0" -> "CC BY-SA 3.0"
"cc_by_4.0" -> "CC BY 4.0"
"cc_by_sa_4.0" -> "CC BY-SA 4.0"
"cc_by_nc_3.0" -> "CC BY-NC 3.0"
"cc_by_nc_sa_3.0" -> "CC BY-NC-SA 3.0"
else -> "Not found"
}

if (license_name.text == "") license_container.visibility = View.GONE

visit_button.setTextColor(ContextCompat.getColor(applicationContext, R.color.defaultTextColor))
setOnClickListeners(website)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,15 +47,16 @@ class RecyclerViewAdapter(
genericViewHolder.imgUser.setImageDrawable(usedDrawables[position])
if (model!!.iconLicense.isNotEmpty()) {
genericViewHolder.itemLicense.visibility = View.VISIBLE
when (model.iconLicense) {
"apache_2.0" -> genericViewHolder.itemLicense.text = "Apache 2.0"
"mit" -> genericViewHolder.itemLicense.text = "MIT License"
"cc_by_sa_3.0" -> genericViewHolder.itemLicense.text = "CC BY-SA 3.0"
"cc_by_3.0" -> genericViewHolder.itemLicense.text = "CC BY 3.0"
"cc_by_4.0" -> genericViewHolder.itemLicense.text = "CC BY 4.0"
"cc_by_sa_4.0" -> genericViewHolder.itemLicense.text = "CC BY-SA 4.0"
"cc_by_nc_3.0" -> genericViewHolder.itemLicense.text = "CC BY-NC 3.0"
else -> genericViewHolder.itemLicense.text = "..."
genericViewHolder.itemLicense.text = when (model.iconLicense) {
"apache_2.0" -> "Apache 2.0"
"mit" -> "MIT License"
"cc_by_sa_3.0" -> "CC BY-SA 3.0"
"cc_by_3.0" -> "CC BY 3.0"
"cc_by_4.0" -> "CC BY 4.0"
"cc_by_sa_4.0" -> "CC BY-SA 4.0"
"cc_by_nc_3.0" -> "CC BY-NC 3.0"
"cc_by_nc_sa_3.0" -> "CC BY-NC-SA 3.0"
else -> "..."
}
} else {
genericViewHolder.itemLicense.visibility = View.GONE
Expand Down

0 comments on commit dc371dd

Please sign in to comment.