mirror of
https://github.com/oxen-io/session-android.git
synced 2025-01-11 17:43:39 +00:00
Fix up UI
This commit is contained in:
parent
b4a81bf937
commit
f8464a1462
@ -100,7 +100,6 @@
|
||||
android:supportsRtl="true"
|
||||
android:theme="@style/TextSecure.DarkTheme"
|
||||
tools:replace="android:allowBackup">
|
||||
<activity android:name="org.thoughtcrime.securesms.loki.LinkedDevicesActivity"></activity>
|
||||
|
||||
<meta-data
|
||||
android:name="io.fabric.ApiKey"
|
||||
@ -125,6 +124,7 @@
|
||||
android:name="firebase_messaging_auto_init_enabled"
|
||||
android:value="false" />
|
||||
|
||||
<activity android:name="org.thoughtcrime.securesms.loki.LinkedDevicesActivity" />
|
||||
<activity
|
||||
android:name="org.thoughtcrime.securesms.WebRtcCallActivity"
|
||||
android:configChanges="mcc|mnc|locale|touchscreen|keyboard|keyboardHidden|navigation|orientation|screenLayout|screenSize|fontScale"
|
||||
|
@ -1,58 +1,49 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
xmlns:fab="http://schemas.android.com/apk/res-auto"
|
||||
android:orientation="vertical">
|
||||
<RelativeLayout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
xmlns:fab="http://schemas.android.com/apk/res-auto">
|
||||
|
||||
<LinearLayout android:id="@+id/progress_container"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="fill_parent"
|
||||
android:gravity="center"
|
||||
android:orientation="vertical"
|
||||
android:visibility="gone" >
|
||||
<ProgressBar
|
||||
android:id="@+id/activityIndicator"
|
||||
android:indeterminate="true"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_centerInParent="true"
|
||||
android:visibility="gone" />
|
||||
|
||||
<ProgressBar android:id="@+id/progress"
|
||||
android:indeterminate="true"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content" >
|
||||
</ProgressBar>
|
||||
</LinearLayout>
|
||||
<TextView
|
||||
android:id="@+id/emptyStateTextView"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:gravity="center"
|
||||
android:textSize="20sp"
|
||||
android:visibility="gone"
|
||||
android:text="@string/device_list_fragment__no_devices_linked"
|
||||
android:paddingStart="16dip"
|
||||
android:paddingEnd="16dip"
|
||||
tools:visibility="visible"/>
|
||||
|
||||
<TextView android:id="@+id/empty"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_gravity="center|center_vertical"
|
||||
android:gravity="center|center_vertical"
|
||||
android:textSize="20sp"
|
||||
android:visibility="gone"
|
||||
android:text="@string/device_list_fragment__no_devices_linked"
|
||||
android:paddingStart="16dip"
|
||||
android:paddingEnd="16dip"
|
||||
android:layout_weight="1"
|
||||
tools:visibility="visible"/>
|
||||
|
||||
<ListView android:id="@id/android:list"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"
|
||||
android:drawSelectorOnTop="false"
|
||||
android:paddingStart="16dip"
|
||||
android:paddingEnd="16dip"
|
||||
tools:visibility="gone"/>
|
||||
<ListView
|
||||
android:id="@id/android:list"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:drawSelectorOnTop="false" />
|
||||
|
||||
<com.melnykov.fab.FloatingActionButton
|
||||
android:id="@+id/add_device"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="bottom|right"
|
||||
android:layout_margin="16dp"
|
||||
android:src="@drawable/ic_add_white_original_24dp"
|
||||
android:focusable="true"
|
||||
android:contentDescription="@string/device_list_fragment__link_new_device"
|
||||
fab:fab_colorNormal="?fab_color"
|
||||
fab:fab_colorPressed="@color/textsecure_primary_dark"
|
||||
fab:fab_colorRipple="@color/textsecure_primary_dark" />
|
||||
android:id="@+id/addDeviceButton"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentBottom="true"
|
||||
android:layout_alignParentRight="true"
|
||||
android:layout_margin="16dp"
|
||||
android:src="@drawable/ic_add_white_original_24dp"
|
||||
android:focusable="true"
|
||||
android:contentDescription="@string/device_list_fragment__link_new_device"
|
||||
fab:fab_colorNormal="?fab_color"
|
||||
fab:fab_colorPressed="@color/textsecure_primary_dark"
|
||||
fab:fab_colorRipple="@color/textsecure_primary_dark" />
|
||||
|
||||
</LinearLayout>
|
||||
</RelativeLayout>
|
@ -1,14 +1,17 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<org.thoughtcrime.securesms.DeviceListItem xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:orientation="vertical"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingBottom="8dp">
|
||||
<org.thoughtcrime.securesms.DeviceListItem
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:orientation="vertical"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="64dp"
|
||||
android:paddingStart="16dp"
|
||||
android:paddingEnd="16dp"
|
||||
android:gravity="center_vertical">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/name"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="8dp"
|
||||
android:ellipsize="marquee"
|
||||
android:singleLine="true"
|
||||
android:text="Name"
|
||||
|
@ -293,7 +293,7 @@
|
||||
|
||||
<!-- DeviceListActivity -->
|
||||
<string name="DeviceListActivity_unlink_s">Unlink \'%s\'?</string>
|
||||
<string name="DeviceListActivity_by_unlinking_this_device_it_will_no_longer_be_able_to_send_or_receive">By unlinking this device, it will no longer be able to send or receive messages.</string>
|
||||
<string name="DeviceListActivity_by_unlinking_this_device_it_will_no_longer_be_able_to_send_or_receive">This device will no longer be able to send or receive messages.</string>
|
||||
<string name="DeviceListActivity_network_connection_failed">Network connection failed</string>
|
||||
<string name="DeviceListActivity_try_again">Try again</string>
|
||||
<string name="DeviceListActivity_unlinking_device">Unlinking device...</string>
|
||||
@ -948,7 +948,7 @@
|
||||
<string name="device_link_fragment__link_device">Link device</string>
|
||||
|
||||
<!-- device_list_fragment -->
|
||||
<string name="device_list_fragment__no_devices_linked">No devices linked</string>
|
||||
<string name="device_list_fragment__no_devices_linked">You don\'t have any linked devices yet</string>
|
||||
<string name="device_list_fragment__link_new_device">Link new device</string>
|
||||
|
||||
<!-- experience_upgrade_activity -->
|
||||
@ -1159,7 +1159,7 @@
|
||||
<string name="AndroidManifest__log_submit">Submit debug log</string>
|
||||
<string name="AndroidManifest__media_preview">Media preview</string>
|
||||
<string name="AndroidManifest__message_details">Message details</string>
|
||||
<string name="AndroidManifest__linked_devices">Linked devices</string>
|
||||
<string name="AndroidManifest__linked_devices">Linked Devices</string>
|
||||
<string name="AndroidManifest__invite_friends">Invite friends</string>
|
||||
<string name="AndroidManifest_archived_conversations">Archived conversations</string>
|
||||
<string name="AndroidManifest_remove_photo">Remove photo</string>
|
||||
@ -1578,7 +1578,7 @@
|
||||
<string name="activity_settings_public_key_copied_message">Copied to clipboard</string>
|
||||
<string name="activity_settings_share_public_key_button_title">Share Public Key</string>
|
||||
<string name="activity_settings_show_qr_code_button_title">Show QR Code</string>
|
||||
<string name="activity_settings_linked_devices_button_title">Linked Device</string>
|
||||
<string name="activity_settings_linked_devices_button_title">Linked Devices</string>
|
||||
<string name="activity_settings_show_seed_button_title">Show Seed</string>
|
||||
<string name="activity_settings_seed_dialog_title">Your Seed</string>
|
||||
<string name="activity_settings_seed_dialog_copy_button_title">Copy</string>
|
||||
@ -1639,7 +1639,7 @@
|
||||
<!-- Scan QR code fragment -->
|
||||
<string name="fragment_scan_qr_code_title">Scan QR Code</string>
|
||||
<string name="fragment_scan_qr_code_explanation_new_conversation">Scan the QR code of the person you\'d like to securely message. They can find their QR code by going into Loki Messenger\'s in-app settings and clicking \"Show QR Code\".</string>
|
||||
<string name="fragment_scan_qr_code_explanation_link_device">Scan the QR code of the device you would like to link.</string>
|
||||
<string name="fragment_scan_qr_code_explanation_link_device">Link to an existing device by going into its in-app settings and clicking \"Link Device\".</string>
|
||||
<string name="fragment_scan_qr_code_camera_permission_dialog_message">Loki Messenger needs camera access to scan QR codes.</string>
|
||||
<!-- Conversation activity -->
|
||||
<string name="activity_conversation_copy_public_key_button_title">Copy public key</string>
|
||||
@ -1650,6 +1650,6 @@
|
||||
<string name="fragment_device_list_unlink_device_title">Unlink device</string>
|
||||
<!-- Device unlink dialog -->
|
||||
<string name="dialog_device_unlink_title">Device unlinked</string>
|
||||
<string name="dialog_device_unlink_message">This device has been successfully unlinked.</string>
|
||||
<string name="dialog_device_unlink_message">This device has been successfully unlinked</string>
|
||||
|
||||
</resources>
|
||||
|
@ -33,6 +33,10 @@
|
||||
android:title="@string/preferences__advanced"
|
||||
android:icon="@drawable/ic_advanced_24dp"/> -->
|
||||
|
||||
<Preference android:key="preference_category_linked_devices"
|
||||
android:title="@string/activity_settings_linked_devices_button_title"
|
||||
android:icon="@drawable/icon_link"/>
|
||||
|
||||
<Preference android:key="preference_category_public_key"
|
||||
android:title="@string/activity_settings_share_public_key_button_title"
|
||||
android:icon="@drawable/icon_share"/>
|
||||
@ -41,10 +45,6 @@
|
||||
android:title="@string/activity_settings_show_qr_code_button_title"
|
||||
android:icon="@drawable/icon_qr_code"/>
|
||||
|
||||
<Preference android:key="preference_category_linked_devices"
|
||||
android:title="@string/activity_settings_linked_devices_button_title"
|
||||
android:icon="@drawable/icon_link"/>
|
||||
|
||||
<Preference android:key="preference_category_seed"
|
||||
android:title="@string/activity_settings_show_seed_button_title"
|
||||
android:icon="@drawable/icon_seedling"/>
|
||||
|
@ -27,7 +27,6 @@ import android.database.ContentObserver;
|
||||
import android.os.AsyncTask;
|
||||
import android.os.Build;
|
||||
import android.os.Handler;
|
||||
import android.preference.PreferenceManager;
|
||||
import android.support.annotation.NonNull;
|
||||
import android.support.annotation.Nullable;
|
||||
import android.support.multidex.MultiDexApplication;
|
||||
@ -97,11 +96,11 @@ import org.whispersystems.signalservice.api.messages.SignalServiceEnvelope;
|
||||
import org.whispersystems.signalservice.internal.push.SignalServiceProtos;
|
||||
import org.whispersystems.signalservice.loki.api.LokiAPIDatabaseProtocol;
|
||||
import org.whispersystems.signalservice.loki.api.LokiDotNetAPI;
|
||||
import org.whispersystems.signalservice.loki.api.LokiPublicChat;
|
||||
import org.whispersystems.signalservice.loki.api.LokiPublicChatAPI;
|
||||
import org.whispersystems.signalservice.loki.api.LokiLongPoller;
|
||||
import org.whispersystems.signalservice.loki.api.LokiP2PAPI;
|
||||
import org.whispersystems.signalservice.loki.api.LokiP2PAPIDelegate;
|
||||
import org.whispersystems.signalservice.loki.api.LokiPublicChat;
|
||||
import org.whispersystems.signalservice.loki.api.LokiPublicChatAPI;
|
||||
import org.whispersystems.signalservice.loki.api.LokiRSSFeed;
|
||||
import org.whispersystems.signalservice.loki.api.LokiStorageAPI;
|
||||
import org.whispersystems.signalservice.loki.utilities.Analytics;
|
||||
@ -616,7 +615,7 @@ public class ApplicationContext extends MultiDexApplication implements Dependenc
|
||||
}
|
||||
Set<String> servers = DatabaseFactory.getLokiThreadDatabase(this).getAllPublicChatServers();
|
||||
for (String server : servers) {
|
||||
publicChatAPI.setProfileAvatar(server, profileKey, url);
|
||||
publicChatAPI.setProfilePicture(server, profileKey, url);
|
||||
}
|
||||
}
|
||||
});
|
||||
@ -636,7 +635,6 @@ public class ApplicationContext extends MultiDexApplication implements Dependenc
|
||||
if (this.deleteDatabase("signal.db")) {
|
||||
Log.d("Loki", "Deleted database");
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -39,7 +39,6 @@ import org.thoughtcrime.securesms.crypto.ProfileKeyUtil;
|
||||
import org.thoughtcrime.securesms.database.Address;
|
||||
import org.thoughtcrime.securesms.database.DatabaseFactory;
|
||||
import org.thoughtcrime.securesms.dependencies.InjectableType;
|
||||
import org.thoughtcrime.securesms.jobs.MultiDeviceProfileKeyUpdateJob;
|
||||
import org.thoughtcrime.securesms.logging.Log;
|
||||
import org.thoughtcrime.securesms.mms.GlideApp;
|
||||
import org.thoughtcrime.securesms.permissions.Permissions;
|
||||
@ -68,7 +67,6 @@ import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.security.SecureRandom;
|
||||
import java.util.Arrays;
|
||||
import java.util.Collections;
|
||||
import java.util.Set;
|
||||
import java.util.concurrent.ExecutionException;
|
||||
import java.util.regex.Matcher;
|
||||
@ -76,7 +74,6 @@ import java.util.regex.Pattern;
|
||||
|
||||
import javax.inject.Inject;
|
||||
|
||||
import kotlin.Triple;
|
||||
import network.loki.messenger.R;
|
||||
|
||||
@SuppressLint("StaticFieldLeak")
|
||||
@ -416,7 +413,7 @@ public class CreateProfileActivity extends BaseActionBarActivity implements Inje
|
||||
if (avatar != null) {
|
||||
Log.d("Loki", "Start uploading profile photo");
|
||||
LokiStorageAPI storageAPI = LokiStorageAPI.shared;
|
||||
LokiDotNetAPI.UploadResult result = storageAPI.uploadProfilePhoto(storageAPI.getServer(), profileKey, avatar);
|
||||
LokiDotNetAPI.UploadResult result = storageAPI.uploadProfilePicture(storageAPI.getServer(), profileKey, avatar);
|
||||
Log.d("Loki", "Profile photo uploaded, the url is " + result.getUrl());
|
||||
TextSecurePreferences.setProfileAvatarUrl(context, result.getUrl());
|
||||
} else {
|
||||
|
@ -16,6 +16,7 @@ import android.widget.AdapterView;
|
||||
import android.widget.ArrayAdapter;
|
||||
import android.widget.Button;
|
||||
import android.widget.EditText;
|
||||
import android.widget.LinearLayout;
|
||||
import android.widget.ListView;
|
||||
|
||||
import com.melnykov.fab.FloatingActionButton;
|
||||
@ -28,17 +29,18 @@ import org.thoughtcrime.securesms.loki.DeviceListBottomSheetFragment;
|
||||
import org.thoughtcrime.securesms.loki.MnemonicUtilities;
|
||||
import org.thoughtcrime.securesms.util.TextSecurePreferences;
|
||||
import org.thoughtcrime.securesms.util.ViewUtil;
|
||||
import org.whispersystems.libsignal.util.guava.Function;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
|
||||
import org.whispersystems.libsignal.util.guava.Function;
|
||||
|
||||
import kotlin.Pair;
|
||||
import kotlin.Unit;
|
||||
import network.loki.messenger.R;
|
||||
|
||||
import static org.thoughtcrime.securesms.loki.GeneralUtilitiesKt.toPx;
|
||||
|
||||
public class DeviceListFragment extends ListFragment
|
||||
implements LoaderManager.LoaderCallbacks<List<Device>>,
|
||||
ListView.OnItemClickListener, InjectableType, Button.OnClickListener
|
||||
@ -71,9 +73,9 @@ public class DeviceListFragment extends ListFragment
|
||||
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle bundle) {
|
||||
View view = inflater.inflate(R.layout.device_list_fragment, container, false);
|
||||
|
||||
this.empty = view.findViewById(R.id.empty);
|
||||
this.progressContainer = view.findViewById(R.id.progress_container);
|
||||
this.addDeviceButton = ViewUtil.findById(view, R.id.add_device);
|
||||
this.empty = view.findViewById(R.id.emptyStateTextView);
|
||||
this.progressContainer = view.findViewById(R.id.activityIndicator);
|
||||
this.addDeviceButton = ViewUtil.findById(view, R.id.addDeviceButton);
|
||||
this.addDeviceButton.setOnClickListener(this);
|
||||
updateAddDeviceButtonVisibility();
|
||||
|
||||
@ -141,16 +143,22 @@ public class DeviceListFragment extends ListFragment
|
||||
DeviceListBottomSheetFragment bottomSheet = new DeviceListBottomSheetFragment();
|
||||
bottomSheet.setOnEditTapped(() -> {
|
||||
bottomSheet.dismiss();
|
||||
EditText deviceNameText = new EditText(getContext());
|
||||
deviceNameText.setText(hasDeviceName ? deviceName : "");
|
||||
EditText deviceNameEditText = new EditText(getContext());
|
||||
LinearLayout deviceNameEditTextContainer = new LinearLayout(getContext());
|
||||
LinearLayout.LayoutParams layoutParams = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT, LinearLayout.LayoutParams.WRAP_CONTENT);
|
||||
layoutParams.setMarginStart(toPx(18, getResources()));
|
||||
layoutParams.setMarginEnd(toPx(18, getResources()));
|
||||
deviceNameEditText.setLayoutParams(layoutParams);
|
||||
deviceNameEditTextContainer.addView(deviceNameEditText);
|
||||
deviceNameEditText.setText(hasDeviceName ? deviceName : "");
|
||||
AlertDialog.Builder builder = new AlertDialog.Builder(getActivity());
|
||||
builder.setTitle(R.string.DeviceListActivity_edit_device_name);
|
||||
builder.setView(deviceNameText);
|
||||
builder.setView(deviceNameEditTextContainer);
|
||||
builder.setNegativeButton(android.R.string.cancel, null);
|
||||
builder.setPositiveButton(android.R.string.ok, new DialogInterface.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(DialogInterface dialog, int which) {
|
||||
if (handleDeviceNameChange != null) { handleDeviceNameChange.apply(new Pair<>(deviceId, deviceNameText.getText().toString().trim())); }
|
||||
if (handleDeviceNameChange != null) { handleDeviceNameChange.apply(new Pair<>(deviceId, deviceNameEditText.getText().toString().trim())); }
|
||||
}
|
||||
});
|
||||
builder.show();
|
||||
|
@ -101,7 +101,7 @@ public class RetrieveProfileAvatarJob extends BaseJob implements InjectableType
|
||||
|
||||
try {
|
||||
InputStream avatarStream = receiver.retrieveProfileAvatar(profileAvatar, downloadDestination, profileKey, MAX_PROFILE_SIZE_BYTES);
|
||||
File decryptDestination = File.createTempFile("avatar", "jpg", context.getCacheDir());
|
||||
File decryptDestination = File.createTempFile("avatar", "jpg", context.getCacheDir());
|
||||
|
||||
Util.copy(avatarStream, new FileOutputStream(decryptDestination));
|
||||
decryptDestination.renameTo(AvatarHelper.getAvatarFile(context, recipient.getAddress()));
|
||||
|
@ -7,6 +7,7 @@ import java.io.File
|
||||
import java.io.FileOutputStream
|
||||
|
||||
object MnemonicUtilities {
|
||||
|
||||
@JvmStatic
|
||||
public fun getLanguageFileDirectory(context: Context): File {
|
||||
val languages = listOf( "english", "japanese", "portuguese", "spanish" )
|
||||
|
Loading…
x
Reference in New Issue
Block a user