mirror of
https://github.com/SimpleMobileTools/Simple-SMS-Messenger.git
synced 2025-01-30 09:04:50 +01:00
Merge branch 'SimpleMobileTools:master' into rewrite_sms
This commit is contained in:
commit
e9ad798e5e
@ -1,6 +1,13 @@
|
||||
Changelog
|
||||
==========
|
||||
|
||||
Version 5.17.0 *(2023-01-03)*
|
||||
----------------------------
|
||||
|
||||
* Use Material You theme by default on Android 12+
|
||||
* Increased minimal required Android OS version to 6
|
||||
* Added some UI, translation and stability improvements
|
||||
|
||||
Version 5.16.6 *(2022-12-14)*
|
||||
----------------------------
|
||||
|
||||
|
@ -16,8 +16,8 @@ android {
|
||||
applicationId "com.simplemobiletools.smsmessenger"
|
||||
minSdkVersion 23
|
||||
targetSdkVersion 33
|
||||
versionCode 67
|
||||
versionName "5.16.6"
|
||||
versionCode 68
|
||||
versionName "5.17.0"
|
||||
setProperty("archivesBaseName", "sms-messenger")
|
||||
}
|
||||
|
||||
@ -63,7 +63,7 @@ android {
|
||||
}
|
||||
|
||||
dependencies {
|
||||
implementation 'com.github.SimpleMobileTools:Simple-Commons:16633112b0'
|
||||
implementation 'com.github.SimpleMobileTools:Simple-Commons:afaa7603d1'
|
||||
implementation 'org.greenrobot:eventbus:3.3.1'
|
||||
implementation 'com.github.tibbi:IndicatorFastScroll:4524cd0b61'
|
||||
implementation 'com.github.tibbi:android-smsmms:33fcaf94d9'
|
||||
|
@ -33,7 +33,6 @@ import com.simplemobiletools.smsmessenger.models.Events
|
||||
import com.simplemobiletools.smsmessenger.models.Message
|
||||
import com.simplemobiletools.smsmessenger.models.SearchResult
|
||||
import kotlinx.android.synthetic.main.activity_main.*
|
||||
import kotlinx.android.synthetic.main.menu_search.view.*
|
||||
import org.greenrobot.eventbus.EventBus
|
||||
import org.greenrobot.eventbus.Subscribe
|
||||
import org.greenrobot.eventbus.ThreadMode
|
||||
@ -139,7 +138,7 @@ class MainActivity : SimpleActivity() {
|
||||
}
|
||||
|
||||
private fun setupOptionsMenu() {
|
||||
main_menu.top_toolbar.inflateMenu(R.menu.menu_main)
|
||||
main_menu.getToolbar().inflateMenu(R.menu.menu_main)
|
||||
main_menu.setupMenu()
|
||||
main_menu.onSearchOpenListener = {
|
||||
search_holder.fadeIn()
|
||||
@ -159,7 +158,7 @@ class MainActivity : SimpleActivity() {
|
||||
searchTextChanged(text)
|
||||
}
|
||||
|
||||
main_menu.top_toolbar.setOnMenuItemClickListener { menuItem ->
|
||||
main_menu.getToolbar().setOnMenuItemClickListener { menuItem ->
|
||||
when (menuItem.itemId) {
|
||||
R.id.import_messages -> tryImportMessages()
|
||||
R.id.export_messages -> tryToExportMessages()
|
||||
@ -173,7 +172,7 @@ class MainActivity : SimpleActivity() {
|
||||
}
|
||||
|
||||
private fun refreshMenuItems() {
|
||||
main_menu.top_toolbar.menu.apply {
|
||||
main_menu.getToolbar().menu.apply {
|
||||
findItem(R.id.more_apps_from_us).isVisible = !resources.getBoolean(R.bool.hide_google_relations)
|
||||
}
|
||||
}
|
||||
|
@ -1,71 +0,0 @@
|
||||
package com.simplemobiletools.smsmessenger.views
|
||||
|
||||
import android.app.Activity
|
||||
import android.content.Context
|
||||
import android.util.AttributeSet
|
||||
import com.google.android.material.appbar.AppBarLayout
|
||||
import com.simplemobiletools.commons.extensions.*
|
||||
import com.simplemobiletools.commons.helpers.LOWER_ALPHA
|
||||
import com.simplemobiletools.commons.helpers.MEDIUM_ALPHA
|
||||
import com.simplemobiletools.smsmessenger.R
|
||||
import com.simplemobiletools.smsmessenger.activities.SimpleActivity
|
||||
import kotlinx.android.synthetic.main.menu_search.view.*
|
||||
|
||||
class MySearchMenu(context: Context, attrs: AttributeSet) : AppBarLayout(context, attrs) {
|
||||
var isSearchOpen = false
|
||||
var onSearchOpenListener: (() -> Unit)? = null
|
||||
var onSearchClosedListener: (() -> Unit)? = null
|
||||
var onSearchTextChangedListener: ((text: String) -> Unit)? = null
|
||||
|
||||
init {
|
||||
inflate(context, R.layout.menu_search, this)
|
||||
}
|
||||
|
||||
fun setupMenu() {
|
||||
top_toolbar_search_icon.setOnClickListener {
|
||||
if (isSearchOpen) {
|
||||
closeSearch()
|
||||
} else {
|
||||
top_toolbar_search.requestFocus()
|
||||
(context as? Activity)?.showKeyboard(top_toolbar_search)
|
||||
}
|
||||
}
|
||||
|
||||
top_toolbar_search.setOnFocusChangeListener { v, hasFocus ->
|
||||
if (hasFocus) {
|
||||
openSearch()
|
||||
}
|
||||
}
|
||||
|
||||
top_toolbar_search.onTextChangeListener {
|
||||
onSearchTextChangedListener?.invoke(it)
|
||||
}
|
||||
}
|
||||
|
||||
private fun openSearch() {
|
||||
isSearchOpen = true
|
||||
onSearchOpenListener?.invoke()
|
||||
top_toolbar_search_icon.setImageResource(R.drawable.ic_arrow_left_vector)
|
||||
}
|
||||
|
||||
fun closeSearch() {
|
||||
isSearchOpen = false
|
||||
onSearchClosedListener?.invoke()
|
||||
top_toolbar_search.setText("")
|
||||
top_toolbar_search_icon.setImageResource(R.drawable.ic_search_vector)
|
||||
(context as? Activity)?.hideKeyboard()
|
||||
}
|
||||
|
||||
fun updateColors() {
|
||||
val backgroundColor = context.getProperBackgroundColor()
|
||||
val contrastColor = backgroundColor.getContrastColor()
|
||||
|
||||
setBackgroundColor(backgroundColor)
|
||||
top_app_bar_layout.setBackgroundColor(backgroundColor)
|
||||
top_toolbar_search_icon.applyColorFilter(contrastColor)
|
||||
top_toolbar_holder.background?.applyColorFilter(context.getProperPrimaryColor().adjustAlpha(LOWER_ALPHA))
|
||||
top_toolbar_search.setTextColor(contrastColor)
|
||||
top_toolbar_search.setHintTextColor(contrastColor.adjustAlpha(MEDIUM_ALPHA))
|
||||
(context as? SimpleActivity)?.updateTopBarColors(top_toolbar, backgroundColor)
|
||||
}
|
||||
}
|
@ -5,7 +5,7 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<com.simplemobiletools.smsmessenger.views.MySearchMenu
|
||||
<com.simplemobiletools.commons.views.MySearchMenu
|
||||
android:id="@+id/main_menu"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content" />
|
||||
|
@ -1,49 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<com.google.android.material.appbar.AppBarLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:id="@+id/top_app_bar_layout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="?attr/actionBarSize"
|
||||
android:layout_marginStart="@dimen/activity_margin"
|
||||
android:layout_marginEnd="@dimen/activity_margin"
|
||||
app:layout_scrollFlags="enterAlways|scroll">
|
||||
|
||||
<RelativeLayout
|
||||
android:id="@+id/top_toolbar_holder"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/medium_margin"
|
||||
android:layout_marginBottom="@dimen/medium_margin"
|
||||
android:background="@drawable/search_menu_background">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/top_toolbar_search_icon"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_centerVertical="true"
|
||||
android:paddingStart="@dimen/activity_margin"
|
||||
android:src="@drawable/ic_search_vector" />
|
||||
|
||||
<EditText
|
||||
android:id="@+id/top_toolbar_search"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_centerVertical="true"
|
||||
android:layout_toStartOf="@+id/top_toolbar"
|
||||
android:layout_toEndOf="@+id/top_toolbar_search_icon"
|
||||
android:background="@null"
|
||||
android:gravity="start|center_vertical"
|
||||
android:hint="@string/search"
|
||||
android:paddingStart="@dimen/activity_margin"
|
||||
android:textSize="@dimen/big_text_size" />
|
||||
|
||||
<com.google.android.material.appbar.MaterialToolbar
|
||||
android:id="@+id/top_toolbar"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_alignParentEnd="true"
|
||||
android:layout_marginEnd="@dimen/small_margin"
|
||||
app:titleTextAppearance="@style/AppTheme.ActionBar.TitleTextStyle" />
|
||||
|
||||
</RelativeLayout>
|
||||
</com.google.android.material.appbar.AppBarLayout>
|
@ -2,20 +2,23 @@
|
||||
<menu 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"
|
||||
tools:ignore="AppCompatResource">
|
||||
tools:ignore="AppCompatResource,AlwaysShowAction">
|
||||
<item
|
||||
android:id="@+id/cab_delete"
|
||||
android:icon="@drawable/ic_delete_vector"
|
||||
android:showAsAction="always"
|
||||
android:title="@string/delete"
|
||||
app:showAsAction="always" />
|
||||
<item
|
||||
android:id="@+id/cab_add_number_to_contact"
|
||||
android:icon="@drawable/ic_add_person_vector"
|
||||
android:showAsAction="always"
|
||||
android:title="@string/add_number_to_contact"
|
||||
app:showAsAction="always" />
|
||||
<item
|
||||
android:id="@+id/cab_dial_number"
|
||||
android:icon="@drawable/ic_phone_vector"
|
||||
android:showAsAction="always"
|
||||
android:title="@string/dial_number"
|
||||
app:showAsAction="always" />
|
||||
<item
|
||||
|
@ -2,20 +2,23 @@
|
||||
<menu 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"
|
||||
tools:ignore="AppCompatResource">
|
||||
tools:ignore="AppCompatResource,AlwaysShowAction">
|
||||
<item
|
||||
android:id="@+id/cab_copy_to_clipboard"
|
||||
android:icon="@drawable/ic_copy_vector"
|
||||
android:showAsAction="always"
|
||||
android:title="@string/copy_to_clipboard"
|
||||
app:showAsAction="always" />
|
||||
<item
|
||||
android:id="@+id/cab_share"
|
||||
android:icon="@drawable/ic_share_vector"
|
||||
android:showAsAction="always"
|
||||
android:title="@string/share"
|
||||
app:showAsAction="always" />
|
||||
<item
|
||||
android:id="@+id/cab_delete"
|
||||
android:icon="@drawable/ic_delete_vector"
|
||||
android:showAsAction="always"
|
||||
android:title="@string/delete"
|
||||
app:showAsAction="always" />
|
||||
<item
|
||||
|
3
fastlane/metadata/android/en-US/changelogs/68.txt
Normal file
3
fastlane/metadata/android/en-US/changelogs/68.txt
Normal file
@ -0,0 +1,3 @@
|
||||
* Use Material You theme by default on Android 12+
|
||||
* Increased minimal required Android OS version to 6
|
||||
* Added some UI, translation and stability improvements
|
Loading…
x
Reference in New Issue
Block a user