Prepare play release
This commit is contained in:
parent
452ae3ee38
commit
a0d75bdee5
19 changed files with 80 additions and 398 deletions
|
@ -11,8 +11,6 @@
|
|||
<uses-permission android:name="android.permission.READ_MEDIA_AUDIO" />
|
||||
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
|
||||
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
|
||||
<uses-permission android:name="android.permission.READ_CONTACTS" />
|
||||
<uses-permission android:name="android.permission.READ_PROFILE" />
|
||||
<uses-permission android:name="android.permission.INTERNET" />
|
||||
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
|
||||
<uses-permission android:name="android.permission.WAKE_LOCK" />
|
||||
|
@ -133,11 +131,11 @@
|
|||
tools:targetApi="tiramisu">
|
||||
|
||||
<service
|
||||
android:name="de.monocles.chat.DownloadDefaultStickers"
|
||||
android:name="eu.monocles.chat.DownloadDefaultStickers"
|
||||
android:exported="false"
|
||||
android:foregroundServiceType="dataSync" />
|
||||
|
||||
<service android:name="de.monocles.chat.ConnectionService"
|
||||
<service android:name="eu.monocles.chat.ConnectionService"
|
||||
android:label="@string/app_name"
|
||||
android:permission="android.permission.BIND_TELECOM_CONNECTION_SERVICE"
|
||||
android:exported="true" >
|
||||
|
@ -234,7 +232,7 @@
|
|||
<receiver android:name=".services.AlarmReceiver" />
|
||||
|
||||
<activity
|
||||
android:name="de.monocles.chat.ui.StartUI"
|
||||
android:name="eu.monocles.chat.ui.StartUI"
|
||||
android:configChanges="orientation|screenSize"
|
||||
android:label="@string/short_app_name"
|
||||
android:launchMode="singleTask"
|
||||
|
@ -345,7 +343,7 @@
|
|||
android:exported="false"
|
||||
android:launchMode="singleTask" />
|
||||
<activity
|
||||
android:name="de.monocles.chat.SignUpPage"
|
||||
android:name="eu.monocles.chat.SignUpPage"
|
||||
android:label="@string/create_account"
|
||||
android:launchMode="singleTask"
|
||||
android:exported="true">
|
||||
|
@ -363,13 +361,13 @@
|
|||
</activity>
|
||||
|
||||
<activity
|
||||
android:name="de.monocles.chat.WebxdcStore"
|
||||
android:name="eu.monocles.chat.WebxdcStore"
|
||||
android:label="@string/webxdcs"
|
||||
android:launchMode="standard"
|
||||
android:exported="false" />
|
||||
|
||||
<activity
|
||||
android:name="de.monocles.chat.RegisterMonoclesActivity"
|
||||
android:name="eu.monocles.chat.RegisterMonoclesActivity"
|
||||
android:label="@string/create_account"
|
||||
android:exported="false"
|
||||
android:launchMode="singleTask" />
|
||||
|
|
|
@ -112,7 +112,7 @@ public class DownloadDefaultStickers extends Service {
|
|||
os.close();
|
||||
} catch (final Exception e) {
|
||||
file = null;
|
||||
Log.d(de.monocles.chat.Config.LOGTAG, Objects.requireNonNull(e.getMessage()));
|
||||
Log.d(eu.siacs.conversations.Config.LOGTAG, Objects.requireNonNull(e.getMessage()));
|
||||
}
|
||||
|
||||
JSONArray cids = sticker.getJSONArray("cids");
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
package de.monocles.chat;
|
||||
package eu.monocles.chat;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.content.Context;
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
package de.monocles.chat;
|
||||
package eu.monocles.chat;
|
||||
|
||||
import android.content.Context;
|
||||
import android.util.AttributeSet;
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
package de.monocles.chat;
|
||||
package eu.monocles.chat;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.content.Context;
|
||||
|
|
|
@ -1,343 +0,0 @@
|
|||
package eu.monocles.chat.ui;
|
||||
|
||||
import android.content.DialogInterface;
|
||||
import android.content.Intent;
|
||||
import android.net.Uri;
|
||||
import android.os.Bundle;
|
||||
import android.content.SharedPreferences;
|
||||
import android.content.res.Resources;
|
||||
import android.preference.PreferenceManager;
|
||||
import android.util.Log;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.Menu;
|
||||
import android.view.MenuItem;
|
||||
import android.view.View;
|
||||
|
||||
import eu.siacs.conversations.ui.ChannelDiscoveryActivity;
|
||||
import eu.siacs.conversations.ui.ConversationsActivity;
|
||||
import eu.siacs.conversations.ui.MediaBrowserActivity;
|
||||
import eu.siacs.conversations.ui.StartConversationActivity;
|
||||
import eu.siacs.conversations.ui.XmppActivity;
|
||||
import eu.siacs.conversations.utils.Compatibility;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.appcompat.app.AlertDialog;
|
||||
import androidx.appcompat.widget.Toolbar;
|
||||
import androidx.core.content.ContextCompat;
|
||||
import androidx.databinding.DataBindingUtil;
|
||||
|
||||
import com.google.android.material.bottomnavigation.BottomNavigationView;
|
||||
import com.google.android.material.snackbar.Snackbar;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.io.ObjectInputStream;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
import eu.siacs.conversations.Config;
|
||||
import eu.siacs.conversations.R;
|
||||
import eu.siacs.conversations.databinding.ActivityCallsBinding;
|
||||
import eu.siacs.conversations.databinding.DialogEnterPasswordBinding;
|
||||
import eu.siacs.conversations.services.ImportBackupService;
|
||||
import eu.siacs.conversations.ui.adapter.BackupFileAdapter;
|
||||
import eu.siacs.conversations.utils.ThemeHelper;
|
||||
import eu.siacs.conversations.utils.BackupFileHeader;
|
||||
|
||||
|
||||
public class CallsActivity extends XmppActivity {
|
||||
|
||||
private ActivityCallsBinding binding;
|
||||
|
||||
|
||||
private BackupFileAdapter backupFileAdapter;
|
||||
private ImportBackupService service;
|
||||
private boolean mLoadingState = false;
|
||||
|
||||
|
||||
@Override
|
||||
protected void onCreate(final Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
binding = DataBindingUtil.setContentView(this, R.layout.activity_calls);
|
||||
setSupportActionBar((Toolbar) binding.toolbar.getRoot());
|
||||
setLoadingState(savedInstanceState != null && savedInstanceState.getBoolean("loading_state", false));
|
||||
|
||||
this.backupFileAdapter = new BackupFileAdapter();
|
||||
this.binding.list.setAdapter(this.backupFileAdapter);
|
||||
//this.backupFileAdapter.setOnItemClickedListener(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onCreateOptionsMenu(final Menu menu) {
|
||||
getMenuInflater().inflate(R.menu.import_backup, menu);
|
||||
final MenuItem openBackup = menu.findItem(R.id.action_open_backup_file);
|
||||
openBackup.setVisible(!this.mLoadingState);
|
||||
|
||||
|
||||
// Initialize and assign variable
|
||||
BottomNavigationView bottomNavigationView=findViewById(R.id.bottom_navigation);
|
||||
|
||||
// Set Home selected
|
||||
bottomNavigationView.setSelectedItemId(R.id.calls);
|
||||
|
||||
// Perform item selected listener
|
||||
bottomNavigationView.setOnNavigationItemSelectedListener(new BottomNavigationView.OnNavigationItemSelectedListener() {
|
||||
@Override
|
||||
public boolean onNavigationItemSelected(@NonNull MenuItem item) {
|
||||
|
||||
switch(item.getItemId())
|
||||
{
|
||||
case R.id.chats:
|
||||
startActivity(new Intent(getApplicationContext(), ConversationsActivity.class));
|
||||
overridePendingTransition(R.animator.fade_in, R.animator.fade_out);
|
||||
return true;
|
||||
case R.id.calls:
|
||||
return true;
|
||||
case R.id.contactslist:
|
||||
startActivity(new Intent(getApplicationContext(),StartConversationActivity.class));
|
||||
overridePendingTransition(R.animator.fade_in, R.animator.fade_out);
|
||||
return true;
|
||||
case R.id.stories:
|
||||
startActivity(new Intent(getApplicationContext(),MediaBrowserActivity.class));
|
||||
overridePendingTransition(R.animator.fade_in, R.animator.fade_out);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
});
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void refreshUiReal() {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onSaveInstanceState(Bundle bundle) {
|
||||
bundle.putBoolean("loading_state", this.mLoadingState);
|
||||
super.onSaveInstanceState(bundle);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onStart() {
|
||||
super.onStart();
|
||||
final int theme = ThemeHelper.find(this);
|
||||
if (this.mTheme != theme) {
|
||||
recreate();
|
||||
} else {
|
||||
//bindService(new Intent(this, ImportBackupService.class), this, Context.BIND_AUTO_CREATE);
|
||||
}
|
||||
final Intent intent = getIntent();
|
||||
if (intent != null && Intent.ACTION_VIEW.equals(intent.getAction()) && !this.mLoadingState) {
|
||||
Uri uri = intent.getData();
|
||||
if (uri != null) {
|
||||
openBackupFileFromUri(uri, true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onStop() {
|
||||
super.onStop();
|
||||
if (this.service != null) {
|
||||
//this.service.removeOnBackupProcessedListener(this);
|
||||
}
|
||||
//unbindService(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBackendConnected() {
|
||||
}
|
||||
|
||||
|
||||
|
||||
/***
|
||||
* Restore settings from a backup file
|
||||
* @param uri
|
||||
*/
|
||||
@SuppressWarnings (value="unchecked")
|
||||
private void restoreSettingsFromFile(Uri uri) {
|
||||
try {
|
||||
SharedPreferences current_prefs = PreferenceManager.getDefaultSharedPreferences(getApplicationContext());
|
||||
SharedPreferences.Editor editor = current_prefs.edit();
|
||||
InputStream inputStream = getContentResolver().openInputStream(uri);
|
||||
ObjectInputStream ois = new ObjectInputStream(inputStream);
|
||||
HashMap<String, ?> backup_prefs = (HashMap<String, ?>) ois.readObject();
|
||||
|
||||
for (Map.Entry<String, ?> entry : backup_prefs.entrySet()) {
|
||||
String k = entry.getKey();
|
||||
Object v = entry.getValue();
|
||||
|
||||
if(v instanceof Boolean) {
|
||||
editor.putBoolean(k, (Boolean) v);
|
||||
} else if(v instanceof Float) {
|
||||
editor.putFloat(k, (Float) v);
|
||||
} else if(v instanceof Integer) {
|
||||
editor.putInt(k, (Integer) v);
|
||||
} else if(v instanceof Long) {
|
||||
editor.putLong(k, (Long) v);
|
||||
} else if (v instanceof String) {
|
||||
editor.putString(k, v.toString());
|
||||
} else {
|
||||
editor.putStringSet(k, (Set<String>)v);
|
||||
}
|
||||
}
|
||||
|
||||
editor.apply(); // this may fail...
|
||||
ois.close();
|
||||
inputStream.close();
|
||||
showSnackbarAndFinishActivity(R.string.settings_restore_message_success, 2000, null);
|
||||
} catch (IOException iox) {
|
||||
Log.d(Config.LOGTAG, "Failed to open settings backup file: " + iox.getMessage());
|
||||
showSnackbarAndFinishActivity(R.string.settings_restore_message_failure, 5000, iox.getMessage());
|
||||
} catch(ClassNotFoundException cnfx) {
|
||||
Log.d(Config.LOGTAG, "Failed to parse settings backup file: " + cnfx.getMessage());
|
||||
showSnackbarAndFinishActivity(R.string.settings_restore_message_failure, 5000, cnfx.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
/***
|
||||
* Show a Snackbar and finish the current activity (returning to the previous) after the given timeout
|
||||
* @param resourceID
|
||||
* @param timeoutMillis
|
||||
* @param msg Additional error message
|
||||
*/
|
||||
private void showSnackbarAndFinishActivity(int resourceID, int timeoutMillis, String msg) {
|
||||
Resources res = getResources();
|
||||
Snackbar sb = null;
|
||||
|
||||
if(msg == null) {
|
||||
sb = Snackbar.make(binding.coordinator, res.getString(resourceID), Snackbar.LENGTH_LONG);
|
||||
} else {
|
||||
sb = Snackbar.make(binding.coordinator, String.format(res.getString(resourceID), msg), Snackbar.LENGTH_LONG);
|
||||
}
|
||||
|
||||
sb.setDuration(timeoutMillis);
|
||||
sb.addCallback(new Snackbar.Callback() {
|
||||
public void onDismissed(Snackbar snackbar, int event) {
|
||||
if (event == Snackbar.Callback.DISMISS_EVENT_TIMEOUT) {
|
||||
finish();
|
||||
}
|
||||
}
|
||||
});
|
||||
sb.show();
|
||||
}
|
||||
|
||||
|
||||
/***
|
||||
* TODO: make this function distinguish between a .ceb file and a settings file
|
||||
* @param uri
|
||||
* @param finishOnCancel
|
||||
*/
|
||||
|
||||
private void openBackupFileFromUri(final Uri uri, final boolean finishOnCancel) {
|
||||
new Thread(() -> {
|
||||
try {
|
||||
if( uri.getPath().endsWith(".ceb") ) {
|
||||
final ImportBackupService.BackupFile backupFile = ImportBackupService.BackupFile.read(this, uri);
|
||||
runOnUiThread(() -> showEnterPasswordDialog(backupFile, finishOnCancel));
|
||||
} else {
|
||||
restoreSettingsFromFile(uri);
|
||||
}
|
||||
} catch (final BackupFileHeader.OutdatedBackupFileVersion e) {
|
||||
Snackbar.make(binding.coordinator, R.string.outdated_backup_file_format, Snackbar.LENGTH_LONG).show();
|
||||
} catch (final IOException | IllegalArgumentException e) {
|
||||
Log.d(Config.LOGTAG, "unable to open backup file " + uri, e);
|
||||
runOnUiThread(() -> Snackbar.make(binding.coordinator, R.string.not_a_backup_file, Snackbar.LENGTH_LONG).show());
|
||||
}
|
||||
}).start();
|
||||
}
|
||||
|
||||
private void showEnterPasswordDialog(final ImportBackupService.BackupFile backupFile, final boolean finishOnCancel) {
|
||||
final DialogEnterPasswordBinding enterPasswordBinding = DataBindingUtil.inflate(LayoutInflater.from(this), R.layout.dialog_enter_password, null, false);
|
||||
Log.d(Config.LOGTAG, "attempting to import " + backupFile.getUri());
|
||||
enterPasswordBinding.explain.setText(getString(R.string.enter_password_to_restore, backupFile.getHeader().getJid().toString()));
|
||||
final AlertDialog.Builder builder = new AlertDialog.Builder(this);
|
||||
builder.setView(enterPasswordBinding.getRoot());
|
||||
builder.setTitle(R.string.enter_password);
|
||||
builder.setNegativeButton(R.string.cancel, (dialog, which) -> {
|
||||
if (finishOnCancel) {
|
||||
finish();
|
||||
}
|
||||
});
|
||||
builder.setPositiveButton(R.string.restore, null);
|
||||
builder.setCancelable(false);
|
||||
final AlertDialog dialog = builder.create();
|
||||
dialog.setOnShowListener((d) -> {
|
||||
dialog.getButton(DialogInterface.BUTTON_POSITIVE).setOnClickListener(v -> {
|
||||
final String password = enterPasswordBinding.accountPassword.getEditableText().toString();
|
||||
if (password.isEmpty()) {
|
||||
enterPasswordBinding.accountPasswordLayout.setError(getString(R.string.please_enter_password));
|
||||
return;
|
||||
}
|
||||
final Uri uri = backupFile.getUri();
|
||||
Intent intent = new Intent(this, ImportBackupService.class);
|
||||
intent.setAction(Intent.ACTION_SEND);
|
||||
intent.putExtra("password", password);
|
||||
if ("file".equals(uri.getScheme())) {
|
||||
intent.putExtra("file", uri.getPath());
|
||||
} else {
|
||||
intent.setData(uri);
|
||||
intent.setFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION);
|
||||
}
|
||||
setLoadingState(true);
|
||||
ContextCompat.startForegroundService(this, intent);
|
||||
d.dismiss();
|
||||
});
|
||||
});
|
||||
dialog.show();
|
||||
}
|
||||
|
||||
private void setLoadingState(final boolean loadingState) {
|
||||
binding.coordinator.setVisibility(loadingState ? View.GONE : View.VISIBLE);
|
||||
binding.inProgress.setVisibility(loadingState ? View.VISIBLE : View.GONE);
|
||||
setTitle(loadingState ? R.string.restoring_backup : R.string.restore_backup);
|
||||
configureActionBar(getSupportActionBar(), !loadingState);
|
||||
this.mLoadingState = loadingState;
|
||||
invalidateOptionsMenu();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onActivityResult(int requestCode, int resultCode, Intent intent) {
|
||||
super.onActivityResult(requestCode, resultCode, intent);
|
||||
if (resultCode == RESULT_OK) {
|
||||
if (requestCode == 0xbac) {
|
||||
openBackupFileFromUri(intent.getData(), false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void restart() {
|
||||
Log.d(Config.LOGTAG, "Restarting " + getBaseContext().getPackageManager().getLaunchIntentForPackage(getBaseContext().getPackageName()));
|
||||
Intent intent = getBaseContext().getPackageManager().getLaunchIntentForPackage(getBaseContext().getPackageName());
|
||||
intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
|
||||
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
|
||||
startActivity(intent);
|
||||
overridePendingTransition(R.animator.fade_in, R.animator.fade_out);
|
||||
System.exit(0);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onOptionsItemSelected(MenuItem item) {
|
||||
if (item.getItemId() == R.id.action_open_backup_file) {
|
||||
openBackupFile();
|
||||
return true;
|
||||
}
|
||||
return super.onOptionsItemSelected(item);
|
||||
}
|
||||
|
||||
private void openBackupFile() {
|
||||
Intent intent;
|
||||
if (Compatibility.runsThirty()) {
|
||||
intent = new Intent(Intent.ACTION_OPEN_DOCUMENT);
|
||||
} else {
|
||||
intent = new Intent(Intent.ACTION_GET_CONTENT);
|
||||
}
|
||||
intent.setType("*/*");
|
||||
intent.putExtra(Intent.EXTRA_ALLOW_MULTIPLE, false);
|
||||
intent.addCategory(Intent.CATEGORY_OPENABLE);
|
||||
startActivityForResult(Intent.createChooser(intent, getString(R.string.open_backup)), 0xbac);
|
||||
}
|
||||
}
|
|
@ -64,9 +64,9 @@ import com.google.android.material.tabs.TabLayout;
|
|||
import com.google.android.material.textfield.TextInputLayout;
|
||||
import com.google.common.base.Optional;
|
||||
|
||||
import de.monocles.chat.ConversationPage;
|
||||
import de.monocles.chat.Util;
|
||||
import de.monocles.chat.WebxdcPage;
|
||||
import eu.monocles.chat.ConversationPage;
|
||||
import eu.monocles.chat.Util;
|
||||
import eu.monocles.chat.WebxdcPage;
|
||||
|
||||
import io.michaelrocks.libphonenumber.android.NumberParseException;
|
||||
|
||||
|
|
|
@ -65,8 +65,8 @@ import com.wolt.blurhashkt.BlurHashDecoder;
|
|||
|
||||
import org.tomlj.Toml;
|
||||
|
||||
import de.monocles.chat.BobTransfer;
|
||||
import de.monocles.chat.ThumbHash;
|
||||
import eu.monocles.chat.BobTransfer;
|
||||
import eu.monocles.chat.ThumbHash;
|
||||
|
||||
import java.io.ByteArrayInputStream;
|
||||
import java.io.ByteArrayOutputStream;
|
||||
|
|
|
@ -59,6 +59,7 @@ public class CallIntegration extends Connection {
|
|||
private AudioDevice initialAudioDevice = null;
|
||||
private final AtomicBoolean initialAudioDeviceConfigured = new AtomicBoolean(false);
|
||||
private final AtomicBoolean delayedDestructionInitiated = new AtomicBoolean(false);
|
||||
private final AtomicBoolean isDestroyed = new AtomicBoolean(false);
|
||||
|
||||
private List<CallEndpoint> availableEndpoints = Collections.emptyList();
|
||||
|
||||
|
@ -388,7 +389,6 @@ public class CallIntegration extends Connection {
|
|||
Log.d(Config.LOGTAG, "CallIntegration.error()");
|
||||
startTone(DEFAULT_TONE_VOLUME, ToneGenerator.TONE_CDMA_CALLDROP_LITE, 375);
|
||||
this.destroyWithDelay(new DisconnectCause(DisconnectCause.ERROR, null), 375);
|
||||
this.destroyWith(new DisconnectCause(DisconnectCause.ERROR, null));
|
||||
}
|
||||
|
||||
public void retracted() {
|
||||
|
@ -413,7 +413,7 @@ public class CallIntegration extends Connection {
|
|||
JingleConnectionManager.SCHEDULED_EXECUTOR_SERVICE.schedule(
|
||||
() -> {
|
||||
this.setDisconnected(disconnectCause);
|
||||
this.destroy();
|
||||
this.destroyCallIntegration();
|
||||
},
|
||||
delay,
|
||||
TimeUnit.MILLISECONDS);
|
||||
|
@ -428,7 +428,7 @@ public class CallIntegration extends Connection {
|
|||
return;
|
||||
}
|
||||
this.setDisconnected(disconnectCause);
|
||||
this.destroy();
|
||||
this.destroyCallIntegration();
|
||||
Log.d(Config.LOGTAG, "destroyed!");
|
||||
}
|
||||
|
||||
|
@ -516,6 +516,15 @@ public class CallIntegration extends Connection {
|
|||
audioManager.getAudioDevices()));
|
||||
}
|
||||
|
||||
private void destroyCallIntegration() {
|
||||
super.destroy();
|
||||
this.isDestroyed.set(true);
|
||||
}
|
||||
|
||||
public boolean isDestroyed() {
|
||||
return this.isDestroyed.get();
|
||||
}
|
||||
|
||||
/** AudioDevice is the names of possible audio devices that we currently support. */
|
||||
public enum AudioDevice {
|
||||
NONE,
|
||||
|
|
|
@ -27,9 +27,9 @@ import com.kedia.ogparser.OpenGraphCallback;
|
|||
import com.kedia.ogparser.OpenGraphParser;
|
||||
import com.kedia.ogparser.OpenGraphResult;
|
||||
|
||||
import de.monocles.chat.EmojiSearch;
|
||||
import de.monocles.chat.GifsAdapter;
|
||||
import de.monocles.chat.StickerAdapter;
|
||||
import eu.monocles.chat.EmojiSearch;
|
||||
import eu.monocles.chat.GifsAdapter;
|
||||
import eu.monocles.chat.StickerAdapter;
|
||||
import eu.siacs.conversations.ui.ConversationsActivity;
|
||||
import eu.siacs.conversations.persistance.UnifiedPushDatabase;
|
||||
import eu.siacs.conversations.ui.util.Attachment;
|
||||
|
@ -116,7 +116,7 @@ import com.google.common.collect.Multimap;
|
|||
|
||||
import com.otaliastudios.transcoder.strategy.DefaultAudioStrategy;
|
||||
|
||||
import de.monocles.chat.WebxdcUpdate;
|
||||
import eu.monocles.chat.WebxdcUpdate;
|
||||
|
||||
import org.conscrypt.Conscrypt;
|
||||
import org.openintents.openpgp.IOpenPgpService2;
|
||||
|
@ -1765,10 +1765,12 @@ public class XmppConnectionService extends Service {
|
|||
}
|
||||
|
||||
restoreFromDatabase();
|
||||
|
||||
/*
|
||||
if (ContextCompat.checkSelfPermission(this, Manifest.permission.READ_CONTACTS) == PackageManager.PERMISSION_GRANTED) {
|
||||
startContactObserver();
|
||||
}
|
||||
|
||||
*/
|
||||
FileBackend.switchStorage(usingInnerStorage());
|
||||
FILE_OBSERVER_EXECUTOR.execute(fileBackend::deleteHistoricAvatarPath);
|
||||
if (Compatibility.hasStoragePermission(this)) {
|
||||
|
|
|
@ -168,17 +168,19 @@ public class ContactDetailsActivity extends OmemoActivity implements OnAccountUp
|
|||
private void checkContactPermissionAndShowAddDialog() {
|
||||
if (hasContactsPermission()) {
|
||||
showAddToPhoneBookDialog();
|
||||
} else if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
|
||||
}
|
||||
/*
|
||||
else {
|
||||
requestPermissions(new String[]{Manifest.permission.READ_CONTACTS}, REQUEST_SYNC_CONTACTS);
|
||||
}
|
||||
*/
|
||||
}
|
||||
|
||||
private boolean hasContactsPermission() {
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
|
||||
return checkSelfPermission(Manifest.permission.READ_CONTACTS) == PackageManager.PERMISSION_GRANTED;
|
||||
} else {
|
||||
return true;
|
||||
}
|
||||
/*
|
||||
return checkSelfPermission(Manifest.permission.READ_CONTACTS) == PackageManager.PERMISSION_GRANTED;
|
||||
*/
|
||||
return true;
|
||||
}
|
||||
|
||||
private void showAddToPhoneBookDialog() {
|
||||
|
@ -1028,6 +1030,7 @@ public class ContactDetailsActivity extends OmemoActivity implements OnAccountUp
|
|||
}
|
||||
|
||||
private void onBadgeClick(View view) {
|
||||
/*
|
||||
final Uri systemAccount = contact.getSystemAccount();
|
||||
if (systemAccount == null) {
|
||||
checkContactPermissionAndShowAddDialog();
|
||||
|
@ -1040,6 +1043,13 @@ public class ContactDetailsActivity extends OmemoActivity implements OnAccountUp
|
|||
ToastCompat.makeText(this, R.string.no_application_found_to_view_contact, ToastCompat.LENGTH_SHORT).show();
|
||||
}
|
||||
}
|
||||
|
||||
*/
|
||||
Toast.makeText(
|
||||
this,
|
||||
R.string.contact_list_integration_not_available,
|
||||
Toast.LENGTH_SHORT)
|
||||
.show();
|
||||
}
|
||||
|
||||
public void onBackendConnected() {
|
||||
|
|
|
@ -153,12 +153,12 @@ import java.util.regex.Matcher;
|
|||
import java.util.regex.Pattern;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
import de.monocles.chat.BobTransfer;
|
||||
import de.monocles.chat.EmojiSearch;
|
||||
import de.monocles.chat.GifsAdapter;
|
||||
import de.monocles.chat.KeyboardHeightProvider;
|
||||
import de.monocles.chat.WebxdcPage;
|
||||
import de.monocles.chat.WebxdcStore;
|
||||
import eu.monocles.chat.BobTransfer;
|
||||
import eu.monocles.chat.EmojiSearch;
|
||||
import eu.monocles.chat.GifsAdapter;
|
||||
import eu.monocles.chat.KeyboardHeightProvider;
|
||||
import eu.monocles.chat.WebxdcPage;
|
||||
import eu.monocles.chat.WebxdcStore;
|
||||
import eu.siacs.conversations.Config;
|
||||
import eu.siacs.conversations.R;
|
||||
import eu.siacs.conversations.crypto.axolotl.AxolotlService;
|
||||
|
@ -2036,7 +2036,7 @@ public class ConversationFragment extends XmppFragment
|
|||
}
|
||||
}
|
||||
}
|
||||
de.monocles.chat.GridView GifsGrid = binding.gifsview; // init GridView
|
||||
eu.monocles.chat.GridView GifsGrid = binding.gifsview; // init GridView
|
||||
// Create an object of CustomAdapter and set Adapter to GirdView
|
||||
GifsGrid.setAdapter(new GifsAdapter(activity, filesNames, filesPaths));
|
||||
// implement setOnItemClickListener event on GridView
|
||||
|
|
|
@ -373,9 +373,12 @@ public class StartConversationActivity extends XmppActivity implements XmppConne
|
|||
prefilled = null;
|
||||
}
|
||||
switch (actionItem.getId()) {
|
||||
/*
|
||||
case R.id.discover_public_channels:
|
||||
startActivity(new Intent(this, ChannelDiscoveryActivity.class));
|
||||
break;
|
||||
|
||||
*/
|
||||
case R.id.create_private_group_chat:
|
||||
showCreatePrivateGroupChatDialog();
|
||||
break;
|
||||
|
@ -440,7 +443,7 @@ public class StartConversationActivity extends XmppActivity implements XmppConne
|
|||
recreate();
|
||||
} else {
|
||||
if (pendingViewIntent.peek() == null) {
|
||||
askForContactsPermissions();
|
||||
// askForContactsPermissions();
|
||||
}
|
||||
}
|
||||
mConferenceAdapter.refreshSettings();
|
||||
|
@ -912,6 +915,7 @@ public class StartConversationActivity extends XmppActivity implements XmppConne
|
|||
}
|
||||
|
||||
private void askForContactsPermissions() {
|
||||
/*
|
||||
if (checkSelfPermission(Manifest.permission.READ_CONTACTS) != PackageManager.PERMISSION_GRANTED) {
|
||||
if (mRequestedContactsPermission.compareAndSet(false, true)) {
|
||||
|
||||
|
@ -958,6 +962,7 @@ public class StartConversationActivity extends XmppActivity implements XmppConne
|
|||
|
||||
}
|
||||
}
|
||||
*/
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -979,10 +984,12 @@ public class StartConversationActivity extends XmppActivity implements XmppConne
|
|||
|
||||
@Override
|
||||
protected void onBackendConnected() {
|
||||
|
||||
/*
|
||||
if (checkSelfPermission(Manifest.permission.READ_CONTACTS) == PackageManager.PERMISSION_GRANTED) {
|
||||
xmppConnectionService.getQuickConversationsService().considerSyncBackground(false);
|
||||
}
|
||||
|
||||
*/
|
||||
if (mPostponedActivityResult != null) {
|
||||
onActivityResult(mPostponedActivityResult.first, RESULT_OK, mPostponedActivityResult.second);
|
||||
this.mPostponedActivityResult = null;
|
||||
|
|
|
@ -821,7 +821,7 @@ public class MessageAdapter extends ArrayAdapter<Message> {
|
|||
displayRichLinkMessage(viewHolder, message, darkBackground);
|
||||
}
|
||||
// Make custom emoji bigger too, to match emoji
|
||||
for (final var span : body.getSpans(0, body.length(), de.monocles.chat.InlineImageSpan.class)) {
|
||||
for (final var span : body.getSpans(0, body.length(), eu.monocles.chat.InlineImageSpan.class)) {
|
||||
body.setSpan(
|
||||
new RelativeSizeSpan(2f),
|
||||
body.getSpanStart(span),
|
||||
|
|
|
@ -18,8 +18,7 @@ public class PhoneHelper {
|
|||
}
|
||||
|
||||
public static Uri getProfilePictureUri(final Context context) {
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M
|
||||
&& context.checkSelfPermission(Manifest.permission.READ_CONTACTS) != PackageManager.PERMISSION_GRANTED) {
|
||||
if (context.checkSelfPermission(Manifest.permission.READ_CONTACTS) != PackageManager.PERMISSION_GRANTED) {
|
||||
return null;
|
||||
}
|
||||
return null; // remove address book integration
|
||||
|
|
|
@ -30,7 +30,7 @@
|
|||
app:tabSelectedTextColor="?attr/text_Color_Main"
|
||||
app:tabTextColor="?attr/button_text_color_disabled" />
|
||||
|
||||
<de.monocles.chat.WebviewAwareViewPager
|
||||
<eu.monocles.chat.WebviewAwareViewPager
|
||||
android:id="@+id/conversation_view_pager"
|
||||
android:layout_below="@id/tab_layout"
|
||||
android:layout_width="fill_parent"
|
||||
|
@ -187,7 +187,7 @@
|
|||
app:shapeAppearance="@style/ShapeAppearanceOverlay.PhotoSquare"
|
||||
android:visibility="gone" />
|
||||
|
||||
<de.monocles.chat.ReadMoreTextView
|
||||
<eu.monocles.chat.ReadMoreTextView
|
||||
app:trimExpandedText="@string/show_less"
|
||||
app:trimCollapsedText="@string/show_more"
|
||||
app:trimMode="trimModeLength"
|
||||
|
@ -414,7 +414,7 @@
|
|||
android:layout_weight="1"
|
||||
android:visibility="visible" />
|
||||
|
||||
<de.monocles.chat.GridView
|
||||
<eu.monocles.chat.GridView
|
||||
android:id="@+id/stickersview"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
|
@ -429,7 +429,7 @@
|
|||
android:layout_weight="1"
|
||||
android:visibility="gone" />
|
||||
|
||||
<de.monocles.chat.GridView
|
||||
<eu.monocles.chat.GridView
|
||||
android:id="@+id/gifsview"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
|
@ -656,6 +656,6 @@
|
|||
|
||||
</RelativeLayout>
|
||||
|
||||
</de.monocles.chat.WebviewAwareViewPager>
|
||||
</eu.monocles.chat.WebviewAwareViewPager>
|
||||
</RelativeLayout>
|
||||
</layout>
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
android:orientation="vertical"
|
||||
app:layoutManager="androidx.recyclerview.widget.GridLayoutManager" />
|
||||
|
||||
<de.monocles.chat.GridView
|
||||
<eu.monocles.chat.GridView
|
||||
android:id="@+id/actions"
|
||||
android:background="@color/primary_monocles"
|
||||
android:layout_width="match_parent"
|
||||
|
|
|
@ -30,7 +30,7 @@
|
|||
app:tabSelectedTextColor="?attr/text_Color_Main"
|
||||
app:tabTextColor="?attr/button_text_color_disabled" />
|
||||
|
||||
<de.monocles.chat.WebviewAwareViewPager
|
||||
<eu.monocles.chat.WebviewAwareViewPager
|
||||
android:id="@+id/conversation_view_pager"
|
||||
android:layout_below="@id/tab_layout"
|
||||
android:layout_width="fill_parent"
|
||||
|
@ -176,7 +176,7 @@
|
|||
app:shapeAppearance="@style/ShapeAppearanceOverlay.PhotoSquare"
|
||||
android:visibility="gone" />
|
||||
|
||||
<de.monocles.chat.ReadMoreTextView
|
||||
<eu.monocles.chat.ReadMoreTextView
|
||||
app:trimExpandedText="@string/show_less"
|
||||
app:trimCollapsedText="@string/show_more"
|
||||
app:trimMode="trimModeLength"
|
||||
|
@ -403,7 +403,7 @@
|
|||
android:layout_weight="1"
|
||||
android:visibility="visible" />
|
||||
|
||||
<de.monocles.chat.GridView
|
||||
<eu.monocles.chat.GridView
|
||||
android:id="@+id/stickersview"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
|
@ -418,7 +418,7 @@
|
|||
android:layout_weight="1"
|
||||
android:visibility="gone" />
|
||||
|
||||
<de.monocles.chat.GridView
|
||||
<eu.monocles.chat.GridView
|
||||
android:id="@+id/gifsview"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
|
@ -645,6 +645,6 @@
|
|||
|
||||
</RelativeLayout>
|
||||
|
||||
</de.monocles.chat.WebviewAwareViewPager>
|
||||
</eu.monocles.chat.WebviewAwareViewPager>
|
||||
</RelativeLayout>
|
||||
</layout>
|
||||
|
|
|
@ -12,7 +12,7 @@
|
|||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent" />
|
||||
|
||||
<de.monocles.chat.GridView
|
||||
<eu.monocles.chat.GridView
|
||||
android:id="@+id/actions"
|
||||
android:background="@color/primary_monocles"
|
||||
android:layout_width="match_parent"
|
||||
|
|
Loading…
Reference in a new issue