mirror of
https://github.com/nextcloud/talk-android
synced 2025-06-20 12:09:45 +01:00
Add licence headers and optimize/theme translation layout
Signed-off-by: Andy Scherzinger <info@andy-scherzinger.de>
This commit is contained in:
parent
5bc0f82398
commit
ac0f8608a7
@ -3239,7 +3239,6 @@ class ChatActivity :
|
|||||||
val intent = Intent(this, TranslateActivity::class.java)
|
val intent = Intent(this, TranslateActivity::class.java)
|
||||||
intent.putExtras(bundle)
|
intent.putExtras(bundle)
|
||||||
startActivity(intent)
|
startActivity(intent)
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun hasVisibleItems(message: ChatMessage): Boolean {
|
private fun hasVisibleItems(message: ChatMessage): Boolean {
|
||||||
|
@ -1,3 +1,22 @@
|
|||||||
|
/*
|
||||||
|
* Nextcloud Talk application
|
||||||
|
*
|
||||||
|
* @author Julius Linus
|
||||||
|
* Copyright (C) 2023 Julius Linus <julius.linus@nextcloud.com>
|
||||||
|
*
|
||||||
|
* This program is free software: you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation, either version 3 of the License, or
|
||||||
|
* at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
package com.nextcloud.talk.models.json.translations
|
package com.nextcloud.talk.models.json.translations
|
||||||
|
|
||||||
import android.os.Parcelable
|
import android.os.Parcelable
|
||||||
@ -16,4 +35,4 @@ data class TranslateData(
|
|||||||
) : Parcelable {
|
) : Parcelable {
|
||||||
// This constructor is added to work with the 'com.bluelinelabs.logansquare.annotation.JsonObject'
|
// This constructor is added to work with the 'com.bluelinelabs.logansquare.annotation.JsonObject'
|
||||||
constructor() : this(null, null )
|
constructor() : this(null, null )
|
||||||
}
|
}
|
||||||
|
@ -1,3 +1,22 @@
|
|||||||
|
/*
|
||||||
|
* Nextcloud Talk application
|
||||||
|
*
|
||||||
|
* @author Julius Linus
|
||||||
|
* Copyright (C) 2023 Julius Linus <julius.linus@nextcloud.com>
|
||||||
|
*
|
||||||
|
* This program is free software: you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation, either version 3 of the License, or
|
||||||
|
* at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
package com.nextcloud.talk.models.json.translations
|
package com.nextcloud.talk.models.json.translations
|
||||||
|
|
||||||
import android.os.Parcelable
|
import android.os.Parcelable
|
||||||
@ -16,4 +35,4 @@ data class TranslateOCS( // TODO finish this model
|
|||||||
) : Parcelable {
|
) : Parcelable {
|
||||||
// This constructor is added to work with the 'com.bluelinelabs.logansquare.annotation.JsonObject'
|
// This constructor is added to work with the 'com.bluelinelabs.logansquare.annotation.JsonObject'
|
||||||
constructor() : this(null, TranslateData())
|
constructor() : this(null, TranslateData())
|
||||||
}
|
}
|
||||||
|
@ -1,3 +1,22 @@
|
|||||||
|
/*
|
||||||
|
* Nextcloud Talk application
|
||||||
|
*
|
||||||
|
* @author Julius Linus
|
||||||
|
* Copyright (C) 2023 Julius Linus <julius.linus@nextcloud.com>
|
||||||
|
*
|
||||||
|
* This program is free software: you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation, either version 3 of the License, or
|
||||||
|
* at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
package com.nextcloud.talk.models.json.translations
|
package com.nextcloud.talk.models.json.translations
|
||||||
|
|
||||||
import android.os.Parcelable
|
import android.os.Parcelable
|
||||||
@ -10,7 +29,7 @@ import kotlinx.parcelize.Parcelize
|
|||||||
class TranslationsOverall(
|
class TranslationsOverall(
|
||||||
@JsonField(name = ["ocs"])
|
@JsonField(name = ["ocs"])
|
||||||
var ocs: TranslateOCS?
|
var ocs: TranslateOCS?
|
||||||
) : Parcelable {
|
) : Parcelable {
|
||||||
// This constructor is added to work with the 'com.bluelinelabs.logansquare.annotation.JsonObject'
|
// This constructor is added to work with the 'com.bluelinelabs.logansquare.annotation.JsonObject'
|
||||||
constructor() : this(null)
|
constructor() : this(null)
|
||||||
}
|
}
|
||||||
|
@ -1,4 +1,24 @@
|
|||||||
|
/*
|
||||||
|
* Nextcloud Talk application
|
||||||
|
*
|
||||||
|
* @author Julius Linus
|
||||||
|
* Copyright (C) 2023 Julius Linus <julius.linus@nextcloud.com>
|
||||||
|
*
|
||||||
|
* This program is free software: you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation, either version 3 of the License, or
|
||||||
|
* at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
package com.nextcloud.talk.translate
|
package com.nextcloud.talk.translate
|
||||||
|
|
||||||
import android.app.AlertDialog
|
import android.app.AlertDialog
|
||||||
import android.graphics.drawable.ColorDrawable
|
import android.graphics.drawable.ColorDrawable
|
||||||
import android.os.Bundle
|
import android.os.Bundle
|
||||||
@ -27,14 +47,8 @@ import org.json.JSONArray
|
|||||||
import java.util.Locale
|
import java.util.Locale
|
||||||
import javax.inject.Inject
|
import javax.inject.Inject
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// TODO include license at top of the file
|
|
||||||
|
|
||||||
|
|
||||||
@AutoInjector(NextcloudTalkApplication::class)
|
@AutoInjector(NextcloudTalkApplication::class)
|
||||||
class TranslateActivity : BaseActivity()
|
class TranslateActivity : BaseActivity() {
|
||||||
{
|
|
||||||
private lateinit var binding: ActivityTranslateBinding
|
private lateinit var binding: ActivityTranslateBinding
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
@ -47,10 +61,9 @@ class TranslateActivity : BaseActivity()
|
|||||||
|
|
||||||
var toLanguages = arrayOf<String>()
|
var toLanguages = arrayOf<String>()
|
||||||
|
|
||||||
var text : String? = null
|
var text: String? = null
|
||||||
|
|
||||||
var check : Int = 0
|
|
||||||
|
|
||||||
|
var check: Int = 0
|
||||||
|
|
||||||
override fun onCreate(savedInstanceState: Bundle?) {
|
override fun onCreate(savedInstanceState: Bundle?) {
|
||||||
super.onCreate(savedInstanceState)
|
super.onCreate(savedInstanceState)
|
||||||
@ -59,6 +72,7 @@ class TranslateActivity : BaseActivity()
|
|||||||
|
|
||||||
setupActionBar()
|
setupActionBar()
|
||||||
setContentView(binding.root)
|
setContentView(binding.root)
|
||||||
|
setupSystemColors()
|
||||||
setupTextViews()
|
setupTextViews()
|
||||||
setupSpinners()
|
setupSpinners()
|
||||||
getLanguageOptions()
|
getLanguageOptions()
|
||||||
@ -73,7 +87,7 @@ class TranslateActivity : BaseActivity()
|
|||||||
supportActionBar?.setDisplayHomeAsUpEnabled(true)
|
supportActionBar?.setDisplayHomeAsUpEnabled(true)
|
||||||
supportActionBar?.setDisplayShowHomeEnabled(true)
|
supportActionBar?.setDisplayShowHomeEnabled(true)
|
||||||
supportActionBar?.setIcon(ColorDrawable(resources!!.getColor(R.color.transparent)))
|
supportActionBar?.setIcon(ColorDrawable(resources!!.getColor(R.color.transparent)))
|
||||||
supportActionBar?.title = "Translation"
|
supportActionBar?.title = resources!!.getString(R.string.translation)
|
||||||
viewThemeUtils.material.themeToolbar(binding.translationToolbar)
|
viewThemeUtils.material.themeToolbar(binding.translationToolbar)
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -81,6 +95,9 @@ class TranslateActivity : BaseActivity()
|
|||||||
val original = binding.originalMessageTextview
|
val original = binding.originalMessageTextview
|
||||||
val translation = binding.translatedMessageTextview
|
val translation = binding.translatedMessageTextview
|
||||||
|
|
||||||
|
viewThemeUtils.talk.themeIncomingMessageBubble(original, grouped = true, deleted = false)
|
||||||
|
viewThemeUtils.talk.themeIncomingMessageBubble(translation, grouped = true, deleted = false)
|
||||||
|
|
||||||
original.movementMethod = ScrollingMovementMethod()
|
original.movementMethod = ScrollingMovementMethod()
|
||||||
translation.movementMethod = ScrollingMovementMethod()
|
translation.movementMethod = ScrollingMovementMethod()
|
||||||
|
|
||||||
@ -89,19 +106,17 @@ class TranslateActivity : BaseActivity()
|
|||||||
text = bundle?.getString(BundleKeys.KEY_TRANSLATE_MESSAGE)
|
text = bundle?.getString(BundleKeys.KEY_TRANSLATE_MESSAGE)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private fun getLanguageOptions() {
|
private fun getLanguageOptions() {
|
||||||
val currentUser : User = userManager.currentUser.blockingGet()
|
val currentUser: User = userManager.currentUser.blockingGet()
|
||||||
val json = JSONArray(CapabilitiesUtilNew.getLanguages(currentUser).toString())
|
val json = JSONArray(CapabilitiesUtilNew.getLanguages(currentUser).toString())
|
||||||
Log.i("TranslateActivity", "json is: ${json.toString()}")
|
Log.i("TranslateActivity", "json is: $json")
|
||||||
|
|
||||||
var fromLanguagesSet = mutableSetOf<String>("Detect Language")
|
val fromLanguagesSet = mutableSetOf("Detect Language")
|
||||||
var toLanguagesSet = mutableSetOf<String>("Device Settings")
|
val toLanguagesSet = mutableSetOf("Device Settings")
|
||||||
|
|
||||||
for( i in 0..json.length()-1) {
|
for (i in 0..json.length() - 1) {
|
||||||
val current = json.getJSONObject(i)
|
val current = json.getJSONObject(i)
|
||||||
if(current.getString("from") != Locale.getDefault().language)
|
if (current.getString("from") != Locale.getDefault().language) {
|
||||||
{
|
|
||||||
toLanguagesSet.add(current.getString("fromLabel"))
|
toLanguagesSet.add(current.getString("fromLabel"))
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -111,25 +126,32 @@ class TranslateActivity : BaseActivity()
|
|||||||
fromLanguages = fromLanguagesSet.toTypedArray()
|
fromLanguages = fromLanguagesSet.toTypedArray()
|
||||||
toLanguages = toLanguagesSet.toTypedArray()
|
toLanguages = toLanguagesSet.toTypedArray()
|
||||||
|
|
||||||
binding.fromLanguageSpinner.adapter = ArrayAdapter(this, android.R.layout.simple_spinner_dropdown_item,
|
binding.fromLanguageSpinner.adapter = ArrayAdapter(
|
||||||
fromLanguages)
|
this, android.R.layout.simple_spinner_dropdown_item,
|
||||||
|
fromLanguages
|
||||||
binding.toLanguageSpinner.adapter = ArrayAdapter(this, android.R.layout.simple_spinner_dropdown_item,
|
)
|
||||||
toLanguages)
|
|
||||||
|
|
||||||
|
binding.toLanguageSpinner.adapter = ArrayAdapter(
|
||||||
|
this, android.R.layout.simple_spinner_dropdown_item,
|
||||||
|
toLanguages
|
||||||
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun enableSpinners(value : Boolean) {
|
private fun enableSpinners(value: Boolean) {
|
||||||
binding.fromLanguageSpinner.isEnabled = value
|
binding.fromLanguageSpinner.isEnabled = value
|
||||||
binding.toLanguageSpinner.isEnabled = value
|
binding.toLanguageSpinner.isEnabled = value
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun translate(fromLanguage: String?, toLanguage : String) {
|
private fun translate(fromLanguage: String?, toLanguage: String) {
|
||||||
val currentUser : User = userManager.currentUser.blockingGet()
|
val currentUser: User = userManager.currentUser.blockingGet()
|
||||||
val credentials : String = ApiUtils.getCredentials(currentUser.username, currentUser.token)
|
val credentials: String = ApiUtils.getCredentials(currentUser.username, currentUser.token)
|
||||||
val translateURL = currentUser.baseUrl +
|
val translateURL = currentUser.baseUrl +
|
||||||
"/ocs/v2.php/translation/translate?text=$text&toLanguage=$toLanguage" +
|
"/ocs/v2.php/translation/translate?text=$text&toLanguage=$toLanguage" +
|
||||||
if(fromLanguage != null && fromLanguage != "") { "&fromLanguage=$fromLanguage" } else {""}
|
if (fromLanguage != null && fromLanguage != "") {
|
||||||
|
"&fromLanguage=$fromLanguage"
|
||||||
|
} else {
|
||||||
|
""
|
||||||
|
}
|
||||||
|
|
||||||
Log.i("TranslateActivity", "Url is: $translateURL")
|
Log.i("TranslateActivity", "Url is: $translateURL")
|
||||||
ncApi.translateMessage(credentials, translateURL)
|
ncApi.translateMessage(credentials, translateURL)
|
||||||
@ -165,17 +187,15 @@ class TranslateActivity : BaseActivity()
|
|||||||
enableSpinners(true)
|
enableSpinners(true)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private fun getISOFromLanguage(language: String): String {
|
||||||
private fun getISOFromLanguage(language: String) : String {
|
if (language == "Device Settings") {
|
||||||
if(language == "Device Settings") {
|
|
||||||
return Locale.getDefault().language
|
return Locale.getDefault().language
|
||||||
}
|
}
|
||||||
|
|
||||||
|
val currentUser: User = userManager.currentUser.blockingGet()
|
||||||
|
val json = JSONArray(CapabilitiesUtilNew.getLanguages(currentUser).toString())
|
||||||
|
|
||||||
val currentUser : User = userManager.currentUser.blockingGet()
|
for (i in 0..json.length() - 1) {
|
||||||
val json = JSONArray(CapabilitiesUtilNew.getLanguages(currentUser).toString())
|
|
||||||
|
|
||||||
for( i in 0..json.length()-1) {
|
|
||||||
val current = json.getJSONObject(i)
|
val current = json.getJSONObject(i)
|
||||||
if (current.getString("fromLabel") == language) {
|
if (current.getString("fromLabel") == language) {
|
||||||
return current.getString("from")
|
return current.getString("from")
|
||||||
@ -185,20 +205,25 @@ class TranslateActivity : BaseActivity()
|
|||||||
return ""
|
return ""
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private fun setupSpinners() {
|
private fun setupSpinners() {
|
||||||
binding.fromLanguageSpinner.adapter = ArrayAdapter(this, android.R.layout.simple_spinner_dropdown_item,
|
binding.fromLanguageSpinner.adapter = ArrayAdapter(
|
||||||
fromLanguages)
|
this, android.R.layout.simple_spinner_dropdown_item,
|
||||||
binding.toLanguageSpinner.adapter = ArrayAdapter(this, android.R.layout.simple_spinner_dropdown_item,
|
fromLanguages
|
||||||
toLanguages)
|
)
|
||||||
|
binding.toLanguageSpinner.adapter = ArrayAdapter(
|
||||||
|
this, android.R.layout.simple_spinner_dropdown_item,
|
||||||
|
toLanguages
|
||||||
|
)
|
||||||
|
|
||||||
binding.fromLanguageSpinner.onItemSelectedListener = object : AdapterView.OnItemSelectedListener {
|
binding.fromLanguageSpinner.onItemSelectedListener = object : AdapterView.OnItemSelectedListener {
|
||||||
override fun onItemSelected(parent: AdapterView<*>, view: View, position: Int, id: Long) {
|
override fun onItemSelected(parent: AdapterView<*>, view: View, position: Int, id: Long) {
|
||||||
if(++check > 1) {
|
if (++check > 1) {
|
||||||
var fromLabel : String = getISOFromLanguage(parent.getItemAtPosition(position).toString())
|
val fromLabel: String = getISOFromLanguage(parent.getItemAtPosition(position).toString())
|
||||||
var toLabel : String = getISOFromLanguage(binding.toLanguageSpinner.selectedItem.toString())
|
val toLabel: String = getISOFromLanguage(binding.toLanguageSpinner.selectedItem.toString())
|
||||||
Log.i("TranslateActivity", "fromLanguageSpinner :: fromLabel = $fromLabel, toLabel = $ count: " +
|
Log.i(
|
||||||
"$check")
|
"TranslateActivity", "fromLanguageSpinner :: fromLabel = $fromLabel, toLabel = $ count: " +
|
||||||
|
"$check"
|
||||||
|
)
|
||||||
translate(fromLabel, toLabel)
|
translate(fromLabel, toLabel)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -210,11 +235,13 @@ class TranslateActivity : BaseActivity()
|
|||||||
|
|
||||||
binding.toLanguageSpinner.onItemSelectedListener = object : AdapterView.OnItemSelectedListener {
|
binding.toLanguageSpinner.onItemSelectedListener = object : AdapterView.OnItemSelectedListener {
|
||||||
override fun onItemSelected(parent: AdapterView<*>, view: View, position: Int, id: Long) {
|
override fun onItemSelected(parent: AdapterView<*>, view: View, position: Int, id: Long) {
|
||||||
if(++check > 2) {
|
if (++check > 2) {
|
||||||
var toLabel : String = getISOFromLanguage(parent.getItemAtPosition(position).toString())
|
val toLabel: String = getISOFromLanguage(parent.getItemAtPosition(position).toString())
|
||||||
var fromLabel : String = getISOFromLanguage(binding.fromLanguageSpinner.selectedItem.toString())
|
val fromLabel: String = getISOFromLanguage(binding.fromLanguageSpinner.selectedItem.toString())
|
||||||
Log.i("TranslateActivity", "toLanguageSpinner :: fromLabel = $fromLabel, toLabel = $toLabel " +
|
Log.i(
|
||||||
"count: $check")
|
"TranslateActivity", "toLanguageSpinner :: fromLabel = $fromLabel, toLabel = $toLabel " +
|
||||||
|
"count: $check"
|
||||||
|
)
|
||||||
translate(fromLabel, toLabel)
|
translate(fromLabel, toLabel)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -223,8 +250,5 @@ class TranslateActivity : BaseActivity()
|
|||||||
// write code to perform some action
|
// write code to perform some action
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
|
||||||
|
@ -65,7 +65,7 @@ class TalkSpecificViewThemeUtils @Inject constructor(
|
|||||||
private val appcompat: AndroidXViewThemeUtils
|
private val appcompat: AndroidXViewThemeUtils
|
||||||
) :
|
) :
|
||||||
ViewThemeUtilsBase(schemes) {
|
ViewThemeUtilsBase(schemes) {
|
||||||
fun themeIncomingMessageBubble(bubble: ViewGroup, grouped: Boolean, deleted: Boolean) {
|
fun themeIncomingMessageBubble(bubble: View, grouped: Boolean, deleted: Boolean) {
|
||||||
val resources = bubble.resources
|
val resources = bubble.resources
|
||||||
|
|
||||||
var bubbleResource = R.drawable.shape_incoming_message
|
var bubbleResource = R.drawable.shape_incoming_message
|
||||||
@ -88,7 +88,7 @@ class TalkSpecificViewThemeUtils @Inject constructor(
|
|||||||
ViewCompat.setBackground(bubble, bubbleDrawable)
|
ViewCompat.setBackground(bubble, bubbleDrawable)
|
||||||
}
|
}
|
||||||
|
|
||||||
fun themeOutgoingMessageBubble(bubble: ViewGroup, grouped: Boolean, deleted: Boolean) {
|
fun themeOutgoingMessageBubble(bubble: View, grouped: Boolean, deleted: Boolean) {
|
||||||
withScheme(bubble) { scheme ->
|
withScheme(bubble) { scheme ->
|
||||||
val bgBubbleColor = if (deleted) {
|
val bgBubbleColor = if (deleted) {
|
||||||
ColorUtils.setAlphaComponent(scheme.surfaceVariant, HALF_ALPHA_INT)
|
ColorUtils.setAlphaComponent(scheme.surfaceVariant, HALF_ALPHA_INT)
|
||||||
|
@ -219,7 +219,5 @@ object CapabilitiesUtilNew {
|
|||||||
return null
|
return null
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
const val DEFAULT_CHAT_SIZE = 1000
|
const val DEFAULT_CHAT_SIZE = 1000
|
||||||
}
|
}
|
||||||
|
25
app/src/main/res/drawable-night/ic_chevron_right.xml
Normal file
25
app/src/main/res/drawable-night/ic_chevron_right.xml
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
<!--
|
||||||
|
@author Google LLC
|
||||||
|
Copyright (C) 2023 Google LLC
|
||||||
|
|
||||||
|
Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
you may not use this file except in compliance with the License.
|
||||||
|
You may obtain a copy of the License at
|
||||||
|
|
||||||
|
http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
|
||||||
|
Unless required by applicable law or agreed to in writing, software
|
||||||
|
distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
See the License for the specific language governing permissions and
|
||||||
|
limitations under the License.
|
||||||
|
-->
|
||||||
|
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:width="24dp"
|
||||||
|
android:height="24dp"
|
||||||
|
android:viewportWidth="960"
|
||||||
|
android:viewportHeight="960">
|
||||||
|
<path
|
||||||
|
android:fillColor="#61FFFFFF"
|
||||||
|
android:pathData="M376,720L320,664L504,480L320,296L376,240L616,480L376,720Z"/>
|
||||||
|
</vector>
|
@ -1,5 +1,26 @@
|
|||||||
<vector android:height="24dp" android:tint="#000000"
|
<!--
|
||||||
android:viewportHeight="24" android:viewportWidth="24"
|
@author Google LLC
|
||||||
android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android">
|
Copyright (C) 2023 Google LLC
|
||||||
<path android:fillColor="@android:color/white" android:pathData="M12.87,15.07l-2.54,-2.51 0.03,-0.03c1.74,-1.94 2.98,-4.17 3.71,-6.53L17,6L17,4h-7L10,2L8,2v2L1,4v1.99h11.17C11.5,7.92 10.44,9.75 9,11.35 8.07,10.32 7.3,9.19 6.69,8h-2c0.73,1.63 1.73,3.17 2.98,4.56l-5.09,5.02L4,19l5,-5 3.11,3.11 0.76,-2.04zM18.5,10h-2L12,22h2l1.12,-3h4.75L21,22h2l-4.5,-12zM15.88,17l1.62,-4.33L19.12,17h-3.24z"/>
|
|
||||||
|
Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
you may not use this file except in compliance with the License.
|
||||||
|
You may obtain a copy of the License at
|
||||||
|
|
||||||
|
http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
|
||||||
|
Unless required by applicable law or agreed to in writing, software
|
||||||
|
distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
See the License for the specific language governing permissions and
|
||||||
|
limitations under the License.
|
||||||
|
-->
|
||||||
|
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:width="24dp"
|
||||||
|
android:height="24dp"
|
||||||
|
android:tint="#000000"
|
||||||
|
android:viewportWidth="24"
|
||||||
|
android:viewportHeight="24">
|
||||||
|
<path
|
||||||
|
android:fillColor="@android:color/white"
|
||||||
|
android:pathData="M12.87,15.07l-2.54,-2.51 0.03,-0.03c1.74,-1.94 2.98,-4.17 3.71,-6.53L17,6L17,4h-7L10,2L8,2v2L1,4v1.99h11.17C11.5,7.92 10.44,9.75 9,11.35 8.07,10.32 7.3,9.19 6.69,8h-2c0.73,1.63 1.73,3.17 2.98,4.56l-5.09,5.02L4,19l5,-5 3.11,3.11 0.76,-2.04zM18.5,10h-2L12,22h2l1.12,-3h4.75L21,22h2l-4.5,-12zM15.88,17l1.62,-4.33L19.12,17h-3.24z" />
|
||||||
</vector>
|
</vector>
|
||||||
|
25
app/src/main/res/drawable/ic_chevron_right.xml
Normal file
25
app/src/main/res/drawable/ic_chevron_right.xml
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
<!--
|
||||||
|
@author Google LLC
|
||||||
|
Copyright (C) 2023 Google LLC
|
||||||
|
|
||||||
|
Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
you may not use this file except in compliance with the License.
|
||||||
|
You may obtain a copy of the License at
|
||||||
|
|
||||||
|
http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
|
||||||
|
Unless required by applicable law or agreed to in writing, software
|
||||||
|
distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
See the License for the specific language governing permissions and
|
||||||
|
limitations under the License.
|
||||||
|
-->
|
||||||
|
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:width="24dp"
|
||||||
|
android:height="24dp"
|
||||||
|
android:viewportWidth="960"
|
||||||
|
android:viewportHeight="960">
|
||||||
|
<path
|
||||||
|
android:fillColor="#61000000"
|
||||||
|
android:pathData="M376,720L320,664L504,480L320,296L376,240L616,480L376,720Z"/>
|
||||||
|
</vector>
|
@ -1,16 +1,36 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<!--
|
||||||
|
~ Nextcloud Talk application
|
||||||
|
~
|
||||||
|
~ @author Julius Linus
|
||||||
|
~ Copyright (C) 2023 Julius Linus <julius.linus@nextcloud.com>
|
||||||
|
~
|
||||||
|
~ This program is free software: you can redistribute it and/or modify
|
||||||
|
~ it under the terms of the GNU General Public License as published by
|
||||||
|
~ the Free Software Foundation, either version 3 of the License, or
|
||||||
|
~ at your option) any later version.
|
||||||
|
~
|
||||||
|
~ This program is distributed in the hope that it will be useful,
|
||||||
|
~ but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
~ GNU General Public License for more details.
|
||||||
|
~
|
||||||
|
~ You should have received a copy of the GNU General Public License
|
||||||
|
~ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
-->
|
||||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
xmlns:tools="http://schemas.android.com/tools"
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
android:orientation="vertical"
|
|
||||||
android:weightSum="2"
|
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent">
|
android:layout_height="match_parent"
|
||||||
|
android:orientation="vertical"
|
||||||
|
android:weightSum="2">
|
||||||
|
|
||||||
<com.google.android.material.appbar.AppBarLayout
|
<com.google.android.material.appbar.AppBarLayout
|
||||||
android:id="@+id/translation_appbar"
|
android:id="@+id/translation_appbar"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content">
|
android:layout_height="wrap_content">
|
||||||
|
|
||||||
<com.google.android.material.appbar.MaterialToolbar
|
<com.google.android.material.appbar.MaterialToolbar
|
||||||
android:id="@+id/translation_toolbar"
|
android:id="@+id/translation_toolbar"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
@ -21,44 +41,38 @@
|
|||||||
app:navigationIconTint="@color/fontAppbar"
|
app:navigationIconTint="@color/fontAppbar"
|
||||||
app:popupTheme="@style/appActionBarPopupMenu"
|
app:popupTheme="@style/appActionBarPopupMenu"
|
||||||
app:titleTextColor="@color/fontAppbar"
|
app:titleTextColor="@color/fontAppbar"
|
||||||
tools:title="" >
|
tools:title="">
|
||||||
|
|
||||||
</com.google.android.material.appbar.MaterialToolbar>
|
</com.google.android.material.appbar.MaterialToolbar>
|
||||||
|
|
||||||
</com.google.android.material.appbar.AppBarLayout>
|
</com.google.android.material.appbar.AppBarLayout>
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:orientation="horizontal"
|
android:layout_width="match_parent"
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_gravity="center"
|
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_gravity="center"
|
||||||
|
android:orientation="horizontal"
|
||||||
android:padding="@dimen/standard_padding">
|
android:padding="@dimen/standard_padding">
|
||||||
|
|
||||||
<Spinner
|
<Spinner
|
||||||
android:id="@+id/fromLanguageSpinner"
|
android:id="@+id/fromLanguageSpinner"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="@dimen/min_size_clickable_area"
|
||||||
android:background="@color/grey_200"
|
android:layout_weight="1"
|
||||||
android:layout_marginRight="@dimen/standard_margin"
|
android:background="@color/grey_200" />
|
||||||
/>
|
|
||||||
|
|
||||||
<ImageButton
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="match_parent"
|
|
||||||
android:backgroundTint="@color/medium_emphasis_text"
|
|
||||||
android:background="@drawable/ic_chevron_right"
|
|
||||||
/>
|
|
||||||
|
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:layout_width="@dimen/min_size_clickable_area"
|
||||||
|
android:layout_height="@dimen/min_size_clickable_area"
|
||||||
|
android:contentDescription="@null"
|
||||||
|
android:src="@drawable/ic_chevron_right" />
|
||||||
|
|
||||||
<Spinner
|
<Spinner
|
||||||
android:id="@+id/toLanguageSpinner"
|
android:id="@+id/toLanguageSpinner"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="@dimen/min_size_clickable_area"
|
||||||
android:layout_toRightOf="@id/fromLanguageSpinner"
|
android:layout_weight="1"
|
||||||
android:background="@color/grey_200"
|
android:background="@color/grey_200" />
|
||||||
android:layout_marginLeft="@dimen/standard_margin"
|
|
||||||
/>
|
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
@ -66,27 +80,31 @@
|
|||||||
android:id="@+id/original_message_textview"
|
android:id="@+id/original_message_textview"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginStart="@dimen/standard_margin"
|
||||||
|
android:layout_marginEnd="@dimen/standard_margin"
|
||||||
|
android:layout_marginBottom="@dimen/standard_margin"
|
||||||
android:layout_weight="1"
|
android:layout_weight="1"
|
||||||
android:textSize="@dimen/message_text_size"
|
|
||||||
android:textColor="@color/nc_incoming_text_default"
|
|
||||||
android:padding="@dimen/dialog_padding"
|
|
||||||
android:layout_margin="@dimen/standard_margin"
|
|
||||||
android:background="@drawable/shape_grouped_incoming_message"
|
android:background="@drawable/shape_grouped_incoming_message"
|
||||||
|
android:padding="@dimen/dialog_padding"
|
||||||
android:scrollbars="vertical"
|
android:scrollbars="vertical"
|
||||||
android:text="" />
|
android:text=""
|
||||||
|
android:textColor="@color/nc_incoming_text_default"
|
||||||
|
android:textSize="@dimen/message_text_size" />
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/translated_message_textview"
|
android:id="@+id/translated_message_textview"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_margin="@dimen/standard_margin"
|
android:layout_marginStart="@dimen/standard_margin"
|
||||||
|
android:layout_marginEnd="@dimen/standard_margin"
|
||||||
|
android:layout_marginBottom="@dimen/standard_margin"
|
||||||
android:layout_weight="1"
|
android:layout_weight="1"
|
||||||
android:scrollbars="vertical"
|
|
||||||
android:padding="@dimen/dialog_padding"
|
|
||||||
android:background="@drawable/shape_grouped_incoming_message"
|
android:background="@drawable/shape_grouped_incoming_message"
|
||||||
|
android:padding="@dimen/dialog_padding"
|
||||||
|
android:scrollbars="vertical"
|
||||||
android:text=""
|
android:text=""
|
||||||
android:textSize="@dimen/message_text_size"
|
|
||||||
android:textColor="@color/nc_incoming_text_default"
|
android:textColor="@color/nc_incoming_text_default"
|
||||||
|
android:textSize="@dimen/message_text_size"
|
||||||
android:visibility="visible" />
|
android:visibility="visible" />
|
||||||
|
|
||||||
<ProgressBar
|
<ProgressBar
|
||||||
@ -96,5 +114,4 @@
|
|||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:visibility="gone" />
|
android:visibility="gone" />
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
</LinearLayout>
|
|
||||||
|
Loading…
Reference in New Issue
Block a user