Merge branch 'r3.3'

This commit is contained in:
Chumva 2019-04-11 18:25:41 +03:00
commit a539ed0952
7 changed files with 23 additions and 71 deletions

View file

@ -1,21 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item>
<shape android:shape="rectangle">
<gradient
android:angle="0"
android:centerColor="#00ffffff"
android:centerX="0.2"
android:startColor="@color/card_bg_light" />
</shape>
</item>
<item>
<shape android:shape="rectangle">
<gradient
android:angle="180"
android:centerColor="#00ffffff"
android:centerX="0.2"
android:startColor="@color/card_bg_light" />
</shape>
</item>
</layer-list>

View file

@ -6,42 +6,13 @@
android:gravity="center_horizontal"
android:orientation="vertical">
<FrameLayout
android:id="@+id/empty_state_image_container"
android:layout_width="match_parent"
android:layout_height="@dimen/my_location_image_height"
android:layout_marginBottom="16dp"
android:foreground="@drawable/gradient_both_sides_light">
<ImageView
android:id="@+id/empty_state_background"
android:id="@+id/empty_state_background_image"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="@dimen/content_padding_standard"
android:scaleType="center"
android:src="@drawable/img_my_location_roadbg" />
<FrameLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:layout_marginTop="@dimen/content_padding_standard">
<ImageView
android:id="@+id/empty_state_placeholder"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/img_my_location_user" />
<ImageView
android:id="@+id/empty_state_user_icon"
android:layout_width="@dimen/my_location_user_icon_size"
android:layout_height="@dimen/my_location_user_icon_size"
android:layout_gravity="center"
android:src="@drawable/img_user_placeholder" />
</FrameLayout>
</FrameLayout>
android:src="@drawable/img_empty_state_search" />
<net.osmand.telegram.ui.views.TextViewEx
android:layout_width="wrap_content"
@ -56,8 +27,8 @@
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="68dp"
android:layout_marginRight="68dp"
android:layout_marginLeft="@dimen/empty_state_descr_margin"
android:layout_marginRight="@dimen/empty_state_descr_margin"
android:background="@null"
android:gravity="center"
android:text="@string/search_contacts_descr"

View file

@ -60,6 +60,7 @@
<dimen name="disable_sharing_icon_top_margin">30dp</dimen>
<dimen name="search_box_height">48dp</dimen>
<dimen name="empty_state_descr_margin">68dp</dimen>
<dimen name="buttons_bottom_bar_height">56dp</dimen>

View file

@ -2,8 +2,6 @@ package net.osmand.telegram.ui
import android.annotation.SuppressLint
import android.content.Intent
import android.graphics.ColorMatrix
import android.graphics.ColorMatrixColorFilter
import android.os.Bundle
import android.support.v4.app.Fragment
import android.support.v4.app.FragmentManager
@ -43,7 +41,7 @@ class SearchDialogFragment : BaseDialogFragment(), TelegramHelper.TelegramSearch
private lateinit var locationViewCache: UiUtils.UpdateLocationViewCache
private lateinit var searchBox: EditText
private lateinit var searchEditText: EditText
private lateinit var buttonsBar: LinearLayout
private var searchedChatsIds = mutableSetOf<Long>()
@ -74,7 +72,7 @@ class SearchDialogFragment : BaseDialogFragment(), TelegramHelper.TelegramSearch
setNavigationOnClickListener { dismiss() }
}
searchBox = mainView.findViewById<EditText>(R.id.searchEditText).apply {
searchEditText = mainView.findViewById<EditText>(R.id.searchEditText).apply {
addTextChangedListener(object : TextWatcher {
override fun onTextChanged(s: CharSequence, start: Int, before: Int, count: Int) {}
@ -111,13 +109,6 @@ class SearchDialogFragment : BaseDialogFragment(), TelegramHelper.TelegramSearch
})
}
val matrix = ColorMatrix()
matrix.setSaturation(0f)
val filter = ColorMatrixColorFilter(matrix)
mainView.findViewById<ImageView>(R.id.empty_state_background).colorFilter = filter
mainView.findViewById<ImageView>(R.id.empty_state_placeholder).colorFilter = filter
buttonsBar = mainView.findViewById<LinearLayout>(R.id.buttons_bar).apply {
findViewById<TextView>(R.id.primary_btn).apply {
text = getString(R.string.shared_string_continue)
@ -162,6 +153,8 @@ class SearchDialogFragment : BaseDialogFragment(), TelegramHelper.TelegramSearch
telegramHelper.addSearchListener(this)
locationViewCache = app.uiUtils.getUpdateLocationViewCache()
startLocationUpdate()
searchEditText.requestFocus()
AndroidUtils.softKeyboardDelayed(searchEditText)
}
override fun onPause() {

View file

@ -87,7 +87,7 @@
<TextView
android:id="@+id/distance_to_center_text_view"
android:layout_width="wrap_content"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_toEndOf="@id/measurement_points_text_view"
@ -96,6 +96,7 @@
android:layout_toStartOf="@id/up_down_button"
android:textColor="@color/color_distance"
android:textSize="@dimen/default_list_text_size"
android:maxLines="1"
tools:text=" 700 m"/>
<TextView

View file

@ -51,6 +51,7 @@ public class PerformLiveUpdateAsyncTask
final OsmandApplication myApplication = getMyApplication();
OsmandSettings.CommonPreference<Long> lastCheckPreference =
LiveUpdatesHelper.preferenceLastCheck(localIndexFileName, myApplication.getSettings());
LOG.debug(String.format("Last update check for %1s -> %2$d, current check time: %3$d", localIndexFileName, lastCheckPreference.get(), System.currentTimeMillis()));
lastCheckPreference.set(System.currentTimeMillis());
}
@ -91,6 +92,7 @@ public class PerformLiveUpdateAsyncTask
iu.timestamp, iu.sizeText, iu.contentSize,
iu.containerSize, DownloadActivityType.LIVE_UPDATES_FILE);
itemsToDownload.add(indexItem);
LOG.debug(String.format("Filename %1$s -> server timestamp: %2$s, content size: %3$s", iu.fileName, iu.timestamp, iu.contentSize));
}
DownloadIndexesThread downloadThread = application.getDownloadThread();
if (context instanceof DownloadIndexesThread.DownloadEvents) {

View file

@ -14,6 +14,7 @@ import android.support.annotation.Nullable;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.content.ContextCompat;
import android.support.v4.widget.TextViewCompat;
import android.support.v7.app.AlertDialog;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
@ -21,6 +22,7 @@ import android.support.v7.widget.SwitchCompat;
import android.support.v7.widget.helper.ItemTouchHelper;
import android.text.Editable;
import android.text.TextWatcher;
import android.util.TypedValue;
import android.view.ContextThemeWrapper;
import android.view.LayoutInflater;
import android.view.View;
@ -363,7 +365,10 @@ public class MeasurementToolFragment extends BaseOsmAndFragment {
public void onMeasure(float distance, float bearing) {
String distStr = OsmAndFormatter.getFormattedDistance(distance, mapActivity.getMyApplication());
String azimuthStr = OsmAndFormatter.getFormattedAzimuth(bearing, getMyApplication());
distanceToCenterTv.setText(String.format(" %s • %s", distStr, azimuthStr));
distanceToCenterTv.setText(String.format(" %1$s • %2$s", distStr, azimuthStr));
TextViewCompat.setAutoSizeTextTypeUniformWithConfiguration(
distanceToCenterTv, 12, 18, 2, TypedValue.COMPLEX_UNIT_SP
);
}
});