Merge branch 'master' of ssh://github.com/osmandapp/Osmand into MyLocationSharingMode
|
@ -7,6 +7,7 @@ import java.io.IOException;
|
|||
import java.util.Arrays;
|
||||
|
||||
import net.osmand.binary.BinaryMapIndexReader.SearchRequest;
|
||||
import net.osmand.binary.OsmandOdb.TransportRouteSchedule;
|
||||
import net.osmand.data.TransportStop;
|
||||
import net.osmand.osm.edit.Node;
|
||||
import net.osmand.osm.edit.Way;
|
||||
|
@ -307,6 +308,12 @@ public class BinaryMapTransportReaderAdapter {
|
|||
// deprecated
|
||||
// case OsmandOdb.TransportRoute.REVERSESTOPS_FIELD_NUMBER:
|
||||
// break;
|
||||
case OsmandOdb.TransportRoute.SCHEDULETRIP_FIELD_NUMBER:
|
||||
sizeL = codedIS.readRawVarint32();
|
||||
pold = codedIS.pushLimit(sizeL);
|
||||
dataObject.setSchedule(TransportRouteSchedule.parseFrom(codedIS));
|
||||
codedIS.popLimit(pold);
|
||||
break;
|
||||
case OsmandOdb.TransportRoute.DIRECTSTOPS_FIELD_NUMBER:
|
||||
if(onlyDescription){
|
||||
end = true;
|
||||
|
|
|
@ -1,7 +1,5 @@
|
|||
package net.osmand.data;
|
||||
|
||||
import gnu.trove.list.array.TIntArrayList;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.Comparator;
|
||||
|
@ -10,6 +8,7 @@ import java.util.Iterator;
|
|||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import net.osmand.binary.OsmandOdb.TransportRouteSchedule;
|
||||
import net.osmand.osm.edit.Node;
|
||||
import net.osmand.osm.edit.Way;
|
||||
import net.osmand.util.MapUtils;
|
||||
|
@ -22,11 +21,17 @@ public class TransportRoute extends MapObject {
|
|||
private Integer dist = null;
|
||||
private String color;
|
||||
private List<Way> forwardWays;
|
||||
private TransportRouteSchedule schedule;
|
||||
public static final double SAME_STOP = 25;
|
||||
|
||||
public TransportRoute(){
|
||||
}
|
||||
|
||||
public TransportRouteSchedule getSchedule() {
|
||||
return schedule;
|
||||
}
|
||||
|
||||
|
||||
public List<TransportStop> getForwardStops() {
|
||||
return forwardStops;
|
||||
}
|
||||
|
@ -197,4 +202,8 @@ public class TransportRoute extends MapObject {
|
|||
}
|
||||
return d;
|
||||
}
|
||||
|
||||
public void setSchedule(TransportRouteSchedule schedule) {
|
||||
this.schedule = schedule;
|
||||
}
|
||||
}
|
|
@ -4,7 +4,7 @@ apply plugin: 'kotlin-android'
|
|||
apply plugin: 'kotlin-android-extensions'
|
||||
|
||||
android {
|
||||
compileSdkVersion 27
|
||||
compileSdkVersion 28
|
||||
buildToolsVersion "27.0.3"
|
||||
|
||||
sourceSets {
|
||||
|
@ -135,12 +135,12 @@ dependencies {
|
|||
implementation fileTree(dir: 'libs', include: ['*.jar'])
|
||||
|
||||
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
|
||||
implementation 'com.android.support:appcompat-v7:27.1.1'
|
||||
implementation 'com.android.support:design:27.1.1'
|
||||
implementation 'com.android.support:customtabs:27.1.1'
|
||||
implementation 'com.android.support:support-annotations:27.1.1'
|
||||
implementation 'com.android.support:appcompat-v7:28.0.0-rc01'
|
||||
implementation 'com.android.support:design:28.0.0-rc01'
|
||||
implementation 'com.android.support:customtabs:28.0.0-rc01'
|
||||
implementation 'com.android.support:support-annotations:28.0.0-rc01'
|
||||
implementation 'commons-logging:commons-logging-api:1.1'
|
||||
implementation 'com.android.support:recyclerview-v7:27.1.1'
|
||||
implementation 'com.android.support:recyclerview-v7:28.0.0-rc01'
|
||||
implementation 'com.vividsolutions:jts-core:1.14.0'
|
||||
implementation("com.github.HITGIF:TextFieldBoxes:1.4.4") {
|
||||
exclude group: 'com.android.support'
|
||||
|
|
Before Width: | Height: | Size: 1.5 KiB After Width: | Height: | Size: 1.5 KiB |
Before Width: | Height: | Size: 1.5 KiB After Width: | Height: | Size: 1.5 KiB |
BIN
OsmAnd-telegram/res/drawable-hdpi/ic_logo_osmand_free.png
Normal file
After Width: | Height: | Size: 2.7 KiB |
BIN
OsmAnd-telegram/res/drawable-hdpi/ic_logo_osmand_plus.png
Normal file
After Width: | Height: | Size: 2.9 KiB |
BIN
OsmAnd-telegram/res/drawable-hdpi/img_shadow_fab_tap.9.png
Normal file
After Width: | Height: | Size: 4 KiB |
Before Width: | Height: | Size: 1.3 KiB After Width: | Height: | Size: 1.3 KiB |
Before Width: | Height: | Size: 1.3 KiB After Width: | Height: | Size: 1.3 KiB |
BIN
OsmAnd-telegram/res/drawable-mdpi/ic_logo_osmand_free.png
Normal file
After Width: | Height: | Size: 1.9 KiB |
BIN
OsmAnd-telegram/res/drawable-mdpi/ic_logo_osmand_plus.png
Normal file
After Width: | Height: | Size: 2 KiB |
Before Width: | Height: | Size: 2.8 KiB After Width: | Height: | Size: 2.9 KiB |
BIN
OsmAnd-telegram/res/drawable-mdpi/img_shadow_fab_tap.9.png
Normal file
After Width: | Height: | Size: 2.8 KiB |
Before Width: | Height: | Size: 1.8 KiB After Width: | Height: | Size: 1.7 KiB |
Before Width: | Height: | Size: 1.7 KiB After Width: | Height: | Size: 1.8 KiB |
BIN
OsmAnd-telegram/res/drawable-xhdpi/ic_logo_osmand_free.png
Normal file
After Width: | Height: | Size: 3.6 KiB |
BIN
OsmAnd-telegram/res/drawable-xhdpi/ic_logo_osmand_plus.png
Normal file
After Width: | Height: | Size: 3.8 KiB |
BIN
OsmAnd-telegram/res/drawable-xhdpi/img_shadow_fab_tap.9.png
Normal file
After Width: | Height: | Size: 5.2 KiB |
Before Width: | Height: | Size: 2.3 KiB After Width: | Height: | Size: 2.3 KiB |
Before Width: | Height: | Size: 2.3 KiB After Width: | Height: | Size: 2.4 KiB |
BIN
OsmAnd-telegram/res/drawable-xxhdpi/ic_logo_osmand_free.png
Normal file
After Width: | Height: | Size: 5 KiB |
BIN
OsmAnd-telegram/res/drawable-xxhdpi/ic_logo_osmand_plus.png
Normal file
After Width: | Height: | Size: 5.5 KiB |
BIN
OsmAnd-telegram/res/drawable-xxhdpi/img_shadow_fab_tap.9.png
Normal file
After Width: | Height: | Size: 7.8 KiB |
|
@ -2,6 +2,7 @@
|
|||
<LinearLayout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:fitsSystemWindows="true"
|
||||
|
@ -39,7 +40,8 @@
|
|||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical">
|
||||
android:orientation="vertical"
|
||||
android:paddingBottom="@dimen/list_view_bottom_padding">
|
||||
|
||||
<include layout="@layout/list_item_divider"/>
|
||||
|
||||
|
@ -99,6 +101,130 @@
|
|||
|
||||
</LinearLayout>
|
||||
|
||||
<include layout="@layout/list_item_divider"/>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="?attr/card_bg_color"
|
||||
android:orientation="vertical">
|
||||
|
||||
<net.osmand.telegram.ui.views.TextViewEx
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/list_header_height"
|
||||
android:ellipsize="end"
|
||||
android:gravity="center_vertical"
|
||||
android:maxLines="1"
|
||||
android:paddingLeft="@dimen/content_padding_standard"
|
||||
android:paddingRight="@dimen/content_padding_standard"
|
||||
android:text="@string/shared_string_account"
|
||||
android:textColor="?android:textColorPrimary"
|
||||
android:textSize="@dimen/list_item_title_text_size"
|
||||
app:typeface="@string/font_roboto_medium"/>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/user_row"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/user_icon"
|
||||
android:layout_width="@dimen/list_item_icon_size"
|
||||
android:layout_height="@dimen/list_item_icon_size"
|
||||
android:layout_marginEnd="@dimen/content_padding_standard"
|
||||
android:layout_marginLeft="@dimen/content_padding_half"
|
||||
android:layout_marginRight="@dimen/content_padding_standard"
|
||||
android:layout_marginStart="@dimen/content_padding_half"
|
||||
android:layout_marginTop="@dimen/image_button_padding"
|
||||
tools:src="@drawable/img_user_picture"/>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginEnd="@dimen/content_padding_standard"
|
||||
android:layout_marginRight="@dimen/content_padding_standard"
|
||||
android:orientation="vertical">
|
||||
|
||||
<net.osmand.telegram.ui.views.TextViewEx
|
||||
android:id="@+id/username"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:ellipsize="end"
|
||||
android:maxLines="2"
|
||||
android:textColor="?android:textColorPrimary"
|
||||
android:textSize="@dimen/list_item_title_text_size"
|
||||
app:firstBaselineToTopHeight="25sp"
|
||||
app:typeface="@string/font_roboto_regular"
|
||||
tools:text="Some user name"/>
|
||||
|
||||
<net.osmand.telegram.ui.views.TextViewEx
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:ellipsize="end"
|
||||
android:maxLines="2"
|
||||
android:text="@string/connected_account"
|
||||
android:textColor="?android:attr/textColorSecondary"
|
||||
android:textSize="@dimen/list_item_description_text_size"
|
||||
app:firstBaselineToTopHeight="20sp"
|
||||
app:lastBaselineToBottomHeight="16sp"
|
||||
app:typeface="@string/font_roboto_regular"/>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<net.osmand.telegram.ui.views.TextViewEx
|
||||
android:id="@+id/logout_btn"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/list_header_height"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:background="?attr/selectableItemBackground"
|
||||
android:ellipsize="end"
|
||||
android:gravity="center_vertical"
|
||||
android:maxLines="1"
|
||||
android:paddingLeft="@dimen/dialog_padding_horizontal"
|
||||
android:paddingRight="@dimen/dialog_padding_horizontal"
|
||||
android:text="@string/shared_string_logout"
|
||||
android:textColor="?attr/ctrl_active_color"
|
||||
app:typeface="@string/font_roboto_medium"/>
|
||||
|
||||
<View
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="1dp"
|
||||
android:background="?attr/card_divider_color"/>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/help_row"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="?attr/selectableItemBackground"
|
||||
android:gravity="center_vertical"
|
||||
android:paddingLeft="@dimen/content_padding_standard"
|
||||
android:paddingRight="@dimen/content_padding_standard">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/help_icon"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginEnd="@dimen/content_padding_big"
|
||||
android:layout_marginRight="@dimen/content_padding_big"
|
||||
tools:src="@drawable/ic_action_live_now"
|
||||
tools:tint="@color/icon_light"/>
|
||||
|
||||
<net.osmand.telegram.ui.views.TextViewEx
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/logout_help_desc"
|
||||
android:textColor="?android:textColorPrimary"
|
||||
android:textSize="@dimen/list_item_title_text_size"
|
||||
app:firstBaselineToTopHeight="25sp"
|
||||
app:lastBaselineToBottomHeight="16sp"
|
||||
app:typeface="@string/font_roboto_regular"/>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<include layout="@layout/card_bottom_divider"/>
|
||||
|
||||
</LinearLayout>
|
||||
|
|
|
@ -5,7 +5,6 @@
|
|||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="@dimen/list_item_bottom_margin"
|
||||
android:background="?attr/selectableItemBackground"
|
||||
android:paddingLeft="@dimen/content_padding_standard"
|
||||
android:paddingRight="@dimen/content_padding_standard"
|
||||
|
@ -17,6 +16,7 @@
|
|||
android:layout_height="wrap_content"
|
||||
android:layout_marginEnd="@dimen/content_padding_big"
|
||||
android:layout_marginRight="@dimen/content_padding_big"
|
||||
android:layout_marginTop="@dimen/image_button_padding"
|
||||
tools:src="@drawable/ic_action_live_now"
|
||||
tools:tint="@color/icon_light"/>
|
||||
|
||||
|
@ -33,16 +33,20 @@
|
|||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textColor="?android:textColorPrimary"
|
||||
android:textSize="@dimen/title_text_size"
|
||||
android:textSize="@dimen/list_item_title_text_size"
|
||||
app:firstBaselineToTopHeight="25sp"
|
||||
app:typeface="@string/font_roboto_regular"
|
||||
tools:text="Some title"/>
|
||||
|
||||
<TextView
|
||||
<net.osmand.telegram.ui.views.TextViewEx
|
||||
android:id="@+id/description"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textColor="?android:attr/textColorSecondary"
|
||||
android:textSize="@dimen/descr_text_size"
|
||||
android:textSize="@dimen/list_item_description_text_size"
|
||||
app:firstBaselineToTopHeight="20sp"
|
||||
app:lastBaselineToBottomHeight="16sp"
|
||||
app:typeface="@string/font_roboto_regular"
|
||||
tools:text="Some long description"/>
|
||||
|
||||
</LinearLayout>
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_height="@dimen/list_item_height"
|
||||
android:layout_marginBottom="@dimen/list_item_bottom_margin"
|
||||
android:background="?attr/selectableItemBackground"
|
||||
android:gravity="center_vertical"
|
||||
|
@ -29,14 +29,18 @@
|
|||
android:layout_marginRight="@dimen/content_padding_standard"
|
||||
android:layout_weight="1"
|
||||
android:textColor="?android:textColorPrimary"
|
||||
android:textSize="@dimen/title_text_size"
|
||||
android:textSize="@dimen/list_item_title_text_size"
|
||||
app:typeface="@string/font_roboto_regular"
|
||||
tools:text="Some title"/>
|
||||
|
||||
<RadioButton
|
||||
android:id="@+id/radio_button"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"/>
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@null"
|
||||
android:clickable="false"
|
||||
android:focusable="false"
|
||||
android:saveEnabled="false"/>
|
||||
|
||||
<include
|
||||
layout="@layout/primary_btn"
|
||||
|
|
|
@ -1,4 +1,7 @@
|
|||
<resources>
|
||||
<string name="logout_help_desc">How to disconnect OsmAnd Location Sharing from Telegram</string>
|
||||
<string name="connected_account">Connected account</string>
|
||||
<string name="shared_string_account">Account</string>
|
||||
<string name="in_time">in %1$s</string>
|
||||
<string name="osmand_connect">OsmAnd connect</string>
|
||||
<string name="location_history_desc">Hide contacts that are not updated their location after the specified period of time.</string>
|
||||
|
|
|
@ -88,6 +88,17 @@ object TelegramUiHelper {
|
|||
else -> 0
|
||||
}
|
||||
|
||||
fun getUserName(user: TdApi.User): String {
|
||||
var name = "${user.firstName} ${user.lastName}".trim()
|
||||
if (name.isEmpty()) {
|
||||
name = user.username
|
||||
}
|
||||
if (name.isEmpty()) {
|
||||
name = user.phoneNumber
|
||||
}
|
||||
return name
|
||||
}
|
||||
|
||||
fun messageToLocationItem(
|
||||
helper: TelegramHelper,
|
||||
chat: TdApi.Chat,
|
||||
|
@ -129,13 +140,7 @@ object TelegramUiHelper {
|
|||
return LocationItem().apply {
|
||||
chatId = chat.id
|
||||
chatTitle = chat.title
|
||||
name = "${user.firstName} ${user.lastName}".trim()
|
||||
if (name.isEmpty()) {
|
||||
name = user.username
|
||||
}
|
||||
if (name.isEmpty()) {
|
||||
name = user.phoneNumber
|
||||
}
|
||||
name = TelegramUiHelper.getUserName(user)
|
||||
latLon = LatLon(content.location.latitude, content.location.longitude)
|
||||
photoPath = helper.getUserPhotoPath(user)
|
||||
placeholderId = R.drawable.img_user_picture
|
||||
|
|
|
@ -65,7 +65,7 @@ class LiveNowTabFragment : Fragment(), TelegramListener, TelegramIncomingMessage
|
|||
layoutManager = LinearLayoutManager(context)
|
||||
adapter = this@LiveNowTabFragment.adapter
|
||||
addOnScrollListener(object : RecyclerView.OnScrollListener() {
|
||||
override fun onScrollStateChanged(recyclerView: RecyclerView?, newState: Int) {
|
||||
override fun onScrollStateChanged(recyclerView: RecyclerView, newState: Int) {
|
||||
super.onScrollStateChanged(recyclerView, newState)
|
||||
locationUiUpdateAllowed = newState == RecyclerView.SCROLL_STATE_IDLE
|
||||
when (newState) {
|
||||
|
@ -110,6 +110,7 @@ class LiveNowTabFragment : Fragment(), TelegramListener, TelegramIncomingMessage
|
|||
TelegramAuthorizationState.READY -> {
|
||||
updateList()
|
||||
}
|
||||
TelegramAuthorizationState.LOGGING_OUT,
|
||||
TelegramAuthorizationState.CLOSED,
|
||||
TelegramAuthorizationState.UNKNOWN -> {
|
||||
adapter.items = emptyList()
|
||||
|
|
|
@ -94,7 +94,7 @@ class MyLocationTabFragment : Fragment(), TelegramListener, ChatLiveMessagesList
|
|||
appBarOutlineProvider = outlineProvider
|
||||
outlineProvider = null
|
||||
}
|
||||
addOnOffsetChangedListener { appBar, offset ->
|
||||
addOnOffsetChangedListener(AppBarLayout.OnOffsetChangedListener { appBar, offset ->
|
||||
if (appBarScrollRange == -1) {
|
||||
appBarScrollRange = appBar.totalScrollRange
|
||||
}
|
||||
|
@ -105,7 +105,7 @@ class MyLocationTabFragment : Fragment(), TelegramListener, ChatLiveMessagesList
|
|||
adjustAppbar()
|
||||
optionsBtn.visibility = if (collapsed) View.VISIBLE else View.GONE
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
userImage = mainView.findViewById<ImageView>(R.id.my_location_user_image).apply {
|
||||
|
@ -207,6 +207,7 @@ class MyLocationTabFragment : Fragment(), TelegramListener, ChatLiveMessagesList
|
|||
TelegramHelper.TelegramAuthorizationState.READY -> {
|
||||
updateContent()
|
||||
}
|
||||
TelegramHelper.TelegramAuthorizationState.LOGGING_OUT,
|
||||
TelegramHelper.TelegramAuthorizationState.CLOSED,
|
||||
TelegramHelper.TelegramAuthorizationState.UNKNOWN -> {
|
||||
adapter.chats = mutableListOf()
|
||||
|
|
|
@ -11,13 +11,12 @@ import android.view.Gravity
|
|||
import android.view.LayoutInflater
|
||||
import android.view.View
|
||||
import android.view.ViewGroup
|
||||
import android.widget.ArrayAdapter
|
||||
import android.widget.ImageView
|
||||
import android.widget.TextView
|
||||
import android.widget.Toast
|
||||
import android.widget.*
|
||||
import net.osmand.telegram.R
|
||||
import net.osmand.telegram.TelegramApplication
|
||||
import net.osmand.telegram.helpers.OsmandAidlHelper
|
||||
import net.osmand.telegram.helpers.TelegramHelper
|
||||
import net.osmand.telegram.helpers.TelegramUiHelper
|
||||
import net.osmand.telegram.utils.AndroidUtils
|
||||
import net.osmand.telegram.utils.OsmandFormatter
|
||||
|
||||
|
@ -66,13 +65,62 @@ class SettingsDialogFragment : DialogFragment() {
|
|||
|
||||
container = mainView.findViewById(R.id.osmand_connect_container)
|
||||
for (appConn in AppConnect.values()) {
|
||||
val pack = appConn.appPackage
|
||||
val installed = AndroidUtils.isAppInstalled(context!!, pack)
|
||||
inflater.inflate(R.layout.item_with_rb_and_btn, container, false).apply {
|
||||
findViewById<ImageView>(R.id.icon).setImageDrawable(uiUtils.getThemedIcon(appConn.iconId))
|
||||
findViewById<ImageView>(R.id.icon).setImageDrawable(uiUtils.getIcon(appConn.iconId))
|
||||
findViewById<TextView>(R.id.title).text = appConn.title
|
||||
// FIXME
|
||||
if (installed) {
|
||||
findViewById<View>(R.id.primary_btn).visibility = View.GONE
|
||||
findViewById<RadioButton>(R.id.radio_button).visibility = View.VISIBLE
|
||||
setOnClickListener {
|
||||
// FIXME
|
||||
updateSelectedAppConn()
|
||||
}
|
||||
} else {
|
||||
findViewById<RadioButton>(R.id.radio_button).visibility = View.GONE
|
||||
findViewById<TextView>(R.id.primary_btn).apply {
|
||||
setText(R.string.shared_string_install)
|
||||
setOnClickListener {
|
||||
context?.also { ctx ->
|
||||
startActivity(AndroidUtils.getPlayMarketIntent(ctx, pack))
|
||||
}
|
||||
}
|
||||
}
|
||||
setOnClickListener(null)
|
||||
isClickable = false
|
||||
}
|
||||
tag = pack
|
||||
container.addView(this)
|
||||
}
|
||||
}
|
||||
updateSelectedAppConn()
|
||||
|
||||
val user = telegramHelper.getCurrentUser()
|
||||
if (user != null) {
|
||||
TelegramUiHelper.setupPhoto(
|
||||
app,
|
||||
mainView.findViewById(R.id.user_icon),
|
||||
telegramHelper.getUserPhotoPath(user),
|
||||
R.drawable.img_user_picture,
|
||||
false
|
||||
)
|
||||
mainView.findViewById<TextView>(R.id.username).text = TelegramUiHelper.getUserName(user)
|
||||
} else {
|
||||
mainView.findViewById<View>(R.id.user_row).visibility = View.GONE
|
||||
}
|
||||
|
||||
mainView.findViewById<View>(R.id.logout_btn).setOnClickListener {
|
||||
logoutTelegram()
|
||||
dismiss()
|
||||
}
|
||||
|
||||
mainView.findViewById<ImageView>(R.id.help_icon)
|
||||
.setImageDrawable(uiUtils.getActiveIcon(R.drawable.ic_action_share_location))
|
||||
mainView.findViewById<View>(R.id.help_row).setOnClickListener {
|
||||
// FIXME
|
||||
Toast.makeText(context, "Logout help", Toast.LENGTH_SHORT).show()
|
||||
}
|
||||
|
||||
return mainView
|
||||
}
|
||||
|
@ -95,6 +143,24 @@ class SettingsDialogFragment : DialogFragment() {
|
|||
}
|
||||
}
|
||||
|
||||
private fun updateSelectedAppConn() {
|
||||
view?.findViewById<ViewGroup>(R.id.osmand_connect_container)?.apply {
|
||||
for (i in 0..childCount) {
|
||||
getChildAt(i).apply {
|
||||
// FIXME
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private fun logoutTelegram(silent: Boolean = false) {
|
||||
if (telegramHelper.getTelegramAuthorizationState() == TelegramHelper.TelegramAuthorizationState.READY) {
|
||||
telegramHelper.logout()
|
||||
} else if (!silent) {
|
||||
Toast.makeText(context, R.string.not_logged_in, Toast.LENGTH_SHORT).show()
|
||||
}
|
||||
}
|
||||
|
||||
// FIXME
|
||||
private inner class SendMyLocPref : DurationPref(
|
||||
R.drawable.ic_action_share_location,
|
||||
|
@ -163,12 +229,12 @@ class SettingsDialogFragment : DialogFragment() {
|
|||
val appPackage: String
|
||||
) {
|
||||
OSMAND_PLUS(
|
||||
R.drawable.ic_action_osmand_plus,
|
||||
R.drawable.ic_logo_osmand_plus,
|
||||
"OsmAnd+",
|
||||
OsmandAidlHelper.OSMAND_PLUS_PACKAGE_NAME
|
||||
),
|
||||
OSMAND_FREE(
|
||||
R.drawable.ic_action_osmand_free,
|
||||
R.drawable.ic_logo_osmand_free,
|
||||
"OsmAnd",
|
||||
OsmandAidlHelper.OSMAND_FREE_PACKAGE_NAME
|
||||
)
|
||||
|
|
|
@ -95,6 +95,10 @@ class UiUtils(private val app: TelegramApplication) {
|
|||
return getDrawable(id, if (isLightContent) R.color.icon_light else 0)
|
||||
}
|
||||
|
||||
fun getActiveIcon(@DrawableRes id: Int): Drawable? {
|
||||
return getDrawable(id, if (isLightContent) R.color.ctrl_active_light else 0)
|
||||
}
|
||||
|
||||
fun getIcon(@DrawableRes id: Int): Drawable? {
|
||||
return getDrawable(id, 0)
|
||||
}
|
||||
|
|
|
@ -3009,4 +3009,5 @@ Abasta l\'àrea: %1$s x %2$s</string>
|
|||
<string name="poi_cannot_be_found">No es pot trobar el node o la via.</string>
|
||||
<string name="search_no_results_feedback">Cap resultat en la cerca?
|
||||
\nComenteu-nos-ho</string>
|
||||
</resources>
|
||||
<string name="test_voice_desrc">Premeu un botó i escolteu la corresponent descripció de veu per identificar les descripcions pendents o errònies.</string>
|
||||
</resources>
|
||||
|
|
|
@ -3194,4 +3194,5 @@ Repræsenterer område: %1$s x %2$s</string>
|
|||
<string name="poi_cannot_be_found">Node eller vej kan ikke findes.</string>
|
||||
<string name="search_no_results_feedback">Ingen søgeresultater?
|
||||
\nGiv tilbagemelding</string>
|
||||
</resources>
|
||||
<string name="test_voice_desrc">Tryk på en knap og lyt til den tilsvarende taletekst for at identificere manglende eller fejlagtige henvisninger.</string>
|
||||
</resources>
|
||||
|
|
|
@ -2743,7 +2743,7 @@ Indikas lokon: %1$s x %2$s"</string>
|
|||
<string name="one_tap_active_descr">Per frapeti markon sur la mapo, movi ĝin al komenco de la listo senmalfermante kuntekstan menuon.</string>
|
||||
<string name="one_tap_active">Aktivigi per unu frapeto</string>
|
||||
<string name="empty_state_av_notes">Fari notojn!</string>
|
||||
<string name="empty_state_av_notes_desc">Aldoni sonajn, videajn aŭ fotajn notojn al iu ajn punkto sur la mapo per la fenestraĵo aŭ kunteksta menuo.</string>
|
||||
<string name="empty_state_av_notes_desc">Aldonu sonajn, videajn aŭ fotajn notojn al iu ajn punkto sur la mapo per la fenestraĵo aŭ kunteksta menuo.</string>
|
||||
<string name="notes_by_date">Notoj laŭ dato</string>
|
||||
<string name="by_date">Laŭ dato</string>
|
||||
<string name="by_type">Laŭ speco</string>
|
||||
|
@ -2963,4 +2963,5 @@ Indikas lokon: %1$s x %2$s"</string>
|
|||
<string name="poi_cannot_be_found">Ne povis trovi nodon aŭ linion.</string>
|
||||
<string name="search_no_results_feedback">Neniuj serĉ-rezultoj?
|
||||
\nSciigu nin</string>
|
||||
</resources>
|
||||
<string name="test_voice_desrc">Premu butonon kaj aŭskultu rilatan voĉan sciigon por identigi mankajn aŭ erarajn sciigojn.</string>
|
||||
</resources>
|
||||
|
|
|
@ -3000,4 +3000,5 @@ Lon %2$s</string>
|
|||
<string name="poi_cannot_be_found">No se puede encontrar el nodo o la vía.</string>
|
||||
<string name="search_no_results_feedback">¿Sin resultados de búsqueda?
|
||||
\nDanos tu opinión</string>
|
||||
</resources>
|
||||
<string name="test_voice_desrc">Pulsa un botón y escucha el aviso de voz correspondiente para identificar avisos faltantes o defectuosos.</string>
|
||||
</resources>
|
||||
|
|
|
@ -3143,4 +3143,5 @@ Area honi dagokio: %1$s x %2$s</string>
|
|||
\n
|
||||
\n</string>
|
||||
<string name="commiting_way">Bidea betetzen…</string>
|
||||
</resources>
|
||||
<string name="test_voice_desrc">Sakatu botoi bat eta entzun dagokion ahots-deskripzioa falta diren edo gaizki dauden deskripzioan antzemateko.</string>
|
||||
</resources>
|
||||
|
|
|
@ -3052,4 +3052,7 @@
|
|||
\n
|
||||
\n• Andre feilrettinger
|
||||
\n</string>
|
||||
</resources>
|
||||
<string name="commiting_way">Sender inn vei…</string>
|
||||
<string name="send_search_query_description">Ditt søk <b>\"%1$s\"</b>, vil bli sent inn sammen med din plassering.<br/><br/> Ingen personvernsinfo samles inn, søkedata trengs kun til forbedring av søket.<br/></string>
|
||||
<string name="test_voice_desrc">Trykk på en knapp og hør på tilhørende stemmeveiledning for å identifisere manglende eller feilaktige veiledninger.</string>
|
||||
</resources>
|
||||
|
|
|
@ -3130,4 +3130,5 @@ Pro praghere iscrie su còdighe intreu</string>
|
|||
<string name="search_no_results_feedback">Perunu risultadu de chirca?
|
||||
\nDaghe·nos s\'opinione tua</string>
|
||||
<string name="commiting_way">Imbiende sa bia…</string>
|
||||
</resources>
|
||||
<string name="test_voice_desrc">Toca unu butone e ascurta su cummandu vocale chi li currispondet, pro identificare cummandos chi mancant o chi sunt isballiados.</string>
|
||||
</resources>
|
||||
|
|
|
@ -1543,4 +1543,20 @@
|
|||
<string name="poi_garden_furniture">Продавница баштенског намештаја</string>
|
||||
<string name="poi_shop_yes">Општа продавница</string>
|
||||
<string name="poi_glaziery">Стаклара</string>
|
||||
<string name="poi_hardware">Гвожђара</string>
|
||||
<string name="poi_herbalist">Продавница биља</string>
|
||||
<string name="poi_houseware">Продавница кућних потребштина</string>
|
||||
<string name="poi_kitchen">Кухињски намештај</string>
|
||||
<string name="poi_medical_supply">Медицинска достава</string>
|
||||
<string name="poi_outdoor">Продавница спољње опреме</string>
|
||||
<string name="poi_radiotechnics">Радиотехничка продавница</string>
|
||||
<string name="poi_ship_chandler">Бродска опрема</string>
|
||||
<string name="poi_stationery">Продавница канцеларијске опреме</string>
|
||||
<string name="poi_tableware">Продавница прибора за јело</string>
|
||||
<string name="poi_trade">Трговачки терминал</string>
|
||||
<string name="poi_variety_store">Продавница мешане робе</string>
|
||||
<string name="poi_window_blind">Продавница прозорских застора</string>
|
||||
<string name="poi_department_store">Робна кућа</string>
|
||||
<string name="poi_energy">Енергетско одељење</string>
|
||||
<string name="poi_car">Продавница аута</string>
|
||||
</resources>
|
||||
|
|
|
@ -2992,4 +2992,5 @@
|
|||
\n
|
||||
\n</string>
|
||||
<string name="commiting_way">Предајем пут…</string>
|
||||
</resources>
|
||||
<string name="test_voice_desrc">Кликните дугме и слушајте одговарајуће гласовно навођење да би препознали недостајајућа или погрешна навођења.</string>
|
||||
</resources>
|
||||
|
|