diff --git a/build.gradle b/build.gradle index 2817bcef3c..91415088e5 100644 --- a/build.gradle +++ b/build.gradle @@ -24,15 +24,27 @@ buildscript { allprojects { repositories { - maven { url "http://dl.bintray.com/piasy/maven" } - maven { url 'https://jitpack.io' } + // For olm library. This has to be declared first, to ensure that Olm library is not downloaded from another repo + maven { + url 'https://jitpack.io' + content { + // Use this repo only for olm library + includeGroupByRegex "org\\.matrix\\.gitlab\\.matrix-org" + // And also for FilePicker + includeGroupByRegex "com\\.github\\.jaiselrahman" + // And monarchy + includeGroupByRegex "com\\.github\\.Zhuinden" + } + } + maven { + url "http://dl.bintray.com/piasy/maven" + content { + includeGroupByRegex "com\\.github\\.piasy" + } + } maven { url 'https://oss.sonatype.org/content/repositories/snapshots/' } google() jcenter() - // For Olm SDK - maven { - url 'https://jitpack.io' - } } } diff --git a/matrix-sdk-android/build.gradle b/matrix-sdk-android/build.gradle index 2066c5ef16..3eaf43eb69 100644 --- a/matrix-sdk-android/build.gradle +++ b/matrix-sdk-android/build.gradle @@ -6,7 +6,6 @@ apply plugin: 'realm-android' apply plugin: 'okreplay' buildscript { - repositories { jcenter() } @@ -15,11 +14,6 @@ buildscript { } } -repositories { - google() - jcenter() -} - androidExtensions { experimental = true } diff --git a/vector/src/main/java/im/vector/riotx/core/extensions/TextView.kt b/vector/src/main/java/im/vector/riotx/core/extensions/TextView.kt index 3bece712c0..37305c6cf7 100644 --- a/vector/src/main/java/im/vector/riotx/core/extensions/TextView.kt +++ b/vector/src/main/java/im/vector/riotx/core/extensions/TextView.kt @@ -19,10 +19,12 @@ package im.vector.riotx.core.extensions import android.text.Spannable import android.text.SpannableString import android.text.style.ForegroundColorSpan +import android.text.style.UnderlineSpan import android.widget.TextView import androidx.annotation.AttrRes import androidx.annotation.StringRes import androidx.core.view.isVisible +import im.vector.riotx.R import im.vector.riotx.features.themes.ThemeUtils @@ -43,11 +45,13 @@ fun TextView.setTextOrHide(newText: CharSequence?, hideWhenBlank: Boolean = true * Set text with a colored part * @param fullTextRes the resource id of the full text. Value MUST contains a parameter for string, which will be replaced by the colored part * @param coloredTextRes the resource id of the colored part of the text - * @param colorAttribute attribute of the color + * @param colorAttribute attribute of the color. Default to colorAccent + * @param underline true to also underline the text. Default to false */ fun TextView.setTextWithColoredPart(@StringRes fullTextRes: Int, @StringRes coloredTextRes: Int, - @AttrRes colorAttribute: Int) { + @AttrRes colorAttribute: Int = R.attr.colorAccent, + underline: Boolean = false) { val coloredPart = resources.getString(coloredTextRes) // Insert colored part into the full text val fullText = resources.getString(fullTextRes, coloredPart) @@ -60,5 +64,8 @@ fun TextView.setTextWithColoredPart(@StringRes fullTextRes: Int, text = SpannableString(fullText) .apply { setSpan(foregroundSpan, index, index + coloredPart.length, Spannable.SPAN_EXCLUSIVE_EXCLUSIVE) + if (underline) { + setSpan(UnderlineSpan(), index, index + coloredPart.length, Spannable.SPAN_EXCLUSIVE_EXCLUSIVE) + } } } diff --git a/vector/src/main/java/im/vector/riotx/features/disclaimer/DisclaimerDialog.kt b/vector/src/main/java/im/vector/riotx/features/disclaimer/DisclaimerDialog.kt index 6756033f13..ac6b23a109 100644 --- a/vector/src/main/java/im/vector/riotx/features/disclaimer/DisclaimerDialog.kt +++ b/vector/src/main/java/im/vector/riotx/features/disclaimer/DisclaimerDialog.kt @@ -45,12 +45,7 @@ fun showDisclaimerDialog(activity: Activity) { val textView = (dialogLayout as ViewGroup).findViewById(R.id.dialogDisclaimerContentLine2) @Suppress("ConstantConditionIf") if (BuildConfig.FLAVOR == "gplay") { - - textView.setTextWithColoredPart( - R.string.alpha_disclaimer_content_line_2_gplay, - R.string.alpha_disclaimer_content_line_2_gplay_colored_part, - R.attr.colorAccent - ) + textView.setTextWithColoredPart(R.string.alpha_disclaimer_content_line_2_gplay, R.string.alpha_disclaimer_content_line_2_gplay_colored_part) textView.setOnClickListener { openPlayStore(activity) diff --git a/vector/src/main/java/im/vector/riotx/features/login/LoginActivity.kt b/vector/src/main/java/im/vector/riotx/features/login/LoginActivity.kt index 911bffb8b1..5c91b4bcc6 100644 --- a/vector/src/main/java/im/vector/riotx/features/login/LoginActivity.kt +++ b/vector/src/main/java/im/vector/riotx/features/login/LoginActivity.kt @@ -19,8 +19,8 @@ package im.vector.riotx.features.login import android.content.Context import android.content.Intent import android.os.Bundle -import android.view.View import android.widget.Toast +import androidx.core.view.isVisible import arrow.core.Try import com.jakewharton.rxbinding2.widget.RxTextView import im.vector.matrix.android.api.MatrixCallback @@ -31,8 +31,10 @@ import im.vector.riotx.R import im.vector.riotx.core.di.ActiveSessionHolder import im.vector.riotx.core.di.ScreenComponent import im.vector.riotx.core.extensions.configureAndStart +import im.vector.riotx.core.extensions.setTextWithColoredPart import im.vector.riotx.core.extensions.showPassword import im.vector.riotx.core.platform.VectorBaseActivity +import im.vector.riotx.core.utils.openUrlInExternalBrowser import im.vector.riotx.features.disclaimer.showDisclaimerDialog import im.vector.riotx.features.home.HomeActivity import im.vector.riotx.features.notifications.PushRuleTriggerListener @@ -61,11 +63,20 @@ class LoginActivity : VectorBaseActivity() { override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) setContentView(R.layout.activity_login) + setupNotice() setupAuthButton() setupPasswordReveal() homeServerField.setText(DEFAULT_HOME_SERVER_URI) } + private fun setupNotice() { + riotx_no_registration_notice.setTextWithColoredPart(R.string.riotx_no_registration_notice, R.string.riotx_no_registration_notice_colored_part) + + riotx_no_registration_notice.setOnClickListener { + openUrlInExternalBrowser(this@LoginActivity, "https://about.riot.im/downloads") + } + } + override fun onResume() { super.onResume() @@ -85,7 +96,8 @@ class LoginActivity : VectorBaseActivity() { } private fun authenticateWith(homeServerConnectionConfig: HomeServerConnectionConfig, login: String, password: String) { - progressBar.visibility = View.VISIBLE + progressBar.isVisible = true + touchArea.isVisible = true authenticator.authenticate(homeServerConnectionConfig, login, password, object : MatrixCallback { override fun onSuccess(data: Session) { activeSessionHolder.setActiveSession(data) @@ -94,7 +106,8 @@ class LoginActivity : VectorBaseActivity() { } override fun onFailure(failure: Throwable) { - progressBar.visibility = View.GONE + progressBar.isVisible = false + touchArea.isVisible = false Toast.makeText(this@LoginActivity, "Authenticate failure: $failure", Toast.LENGTH_LONG).show() } }) diff --git a/vector/src/main/res/drawable-hdpi/riotx_logo.png b/vector/src/main/res/drawable-hdpi/riotx_logo.png new file mode 100644 index 0000000000..8d6e3454b8 Binary files /dev/null and b/vector/src/main/res/drawable-hdpi/riotx_logo.png differ diff --git a/vector/src/main/res/drawable-mdpi/riotx_logo.png b/vector/src/main/res/drawable-mdpi/riotx_logo.png new file mode 100644 index 0000000000..5c45ebabaf Binary files /dev/null and b/vector/src/main/res/drawable-mdpi/riotx_logo.png differ diff --git a/vector/src/main/res/drawable-xhdpi/riotx_logo.png b/vector/src/main/res/drawable-xhdpi/riotx_logo.png new file mode 100644 index 0000000000..651ff38e09 Binary files /dev/null and b/vector/src/main/res/drawable-xhdpi/riotx_logo.png differ diff --git a/vector/src/main/res/drawable-xxhdpi/riotx_logo.png b/vector/src/main/res/drawable-xxhdpi/riotx_logo.png new file mode 100644 index 0000000000..1652b970e7 Binary files /dev/null and b/vector/src/main/res/drawable-xxhdpi/riotx_logo.png differ diff --git a/vector/src/main/res/drawable-xxxhdpi/riotx_logo.png b/vector/src/main/res/drawable-xxxhdpi/riotx_logo.png new file mode 100644 index 0000000000..fd944daf8f Binary files /dev/null and b/vector/src/main/res/drawable-xxxhdpi/riotx_logo.png differ diff --git a/vector/src/main/res/layout/activity_login.xml b/vector/src/main/res/layout/activity_login.xml index eb0fd48ebc..0b76b461df 100644 --- a/vector/src/main/res/layout/activity_login.xml +++ b/vector/src/main/res/layout/activity_login.xml @@ -16,25 +16,32 @@ android:layout_width="match_parent" android:layout_height="wrap_content" android:orientation="vertical" - android:paddingStart="24dp" - android:paddingLeft="24dp" - android:paddingTop="24dp" - android:paddingEnd="24dp" - android:paddingRight="24dp" - android:paddingBottom="80dp"> + android:padding="24dp"> + android:src="@drawable/riotx_logo" /> + + + + android:layout_height="wrap_content" + android:layout_marginTop="16dp"> + + android:hint="@string/settings_home_server"> - + + + + + app:layout_constraintStart_toStartOf="parent" + tools:visibility="visible" /> diff --git a/vector/src/main/res/values/strings_riotX.xml b/vector/src/main/res/values/strings_riotX.xml index 8c492fc465..7c1d39c4df 100644 --- a/vector/src/main/res/values/strings_riotX.xml +++ b/vector/src/main/res/values/strings_riotX.xml @@ -16,5 +16,9 @@ "(edited)" + + %1$s to create an account. + Use the old app + \ No newline at end of file