2015-02-08 21:53:12 +00:00
|
|
|
package org.thoughtcrime.securesms;
|
|
|
|
|
2019-07-23 23:51:09 +00:00
|
|
|
import android.app.ActivityManager;
|
2019-03-25 20:23:38 +00:00
|
|
|
import android.content.Context;
|
2019-07-23 23:51:09 +00:00
|
|
|
import android.graphics.Bitmap;
|
|
|
|
import android.graphics.BitmapFactory;
|
2015-02-08 21:53:12 +00:00
|
|
|
import android.os.Build;
|
2015-02-10 23:33:57 +00:00
|
|
|
import android.os.Build.VERSION;
|
|
|
|
import android.os.Build.VERSION_CODES;
|
2020-08-19 00:06:26 +00:00
|
|
|
import androidx.annotation.NonNull;
|
|
|
|
import androidx.fragment.app.FragmentActivity;
|
2015-02-08 21:53:12 +00:00
|
|
|
import android.view.KeyEvent;
|
|
|
|
|
2021-01-15 05:51:53 +00:00
|
|
|
import org.session.libsession.utilities.TextSecurePreferences;
|
|
|
|
import org.session.libsession.utilities.dynamiclanguage.DynamicLanguageActivityHelper;
|
|
|
|
import org.session.libsession.utilities.dynamiclanguage.DynamicLanguageContextWrapper;
|
2019-03-25 20:23:38 +00:00
|
|
|
|
2019-07-24 02:30:23 +00:00
|
|
|
import network.loki.messenger.R;
|
|
|
|
|
2015-02-08 21:53:12 +00:00
|
|
|
public abstract class BaseActivity extends FragmentActivity {
|
2019-03-25 20:23:38 +00:00
|
|
|
@Override
|
|
|
|
protected void onResume() {
|
|
|
|
super.onResume();
|
|
|
|
DynamicLanguageActivityHelper.recreateIfNotInCorrectLanguage(this, TextSecurePreferences.getLanguage(this));
|
2019-09-18 05:40:18 +00:00
|
|
|
String name = getResources().getString(R.string.app_name);
|
|
|
|
Bitmap icon = BitmapFactory.decodeResource(getResources(), R.drawable.ic_launcher_foreground);
|
2020-01-09 00:35:43 +00:00
|
|
|
int color = getResources().getColor(R.color.app_icon_background);
|
2019-09-18 05:40:18 +00:00
|
|
|
setTaskDescription(new ActivityManager.TaskDescription(name, icon, color));
|
2019-03-25 20:23:38 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
protected void attachBaseContext(Context newBase) {
|
|
|
|
super.attachBaseContext(DynamicLanguageContextWrapper.updateContext(newBase, TextSecurePreferences.getLanguage(newBase)));
|
|
|
|
}
|
2015-02-08 21:53:12 +00:00
|
|
|
}
|