Skip to content

Commit

Permalink
Some updates and fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
levinli303 committed May 8, 2021
1 parent b21a5c0 commit 7960ef4
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 26 deletions.
4 changes: 0 additions & 4 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -71,10 +71,6 @@ android {
targetCompatibility = "8"
sourceCompatibility = "8"
}

kotlinOptions {
jvmTarget = JavaVersion.VERSION_1_8.toString()
}
}

dependencies {
Expand Down
4 changes: 2 additions & 2 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
package="space.celestia.mobilecelestia"
android:versionCode="177"
android:versionName="1.3.1">
android:versionCode="178"
android:versionName="1.3.2">

<uses-feature android:glEsVersion="0x00020000" android:required="true" />
<uses-permission android:name="android.permission.INTERNET"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

package space.celestia.mobilecelestia.favorite

import android.os.Build
import android.view.LayoutInflater
import android.view.Menu
import android.view.View
Expand Down Expand Up @@ -236,19 +237,21 @@ class FavoriteItemRecyclerViewAdapter private constructor(
}
return@setOnLongClickListener true
}
holder.itemView.setOnContextClickListener {
val popup = PopupMenu(it.context, it)
setupPopupMenu(popup, actions) { menuItem ->
when (menuItem) {
FavoriteItemAction.Delete -> {
listener?.deleteFavoriteItem(children.indexOf(item))
}
FavoriteItemAction.Rename -> {
listener?.renameFavoriteItem(item)
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
holder.itemView.setOnContextClickListener {
val popup = PopupMenu(it.context, it)
setupPopupMenu(popup, actions) { menuItem ->
when (menuItem) {
FavoriteItemAction.Delete -> {
listener?.deleteFavoriteItem(children.indexOf(item))
}
FavoriteItemAction.Rename -> {
listener?.renameFavoriteItem(item)
}
}
}
return@setOnContextClickListener true
}
return@setOnContextClickListener true
}
} else {
holder.itemView.setOnLongClickListener(null)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ enum class ToolbarAction : Serializable {

val imageName: String
get() {
return "toolbar_" + toString().toLowerCase(Locale.ENGLISH)
return "toolbar_" + toString().lowercase(Locale.US)
}

companion object {
Expand Down
14 changes: 6 additions & 8 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -12,25 +12,23 @@
// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {
ext.kotlin_version = '1.4.32'
ext.kotlin_version = '1.5.0'

repositories {
google()
jcenter()

mavenCentral()
}

dependencies {
classpath 'com.android.tools.build:gradle:4.1.3'
classpath 'com.android.tools.build:gradle:4.2.0'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"

// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}

allprojects {
repositories {
google()
jcenter()
mavenCentral()
}
}

Expand Down
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.5-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-6.7.1-all.zip

0 comments on commit 7960ef4

Please sign in to comment.