Skip to content

Commit

Permalink
del: Remove App upgrade check
Browse files Browse the repository at this point in the history
Signed-off-by: Hu Shenghao <[email protected]>
  • Loading branch information
hushenghao committed Jul 17, 2024
1 parent be934b9 commit a8935e0
Show file tree
Hide file tree
Showing 15 changed files with 16 additions and 400 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
### v2.6.1

- Remove App upgrade check [#317](https://github.com/hushenghao/AndroidEasterEggs/issues/317)
- Known issue fixes

### v2.6.0 (2024-07-16)
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG_zh.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
### v2.6.1

- 删除 App 更新检查 [#317](https://github.com/hushenghao/AndroidEasterEggs/issues/317)
- 修复已知问题

### v2.6.0 (2024-07-16)
Expand Down
6 changes: 0 additions & 6 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -113,12 +113,6 @@ dependencies {
implementation(libs.viewbinding.delegate)
implementation(libs.blurhash.android)
// implementation(libs.blurhash.painter)
implementation(platform(libs.squareup.okhttp.bom))
implementation(libs.squareup.okhttp)
implementation(libs.squareup.okhttp.logging)
implementation(libs.squareup.retrofit)
implementation(libs.squareup.retrofit.converter.moshi)
ksp(libs.squareup.moshi.codegen)
debugImplementation(libs.squareup.leakcanary)

implementation(project(":eggs:UpsideDownCake"))
Expand Down
1 change: 1 addition & 0 deletions app/src/debug/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,5 @@
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.CHANGE_NETWORK_STATE" />

<uses-permission android:name="android.permission.INTERNET" />
</manifest>
2 changes: 0 additions & 2 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@
android:name="com.android.launcher.permission.INSTALL_SHORTCUT"
android:maxSdkVersion="26" />

<uses-permission android:name="android.permission.INTERNET" />

<application
android:name=".EasterEggsApp"
android:allowBackup="true"
Expand Down
42 changes: 0 additions & 42 deletions app/src/main/java/com/dede/android_eggs/api/ApiManager.kt

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -3,27 +3,16 @@ package com.dede.android_eggs.views.settings.compose.options
import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.rounded.Star
import androidx.compose.runtime.Composable
import androidx.compose.runtime.getValue
import androidx.compose.runtime.mutableStateOf
import androidx.compose.runtime.setValue
import androidx.compose.ui.platform.LocalContext
import androidx.compose.ui.res.stringResource
import androidx.lifecycle.ViewModel
import androidx.lifecycle.viewModelScope
import com.dede.android_eggs.R
import com.dede.android_eggs.api.request.GithubRequests
import com.dede.android_eggs.ui.composes.icons.Github
import com.dede.android_eggs.util.CustomTabsBrowser
import com.dede.android_eggs.util.launchCatchable
import com.dede.android_eggs.views.settings.compose.basic.Option
import com.dede.android_eggs.views.settings.compose.basic.imageVectorIconBlock
import dagger.hilt.android.lifecycle.HiltViewModel
import javax.inject.Inject

@Composable
fun GithubOption(
// viewModel: GithubViewModel = viewModel()
) {
fun GithubOption() {
val context = LocalContext.current
Option(
leadingIcon = imageVectorIconBlock(
Expand All @@ -33,58 +22,8 @@ fun GithubOption(
title = stringResource(R.string.label_github),
desc = stringResource(R.string.url_github),
trailingContent = imageVectorIconBlock(imageVector = Icons.Rounded.Star),
// trailingContent = {
// Column(
// modifier = Modifier.animateContentSize(alignment = Alignment.TopCenter),
// horizontalAlignment = Alignment.CenterHorizontally
// ) {
// Icon(
// imageVector = Icons.Rounded.Star,
// contentDescription = null,
// tint = Color(0xFFDFAA39)
// )
// if (viewModel.starCount != null) {
// Text(
// text = viewModel.starCount!!,
// style = MaterialTheme.typography.labelSmall,
// fontWeight = FontWeight.Bold,
// modifier = Modifier
// .background(
// MaterialTheme.colorScheme.secondaryContainer,
// RoundedCornerShape(10.dp)
// )
// .padding(horizontal = 4.dp)
// )
// }
// }
// },
onClick = {
CustomTabsBrowser.launchUrl(context, R.string.url_github)
}
)
}

@HiltViewModel
class GithubViewModel @Inject constructor(val githubRequests: GithubRequests) : ViewModel() {

var starCount by mutableStateOf<String?>(null)
private set

init {
getRepositoryInfo()
}

private fun getRepositoryInfo() {
viewModelScope.launchCatchable {
val repositoryInfo = githubRequests.getRepositoryInfo()
if (repositoryInfo != null) {
val stargazersCount = repositoryInfo.stargazersCount
starCount = if (stargazersCount >= 1000) {
"%.1f".format(stargazersCount / 1000f)
} else {
stargazersCount.toString()
}
}
}
}
}
Loading

0 comments on commit a8935e0

Please sign in to comment.