Commit 21294b02 authored by Grigory Fedorov's avatar Grigory Fedorov

Merge branch 'release/1.0.9'

parents 74bb67fa e9870e69
......@@ -7,8 +7,8 @@ android {
defaultConfig {
minSdkVersion 14
targetSdkVersion 22
versionCode 180
versionName '1.0.8'
versionCode 181
versionName '1.0.9'
}
compileOptions {
......
......@@ -14,12 +14,6 @@
*/
package com.xabber.android.data;
import java.io.File;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.Iterator;
import android.database.DatabaseUtils;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteException;
......@@ -27,6 +21,12 @@ import android.database.sqlite.SQLiteOpenHelper;
import com.xabber.android.data.entity.AbstractAccountTable;
import java.io.File;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.Iterator;
/**
* Helps to open, create, and upgrade the database file.
* <p/>
......@@ -38,13 +38,10 @@ public class DatabaseManager extends SQLiteOpenHelper implements
OnLoadListener, OnClearListener {
private static final String DATABASE_NAME = "xabber.db";
private static final int DATABASE_VERSION = 66;
private static final int DATABASE_VERSION = 67;
private static final SQLiteException DOWNGRAD_EXCEPTION = new SQLiteException(
"Database file was deleted");
private final ArrayList<DatabaseTable> registeredTables;
private final static DatabaseManager instance;
static {
......@@ -52,15 +49,94 @@ public class DatabaseManager extends SQLiteOpenHelper implements
Application.getInstance().addManager(instance);
}
public static DatabaseManager getInstance() {
return instance;
}
private final ArrayList<DatabaseTable> registeredTables;
private DatabaseManager() {
super(Application.getInstance(), DATABASE_NAME, null, DATABASE_VERSION);
registeredTables = new ArrayList<DatabaseTable>();
}
public static DatabaseManager getInstance() {
return instance;
}
/**
* Builds IN statement for specified collection of values.
*
* @param <T>
* @param column
* @param values
* @return "column IN (value1, ... valueN)" or
* "(column IS NULL AND column IS NOT NULL)" if ids is empty.
*/
public static <T> String in(String column, Collection<T> values) {
if (values.isEmpty())
return new StringBuilder("(").append(column)
.append(" IS NULL AND ").append(column)
.append(" IS NOT NULL)").toString();
StringBuilder builder = new StringBuilder(column);
builder.append(" IN (");
Iterator<T> iterator = values.iterator();
while (iterator.hasNext()) {
T value = iterator.next();
if (value instanceof String)
builder.append(DatabaseUtils.sqlEscapeString((String) value));
else
builder.append(value.toString());
if (iterator.hasNext())
builder.append(",");
}
builder.append(")");
return builder.toString();
}
public static void execSQL(SQLiteDatabase db, String sql) {
LogManager.iString(DatabaseManager.class.getName(), sql);
db.execSQL(sql);
}
public static void dropTable(SQLiteDatabase db, String table) {
execSQL(db, "DROP TABLE IF EXISTS " + table + ";");
}
public static void renameTable(SQLiteDatabase db, String table,
String newTable) {
execSQL(db, "ALTER TABLE " + table + " RENAME TO " + newTable + ";");
}
public static String commaSeparatedFromCollection(Collection<String> strings) {
StringBuilder builder = new StringBuilder();
for (String value : strings) {
if (builder.length() > 0)
builder.append(",");
builder.append(value.replace("\\", "\\\\").replace(",", "\\,"));
}
return builder.toString();
}
public static Collection<String> collectionFromCommaSeparated(String value) {
Collection<String> collection = new ArrayList<String>();
boolean escape = false;
StringBuilder builder = new StringBuilder();
for (int index = 0; index < value.length(); index++) {
char chr = value.charAt(index);
if (!escape) {
if (chr == '\\') {
escape = true;
continue;
} else if (chr == ',') {
collection.add(builder.toString());
builder = new StringBuilder();
continue;
}
}
escape = false;
builder.append(chr);
}
collection.add(builder.toString());
return Collections.unmodifiableCollection(collection);
}
/**
* Register new table.
*
......@@ -146,81 +222,4 @@ public class DatabaseManager extends SQLiteOpenHelper implements
((AbstractAccountTable) table).removeAccount(account);
}
/**
* Builds IN statement for specified collection of values.
*
* @param <T>
* @param column
* @param values
* @return "column IN (value1, ... valueN)" or
* "(column IS NULL AND column IS NOT NULL)" if ids is empty.
*/
public static <T> String in(String column, Collection<T> values) {
if (values.isEmpty())
return new StringBuilder("(").append(column)
.append(" IS NULL AND ").append(column)
.append(" IS NOT NULL)").toString();
StringBuilder builder = new StringBuilder(column);
builder.append(" IN (");
Iterator<T> iterator = values.iterator();
while (iterator.hasNext()) {
T value = iterator.next();
if (value instanceof String)
builder.append(DatabaseUtils.sqlEscapeString((String) value));
else
builder.append(value.toString());
if (iterator.hasNext())
builder.append(",");
}
builder.append(")");
return builder.toString();
}
public static void execSQL(SQLiteDatabase db, String sql) {
LogManager.iString(DatabaseManager.class.getName(), sql);
db.execSQL(sql);
}
public static void dropTable(SQLiteDatabase db, String table) {
execSQL(db, "DROP TABLE IF EXISTS " + table + ";");
}
public static void renameTable(SQLiteDatabase db, String table,
String newTable) {
execSQL(db, "ALTER TABLE " + table + " RENAME TO " + newTable + ";");
}
public static String commaSeparatedFromCollection(Collection<String> strings) {
StringBuilder builder = new StringBuilder();
for (String value : strings) {
if (builder.length() > 0)
builder.append(",");
builder.append(value.replace("\\", "\\\\").replace(",", "\\,"));
}
return builder.toString();
}
public static Collection<String> collectionFromCommaSeparated(String value) {
Collection<String> collection = new ArrayList<String>();
boolean escape = false;
StringBuilder builder = new StringBuilder();
for (int index = 0; index < value.length(); index++) {
char chr = value.charAt(index);
if (!escape) {
if (chr == '\\') {
escape = true;
continue;
} else if (chr == ',') {
collection.add(builder.toString());
builder = new StringBuilder();
continue;
}
}
escape = false;
builder.append(chr);
}
collection.add(builder.toString());
return Collections.unmodifiableCollection(collection);
}
}
......@@ -14,9 +14,6 @@
*/
package com.xabber.android.data.message.chat;
import java.util.HashSet;
import java.util.Set;
import android.database.Cursor;
import android.net.Uri;
......@@ -28,6 +25,9 @@ import com.xabber.android.data.account.OnAccountRemovedListener;
import com.xabber.android.data.entity.BaseEntity;
import com.xabber.android.data.entity.NestedMap;
import java.util.HashSet;
import java.util.Set;
/**
* Manage chat specific options.
*
......@@ -39,63 +39,57 @@ public class ChatManager implements OnLoadListener, OnAccountRemovedListener {
.parse("com.xabber.android.data.message.ChatManager.EMPTY_SOUND");
private static final Object PRIVATE_CHAT = new Object();
private final static ChatManager instance;
static {
instance = new ChatManager();
Application.getInstance().addManager(instance);
}
/**
* Stored input for user in account.
*/
private final NestedMap<ChatInput> chatInputs;
/**
* List of chats whose messages mustn't be saved for user in account.
*/
private final NestedMap<Object> privateChats;
/**
* Whether notification in visible chat should be used for user in account.
*/
private final NestedMap<Boolean> notifyVisible;
/**
* Whether text of incoming message should be shown in notification bar for
* user in account.
*/
private final NestedMap<Boolean> showText;
private final NestedMap<ShowMessageTextInNotification> showText;
/**
* Whether vibro notification should be used for user in account.
*/
private final NestedMap<Boolean> makeVibro;
/**
* Sound, associated with chat for user in account.
*/
private final NestedMap<Uri> sounds;
private final static ChatManager instance;
static {
instance = new ChatManager();
Application.getInstance().addManager(instance);
}
public static ChatManager getInstance() {
return instance;
}
private ChatManager() {
chatInputs = new NestedMap<ChatInput>();
privateChats = new NestedMap<Object>();
sounds = new NestedMap<Uri>();
showText = new NestedMap<Boolean>();
showText = new NestedMap<>();
makeVibro = new NestedMap<Boolean>();
notifyVisible = new NestedMap<Boolean>();
}
public static ChatManager getInstance() {
return instance;
}
@Override
public void onLoad() {
final Set<BaseEntity> privateChats = new HashSet<BaseEntity>();
final NestedMap<Boolean> notifyVisible = new NestedMap<Boolean>();
final NestedMap<Boolean> showText = new NestedMap<Boolean>();
final NestedMap<ShowMessageTextInNotification> showText = new NestedMap<>();
final NestedMap<Boolean> makeVibro = new NestedMap<Boolean>();
final NestedMap<Uri> sounds = new NestedMap<Uri>();
Cursor cursor;
......@@ -174,7 +168,7 @@ public class ChatManager implements OnLoadListener, OnAccountRemovedListener {
}
private void onLoaded(Set<BaseEntity> privateChats,
NestedMap<Boolean> notifyVisible, NestedMap<Boolean> showText,
NestedMap<Boolean> notifyVisible, NestedMap<ShowMessageTextInNotification> showText,
NestedMap<Boolean> vibro, NestedMap<Uri> sounds) {
for (BaseEntity baseEntity : privateChats)
this.privateChats.put(baseEntity.getAccount(),
......@@ -316,14 +310,27 @@ public class ChatManager implements OnLoadListener, OnAccountRemovedListener {
* Common value if there is no user specific value.
*/
public boolean isShowText(String account, String user) {
Boolean value = showText.get(account, user);
if (value == null)
return SettingsManager.eventsShowText();
return value;
switch (getShowText(account, user)) {
case show:
return true;
case hide:
return false;
case default_settings:
default:
return SettingsManager.eventsShowText();
}
}
public ShowMessageTextInNotification getShowText(String account, String user) {
ShowMessageTextInNotification showMessageTextInNotification = showText.get(account, user);
if (showMessageTextInNotification == null) {
return ShowMessageTextInNotification.default_settings;
} else {
return showMessageTextInNotification;
}
}
public void setShowText(final String account, final String user,
final boolean value) {
public void setShowText(final String account, final String user, final ShowMessageTextInNotification value) {
showText.put(account, user, value);
Application.getInstance().runInBackground(new Runnable() {
@Override
......
package com.xabber.android.data.message.chat;
public enum ShowMessageTextInNotification {
/**
* Show message text in notifications according to global settings.
*/
default_settings,
/**
* Always show message text in notifications.
*/
show,
/**
* Never show message text in notifications.
*/
hide;
public static ShowMessageTextInNotification fromInteger(int x) {
switch (x) {
case 0:
return default_settings;
case 1:
return show;
case 2:
return hide;
default:
return default_settings;
}
}
}
......@@ -19,13 +19,14 @@ import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteStatement;
import com.xabber.android.data.DatabaseManager;
import com.xabber.android.data.SettingsManager;
/**
* Storage with settings to show text in notification for each chat.
*
* @author alexander.ivanov
*/
class ShowTextTable extends AbstractChatPropertyTable<Boolean> {
class ShowTextTable extends AbstractChatPropertyTable<ShowMessageTextInNotification> {
static final String NAME = "chat_show_text";
......@@ -36,12 +37,16 @@ class ShowTextTable extends AbstractChatPropertyTable<Boolean> {
DatabaseManager.getInstance().addTable(instance);
}
private ShowTextTable(DatabaseManager databaseManager) {
super(databaseManager);
}
public static ShowTextTable getInstance() {
return instance;
}
private ShowTextTable(DatabaseManager databaseManager) {
super(databaseManager);
static ShowMessageTextInNotification getValue(Cursor cursor) {
return ShowMessageTextInNotification.fromInteger((int) cursor.getLong(cursor.getColumnIndex(Fields.VALUE)));
}
@Override
......@@ -55,8 +60,8 @@ class ShowTextTable extends AbstractChatPropertyTable<Boolean> {
}
@Override
void bindValue(SQLiteStatement writeStatement, Boolean value) {
writeStatement.bindLong(3, value ? 1 : 0);
void bindValue(SQLiteStatement writeStatement, ShowMessageTextInNotification showMessageTextInNotification) {
writeStatement.bindLong(3, showMessageTextInNotification.ordinal());
}
@Override
......@@ -66,13 +71,29 @@ class ShowTextTable extends AbstractChatPropertyTable<Boolean> {
case 52:
initialMigrate(db, "chat_show_text", "INTEGER");
break;
case 67:
int trueMigrationValue;
int falseMigrationValue;
if (SettingsManager.eventsShowText()) {
trueMigrationValue = ShowMessageTextInNotification.default_settings.ordinal();
falseMigrationValue = ShowMessageTextInNotification.hide.ordinal();
} else {
trueMigrationValue = ShowMessageTextInNotification.show.ordinal();
falseMigrationValue = ShowMessageTextInNotification.default_settings.ordinal();
}
String sql = "UPDATE " + NAME
+ " SET " + Fields.VALUE + " = CASE WHEN (" + Fields.VALUE + "=1) THEN "
+ trueMigrationValue + " ELSE " + falseMigrationValue + " END;";
DatabaseManager.execSQL(db, sql);
default:
break;
}
}
static boolean getValue(Cursor cursor) {
return cursor.getLong(cursor.getColumnIndex(Fields.VALUE)) != 0;
}
}
......@@ -260,7 +260,7 @@ public class ChatViewerFragment extends Fragment implements PopupMenu.OnMenuItem
}
private void setSendButtonColor() {
boolean empty = inputView.getText().toString().isEmpty();
boolean empty = inputView.getText().toString().trim().isEmpty();
if (empty != isInputEmpty) {
isInputEmpty = empty;
......
......@@ -10,6 +10,7 @@ import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.AdapterView;
import android.widget.ImageView;
import android.widget.ListView;
import com.xabber.android.R;
......@@ -27,7 +28,7 @@ public class ContactListDrawerFragment extends Fragment implements View.OnClickL
private ListView listView;
private View divider;
private View headerTitle;
private View drawerHeader;
private ImageView drawerHeaderImage;
@Override
public void onAttach(Activity activity) {
......@@ -40,7 +41,8 @@ public class ContactListDrawerFragment extends Fragment implements View.OnClickL
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
View view = inflater.inflate(R.layout.contact_list_drawer, container, false);
drawerHeader = view.findViewById(R.id.drawer_header);
View drawerHeader = view.findViewById(R.id.drawer_header);
drawerHeaderImage = (ImageView) drawerHeader.findViewById(R.id.drawer_header_image);
listView = (ListView) view.findViewById(R.id.drawer_account_list);
......@@ -99,7 +101,7 @@ public class ContactListDrawerFragment extends Fragment implements View.OnClickL
private void update() {
adapter.onChange();
drawerHeader.getBackground().setLevel(AccountPainter.getDefaultAccountColorLevel());
drawerHeaderImage.setImageLevel(AccountPainter.getDefaultAccountColorLevel());
if (adapter.getCount() == 0) {
headerTitle.setVisibility(View.GONE);
......
......@@ -176,8 +176,6 @@ public class ContactListFragment extends Fragment implements OnAccountChangedLis
GroupConfiguration groupConfiguration = (GroupConfiguration) object;
adapter.setExpanded(groupConfiguration.getAccount(), groupConfiguration.getUser(),
!groupConfiguration.isExpanded());
} else {
throw new IllegalStateException();
}
}
......
......@@ -12,6 +12,8 @@ import com.xabber.android.data.account.AccountItem;
import com.xabber.android.data.account.AccountManager;
import com.xabber.android.data.connection.ConnectionState;
import com.xabber.android.data.extension.avatar.AvatarManager;
import com.xabber.android.data.roster.RosterManager;
import com.xabber.android.ui.helper.AccountPainter;
import java.util.ArrayList;
import java.util.Collection;
......@@ -20,12 +22,11 @@ import java.util.List;
public class NavigationDrawerAccountAdapter extends BaseListEditorAdapter<String> {
private final int[] accountColors;
private final AccountPainter accountPainter;
public NavigationDrawerAccountAdapter(Activity activity) {
super(activity);
accountColors = activity.getResources().getIntArray(R.array.account_action_bar);
accountPainter = new AccountPainter(activity);
}
@Override
......@@ -39,13 +40,16 @@ public class NavigationDrawerAccountAdapter extends BaseListEditorAdapter<String
}
String account = getItem(position);
int accountColor = accountColors[accountManager.getColorLevel(account)];
((ImageView) view.findViewById(R.id.color)).setImageDrawable(new ColorDrawable((accountPainter.getAccountMainColor(account))));
((ImageView) view.findViewById(R.id.avatar)).setImageDrawable(AvatarManager.getInstance().getAccountAvatar(account));
TextView accountName = (TextView) view.findViewById(R.id.name);
accountName.setText(RosterManager.getInstance().getBestContact(account, accountManager.getVerboseName(account)).getName());
accountName.setTextColor(accountPainter.getAccountDarkestColor(account));
((ImageView) view.findViewById(R.id.color)).setImageDrawable(new ColorDrawable(accountColor));
((ImageView) view.findViewById(R.id.avatar))
.setImageDrawable(AvatarManager.getInstance().getAccountAvatar(account));
((TextView) view.findViewById(R.id.account_jid)).setText(accountManager.getVerboseName(account));
((TextView) view.findViewById(R.id.name)).setText(accountManager.getVerboseName(account));
AccountItem accountItem = accountManager.getAccount(account);
ConnectionState state;
if (accountItem == null) {
......
......@@ -17,11 +17,13 @@ public class AccountPainter {
private int[] accountMainColors;
private int[] accountDarkColors;
private int[] accountDarkestColors;
public AccountPainter(Context context) {
accountMainColors = context.getResources().getIntArray(R.array.account_action_bar);
accountDarkColors = context.getResources().getIntArray(R.array.account_status_bar);
accountDarkestColors = context.getResources().getIntArray(R.array.account_900);
accountColorNames = context.getResources().getStringArray(R.array.account_color_names);
......@@ -84,6 +86,11 @@ public class AccountPainter {
return accountDarkColors[getAccountColorLevel(account)];
}
public int getAccountDarkestColor(String account) {
return accountDarkestColors[getAccountColorLevel(account)];
}
public int getDefaultDarkColor() {
String firstAccount = getFirstAccount();
if (firstAccount == null) {
......
......@@ -8,6 +8,7 @@ import com.xabber.android.R;
import com.xabber.android.data.account.AccountItem;
import com.xabber.android.data.account.ArchiveMode;
import com.xabber.android.data.message.chat.ChatManager;
import com.xabber.android.data.message.chat.ShowMessageTextInNotification;
import java.util.HashMap;
import java.util.Map;
......@@ -46,7 +47,8 @@ public class ChatContactSettingsFragment extends BaseSettingsFragment {
putValue(map, R.string.chat_events_visible_chat_key, ChatManager
.getInstance().isNotifyVisible(account, user));
putValue(map, R.string.chat_events_show_text_key, ChatManager
.getInstance().isShowText(account, user));
.getInstance().getShowText(account, user).ordinal());
putValue(map, R.string.chat_events_vibro_key, ChatManager.getInstance()
.isMakeVibro(account, user));
putValue(map, R.string.chat_events_sound_key, ChatManager.getInstance()
......@@ -67,9 +69,10 @@ public class ChatContactSettingsFragment extends BaseSettingsFragment {
ChatManager.getInstance().setNotifyVisible(account, user,
getBoolean(result, R.string.chat_events_visible_chat_key));
if (hasChanges(source, result, R.string.chat_events_show_text_key))
if (hasChanges(source, result, R.string.chat_events_show_text_key)) {
ChatManager.getInstance().setShowText(account, user,
getBoolean(result, R.string.chat_events_show_text_key));
ShowMessageTextInNotification.fromInteger(getInt(result, R.string.chat_events_show_text_key)));
}
if (hasChanges(source, result, R.string.chat_events_vibro_key))
ChatManager.getInstance().setMakeVibro(account, user,
......
......@@ -848,7 +848,7 @@ public class XMPPConnection extends Connection {
throw new IllegalStateException();
context.init(kms, new TrustManager[]{new XMPPTrustManager(
KeyStoreManager.getOrCreateKeyStore(config),
getServiceName(), config.getCertificateListener(),
getHost(), config.getCertificateListener(),
chainCheck, domainCheck, allowSelfSigned)}, SECURE_RANDOM);
}
Socket plain = socket;
......
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@android:color/background_light"
android:clickable="true"
android:orientation="vertical">
<RelativeLayout
<FrameLayout
android:id="@+id/drawer_header"
android:layout_width="match_parent"
android:layout_height="170dp"
android:background="@drawable/drawer_image">
android:layout_width="wrap_content"
android:layout_height="wrap_content">
<ImageView
android:id="@+id/drawer_header_image"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/drawer_image" />
<LinearLayout
android:layout_width="match_parent"
......@@ -19,26 +25,49 @@
<ImageView
android:id="@+id/imageView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_width="64dp"
android:layout_height="64dp"
android:layout_marginLeft="8dp"
android:src="@drawable/ic_connect" />
<TextView
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:shadowColor="@color/grey_700"
android:shadowDx="1"
android:shadowDy="1"
android:shadowRadius="2"
android:text="@string/application_title_short"
android:textColor="@color/grey_50"
android:textSize="40sp" />
android:orientation="vertical"
android:paddingTop="8dp">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_margin="0dp"
android:shadowColor="@color/grey_700"
android:shadowDx="1"
android:shadowDy="1"
android:shadowRadius="2"
android:text="@string/application_title_short"
android:textColor="@color/grey_50"
android:textSize="24sp" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_marginTop="-8dp"
android:shadowColor="@color/grey_700"
android:shadowDx="1"
android:shadowDy="1"
android:shadowRadius="2"
android:text="@string/about_open_source_xmpp_client"
android:textColor="@color/grey_300"
android:textSize="12sp" />
</LinearLayout>
</LinearLayout>
</RelativeLayout>
</FrameLayout>
<ListView
android:id="@+id/drawer_account_list"
......@@ -46,5 +75,7 @@
android:layout_height="wrap_content"
android:divider="@null"
android:dividerHeight="0dp"
/>
tools:listfooter="@layout/contact_list_drawer_footer"
tools:listheader="@layout/contact_list_drawer_header"
tools:listitem="@layout/contact_list_drawer_account_item" />
</LinearLayout>
\ No newline at end of file
......@@ -13,7 +13,7 @@
-->
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="48dp"
android:layout_height="64dp"
android:paddingLeft="10dp"
android:paddingRight="16dp">
......@@ -24,14 +24,14 @@
<de.hdodenhof.circleimageview.CircleImageView xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/color"
android:layout_width="36dp"
android:layout_height="36dp"
android:layout_width="40dp"
android:layout_height="40dp"
android:src="@color/green_500" />
<de.hdodenhof.circleimageview.CircleImageView xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/avatar"
android:layout_width="36dp"
android:layout_height="36dp"
android:layout_width="40dp"
android:layout_height="40dp"
android:src="@drawable/ic_avatar_1"
app:border_color="@android:color/transparent"
app:border_width="3dp" />
......@@ -40,10 +40,11 @@
<LinearLayout
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_weight="1"
android:orientation="vertical"
android:paddingLeft="26dp">
android:paddingLeft="22dp">
<TextView
android:id="@+id/name"
......@@ -51,11 +52,23 @@
android:layout_height="wrap_content"
android:layout_weight="1"
android:ellipsize="marquee"
android:gravity="bottom"
android:singleLine="true"
android:text="test"
android:textColor="?android:attr/textColorPrimary"
android:textStyle="bold" />
android:text="Some Name"
android:textColor="@color/green_700"
android:textSize="18sp" />
<TextView
android:id="@+id/account_jid"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="-2dp"
android:layout_marginTop="-4dp"
android:layout_weight="1"
android:ellipsize="marquee"
android:singleLine="true"
android:text="example@example.com"
android:textColor="@color/grey_500"
android:textSize="14sp" />
<TextView
android:id="@+id/status"
......@@ -65,7 +78,7 @@
android:ellipsize="marquee"
android:gravity="top"
android:singleLine="true"
android:text="@android:string/cancel"
android:text="Online"
android:textColor="?android:attr/textColorSecondary" />
</LinearLayout>
</LinearLayout>
......@@ -9,4 +9,6 @@
<!-- http://dl.dropbox.com/u/1029995/com.xabber.android/about_viewer.png -->
<string name="about_version">Версия: %s</string>
<string name="about_license">Лицензия: GNU GPLv3\n<a href="https://github.com/redsolution/xabber-android">Программное обеспечение с открытым исходным кодом</a></string>
<string name="about_open_source_xmpp_client">open source XMPP client</string>
</resources>
\ No newline at end of file
......@@ -152,4 +152,8 @@
<string name="under_construction">В разработке</string>
<string name="under_construction_message">Этот экран находится в разработке</string>
<string name="chat_events_show_text_global">Использовать глобальные настройки</string>
<string name="chat_events_show_text_always">Отображать текст сообщения</string>
<string name="chat_events_show_text_never">Скрывать текст сообщения</string>
</resources>
\ No newline at end of file
......@@ -9,4 +9,6 @@
<!-- http://dl.dropbox.com/u/1029995/com.xabber.android/about_viewer.png -->
<string name="about_version">Version: %s</string>
<string name="about_license">License: GNU GPLv3\n<a href="https://github.com/redsolution/xabber-android">Open source software</a></string>
<string name="about_open_source_xmpp_client">open source XMPP client</string>
</resources>
\ No newline at end of file
......@@ -152,4 +152,9 @@
<string name="under_construction">Under construction</string>
<string name="under_construction_message">This screen is under construction</string>
<string name="chat_events_show_text_global">Use global settings</string>
<string name="chat_events_show_text_always">Show message text</string>
<string name="chat_events_show_text_never">Hide message text</string>
</resources>
\ No newline at end of file
......@@ -67,6 +67,16 @@
<item>@color/teal_50</item>
</array>
<array name="account_900">
<item>@color/green_900</item>
<item>@color/orange_900</item>
<item>@color/red_900</item>
<item>@color/blue_900</item>
<item>@color/indigo_900</item>
<item>@color/blue_grey_900</item>
<item>@color/cyan_900</item>
<item>@color/teal_900</item>
</array>
<color name="color_primary_light">@color/grey_200</color>
......
......@@ -485,7 +485,25 @@
<!-- preference_chat -->
<string name="chat_save_history_key">chat_save_history</string>
<string name="chat_events_sound_key">chat_events_sound</string>
<string name="chat_events_show_text_key">chat_events_show_text</string>
<string name="chat_events_show_text_key">chat_events_show_message_text</string>
<string-array name="chat_events_show_text_entries">
<item>@string/chat_events_show_text_global</item>
<item>@string/chat_events_show_text_always</item>
<item>@string/chat_events_show_text_never</item>
</string-array>
<string-array name="chat_events_show_text_entry_values">
<item>@string/chat_events_show_text_global_value</item>
<item>@string/chat_events_show_text_always_value</item>
<item>@string/chat_events_show_text_never_value</item>
</string-array>
<string name="chat_events_show_text_global_value">default</string>
<string name="chat_events_show_text_always_value">always</string>
<string name="chat_events_show_text_never_value">never</string>
<string name="chat_events_show_text_default">@string/chat_events_show_text_global_value</string>
<string name="chat_events_vibro_key">chat_events_vibro</string>
<string name="chat_events_visible_chat_key">chat_events_visible_chat</string>
......
......@@ -24,7 +24,11 @@
android:showDefault="true"
android:showSilent="true"
android:title="@string/events_sound" />
<CheckBoxPreference
<ListPreference
android:defaultValue="@string/chat_events_show_text_default"
android:entries="@array/chat_events_show_text_entries"
android:entryValues="@array/chat_events_show_text_entry_values"
android:key="@string/chat_events_show_text_key"
android:title="@string/events_show_text"
/>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment