...
 
Commits (156)
### Pull Request Checklist
<!-- Please read CONTRIBUTING.rst before submitting your pull request -->
* [ ] Pull request is based on the develop branch
* [ ] Pull request updates [CHANGES.rst](https://github.com/vector-im/riot-android/blob/develop/CHANGES.rst)
* [ ] Pull request includes screenshots or videos if containing UI changes
* [ ] Pull request includes a [sign off](https://github.com/matrix-org/synapse/blob/master/CONTRIBUTING.rst#sign-off)
Changes in Liberty Chat 0.0.1 (2019-XX-XX)
Changes in Riot 0.8.20 (2018-12-13)
===================================================
Other changes:
- Added Purism branded app flavour
- Integrated with gitlab CI/CD
MatrixSdk:
- Upgrade to version 0.9.14.
Improvements:
- Remove double negations from settings and update descriptions (#2723)
- Handle missing or bad parameter in slash command
- Support specifying kick and ban message (#2164)
- Add image transparency and fix issues with gifs in the media viewer (#2731)
- Upgrade olm-sdk.aar from version 2.3.0 to version 3.0.0
- Migration to the Preference v7 support
- Make User Agreement part of the registration flow (#2442)
- Fix several color issue on Status theme and prepare rework some styles.
Changes in Riot 0.8.19 (2018-XX-XX)
Bugfix:
- Use same "Call Anyway" string from iOS (#2695)
- Improve `/markdown` command (#2673)
- Display thumbnail for encrypted files without a remote thumbnail (#2734)
Changes in Riot 0.8.19 (2018-11-06)
===================================================
MatrixSdk:
......@@ -1082,3 +1095,32 @@ Changes in Vector 0.2.0 (2016-04-14)
* First official release.
=======================================================
+ TEMPLATE WHEN PREPARING A NEW RELEASE +
=======================================================
Changes in Riot 0.8.XX (2018-XX-XX)
===================================================
MatrixSdk:
- Upgrade to version 0.X.Y.
Features:
-
Improvements:
-
Other changes:
-
Bugfix:
-
Translations:
-
Build:
-
......@@ -39,6 +39,9 @@ allprojects {
maven {
url "https://maven.google.com"
}
maven {
url "https://jitpack.io"
}
}
}
......
......@@ -70,3 +70,11 @@ DO NOT COMMIT
layout_constraintRight_
layout_constraintLeft_
### Use Preference from v7 library (android.support.v7.preference.PreferenceScreen)
<PreferenceScreen
### Use im.vector.preference.VectorSwitchPreference to support multiline of the title
<SwitchPreference
### Use im.vector.preference.VectorPreference to support multiline of the title
<Preference\n
......@@ -5,6 +5,21 @@ repositories {
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-kapt'
apply plugin: 'realm-android'
buildscript {
repositories {
jcenter()
}
dependencies {
classpath "io.realm:realm-gradle-plugin:5.8.0"
}
}
kapt {
correctErrorTypes = true
}
android {
compileSdkVersion 27
......@@ -15,6 +30,11 @@ android {
exclude 'META-INF/NOTICE'
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
defaultConfig {
applicationId "im.vector"
minSdkVersion 16
......@@ -203,6 +223,7 @@ dependencies {
// Kotlin coroutines
implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-core:0.30.2'
implementation "org.jetbrains.anko:anko-commons:0.10.8"
implementation 'com.android.support:multidex:1.0.0'
......@@ -212,6 +233,8 @@ dependencies {
implementation 'com.android.support:design:27.1.1'
implementation 'com.android.support:cardview-v7:27.1.1'
implementation 'com.android.support:recyclerview-v7:27.1.1'
implementation 'com.android.support:preference-v7:27.1.1'
implementation 'com.android.support:preference-v14:27.1.1'
implementation 'com.jakewharton:butterknife:8.5.1'
kapt 'com.jakewharton:butterknife-compiler:8.5.1'
......@@ -219,6 +242,11 @@ dependencies {
implementation 'com.android.support.constraint:constraint-layout:1.1.0'
implementation 'com.getbase:floatingactionbutton:1.10.1'
implementation 'com.binaryfork:spanny:1.0.4'
implementation 'com.github.chrisbanes:PhotoView:2.1.4'
// Epoxy (without androidx packages)
implementation 'com.airbnb.android:epoxy:2.19.0'
kapt 'com.airbnb.android:epoxy-processor:2.19.0'
// Network
implementation 'com.squareup.retrofit2:retrofit:2.4.0'
......
No preview for this file type
......@@ -17,7 +17,7 @@
package im.vector.receiver
import android.content.*
import android.preference.PreferenceManager
import android.support.v7.preference.PreferenceManager
import android.util.Log
import androidx.core.content.edit
import im.vector.Matrix
......
......@@ -9,7 +9,7 @@
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:theme="@style/Theme.AppCompat.Light">
android:theme="@style/Theme.AppCompat.Light.DarkActionBar">
<FrameLayout
android:layout_width="match_parent"
......
......@@ -126,25 +126,27 @@
</intent-filter>
</activity>
<activity
android:name=".activity.AccountCreationActivity"
android:name=".activity.FallbackAccountCreationActivity"
android:configChanges="orientation|screenSize"
android:label="@string/create_account" />
<activity
android:name=".activity.AccountCreationCaptchaActivity"
android:configChanges="orientation|screenSize"
android:label="@string/create_account" />
<activity
android:name=".activity.policies.AccountCreationTermsActivity"
android:configChanges="orientation|screenSize"
android:label="@string/create_account" />
<activity
android:name=".activity.FallbackLoginActivity"
android:configChanges="orientation|screenSize"
android:label="@string/login" />
<activity
android:name=".activity.SplashActivity"
android:configChanges="orientation|screenSize"
android:theme="@style/AppTheme.NoActionBar.Light" />
android:configChanges="orientation|screenSize" />
<activity
android:name=".activity.LoggingOutActivity"
android:configChanges="orientation|screenSize"
android:theme="@style/AppTheme.NoActionBar.Light" />
android:configChanges="orientation|screenSize" />
<activity
android:name=".activity.VectorHomeActivity"
android:configChanges="orientation|screenSize"
......@@ -162,11 +164,8 @@
android:name=".activity.VectorRoomActivity"
android:configChanges="orientation|screenSize"
android:label="@string/title_activity_room"
android:theme="@style/AppTheme.NoActionBar.Light"
android:windowSoftInputMode="stateHidden|adjustResize" />
<activity
android:name=".activity.DeactivateAccountActivity"
android:theme="@style/AppTheme.NoActionBar.Light" />
<activity android:name=".activity.DeactivateAccountActivity" />
<activity
android:name=".activity.VectorRoomCreationActivity"
android:configChanges="orientation|screenSize"
......@@ -203,8 +202,7 @@
android:name=".activity.VectorMemberDetailsActivity"
android:configChanges="orientation|screenSize"
android:label="@string/title_activity_member_details"
android:parentActivityName=".activity.VectorRoomActivity"
android:theme="@style/AppTheme.NoActionBar.Light">
android:parentActivityName=".activity.VectorRoomActivity">
<meta-data
android:name="android.support.PARENT_ACTIVITY"
android:value="im.vector.activity.VectorRoomActivity" />
......@@ -250,12 +248,10 @@
android:theme="@style/AppTheme.NoActionBar.FullScreen.Light" />
<activity
android:name=".activity.IntegrationManagerActivity"
android:configChanges="orientation|screenSize"
android:theme="@style/AppTheme.NoActionBar.Light" />
android:configChanges="orientation|screenSize" />
<activity
android:name=".activity.StickerPickerActivity"
android:configChanges="orientation|screenSize"
android:theme="@style/AppTheme.NoActionBar.Light" />
android:configChanges="orientation|screenSize" />
<activity
android:name=".activity.VectorMediasPickerActivity"
android:label="@string/media_picker_both_capture_title"
......@@ -363,8 +359,7 @@
<activity
android:name=".activity.PhoneNumberAdditionActivity"
android:configChanges="orientation|screenSize"
android:label="@string/settings_add_phone_number"
android:theme="@style/AppTheme.NoActionBar.Light" />
android:label="@string/settings_add_phone_number" />
<activity
android:name=".activity.CountryPickerActivity"
android:configChanges="orientation|screenSize"
......@@ -378,26 +373,20 @@
<activity
android:name=".activity.RoomDirectoryPickerActivity"
android:configChanges="orientation|screenSize"
android:label="@string/select_room_directory"
android:theme="@style/DirectoryPickerTheme.Light" />
android:label="@string/select_room_directory" />
<activity
android:name=".activity.PhoneNumberVerificationActivity"
android:configChanges="orientation|screenSize"
android:label="@string/settings_phone_number_verification"
android:theme="@style/AppTheme.NoActionBar.Light" />
android:label="@string/settings_phone_number_verification" />
<activity
android:name=".activity.NotificationPrivacyActivity"
android:configChanges="orientation|screenSize"
android:label="@string/settings_notification_privacy"
android:theme="@style/AppTheme.NoActionBar.Light" />
<activity
android:name=".activity.VectorWebViewActivity"
android:theme="@style/AppTheme.NoActionBar.Light" />
android:label="@string/settings_notification_privacy" />
<activity android:name=".activity.VectorWebViewActivity" />
<activity
android:name="im.vector.activity.MediaPreviewerActivity"
android:configChanges="orientation|screenSize"
android:theme="@style/AppTheme.NoActionBar.Light" />
android:configChanges="orientation|screenSize" />
<!-- FileProvider -->
<provider
......
......@@ -284,8 +284,21 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
<br/>
Copyright 2015 Pavlovsky Ivan
</li>
<li>
<b>PhotoView</b>
<br/>
Copyright 2018 Chris Banes
</li>
<li>
<b>Epoxy</b>
<br/>
Copyright 2016 Airbnb, Inc.
</li>
<li>
<b>Anko</b>
<br/>
Copyright 2016 JetBrains s.r.o.
</li>
</ul>
<pre>
Apache License
......
......@@ -37,12 +37,11 @@ import org.matrix.androidsdk.data.metrics.MetricsListener;
import org.matrix.androidsdk.data.store.IMXStore;
import org.matrix.androidsdk.data.store.MXFileStore;
import org.matrix.androidsdk.db.MXLatestChatMessageCache;
import org.matrix.androidsdk.db.MXMediasCache;
import org.matrix.androidsdk.db.MXMediaCache;
import org.matrix.androidsdk.listeners.IMXNetworkEventListener;
import org.matrix.androidsdk.listeners.MXEventListener;
import org.matrix.androidsdk.rest.callback.ApiCallback;
import org.matrix.androidsdk.rest.callback.SimpleApiCallback;
import org.matrix.androidsdk.rest.client.LoginRestClient;
import org.matrix.androidsdk.rest.model.Event;
import org.matrix.androidsdk.rest.model.MatrixError;
import org.matrix.androidsdk.rest.model.login.Credentials;
......@@ -417,9 +416,9 @@ public class Matrix {
*
* @return the mediasCache.
*/
public MXMediasCache getMediasCache() {
public MXMediaCache getMediaCache() {
if (getSessions().size() > 0) {
return getSessions().get(0).getMediasCache();
return getSessions().get(0).getMediaCache();
}
return null;
}
......@@ -489,7 +488,7 @@ public class Matrix {
final @NonNull ApiCallback<Void> aCallback) {
Log.d(LOG_TAG, "## deactivateSession() " + session.getMyUserId());
session.deactivateAccount(context, LoginRestClient.LOGIN_FLOW_TYPE_PASSWORD, userPassword, eraseUserData, new SimpleApiCallback<Void>(aCallback) {
session.deactivateAccount(context, userPassword, eraseUserData, new SimpleApiCallback<Void>(aCallback) {
@Override
public void onSuccess(Void info) {
mLoginStorage.removeCredentials(session.getHomeServerConfig());
......
......@@ -32,9 +32,9 @@ import android.os.Build;
import android.os.Bundle;
import android.os.Handler;
import android.os.Looper;
import android.preference.PreferenceManager;
import android.support.multidex.MultiDex;
import android.support.multidex.MultiDexApplication;
import android.support.v7.preference.PreferenceManager;
import android.text.TextUtils;
import com.facebook.stetho.Stetho;
......@@ -178,12 +178,6 @@ public class VectorApp extends MultiDexApplication {
}
};
@Override
protected void attachBaseContext(Context base) {
super.attachBaseContext(base);
MultiDex.install(this);
}
@Override
public void onCreate() {
Log.d(LOG_TAG, "onCreate");
......@@ -372,12 +366,12 @@ public class VectorApp extends MultiDexApplication {
* Suspend background threads.
*/
private void suspendApp() {
PushManager pushManager = Matrix.getInstance(VectorApp.this).getPushManager();
PushManager pushManager = Matrix.getInstance(this).getPushManager();
// suspend the events thread if the client uses FCM
if (!pushManager.isBackgroundSyncAllowed() || (pushManager.useFcm() && pushManager.hasRegistrationToken())) {
Log.d(LOG_TAG, "suspendApp ; pause the event stream");
CommonActivityUtils.pauseEventStream(VectorApp.this);
CommonActivityUtils.pauseEventStream(this);
} else {
Log.d(LOG_TAG, "suspendApp ; the event stream is not paused because FCM is disabled.");
}
......@@ -394,7 +388,7 @@ public class VectorApp extends MultiDexApplication {
// remove older medias
if ((System.currentTimeMillis() - mLastMediasCheck) < (24 * 60 * 60 * 1000)) {
mLastMediasCheck = System.currentTimeMillis();
session.removeMediasBefore(VectorApp.this, PreferencesManager.getMinMediasLastAccessTime(getApplicationContext()));
session.removeMediaBefore(this, PreferencesManager.getMinMediasLastAccessTime(getApplicationContext()));
}
if (session.getDataHandler().areLeftRoomsSynced()) {
......
......@@ -94,6 +94,8 @@ public class AccountCreationCaptchaActivity extends VectorAppCompatActivity {
@Override
public void initUiAndData() {
configureToolbar();
final WebView webView = findViewById(R.id.account_creation_webview);
webView.getSettings().setJavaScriptEnabled(true);
......@@ -164,7 +166,7 @@ public class AccountCreationCaptchaActivity extends VectorAppCompatActivity {
// common error message
private void onError(String errorMessage) {
Log.e(LOG_TAG, "## onError() : errorMessage");
Log.e(LOG_TAG, "## onError() : " + errorMessage);
Toast.makeText(AccountCreationCaptchaActivity.this, errorMessage, Toast.LENGTH_LONG).show();
// on error case, close this activity
......@@ -242,16 +244,4 @@ public class AccountCreationCaptchaActivity extends VectorAppCompatActivity {
}
return super.onKeyDown(keyCode, event);
}
@Override
public void onLowMemory() {
super.onLowMemory();
CommonActivityUtils.onLowMemory(this);
}
@Override
public void onTrimMemory(int level) {
super.onTrimMemory(level);
CommonActivityUtils.onTrimMemory(this, level);
}
}
......@@ -70,10 +70,7 @@ class BugReportActivity : MXCActionBarActivity() {
override fun getLayoutRes() = R.layout.activity_bug_report
override fun initUiAndData() {
supportActionBar?.let {
it.setDisplayShowHomeEnabled(true)
it.setDisplayHomeAsUpEnabled(true)
}
configureToolbar()
if (BugReporter.getScreenshot() != null) {
mScreenShotPreview.setImageBitmap(BugReporter.getScreenshot())
......
......@@ -34,12 +34,12 @@ import android.os.Environment;
import android.os.Handler;
import android.os.Looper;
import android.os.Parcelable;
import android.preference.PreferenceManager;
import android.support.annotation.NonNull;
import android.support.v4.app.FragmentActivity;
import android.support.v4.app.FragmentManager;
import android.support.v4.content.ContextCompat;
import android.support.v7.app.AlertDialog;
import android.support.v7.preference.PreferenceManager;
import android.text.TextUtils;
import android.util.Pair;
import android.view.LayoutInflater;
......@@ -54,7 +54,7 @@ import org.matrix.androidsdk.crypto.data.MXUsersDevicesMap;
import org.matrix.androidsdk.data.Room;
import org.matrix.androidsdk.data.RoomPreviewData;
import org.matrix.androidsdk.data.RoomSummary;
import org.matrix.androidsdk.db.MXMediasCache;
import org.matrix.androidsdk.db.MXMediaCache;
import org.matrix.androidsdk.rest.callback.ApiCallback;
import org.matrix.androidsdk.rest.callback.SimpleApiCallback;
import org.matrix.androidsdk.rest.model.MatrixError;
......@@ -360,7 +360,7 @@ public class CommonActivityUtils {
PIDsRetriever.getInstance().reset();
ContactsManager.getInstance().reset();
MXMediasCache.clearThumbnailsCache(context);
MXMediaCache.clearThumbnailsCache(context);
if (goToLoginPage) {
Activity activeActivity = VectorApp.getCurrentActivity();
......@@ -428,7 +428,7 @@ public class CommonActivityUtils {
PIDsRetriever.getInstance().reset();
ContactsManager.getInstance().reset();
MXMediasCache.clearThumbnailsCache(context);
MXMediaCache.clearThumbnailsCache(context);
callback.onSuccess(info);
}
......@@ -765,7 +765,7 @@ public class CommonActivityUtils {
// Room jump methods.
//==============================================================================================================
/**
/**
* Start a room activity with the dedicated parameters.
* Pop the activity to the homeActivity before pushing the new activity.
*
......@@ -1472,7 +1472,7 @@ public class CommonActivityUtils {
try {
String filenamePrefix = appContext.getString(R.string.app_prefix);
ByteArrayInputStream stream = new ByteArrayInputStream(bytesArray);
String url = session.getMediasCache().saveMedia(stream, filenamePrefix + "-" + System.currentTimeMillis() + ".txt", "text/plain");
String url = session.getMediaCache().saveMedia(stream, filenamePrefix + "-" + System.currentTimeMillis() + ".txt", "text/plain");
stream.close();
saveMediaIntoDownloads(appContext,
......@@ -1501,11 +1501,13 @@ public class CommonActivityUtils {
* @param session the session
* @param activity the calling activity
* @param unknownDevices the unknown devices list
* @param isForCalling true when the user want to start a call
* @param listener optional listener to add an optional "Send anyway" button
*/
public static void displayUnknownDevicesDialog(MXSession session,
FragmentActivity activity,
MXUsersDevicesMap<MXDeviceInfo> unknownDevices,
boolean isForCalling,
VectorUnknownDevicesFragment.IUnknownDevicesSendAnywayListener listener) {
// sanity checks
if (activity.isFinishing() || (null == unknownDevices) || (0 == unknownDevices.getMap().size())) {
......@@ -1519,7 +1521,7 @@ public class CommonActivityUtils {
fragment.dismissAllowingStateLoss();
}
fragment = VectorUnknownDevicesFragment.newInstance(session.getMyUserId(), unknownDevices, listener);
fragment = VectorUnknownDevicesFragment.newInstance(session.getMyUserId(), unknownDevices, isForCalling, listener);
try {
fragment.show(fm, TAG_FRAGMENT_UNKNOWN_DEVICES_DIALOG_DIALOG);
} catch (Exception e) {
......
......@@ -24,7 +24,6 @@ import android.support.v4.view.MenuItemCompat;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.support.v7.widget.SearchView;
import android.support.v7.widget.Toolbar;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
......@@ -89,14 +88,7 @@ public class CountryPickerActivity extends VectorAppCompatActivity implements Co
@Override
public void initUiAndData() {
Toolbar toolbar = findViewById(R.id.toolbar);
if (toolbar != null) {
setSupportActionBar(toolbar);
if (getSupportActionBar() != null) {
getSupportActionBar().setDisplayShowHomeEnabled(true);
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
}
}
configureToolbar();
final Intent intent = getIntent();
mWithIndicator = intent.getBooleanExtra(EXTRA_IN_WITH_INDICATOR, false);
......
......@@ -24,7 +24,6 @@ import butterknife.BindView
import butterknife.OnClick
import im.vector.Matrix
import im.vector.R
import im.vector.ui.themes.ActivityOtherThemes
import org.matrix.androidsdk.MXSession
import org.matrix.androidsdk.rest.callback.SimpleApiCallback
import org.matrix.androidsdk.rest.model.MatrixError
......@@ -54,8 +53,6 @@ class DeactivateAccountActivity : VectorAppCompatActivity() {
* Life cycle
* ========================================================================================== */
override fun getOtherThemes() = ActivityOtherThemes.NoActionBar
override fun getLayoutRes() = R.layout.activity_deactivate_account
override fun getTitleRes() = R.string.deactivate_account_title
......
......@@ -38,31 +38,19 @@ import java.util.Map;
import im.vector.R;
/**
* AccountCreationActivity is the fallback account creation activity
* FallbackAccountCreationActivity is the fallback account creation activity
*/
public class AccountCreationActivity extends VectorAppCompatActivity {
private static final String LOG_TAG = AccountCreationActivity.class.getSimpleName();
public class FallbackAccountCreationActivity extends VectorAppCompatActivity {
private static final String LOG_TAG = FallbackAccountCreationActivity.class.getSimpleName();
public static final String EXTRA_HOME_SERVER_ID = "AccountCreationActivity.EXTRA_HOME_SERVER_ID";
public static final String EXTRA_HOME_SERVER_URL = "FallbackAccountCreationActivity.EXTRA_HOME_SERVER_URL";
// home server url
private String mHomeServerUrl;
@Override
public void onLowMemory() {
super.onLowMemory();
CommonActivityUtils.onLowMemory(this);
}
@Override
public void onTrimMemory(int level) {
super.onTrimMemory(level);
CommonActivityUtils.onTrimMemory(this, level);
}
@Override
public int getLayoutRes() {
return R.layout.activity_account_creation;
return R.layout.activity_login_fallback;
}
@Override
......@@ -72,15 +60,17 @@ public class AccountCreationActivity extends VectorAppCompatActivity {
@Override
public void initUiAndData() {
configureToolbar();
final WebView webView = findViewById(R.id.account_creation_webview);
webView.getSettings().setJavaScriptEnabled(true);
Intent intent = getIntent();
mHomeServerUrl = "https://matrix.org/";
mHomeServerUrl = getString(R.string.default_hs_server_url);
if (intent.hasExtra(EXTRA_HOME_SERVER_ID)) {
mHomeServerUrl = intent.getStringExtra(EXTRA_HOME_SERVER_ID);
if (intent.hasExtra(EXTRA_HOME_SERVER_URL)) {
mHomeServerUrl = intent.getStringExtra(EXTRA_HOME_SERVER_URL);
}
// check the trailing slash
......@@ -96,7 +86,7 @@ public class AccountCreationActivity extends VectorAppCompatActivity {
SslError error) {
final SslErrorHandler fHander = handler;
new AlertDialog.Builder(AccountCreationActivity.this)
new AlertDialog.Builder(FallbackAccountCreationActivity.this)
.setMessage(R.string.ssl_could_not_verify)
.setPositiveButton(R.string.ssl_trust, new DialogInterface.OnClickListener() {
@Override
......
......@@ -43,12 +43,12 @@ import im.vector.R;
/**
* FallbackLoginActivity is the fallback login activity
* i.e this activity is created when the client does not support the
* i.e this activity is created when the client does not support the login flow of the home server
*/
public class FallbackLoginActivity extends VectorAppCompatActivity {
private static final String LOG_TAG = FallbackLoginActivity.class.getSimpleName();
public static final String EXTRA_HOME_SERVER_ID = "FallbackLoginActivity.EXTRA_HOME_SERVER_ID";
public static final String EXTRA_HOME_SERVER_URL = "FallbackLoginActivity.EXTRA_HOME_SERVER_URL";
private WebView mWebView = null;
private String mHomeServerUrl = null;
......@@ -65,14 +65,16 @@ public class FallbackLoginActivity extends VectorAppCompatActivity {
@Override
public void initUiAndData() {
configureToolbar();
mWebView = findViewById(R.id.account_creation_webview);
mWebView.getSettings().setJavaScriptEnabled(true);
Intent intent = getIntent();
mHomeServerUrl = "https://matrix.org/";
mHomeServerUrl = getString(R.string.default_hs_server_url);
if (intent.hasExtra(EXTRA_HOME_SERVER_ID)) {
mHomeServerUrl = intent.getStringExtra(EXTRA_HOME_SERVER_ID);
if (intent.hasExtra(EXTRA_HOME_SERVER_URL)) {
mHomeServerUrl = intent.getStringExtra(EXTRA_HOME_SERVER_URL);
}
// check the trailing slash
......@@ -249,16 +251,4 @@ public class FallbackLoginActivity extends VectorAppCompatActivity {
}
return super.onKeyDown(keyCode, event);
}
@Override
public void onLowMemory() {
super.onLowMemory();
CommonActivityUtils.onLowMemory(this);
}
@Override
public void onTrimMemory(int level) {
super.onTrimMemory(level);
CommonActivityUtils.onTrimMemory(this, level);
}
}
......@@ -23,7 +23,6 @@ import android.support.annotation.CallSuper
import android.text.TextUtils
import im.vector.R
import im.vector.types.JsonDict
import im.vector.ui.themes.ActivityOtherThemes
import im.vector.util.toJsonMap
import im.vector.widgets.WidgetsManager
import org.matrix.androidsdk.rest.callback.ApiCallback
......@@ -43,8 +42,6 @@ class IntegrationManagerActivity : AbstractWidgetActivity() {
private var mWidgetId: String? = null
private var mScreenId: String? = null
override fun getOtherThemes() = ActivityOtherThemes.NoActionBar
override fun getLayoutRes() = R.layout.activity_integration_manager
/* ==========================================================================================
......
......@@ -29,7 +29,6 @@ import android.view.ViewGroup;
import android.widget.RelativeLayout;
import android.widget.Toast;
import org.jetbrains.annotations.NotNull;
import org.jitsi.meet.sdk.JitsiMeetView;
import org.jitsi.meet.sdk.JitsiMeetViewListener;
import org.matrix.androidsdk.MXSession;
......@@ -43,7 +42,6 @@ import java.util.Map;
import butterknife.BindView;
import im.vector.Matrix;
import im.vector.R;
import im.vector.ui.themes.ActivityOtherThemes;
import im.vector.widgets.Widget;
import im.vector.widgets.WidgetsManager;
......@@ -109,12 +107,6 @@ public class JitsiCallActivity extends VectorAppCompatActivity {
}
};
@NotNull
@Override
public ActivityOtherThemes getOtherThemes() {
return ActivityOtherThemes.NoActionBar.INSTANCE;
}
@Override
public int getLayoutRes() {
return R.layout.activity_jitsi_call;
......
......@@ -24,7 +24,6 @@ import android.support.v4.view.MenuItemCompat;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.support.v7.widget.SearchView;
import android.support.v7.widget.Toolbar;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
......@@ -81,14 +80,8 @@ public class LanguagePickerActivity extends VectorAppCompatActivity implements L
@Override
public void initUiAndData() {
Toolbar toolbar = findViewById(R.id.toolbar);
if (toolbar != null) {
setSupportActionBar(toolbar);
if (getSupportActionBar() != null) {
getSupportActionBar().setDisplayShowHomeEnabled(true);
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
}
}
configureToolbar();
initViews();
}
......
......@@ -27,7 +27,6 @@ import android.view.ViewGroup;
import android.view.Window;
import android.view.WindowManager;
import android.widget.EditText;
import android.widget.ImageButton;
import android.widget.LinearLayout;
import android.widget.TextView;
import android.widget.Toast;
......@@ -133,7 +132,7 @@ public class LockScreenActivity extends VectorAppCompatActivity { // do NOT exte
((TextView) findViewById(R.id.lock_screen_sender)).setText(getString(R.string.generic_label, intent.getStringExtra(EXTRA_SENDER_NAME)));
((TextView) findViewById(R.id.lock_screen_body)).setText(intent.getStringExtra(EXTRA_MESSAGE_BODY));
((TextView) findViewById(R.id.lock_screen_room_name)).setText(roomName);
final ImageButton sendButton = findViewById(R.id.lock_screen_sendbutton);
final View sendButton = findViewById(R.id.lock_screen_sendbutton);
final EditText editText = findViewById(R.id.lock_screen_edittext);
// disable send button
......
......@@ -18,21 +18,12 @@
package im.vector.activity;
import org.jetbrains.annotations.NotNull;
import im.vector.R;
import im.vector.ui.themes.ActivityOtherThemes;
/**
* LoggingOutActivity displays an animation while a session log out is in progress.
*/
public class LoggingOutActivity extends MXCActionBarActivity {
@NotNull
@Override
public ActivityOtherThemes getOtherThemes() {
return ActivityOtherThemes.NoActionBar.INSTANCE;
}
@Override
public int getLayoutRes() {
return R.layout.vector_activity_splash;
......
......@@ -15,7 +15,6 @@ import android.widget.VideoView;
import com.bumptech.glide.Glide;
import com.bumptech.glide.request.RequestOptions;
import org.jetbrains.annotations.NotNull;
import org.matrix.androidsdk.data.RoomMediaMessage;
import org.matrix.androidsdk.util.Log;
......@@ -25,7 +24,6 @@ import butterknife.BindView;
import butterknife.OnClick;
import im.vector.R;
import im.vector.adapters.MediaPreviewAdapter;
import im.vector.ui.themes.ActivityOtherThemes;
/**
* Previews media selected to be send.
......@@ -60,12 +58,6 @@ public class MediaPreviewerActivity extends MXCActionBarActivity implements Medi
return R.layout.activity_media_previewer;
}
@NotNull
@Override
public ActivityOtherThemes getOtherThemes() {
return ActivityOtherThemes.NoActionBar.INSTANCE;
}
@SuppressLint("ClickableViewAccessibility")
@Override
public void initUiAndData() {
......
......@@ -23,7 +23,6 @@ import android.view.View;
import android.widget.RadioButton;
import android.widget.TextView;
import org.jetbrains.annotations.NotNull;
import org.matrix.androidsdk.rest.callback.SimpleApiCallback;
import org.matrix.androidsdk.rest.model.MatrixError;
......@@ -33,7 +32,6 @@ import im.vector.Matrix;
import im.vector.R;
import im.vector.activity.util.RequestCodesKt;
import im.vector.push.PushManager;
import im.vector.ui.themes.ActivityOtherThemes;
import im.vector.util.SystemUtilsKt;
/*
......@@ -68,12 +66,6 @@ public class NotificationPrivacyActivity extends VectorAppCompatActivity {
* LifeCycle
* ========================================================================================== */
@NotNull
@Override
public ActivityOtherThemes getOtherThemes() {
return ActivityOtherThemes.NoActionBar.INSTANCE;
}
@Override
public int getLayoutRes() {
return R.layout.activity_notification_privacy;
......
......@@ -21,7 +21,6 @@ import android.content.Context;
import android.content.Intent;
import android.support.design.widget.TextInputEditText;
import android.support.design.widget.TextInputLayout;
import android.support.v7.widget.Toolbar;
import android.text.Editable;
import android.text.TextUtils;
import android.text.TextWatcher;
......@@ -36,7 +35,6 @@ import com.google.i18n.phonenumbers.NumberParseException;
import com.google.i18n.phonenumbers.PhoneNumberUtil;
import com.google.i18n.phonenumbers.Phonenumber;
import org.jetbrains.annotations.NotNull;
import org.matrix.androidsdk.MXSession;
import org.matrix.androidsdk.rest.callback.ApiCallback;
import org.matrix.androidsdk.rest.model.MatrixError;
......@@ -45,7 +43,6 @@ import org.matrix.androidsdk.util.Log;
import im.vector.Matrix;
import im.vector.R;
import im.vector.ui.themes.ActivityOtherThemes;
import im.vector.util.PhoneNumberUtils;
public class PhoneNumberAdditionActivity extends VectorAppCompatActivity implements TextView.OnEditorActionListener, TextWatcher, View.OnClickListener {
......@@ -92,12 +89,6 @@ public class PhoneNumberAdditionActivity extends VectorAppCompatActivity impleme
* *********************************************************************************************
*/
@NotNull
@Override
public ActivityOtherThemes getOtherThemes() {
return ActivityOtherThemes.NoActionBar.INSTANCE;
}
@Override
public int getLayoutRes() {
return R.layout.activity_phone_number_addition;
......@@ -110,12 +101,7 @@ public class PhoneNumberAdditionActivity extends VectorAppCompatActivity impleme
@Override
public void initUiAndData() {
Toolbar toolbar = findViewById(R.id.toolbar);
setSupportActionBar(toolbar);
if (null != getSupportActionBar()) {
getSupportActionBar().setDisplayShowHomeEnabled(true);
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
}
configureToolbar();
mCountry = findViewById(R.id.phone_number_country_value);
mCountryLayout = findViewById(R.id.phone_number_country);
......
......@@ -21,7 +21,6 @@ import android.content.Context;
import android.content.Intent;
import android.support.design.widget.TextInputEditText;
import android.support.design.widget.TextInputLayout;
import android.support.v7.widget.Toolbar;
import android.text.Editable;
import android.text.TextUtils;
import android.text.TextWatcher;
......@@ -31,7 +30,6 @@ import android.view.inputmethod.EditorInfo;
import android.widget.TextView;
import android.widget.Toast;
import org.jetbrains.annotations.NotNull;
import org.matrix.androidsdk.MXSession;
import org.matrix.androidsdk.rest.callback.ApiCallback;
import org.matrix.androidsdk.rest.model.MatrixError;
......@@ -40,7 +38,6 @@ import org.matrix.androidsdk.util.Log;
import im.vector.Matrix;
import im.vector.R;
import im.vector.ui.themes.ActivityOtherThemes;
public class PhoneNumberVerificationActivity extends VectorAppCompatActivity implements TextView.OnEditorActionListener, TextWatcher {
......@@ -78,12 +75,6 @@ public class PhoneNumberVerificationActivity extends VectorAppCompatActivity imp
* *********************************************************************************************
*/
@NotNull
@Override
public ActivityOtherThemes getOtherThemes() {
return ActivityOtherThemes.NoActionBar.INSTANCE;
}
@Override
public int getLayoutRes() {
return R.layout.activity_phone_number_verification;
......@@ -96,12 +87,7 @@ public class PhoneNumberVerificationActivity extends VectorAppCompatActivity imp
@Override
public void initUiAndData() {
Toolbar toolbar = findViewById(R.id.toolbar);
setSupportActionBar(toolbar);
if (null != getSupportActionBar()) {
getSupportActionBar().setDisplayShowHomeEnabled(true);
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
}
configureToolbar();
mPhoneNumberCode = findViewById(R.id.phone_number_code_value);
mPhoneNumberCodeLayout = findViewById(R.id.phone_number_code);
......
......@@ -23,7 +23,6 @@ import android.content.Intent;
import android.support.v7.app.AlertDialog;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.support.v7.widget.Toolbar;
import android.text.TextUtils;
import android.view.LayoutInflater;
import android.view.MenuItem;
......@@ -31,7 +30,6 @@ import android.view.View;
import android.widget.EditText;
import android.widget.Toast;
import org.jetbrains.annotations.NotNull;
import org.matrix.androidsdk.MXSession;
import org.matrix.androidsdk.rest.callback.ApiCallback;
import org.matrix.androidsdk.rest.model.MatrixError;
......@@ -47,7 +45,6 @@ import java.util.Map;
import im.vector.Matrix;
import im.vector.R;
import im.vector.adapters.RoomDirectoryAdapter;
import im.vector.ui.themes.ActivityOtherThemes;
import im.vector.util.RoomDirectoryData;
public class RoomDirectoryPickerActivity extends VectorAppCompatActivity implements RoomDirectoryAdapter.OnSelectRoomDirectoryListener {
......@@ -78,12 +75,6 @@ public class RoomDirectoryPickerActivity extends VectorAppCompatActivity impleme
* *********************************************************************************************
*/
@NotNull
@Override
public ActivityOtherThemes getOtherThemes() {
return ActivityOtherThemes.Directory.INSTANCE;
}
@Override
public int getLayoutRes() {
return R.layout.activity_room_directory_picker;
......@@ -98,14 +89,7 @@ public class RoomDirectoryPickerActivity extends VectorAppCompatActivity impleme
public void initUiAndData() {
setWaitingView(findViewById(R.id.room_directory_loading));
Toolbar toolbar = findViewById(R.id.toolbar);
if (toolbar != null) {
setSupportActionBar(toolbar);
if (getSupportActionBar() != null) {
getSupportActionBar().setDisplayShowHomeEnabled(true);
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
}
}
configureToolbar();
final Intent intent = getIntent();
String sessionId = intent.getStringExtra(EXTRA_SESSION_ID);
......
......@@ -20,12 +20,11 @@ package im.vector.activity;
import android.content.Intent;
import android.os.Build;
import android.os.Bundle;
import android.preference.PreferenceManager;
import android.support.v7.preference.PreferenceManager;
import android.widget.ImageView;
import com.bumptech.glide.Glide;
import org.jetbrains.annotations.NotNull;
import org.matrix.androidsdk.MXSession;
import org.matrix.androidsdk.listeners.IMXEventListener;
import org.matrix.androidsdk.listeners.MXEventListener;
......@@ -48,7 +47,6 @@ import im.vector.analytics.TrackingEvent;
import im.vector.push.PushManager;
import im.vector.receiver.VectorUniversalLinkReceiver;
import im.vector.services.EventStreamService;
import im.vector.ui.themes.ActivityOtherThemes;
import im.vector.util.PreferencesManager;
/**
......@@ -116,7 +114,8 @@ public class SplashActivity extends MXCActionBarActivity {
// launch from a shared files menu
if (getIntent().hasExtra(VectorHomeActivity.EXTRA_SHARED_INTENT_PARAMS)) {
intent.putExtra(VectorHomeActivity.EXTRA_SHARED_INTENT_PARAMS, getIntent().getParcelableExtra(VectorHomeActivity.EXTRA_SHARED_INTENT_PARAMS));
intent.putExtra(VectorHomeActivity.EXTRA_SHARED_INTENT_PARAMS,
(Intent) getIntent().getParcelableExtra(VectorHomeActivity.EXTRA_SHARED_INTENT_PARAMS));
getIntent().removeExtra(VectorHomeActivity.EXTRA_SHARED_INTENT_PARAMS);
}
......@@ -135,12 +134,6 @@ public class SplashActivity extends MXCActionBarActivity {
}
}
@NotNull
@Override
public ActivityOtherThemes getOtherThemes() {
return ActivityOtherThemes.NoActionBar.INSTANCE;
}
@Override
public int getLayoutRes() {
return R.layout.vector_activity_splash;
......
......@@ -23,7 +23,6 @@ import android.view.MenuItem
import im.vector.R
import im.vector.activity.util.INTEGRATION_MANAGER_ACTIVITY_REQUEST_CODE
import im.vector.types.JsonDict
import im.vector.ui.themes.ActivityOtherThemes
import org.matrix.androidsdk.util.JsonUtils
import org.matrix.androidsdk.util.Log
import java.net.URLEncoder
......@@ -41,8 +40,6 @@ class StickerPickerActivity : AbstractWidgetActivity() {
* IMPLEMENT METHODS
* ========================================================================================== */
override fun getOtherThemes() = ActivityOtherThemes.NoActionBar
override fun getLayoutRes() = R.layout.activity_choose_sticker
override fun getTitleRes() = R.string.title_activity_choose_sticker
......
......@@ -74,6 +74,8 @@ public abstract class VectorBaseSearchActivity extends MXCActionBarActivity {
@Override
@CallSuper
public void initUiAndData() {
configureToolbar();
mActionBar = getSupportActionBar();
View actionBarView = customizeActionBar();
......
......@@ -542,6 +542,7 @@ public class VectorCallViewActivity extends VectorAppCompatActivity implements S
CommonActivityUtils.displayUnknownDevicesDialog(mSession,
VectorCallViewActivity.this,
(MXUsersDevicesMap<MXDeviceInfo>) intent.getSerializableExtra(VectorCallViewActivity.EXTRA_UNKNOWN_DEVICES),
true,
null);
}
});
......
......@@ -147,6 +147,8 @@ public class VectorGroupDetailsActivity extends MXCActionBarActivity {
@Override
public void initUiAndData() {
configureToolbar();
if (CommonActivityUtils.shouldRestartApp(this)) {
Log.e(LOG_TAG, "Restart the application.");
CommonActivityUtils.restartApp(this);
......
......@@ -34,7 +34,6 @@ import android.os.Build;
import android.os.Bundle;
import android.os.Handler;
import android.os.Looper;
import android.preference.PreferenceManager;
import android.support.annotation.NonNull;
import android.support.design.internal.BottomNavigationItemView;
import android.support.design.internal.BottomNavigationMenuView;
......@@ -48,6 +47,7 @@ import android.support.v4.view.GravityCompat;
import android.support.v4.widget.DrawerLayout;
import android.support.v7.app.ActionBarDrawerToggle;
import android.support.v7.app.AlertDialog;
import android.support.v7.preference.PreferenceManager;
import android.support.v7.widget.SearchView;
import android.support.v7.widget.Toolbar;
import android.text.Editable;
......
......@@ -45,9 +45,9 @@ import android.opengl.GLES20;
import android.os.Build;
import android.os.Bundle;
import android.os.HandlerThread;
import android.preference.PreferenceManager;
import android.provider.MediaStore;
import android.support.annotation.NonNull;
import android.support.v7.preference.PreferenceManager;
import android.text.TextUtils;
import android.util.DisplayMetrics;
import android.view.MotionEvent;
......
......@@ -29,7 +29,7 @@ import android.widget.Toast;
import com.google.gson.JsonElement;
import org.matrix.androidsdk.MXSession;
import org.matrix.androidsdk.db.MXMediasCache;
import org.matrix.androidsdk.db.MXMediaCache;
import org.matrix.androidsdk.listeners.MXMediaDownloadListener;
import org.matrix.androidsdk.rest.callback.SimpleApiCallback;
import org.matrix.androidsdk.rest.model.MatrixError;
......@@ -122,6 +122,8 @@ public class VectorMediasViewerActivity extends MXCActionBarActivity {
@Override
public void initUiAndData() {
configureToolbar();
if (CommonActivityUtils.shouldRestartApp(this)) {
Log.d(LOG_TAG, "onCreate : restart the application");
CommonActivityUtils.restartApp(this);
......@@ -160,7 +162,7 @@ public class VectorMediasViewerActivity extends MXCActionBarActivity {
int maxImageWidth = intent.getIntExtra(KEY_THUMBNAIL_WIDTH, 0);
int maxImageHeight = intent.getIntExtra(VectorMediasViewerActivity.KEY_THUMBNAIL_HEIGHT, 0);
mAdapter = new VectorMediasViewerAdapter(this, mSession, mSession.getMediasCache(), mMediasList, maxImageWidth, maxImageHeight);
mAdapter = new VectorMediasViewerAdapter(this, mSession, mSession.getMediaCache(), mMediasList, maxImageWidth, maxImageHeight);
mViewPager.setAdapter(mAdapter);
mViewPager.setPageTransformer(true, new DepthPageTransformer());
mAdapter.autoPlayItemAt(position);
......@@ -225,7 +227,7 @@ public class VectorMediasViewerActivity extends MXCActionBarActivity {
* Download the current video file
*/
private void onAction(final int position, final int action) {
final MXMediasCache mediasCache = Matrix.getInstance(this).getMediasCache();
final MXMediaCache mediasCache = Matrix.getInstance(this).getMediaCache();
final SlidableMediaInfo mediaInfo = mMediasList.get(position);
// check if the media has already been downloaded
......
......@@ -34,7 +34,6 @@ import android.widget.ListView;
import android.widget.TextView;
import android.widget.Toast;
import org.jetbrains.annotations.NotNull;
import org.matrix.androidsdk.MXPatterns;
import org.matrix.androidsdk.MXSession;
import org.matrix.androidsdk.call.IMXCall;
......@@ -68,7 +67,6 @@ import im.vector.adapters.VectorMemberDetailsAdapter;
import im.vector.adapters.VectorMemberDetailsDevicesAdapter;