mirror of
https://github.com/sudoxnym/habitica-android.git
synced 2026-04-14 19:56:32 +00:00
Better apk and aab naming
This commit is contained in:
parent
19217707dc
commit
5db99ba7d9
9 changed files with 36 additions and 29 deletions
|
|
@ -78,7 +78,7 @@ dependencies {
|
|||
androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
|
||||
androidTestImplementation 'androidx.test:runner:1.4.0'
|
||||
androidTestImplementation 'androidx.test:rules:1.4.0'
|
||||
debugImplementation 'androidx.fragment:fragment-testing:1.4.1'
|
||||
debugImplementation 'androidx.fragment:fragment-testing:1.5.0'
|
||||
androidTestImplementation 'androidx.test.ext:junit:1.1.3'
|
||||
androidTestImplementation 'androidx.test:core-ktx:1.4.0'
|
||||
androidTestImplementation 'androidx.test.ext:junit-ktx:1.1.3'
|
||||
|
|
@ -108,15 +108,13 @@ dependencies {
|
|||
implementation "androidx.lifecycle:lifecycle-viewmodel-ktx:$lifecycle_version"
|
||||
implementation "androidx.lifecycle:lifecycle-livedata-ktx:$lifecycle_version"
|
||||
implementation "androidx.lifecycle:lifecycle-common-java8:$lifecycle_version"
|
||||
implementation 'androidx.navigation:navigation-fragment-ktx:2.4.2'
|
||||
implementation 'androidx.navigation:navigation-ui-ktx:2.4.2'
|
||||
implementation "androidx.fragment:fragment-ktx:1.4.1"
|
||||
implementation 'androidx.navigation:navigation-fragment-ktx:2.5.0'
|
||||
implementation 'androidx.navigation:navigation-ui-ktx:2.5.0'
|
||||
implementation "androidx.fragment:fragment-ktx:1.5.0"
|
||||
implementation "androidx.paging:paging-runtime-ktx:3.1.1"
|
||||
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-core:$coroutines_version"
|
||||
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-android:$coroutines_version"
|
||||
|
||||
coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:1.1.6'
|
||||
|
||||
implementation 'com.willowtreeapps:signinwithapplebutton:0.3'
|
||||
|
||||
implementation project(':shared')
|
||||
|
|
@ -149,9 +147,6 @@ android {
|
|||
buildConfigField "String", "TESTING_LEVEL", "\"production\""
|
||||
resConfigs 'en', 'bg', 'de', 'en-rGB', 'es', 'fr', 'hr-rHR', 'in', 'it', 'iw', 'ja', 'ko', 'lt', 'nl', 'pl', 'pt-rBR', 'pt-rPT', 'ru', 'tr', 'zh', 'zh-rTW'
|
||||
|
||||
println app_version_code
|
||||
println app_version_name
|
||||
|
||||
versionCode app_version_code
|
||||
versionName app_version_name
|
||||
|
||||
|
|
@ -159,6 +154,9 @@ android {
|
|||
|
||||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
||||
testInstrumentationRunnerArguments clearPackageData: 'true'
|
||||
|
||||
def formattedDate = new Date().format('yyMMdd')
|
||||
archivesBaseName = "Habitica-${formattedDate}${versionCode}"
|
||||
}
|
||||
|
||||
buildFeatures {
|
||||
|
|
@ -266,9 +264,6 @@ android {
|
|||
|
||||
sourceCompatibility JavaVersion.VERSION_1_8
|
||||
targetCompatibility JavaVersion.VERSION_1_8
|
||||
|
||||
// Flag to enable support for the new language APIs
|
||||
coreLibraryDesugaringEnabled true
|
||||
}
|
||||
|
||||
kotlinOptions {
|
||||
|
|
|
|||
|
|
@ -1,10 +1,12 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:orientation="horizontal"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="60dp"
|
||||
android:background="@drawable/button_background_primary"
|
||||
android:gravity="center">
|
||||
android:gravity="center"
|
||||
android:padding="6dp">
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
|
|
@ -18,5 +20,6 @@
|
|||
<com.habitrpg.android.habitica.ui.views.CurrencyView
|
||||
android:id="@+id/currencyView"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"/>
|
||||
android:layout_height="wrap_content"
|
||||
app:fontFamily="sans-serif-medium"/>
|
||||
</LinearLayout>
|
||||
|
|
@ -52,12 +52,14 @@
|
|||
android:id="@+id/shimmer_view"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
app:shimmer_repeat_delay="8000">
|
||||
app:shimmer_repeat_delay="8000"
|
||||
app:shimmer_base_color="@color/text_dimmed"
|
||||
app:shimmer_highlight_color="@color/content_background"
|
||||
app:shimmer_highlight_alpha="0.8">
|
||||
<com.habitrpg.common.habitica.views.PixelArtView
|
||||
android:id="@+id/pet_view"
|
||||
android:layout_width="@dimen/gear_image_size"
|
||||
android:layout_height="@dimen/gear_image_size"
|
||||
android:alpha="0.1"
|
||||
android:layout_gravity="center" />
|
||||
</com.facebook.shimmer.ShimmerFrameLayout>
|
||||
</FrameLayout>
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@ package com.habitrpg.android.habitica.modules;
|
|||
import android.content.Context;
|
||||
import android.content.SharedPreferences;
|
||||
|
||||
import com.habitrpg.android.habitica.BuildConfig;
|
||||
import com.habitrpg.android.habitica.data.TaskRepository;
|
||||
import com.habitrpg.android.habitica.data.UserRepository;
|
||||
import com.habitrpg.android.habitica.helpers.TaskAlarmManager;
|
||||
|
|
@ -28,7 +29,11 @@ public class UserModule {
|
|||
@Named(NAMED_USER_ID)
|
||||
@UserScope
|
||||
public String providesUserID(SharedPreferences sharedPreferences) {
|
||||
return sharedPreferences.getString("UserID", "");
|
||||
if (BuildConfig.DEBUG && !BuildConfig.TEST_USER_ID.isEmpty()) {
|
||||
return BuildConfig.TEST_USER_ID;
|
||||
} else {
|
||||
return sharedPreferences.getString("UserID", "");
|
||||
}
|
||||
}
|
||||
|
||||
@Provides
|
||||
|
|
|
|||
|
|
@ -8,11 +8,11 @@ import com.habitrpg.android.habitica.HabiticaBaseApplication
|
|||
import com.habitrpg.android.habitica.components.UserComponent
|
||||
import com.habitrpg.android.habitica.data.TaskRepository
|
||||
import com.habitrpg.android.habitica.models.tasks.Task
|
||||
import com.habitrpg.common.habitica.models.tasks.TaskType
|
||||
import com.habitrpg.android.habitica.proxy.AnalyticsManager
|
||||
import com.habitrpg.android.habitica.ui.adapter.BaseRecyclerViewAdapter
|
||||
import com.habitrpg.android.habitica.ui.viewHolders.BindableViewHolder
|
||||
import com.habitrpg.android.habitica.ui.viewmodels.TasksViewModel
|
||||
import com.habitrpg.common.habitica.models.tasks.TaskType
|
||||
import javax.inject.Inject
|
||||
|
||||
abstract class BaseTasksRecyclerViewAdapter<VH : BindableViewHolder<Task>>(
|
||||
|
|
@ -60,13 +60,13 @@ abstract class BaseTasksRecyclerViewAdapter<VH : BindableViewHolder<Task>>(
|
|||
if (taskType != task.type)
|
||||
return
|
||||
var i = 0
|
||||
while (i < this.content?.size ?: 0) {
|
||||
while (i < (this.content?.size ?: 0)) {
|
||||
if (content?.get(i)?.id == task.id) {
|
||||
break
|
||||
}
|
||||
++i
|
||||
}
|
||||
if (i < content?.size ?: 0) {
|
||||
if (i < (content?.size ?: 0)) {
|
||||
content?.set(i, task)
|
||||
}
|
||||
filter()
|
||||
|
|
|
|||
|
|
@ -7,12 +7,6 @@ import androidx.core.content.edit
|
|||
import com.habitrpg.common.habitica.BuildConfig
|
||||
import com.habitrpg.common.habitica.helpers.KeyHelper
|
||||
|
||||
/**
|
||||
* The configuration of the host<br></br>
|
||||
* Currently, the Port isn't used at all.
|
||||
*
|
||||
* @author MagicMicky
|
||||
*/
|
||||
class HostConfig {
|
||||
var address: String
|
||||
var port: String
|
||||
|
|
@ -30,6 +24,11 @@ class HostConfig {
|
|||
this.port = BuildConfig.PORT
|
||||
if (BuildConfig.DEBUG) {
|
||||
this.address = BuildConfig.BASE_URL
|
||||
if (BuildConfig.TEST_USER_ID.isNotBlank()) {
|
||||
userID = BuildConfig.TEST_USER_ID
|
||||
apiKey = BuildConfig.TEST_USER_KEY
|
||||
return
|
||||
}
|
||||
} else {
|
||||
val address = sharedPreferences.getString("server_url", null)
|
||||
if (address != null && address.isNotEmpty()) {
|
||||
|
|
@ -39,7 +38,6 @@ class HostConfig {
|
|||
}
|
||||
}
|
||||
this.userID = sharedPreferences.getString(context.getString(com.habitrpg.common.habitica.R.string.SP_userID), null) ?: ""
|
||||
|
||||
this.apiKey = loadAPIKey(sharedPreferences, keyHelper)
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,2 +1,2 @@
|
|||
NAME=4.0
|
||||
CODE=4180
|
||||
CODE=4190
|
||||
|
|
@ -18,6 +18,9 @@ android {
|
|||
versionCode app_version_code + 1
|
||||
versionName app_version_name
|
||||
buildConfigField "String", "TESTING_LEVEL", "\"production\""
|
||||
|
||||
def formattedDate = new Date().format('yyMMdd')
|
||||
archivesBaseName = "Habitica-WearOS-${formattedDate}${versionCode}"
|
||||
}
|
||||
|
||||
signingConfigs {
|
||||
|
|
|
|||
|
|
@ -3,13 +3,14 @@ package com.habitrpg.wearos.habitica.data.repositories
|
|||
import androidx.lifecycle.MutableLiveData
|
||||
import androidx.lifecycle.asFlow
|
||||
import com.habitrpg.wearos.habitica.models.user.User
|
||||
import kotlinx.coroutines.flow.filterNotNull
|
||||
import javax.inject.Inject
|
||||
import javax.inject.Singleton
|
||||
|
||||
@Singleton
|
||||
class UserLocalRepository @Inject constructor() {
|
||||
private val user = MutableLiveData<User?>()
|
||||
fun getUser() = user.asFlow()
|
||||
fun getUser() = user.asFlow().filterNotNull()
|
||||
|
||||
fun saveUser(user: User) {
|
||||
this.user.value = user
|
||||
|
|
|
|||
Loading…
Reference in a new issue