forked from organicmaps/organicmaps
failed attempt to download map after launch
This commit is contained in:
parent
dce2313723
commit
184cd72db2
13 changed files with 489 additions and 30 deletions
|
@ -55,6 +55,12 @@ apply plugin: 'com.github.triplet.play'
|
|||
apply plugin: 'ru.cian.huawei-publish-gradle-plugin'
|
||||
apply plugin: 'org.jetbrains.kotlin.android'
|
||||
apply plugin: 'kotlin-parcelize'
|
||||
apply plugin: 'kotlin-kapt'
|
||||
apply plugin: 'com.google.dagger.hilt.android'
|
||||
|
||||
kapt {
|
||||
correctErrorTypes true
|
||||
}
|
||||
|
||||
def run(cmd) {
|
||||
def stdout = new ByteArrayOutputStream()
|
||||
|
@ -417,6 +423,11 @@ dependencies {
|
|||
implementation 'androidx.work:work-runtime:2.9.0'
|
||||
implementation 'androidx.lifecycle:lifecycle-process:2.8.0'
|
||||
implementation 'com.google.android.material:material:1.12.0'
|
||||
|
||||
// hilt
|
||||
implementation "com.google.dagger:hilt-android:2.47"
|
||||
kapt "com.google.dagger:hilt-compiler:2.47"
|
||||
|
||||
// Fix for app/organicmaps/util/FileUploadWorker.java:14: error: cannot access ListenableFuture
|
||||
// https://github.com/organicmaps/organicmaps/issues/6106
|
||||
implementation 'com.google.guava:guava:33.1.0-android'
|
||||
|
|
|
@ -446,6 +446,10 @@
|
|||
android:foregroundServiceType="location"
|
||||
android:stopWithTask="false" />
|
||||
|
||||
<service
|
||||
android:name="app.tourism.DownloaderService"
|
||||
android:foregroundServiceType="location"/>
|
||||
|
||||
<provider
|
||||
android:name="androidx.core.content.FileProvider"
|
||||
android:authorities="${FILE_PROVIDER_PLACEHOLDER}"
|
||||
|
|
|
@ -111,6 +111,7 @@ import app.organicmaps.widget.placepage.PlacePageController;
|
|||
import app.organicmaps.widget.placepage.PlacePageData;
|
||||
import app.organicmaps.widget.placepage.PlacePageViewModel;
|
||||
import app.tourism.data.dto.SiteLocation;
|
||||
import dagger.hilt.android.AndroidEntryPoint;
|
||||
|
||||
import com.google.android.material.dialog.MaterialAlertDialogBuilder;
|
||||
|
||||
|
@ -125,6 +126,7 @@ import static app.organicmaps.location.LocationState.FOLLOW;
|
|||
import static app.organicmaps.location.LocationState.FOLLOW_AND_ROTATE;
|
||||
import static app.organicmaps.location.LocationState.LOCATION_TAG;
|
||||
|
||||
@AndroidEntryPoint
|
||||
public class MwmActivity extends BaseMwmFragmentActivity
|
||||
implements PlacePageActivationListener,
|
||||
View.OnTouchListener,
|
||||
|
|
|
@ -4,8 +4,11 @@ import static app.organicmaps.location.LocationState.LOCATION_TAG;
|
|||
|
||||
import android.app.Activity;
|
||||
import android.app.Application;
|
||||
import android.app.NotificationChannel;
|
||||
import android.app.NotificationManager;
|
||||
import android.content.Context;
|
||||
import android.content.SharedPreferences;
|
||||
import android.os.Build;
|
||||
import android.os.Bundle;
|
||||
import android.os.Handler;
|
||||
import android.os.Message;
|
||||
|
@ -45,11 +48,14 @@ import app.organicmaps.util.UiUtils;
|
|||
import app.organicmaps.util.Utils;
|
||||
import app.organicmaps.util.log.Logger;
|
||||
import app.organicmaps.util.log.LogsManager;
|
||||
import app.tourism.DownloaderService;
|
||||
import dagger.hilt.android.HiltAndroidApp;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.lang.ref.WeakReference;
|
||||
import java.util.List;
|
||||
|
||||
@HiltAndroidApp
|
||||
public class MwmApplication extends Application implements Application.ActivityLifecycleCallbacks
|
||||
{
|
||||
@NonNull
|
||||
|
@ -139,6 +145,9 @@ public class MwmApplication extends Application implements Application.ActivityL
|
|||
public void onCreate()
|
||||
{
|
||||
super.onCreate();
|
||||
|
||||
createNotificationChannel();
|
||||
|
||||
Logger.i(TAG, "Initializing application");
|
||||
LogsManager.INSTANCE.initFileLogging(this);
|
||||
|
||||
|
@ -166,6 +175,19 @@ public class MwmApplication extends Application implements Application.ActivityL
|
|||
mDisplayManager = new DisplayManager();
|
||||
}
|
||||
|
||||
public void createNotificationChannel() {
|
||||
if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
|
||||
NotificationChannel channel = new NotificationChannel(
|
||||
DownloaderService.DOWNLOADING_CHANNEL,
|
||||
"Download",
|
||||
NotificationManager.IMPORTANCE_LOW
|
||||
);
|
||||
NotificationManager notificationManager =
|
||||
(NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);
|
||||
notificationManager.createNotificationChannel(channel);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Initialize native core of application: platform and framework.
|
||||
*
|
||||
|
|
66
android/app/src/main/java/app/tourism/DownloaderService.kt
Normal file
66
android/app/src/main/java/app/tourism/DownloaderService.kt
Normal file
|
@ -0,0 +1,66 @@
|
|||
package app.tourism
|
||||
|
||||
import android.app.Notification
|
||||
import android.app.Service
|
||||
import android.content.Intent
|
||||
import android.os.IBinder
|
||||
import androidx.core.app.NotificationCompat
|
||||
import androidx.core.app.NotificationManagerCompat
|
||||
import app.tourism.di.InProgressNotificationCompatBuilder
|
||||
import app.tourism.di.NotInProgressNotificationCompatBuilder
|
||||
import dagger.hilt.android.AndroidEntryPoint
|
||||
import javax.inject.Inject
|
||||
|
||||
@AndroidEntryPoint
|
||||
class DownloaderService : Service() {
|
||||
@Inject
|
||||
lateinit var st: String
|
||||
|
||||
@Inject
|
||||
lateinit var notificationManager: NotificationManagerCompat
|
||||
|
||||
@Inject
|
||||
@InProgressNotificationCompatBuilder
|
||||
lateinit var inProgressNotificationBuilder: NotificationCompat.Builder
|
||||
|
||||
@Inject
|
||||
@NotInProgressNotificationCompatBuilder
|
||||
lateinit var notInProgressNotificationBuilder: NotificationCompat.Builder
|
||||
|
||||
override fun onBind(intent: Intent?): IBinder? {
|
||||
return null
|
||||
}
|
||||
|
||||
override fun onStartCommand(intent: Intent?, flags: Int, startId: Int): Int {
|
||||
when (intent?.action) {
|
||||
Actions.START.toString() -> start()
|
||||
Actions.STOP.toString() -> stopSelf()
|
||||
}
|
||||
|
||||
return super.onStartCommand(intent, flags, startId)
|
||||
}
|
||||
|
||||
private fun start() {
|
||||
notificationManager.notificationChannels
|
||||
val mapDownloader = MapDownloader(
|
||||
this,
|
||||
notificationManager,
|
||||
inProgressNotificationBuilder,
|
||||
notInProgressNotificationBuilder,
|
||||
)
|
||||
mapDownloader.downloadTjkMap()
|
||||
val notification = inProgressNotificationBuilder.build()
|
||||
notification.flags = Notification.FLAG_ONGOING_EVENT
|
||||
startForeground(NOTIFICATION_ID, notification)
|
||||
}
|
||||
|
||||
enum class Actions {
|
||||
START, STOP
|
||||
}
|
||||
|
||||
companion object {
|
||||
const val NOTIFICATION_ID = 1
|
||||
const val DOWNLOADING_CHANNEL = "Downloading channel"
|
||||
const val NOTIFICATION_CHANNEL = "Notification channel"
|
||||
}
|
||||
}
|
|
@ -1,6 +1,8 @@
|
|||
package app.tourism
|
||||
|
||||
import android.Manifest
|
||||
import android.content.Intent
|
||||
import android.os.Build
|
||||
import android.os.Bundle
|
||||
import androidx.activity.ComponentActivity
|
||||
import androidx.activity.compose.setContent
|
||||
|
@ -13,58 +15,89 @@ import androidx.compose.material3.Scaffold
|
|||
import androidx.compose.material3.Text
|
||||
import androidx.compose.runtime.Composable
|
||||
import androidx.compose.ui.Modifier
|
||||
import androidx.compose.ui.platform.LocalContext
|
||||
import androidx.compose.ui.tooling.preview.Preview
|
||||
import androidx.core.app.ActivityCompat
|
||||
import androidx.core.app.NotificationManagerCompat
|
||||
import androidx.core.content.ContextCompat.startActivity
|
||||
import app.organicmaps.DownloadResourcesLegacyActivity
|
||||
import app.organicmaps.downloader.CountryItem
|
||||
import app.tourism.data.dto.SiteLocation
|
||||
import app.tourism.ui.theme.OrganicMapsTheme
|
||||
import dagger.hilt.android.AndroidEntryPoint
|
||||
import javax.inject.Inject
|
||||
|
||||
|
||||
@AndroidEntryPoint
|
||||
class MainActivity : ComponentActivity() {
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
super.onCreate(savedInstanceState)
|
||||
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU) {
|
||||
ActivityCompat.requestPermissions(
|
||||
this,
|
||||
arrayOf(Manifest.permission.POST_NOTIFICATIONS),
|
||||
0
|
||||
)
|
||||
}
|
||||
|
||||
enableEdgeToEdge()
|
||||
setContent {
|
||||
OrganicMapsTheme {
|
||||
Scaffold(modifier = Modifier.fillMaxSize()) { innerPadding ->
|
||||
Greeting(
|
||||
name = "Android",
|
||||
modifier = Modifier.padding(innerPadding)
|
||||
)
|
||||
Column(Modifier.padding(innerPadding)) {
|
||||
TestingStuffs()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Composable
|
||||
fun Greeting(name: String, modifier: Modifier = Modifier) {
|
||||
val context = LocalContext.current;
|
||||
Column {
|
||||
Text(
|
||||
text = "Hello $name!",
|
||||
modifier = modifier
|
||||
)
|
||||
@Composable
|
||||
fun TestingStuffs() {
|
||||
Column {
|
||||
TestingNavigationToMap()
|
||||
TestingNotifs()
|
||||
}
|
||||
}
|
||||
|
||||
@Composable
|
||||
fun TestingNavigationToMap() {
|
||||
Button(
|
||||
onClick = {
|
||||
val intent = Intent(context, DownloadResourcesLegacyActivity::class.java)
|
||||
val intent = Intent(this, DownloadResourcesLegacyActivity::class.java)
|
||||
intent.putExtra(
|
||||
"end_point",
|
||||
SiteLocation("Name", 38.573, 68.807)
|
||||
)
|
||||
startActivity(context, intent, null)
|
||||
startActivity(this, intent, null)
|
||||
},
|
||||
) {
|
||||
Text(text = "navigate to Map", modifier = modifier)
|
||||
Text(text = "navigate to Map")
|
||||
}
|
||||
}
|
||||
|
||||
@Composable
|
||||
fun TestingNotifs() {
|
||||
Button(
|
||||
onClick = {
|
||||
Intent(applicationContext, DownloaderService::class.java).also {
|
||||
val mCurrentCountry = CountryItem.fill("Tajikistan")
|
||||
if (!mCurrentCountry.present) {
|
||||
it.action = DownloaderService.Actions.START.toString()
|
||||
startService(it)
|
||||
}
|
||||
}
|
||||
},
|
||||
) {
|
||||
Text(text = "Start download")
|
||||
}
|
||||
Button(
|
||||
onClick = {
|
||||
Intent(applicationContext, DownloaderService::class.java).also {
|
||||
it.action = DownloaderService.Actions.STOP.toString()
|
||||
startService(it)
|
||||
}
|
||||
},
|
||||
) {
|
||||
Text(text = "Stop download")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Preview(showBackground = true)
|
||||
@Composable
|
||||
fun GreetingPreview() {
|
||||
OrganicMapsTheme {
|
||||
Greeting("Android")
|
||||
}
|
||||
}
|
165
android/app/src/main/java/app/tourism/MapDownloader.kt
Normal file
165
android/app/src/main/java/app/tourism/MapDownloader.kt
Normal file
|
@ -0,0 +1,165 @@
|
|||
package app.tourism
|
||||
|
||||
import android.Manifest.permission
|
||||
import android.content.Context
|
||||
import android.content.pm.PackageManager
|
||||
import android.text.TextUtils
|
||||
import android.widget.Toast
|
||||
import androidx.core.app.ActivityCompat
|
||||
import androidx.core.app.NotificationCompat
|
||||
import androidx.core.app.NotificationManagerCompat
|
||||
import app.organicmaps.R
|
||||
import app.organicmaps.downloader.CountryItem
|
||||
import app.organicmaps.downloader.MapManager
|
||||
import app.organicmaps.location.LocationHelper
|
||||
import app.organicmaps.util.Config
|
||||
import app.organicmaps.util.ConnectionState
|
||||
import app.organicmaps.util.log.Logger
|
||||
import kotlin.math.roundToInt
|
||||
|
||||
class MapDownloader(
|
||||
private val context: Context,
|
||||
private val notificationManager: NotificationManagerCompat,
|
||||
private val inProgressNotificationBuilder: NotificationCompat.Builder,
|
||||
private val notInProgressNotificationBuilder: NotificationCompat.Builder,
|
||||
) {
|
||||
private var mStorageSubscriptionSlot = 0
|
||||
private var progress = 0
|
||||
private var mCurrentCountry = CountryItem.fill("Tajikistan")
|
||||
|
||||
private val mStorageCallback: MapManager.StorageCallback = object :
|
||||
MapManager.StorageCallback {
|
||||
override fun onStatusChanged(data: List<MapManager.StorageCallbackData>) {
|
||||
for (item in data) {
|
||||
if (!item.isLeafNode) continue
|
||||
|
||||
if (item.newStatus == CountryItem.STATUS_FAILED)
|
||||
Toast.makeText(context, "failure", Toast.LENGTH_SHORT).show();
|
||||
|
||||
if (mCurrentCountry.id == item.countryId) {
|
||||
updateProgressState()
|
||||
return
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
override fun onProgress(countryId: String, localSize: Long, remoteSize: Long) {
|
||||
if (mCurrentCountry.id == countryId) {
|
||||
updateProgressState()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private fun updateProgressState() {
|
||||
updateStateInternal()
|
||||
}
|
||||
|
||||
private fun updateStateInternal() {
|
||||
val inProgress = (mCurrentCountry.status == CountryItem.STATUS_PROGRESS ||
|
||||
mCurrentCountry.status == CountryItem.STATUS_APPLYING)
|
||||
val failed = (mCurrentCountry.status == CountryItem.STATUS_FAILED)
|
||||
val success = (mCurrentCountry.status == CountryItem.STATUS_DONE)
|
||||
|
||||
if (success) {
|
||||
notInProgressNotificationBuilder.setContentTitle(context.getString(R.string.map_downloaded))
|
||||
if (ActivityCompat.checkSelfPermission(
|
||||
context,
|
||||
permission.POST_NOTIFICATIONS
|
||||
) == PackageManager.PERMISSION_GRANTED
|
||||
) {
|
||||
notificationManager.notify(
|
||||
DownloaderService.NOTIFICATION_ID,
|
||||
notInProgressNotificationBuilder.build()
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
if (failed) {
|
||||
notInProgressNotificationBuilder.setContentTitle(context.getString(R.string.map_download_error))
|
||||
if (ActivityCompat.checkSelfPermission(
|
||||
context,
|
||||
permission.POST_NOTIFICATIONS
|
||||
) == PackageManager.PERMISSION_GRANTED
|
||||
) {
|
||||
notificationManager.notify(
|
||||
DownloaderService.NOTIFICATION_ID,
|
||||
notInProgressNotificationBuilder.build()
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
if (inProgress) {
|
||||
val progress = mCurrentCountry.progress.roundToInt()
|
||||
Logger.d("progress", progress.toString())
|
||||
inProgressNotificationBuilder.setProgress(100, progress, false)
|
||||
if (
|
||||
ActivityCompat.checkSelfPermission(context, permission.POST_NOTIFICATIONS)
|
||||
== PackageManager.PERMISSION_GRANTED
|
||||
) {
|
||||
notificationManager.notify(
|
||||
DownloaderService.NOTIFICATION_ID,
|
||||
inProgressNotificationBuilder.build()
|
||||
)
|
||||
}
|
||||
} else {
|
||||
if (Config.isAutodownloadEnabled() &&
|
||||
!sAutodownloadLocked &&
|
||||
!failed &&
|
||||
ConnectionState.INSTANCE.isWifiConnected
|
||||
) {
|
||||
val loc = LocationHelper.from(context).savedLocation
|
||||
if (loc != null) {
|
||||
val country =
|
||||
MapManager.nativeFindCountry(loc.latitude, loc.longitude)
|
||||
if (TextUtils.equals(mCurrentCountry.id, country) &&
|
||||
MapManager.nativeHasSpaceToDownloadCountry(country)
|
||||
) {
|
||||
MapManager.nativeDownload(mCurrentCountry.id)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public fun downloadTjkMap() {
|
||||
if (mCurrentCountry.present) return
|
||||
|
||||
download()
|
||||
}
|
||||
|
||||
public fun download() {
|
||||
onResume()
|
||||
val failed = mCurrentCountry.status == CountryItem.STATUS_FAILED
|
||||
if (failed) {
|
||||
MapManager.nativeRetry(mCurrentCountry.id)
|
||||
} else {
|
||||
MapManager.nativeDownload(mCurrentCountry.id)
|
||||
}
|
||||
}
|
||||
|
||||
public fun cancel() {
|
||||
MapManager.nativeCancel(mCurrentCountry.id)
|
||||
setAutodownloadLocked(true)
|
||||
}
|
||||
|
||||
fun onPause() {
|
||||
if (mStorageSubscriptionSlot > 0) {
|
||||
MapManager.nativeUnsubscribe(mStorageSubscriptionSlot)
|
||||
mStorageSubscriptionSlot = 0
|
||||
}
|
||||
}
|
||||
|
||||
fun onResume() {
|
||||
if (mStorageSubscriptionSlot == 0) {
|
||||
mStorageSubscriptionSlot = MapManager.nativeSubscribe(mStorageCallback)
|
||||
}
|
||||
}
|
||||
|
||||
companion object {
|
||||
private var sAutodownloadLocked = false
|
||||
|
||||
fun setAutodownloadLocked(locked: Boolean) {
|
||||
sAutodownloadLocked = locked
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,80 @@
|
|||
package app.tourism.di
|
||||
|
||||
import android.app.NotificationChannel
|
||||
import android.app.NotificationManager
|
||||
import android.content.Context
|
||||
import android.os.Build
|
||||
import androidx.core.app.NotificationCompat
|
||||
import androidx.core.app.NotificationCompat.VISIBILITY_PRIVATE
|
||||
import androidx.core.app.NotificationManagerCompat
|
||||
import app.organicmaps.R
|
||||
import app.tourism.DownloaderService
|
||||
import dagger.Module
|
||||
import dagger.Provides
|
||||
import dagger.hilt.InstallIn
|
||||
import dagger.hilt.android.qualifiers.ApplicationContext
|
||||
import dagger.hilt.components.SingletonComponent
|
||||
import javax.inject.Qualifier
|
||||
|
||||
@Module
|
||||
@InstallIn(SingletonComponent::class)
|
||||
object NotificationModule {
|
||||
|
||||
@Provides
|
||||
@NotInProgressNotificationCompatBuilder
|
||||
fun provideNotInProgressNotificationBuilder(
|
||||
@ApplicationContext context: Context
|
||||
): NotificationCompat.Builder {
|
||||
return NotificationCompat.Builder(context, DownloaderService.NOTIFICATION_CHANNEL)
|
||||
.setContentTitle("Welcome")
|
||||
.setSmallIcon(R.mipmap.ic_launcher_round)
|
||||
.setPriority(NotificationCompat.PRIORITY_DEFAULT)
|
||||
.setVisibility(VISIBILITY_PRIVATE)
|
||||
}
|
||||
|
||||
@Provides
|
||||
@InProgressNotificationCompatBuilder
|
||||
fun provideInProgressNotificationBuilder(
|
||||
@ApplicationContext context: Context
|
||||
): NotificationCompat.Builder {
|
||||
return NotificationCompat.Builder(context, DownloaderService.DOWNLOADING_CHANNEL)
|
||||
.setOngoing(true)
|
||||
.setContentTitle(context.getString(R.string.map_downloading))
|
||||
.setSmallIcon(R.mipmap.ic_launcher_round)
|
||||
.setSilent(true)
|
||||
.setPriority(NotificationCompat.PRIORITY_LOW)
|
||||
}
|
||||
|
||||
@Provides
|
||||
fun provideNotificationManager(
|
||||
@ApplicationContext context: Context
|
||||
): NotificationManagerCompat {
|
||||
val notificationManager = NotificationManagerCompat.from(context)
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
|
||||
val channel = NotificationChannel(
|
||||
DownloaderService.NOTIFICATION_CHANNEL,
|
||||
DownloaderService.NOTIFICATION_CHANNEL,
|
||||
NotificationManager.IMPORTANCE_DEFAULT
|
||||
)
|
||||
val channel2 = NotificationChannel(
|
||||
DownloaderService.DOWNLOADING_CHANNEL,
|
||||
DownloaderService.DOWNLOADING_CHANNEL,
|
||||
NotificationManager.IMPORTANCE_LOW
|
||||
)
|
||||
notificationManager.createNotificationChannel(channel)
|
||||
notificationManager.createNotificationChannel(channel2)
|
||||
}
|
||||
return notificationManager
|
||||
}
|
||||
|
||||
@Provides
|
||||
fun provideString(): String = "sdklfjsdalkfj"
|
||||
}
|
||||
|
||||
@Qualifier
|
||||
@Retention(AnnotationRetention.BINARY)
|
||||
annotation class NotInProgressNotificationCompatBuilder
|
||||
|
||||
@Qualifier
|
||||
@Retention(AnnotationRetention.BINARY)
|
||||
annotation class InProgressNotificationCompatBuilder
|
69
android/app/src/main/res/layout/map_downloader.xml
Normal file
69
android/app/src/main/res/layout/map_downloader.xml
Normal file
|
@ -0,0 +1,69 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:visibility="gone"
|
||||
tools:visibility="visible">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
android:background="@drawable/onmap_downloader_background"
|
||||
android:backgroundTint="?menuBackground"
|
||||
android:clipChildren="false"
|
||||
android:clipToPadding="false"
|
||||
android:gravity="center_horizontal"
|
||||
android:orientation="horizontal"
|
||||
android:padding="12dp"
|
||||
tools:ignore="UselessParent">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/downloader_parent"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="@dimen/margin_eighth"
|
||||
android:textAppearance="@style/MwmTextAppearance.Body2"
|
||||
android:textSize="14sp"
|
||||
android:text="@string/map_downloading"
|
||||
tools:text="Some country very loooooooooong country " />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<com.google.android.material.progressindicator.LinearProgressIndicator
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="3dp"
|
||||
android:layout_weight="1" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/downloader_size"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center_horizontal"
|
||||
android:textAppearance="@style/MwmTextAppearance.Body2"
|
||||
android:layout_marginStart="8dp"
|
||||
tools:text="1000 MB" />
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
|
||||
<Button
|
||||
android:id="@+id/downloader_button"
|
||||
style="@style/MwmWidget.Button.Primary"
|
||||
android:layout_width="100dp"
|
||||
android:layout_gravity="center"
|
||||
android:layout_marginStart="8dp"
|
||||
android:visibility="gone"
|
||||
tools:visibility="visible" />
|
||||
</LinearLayout>
|
||||
</ScrollView>
|
|
@ -2160,5 +2160,8 @@
|
|||
<string name="type.amenity.events_venue">Место проведения мероприятий</string>
|
||||
<string name="type.shop.auction">Аукцион</string>
|
||||
<string name="type.shop.collector">Коллекции</string>
|
||||
<string name="brand_name"> Комитет по туризму при Правительстве Республики Таджикистан </string>
|
||||
<string name="brand_name"> Комитет по туризму при Правительстве Республики Таджикистан </string>
|
||||
<string name="map_downloading">Карта Таджикистана скачивается</string>
|
||||
<string name="map_downloaded">Карта Таджикистана была успешно скачана</string>
|
||||
<string name="map_download_error">Не удалось скачать карту</string>
|
||||
</resources>
|
||||
|
|
|
@ -2203,4 +2203,7 @@
|
|||
//todo
|
||||
<string name="brand_name"> Комитет по туризму при Правительстве Республики Таджикистан </string>
|
||||
<string name="title_activity_main">MainActivity</string>
|
||||
<string name="map_downloading">Map of Tajikistan is being downloaded</string>
|
||||
<string name="map_downloaded">Tajikistan map was successfully downloaded</string>
|
||||
<string name="map_download_error">Failed to download map</string>
|
||||
</resources>
|
||||
|
|
|
@ -3,4 +3,5 @@ plugins {
|
|||
id 'com.android.application' version '8.4.1' apply false
|
||||
id 'com.android.library' version '8.4.1' apply false
|
||||
id 'org.jetbrains.kotlin.android' version '1.9.0' apply false
|
||||
id 'com.google.dagger.hilt.android' version '2.47' apply false
|
||||
}
|
||||
|
|
|
@ -10,14 +10,14 @@
|
|||
# This option should only be used with decoupled projects. For more details, visit
|
||||
# https://developer.android.com/r/tools/gradle-multi-project-decoupled-projects
|
||||
# org.gradle.parallel=true
|
||||
#Thu Jun 06 15:38:47 TJT 2024
|
||||
#Mon Jun 10 23:17:53 TJT 2024
|
||||
android.native.buildOutput=verbose
|
||||
android.nonFinalResIds=false
|
||||
android.nonTransitiveRClass=true
|
||||
android.useAndroidX=true
|
||||
enableVulkanDiagnostics=OFF
|
||||
org.gradle.caching=true
|
||||
org.gradle.jvmargs=-Xmx1536M -Dkotlin.daemon.jvm.options\="-Xmx1024M" -Xms256m
|
||||
org.gradle.jvmargs=-Xmx2048M -Dkotlin.daemon.jvm.options\="-Xmx1536M" -Xms256m
|
||||
propCompileSdkVersion=34
|
||||
propMinSdkVersion=21
|
||||
propTargetSdkVersion=34
|
||||
|
|
Loading…
Add table
Reference in a new issue