Compare commits
9 commits
master
...
message_di
Author | SHA1 | Date | |
---|---|---|---|
![]() |
e9aa5d9daa | ||
![]() |
57102059e0 | ||
![]() |
f7d2e15603 | ||
![]() |
c5c5b417dd | ||
![]() |
007f09384e | ||
![]() |
fe78f858ba | ||
![]() |
351db27a77 | ||
![]() |
70938a31a0 | ||
![]() |
58572ba858 |
31 changed files with 750 additions and 250 deletions
build.gradle
src/main
AndroidManifest.xml
java/de/thedevstack/conversationsplus
services
ui
AbstractSearchableListItemActivity.javaConferenceDetailsActivity.javaContactDetailsActivity.javaConversationActivity.javaEditAccountActivity.javaManageAccountActivity.javaShareWithActivity.javaStartConversationActivity.javaTrustKeysActivity.javaVerifyOTRActivity.javaXmppActivity.java
adapter
listeners
utils
res
|
@ -55,6 +55,8 @@ dependencies {
|
|||
|
||||
// Android dependencies
|
||||
compile 'com.android.support:support-v13:23.2.0'
|
||||
compile 'com.android.support:appcompat-v7:23.2.1'
|
||||
compile 'com.android.support:design:23.2.1'
|
||||
}
|
||||
|
||||
ext {
|
||||
|
|
|
@ -25,7 +25,7 @@
|
|||
android:allowBackup="true"
|
||||
android:icon="@drawable/ic_launcher"
|
||||
android:label="@string/app_name"
|
||||
android:theme="@style/ConversationsTheme"
|
||||
android:theme="@style/ConversationsPlusTheme"
|
||||
tools:replace="android:label"
|
||||
android:name="de.thedevstack.conversationsplus.ConversationsPlusApplication">
|
||||
<service android:name=".services.XmppConnectionService" />
|
||||
|
@ -43,7 +43,8 @@
|
|||
android:name=".ui.ConversationActivity"
|
||||
android:label="@string/app_name"
|
||||
android:launchMode="singleTask"
|
||||
android:windowSoftInputMode="stateHidden">
|
||||
android:windowSoftInputMode="stateHidden"
|
||||
android:theme="@style/ConversationsPlusTheme.NoActionBar">
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.MAIN"/>
|
||||
|
||||
|
@ -54,7 +55,8 @@
|
|||
android:name=".ui.StartConversationActivity"
|
||||
android:configChanges="orientation|screenSize"
|
||||
android:label="@string/title_activity_start_conversation"
|
||||
android:launchMode="singleTask">
|
||||
android:launchMode="singleTask"
|
||||
android:theme="@style/ConversationsPlusTheme.ActionBar">
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.SENDTO"/>
|
||||
|
||||
|
@ -81,7 +83,8 @@
|
|||
</activity>
|
||||
<activity
|
||||
android:name=".ui.SettingsActivity"
|
||||
android:label="@string/title_activity_settings"/>
|
||||
android:label="@string/title_activity_settings"
|
||||
android:theme="@style/ConversationsPlusTheme.ActionBar"/>
|
||||
<activity
|
||||
android:name=".ui.ChooseContactActivity"
|
||||
android:label="@string/title_activity_choose_contact"/>
|
||||
|
|
|
@ -156,8 +156,32 @@ public class AvatarService implements OnAdvancedStreamFeaturesLoaded {
|
|||
}
|
||||
}
|
||||
|
||||
public Bitmap getCircled(Conversation conversation, int size) {
|
||||
return getCircled(conversation, size, false);
|
||||
}
|
||||
|
||||
private Bitmap getCircled(Conversation conversation, int size, boolean cachedOnly) {
|
||||
Bitmap squareAvatar = get(conversation, size, cachedOnly);
|
||||
String key = "";
|
||||
if (conversation.getMode() == Conversation.MODE_SINGLE) {
|
||||
key = key(conversation.getContact(), size);
|
||||
} else {
|
||||
key = key(conversation.getMucOptions(), size);
|
||||
}
|
||||
key += "_circle";
|
||||
|
||||
Bitmap circleAvatar = ImageUtil.getBitmapFromCache(key);
|
||||
if (null != circleAvatar || cachedOnly) {
|
||||
return circleAvatar;
|
||||
}
|
||||
circleAvatar = ImageUtil.getCircleBitmap(squareAvatar);
|
||||
ImageUtil.addBitmapToCache(key, circleAvatar);
|
||||
|
||||
return circleAvatar;
|
||||
}
|
||||
|
||||
public Bitmap get(Conversation conversation, int size) {
|
||||
return get(conversation,size,false);
|
||||
return get(conversation, size, false);
|
||||
}
|
||||
|
||||
public Bitmap get(Conversation conversation, int size, boolean cachedOnly) {
|
||||
|
|
|
@ -2,6 +2,7 @@ package de.thedevstack.conversationsplus.ui;
|
|||
|
||||
import android.content.Context;
|
||||
import android.os.Bundle;
|
||||
import android.support.v4.view.MenuItemCompat;
|
||||
import android.text.Editable;
|
||||
import android.text.TextWatcher;
|
||||
import android.view.Menu;
|
||||
|
@ -26,7 +27,7 @@ public abstract class AbstractSearchableListItemActivity extends XmppActivity {
|
|||
|
||||
private EditText mSearchEditText;
|
||||
|
||||
private final MenuItem.OnActionExpandListener mOnActionExpandListener = new MenuItem.OnActionExpandListener() {
|
||||
private final MenuItemCompat.OnActionExpandListener mOnActionExpandListener = new MenuItemCompat.OnActionExpandListener() {
|
||||
|
||||
@Override
|
||||
public boolean onMenuItemActionExpand(final MenuItem item) {
|
||||
|
@ -103,11 +104,11 @@ public abstract class AbstractSearchableListItemActivity extends XmppActivity {
|
|||
public boolean onCreateOptionsMenu(final Menu menu) {
|
||||
getMenuInflater().inflate(R.menu.choose_contact, menu);
|
||||
final MenuItem menuSearchView = menu.findItem(R.id.action_search);
|
||||
final View mSearchView = menuSearchView.getActionView();
|
||||
final View mSearchView = MenuItemCompat.getActionView(menuSearchView);
|
||||
mSearchEditText = (EditText) mSearchView
|
||||
.findViewById(R.id.search_field);
|
||||
mSearchEditText.addTextChangedListener(mSearchTextWatcher);
|
||||
menuSearchView.setOnActionExpandListener(mOnActionExpandListener);
|
||||
MenuItemCompat.setOnActionExpandListener(menuSearchView, mOnActionExpandListener);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
|
@ -247,10 +247,9 @@ public class ConferenceDetailsActivity extends XmppActivity implements OnConvers
|
|||
mInviteButton = (Button) findViewById(R.id.invite);
|
||||
mInviteButton.setOnClickListener(inviteListener);
|
||||
mConferenceType = (TextView) findViewById(R.id.muc_conference_type);
|
||||
if (getActionBar() != null) {
|
||||
getActionBar().setHomeButtonEnabled(true);
|
||||
getActionBar().setDisplayHomeAsUpEnabled(true);
|
||||
}
|
||||
|
||||
this.enableHomeButtonAsUp();
|
||||
|
||||
mEditNickButton.setOnClickListener(new OnClickListener() {
|
||||
|
||||
@Override
|
||||
|
|
|
@ -216,10 +216,8 @@ public class ContactDetailsActivity extends XmppActivity implements OnAccountUpd
|
|||
});
|
||||
keys = (LinearLayout) findViewById(R.id.details_contact_keys);
|
||||
tags = (LinearLayout) findViewById(R.id.tags);
|
||||
if (getActionBar() != null) {
|
||||
getActionBar().setHomeButtonEnabled(true);
|
||||
getActionBar().setDisplayHomeAsUpEnabled(true);
|
||||
}
|
||||
|
||||
this.enableHomeButtonAsUp();
|
||||
|
||||
this.showDynamicTags = ConversationsPlusPreferences.showDynamicTags();
|
||||
}
|
||||
|
|
|
@ -1,7 +1,8 @@
|
|||
package de.thedevstack.conversationsplus.ui;
|
||||
|
||||
import android.annotation.SuppressLint;
|
||||
import android.app.ActionBar;
|
||||
import android.support.design.widget.FloatingActionButton;
|
||||
import android.support.v7.app.ActionBar;
|
||||
import android.app.AlertDialog;
|
||||
import android.app.FragmentTransaction;
|
||||
import android.app.PendingIntent;
|
||||
|
@ -18,6 +19,7 @@ import android.provider.MediaStore;
|
|||
import android.provider.Settings;
|
||||
import android.support.v4.widget.SlidingPaneLayout;
|
||||
import android.support.v4.widget.SlidingPaneLayout.PanelSlideListener;
|
||||
import android.support.v7.widget.Toolbar;
|
||||
import android.util.Log;
|
||||
import android.util.Pair;
|
||||
import android.view.Gravity;
|
||||
|
@ -32,6 +34,7 @@ import android.widget.ArrayAdapter;
|
|||
import android.widget.CheckBox;
|
||||
import android.widget.PopupMenu;
|
||||
import android.widget.PopupMenu.OnMenuItemClickListener;
|
||||
import android.widget.TextView;
|
||||
import android.widget.Toast;
|
||||
|
||||
import net.java.otr4j.session.SessionStatus;
|
||||
|
@ -45,7 +48,9 @@ import java.util.concurrent.atomic.AtomicBoolean;
|
|||
|
||||
import de.thedevstack.android.logcat.Logging;
|
||||
import de.thedevstack.conversationsplus.ConversationsPlusPreferences;
|
||||
import de.thedevstack.conversationsplus.services.AvatarService;
|
||||
import de.thedevstack.conversationsplus.ui.dialogs.UserDecisionDialog;
|
||||
import de.thedevstack.conversationsplus.ui.listeners.AvatarLogoOnClickListener;
|
||||
import de.thedevstack.conversationsplus.ui.listeners.ResizePictureUserDecisionListener;
|
||||
import de.thedevstack.conversationsplus.utils.ConversationUtil;
|
||||
import de.timroes.android.listview.EnhancedListView;
|
||||
|
@ -125,7 +130,7 @@ public class ConversationActivity extends XmppActivity
|
|||
private AtomicBoolean mRedirected = new AtomicBoolean(false);
|
||||
private Pair<Integer, Intent> mPostponedActivityResult;
|
||||
|
||||
public Conversation getSelectedConversation() {
|
||||
public Conversation getSelectedConversation() {
|
||||
return this.mSelectedConversation;
|
||||
}
|
||||
|
||||
|
@ -176,6 +181,7 @@ public class ConversationActivity extends XmppActivity
|
|||
|
||||
@Override
|
||||
protected void onCreate(final Bundle savedInstanceState) {
|
||||
this.useDefaultActionBar = false;
|
||||
super.onCreate(savedInstanceState);
|
||||
if (savedInstanceState != null) {
|
||||
mOpenConverstaion = savedInstanceState.getString(STATE_OPEN_CONVERSATION, null);
|
||||
|
@ -190,6 +196,10 @@ public class ConversationActivity extends XmppActivity
|
|||
|
||||
setContentView(R.layout.fragment_conversations_overview);
|
||||
|
||||
Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
|
||||
setSupportActionBar(toolbar);
|
||||
this.disableHomeButtonAsUp();
|
||||
|
||||
this.mConversationFragment = new ConversationFragment();
|
||||
FragmentTransaction transaction = getFragmentManager().beginTransaction();
|
||||
transaction.replace(R.id.selected_conversation, this.mConversationFragment, "conversation");
|
||||
|
@ -199,11 +209,6 @@ public class ConversationActivity extends XmppActivity
|
|||
this.listAdapter = new ConversationAdapter(this, conversationList);
|
||||
listView.setAdapter(this.listAdapter);
|
||||
|
||||
if (getActionBar() != null) {
|
||||
getActionBar().setDisplayHomeAsUpEnabled(false);
|
||||
getActionBar().setHomeButtonEnabled(false);
|
||||
}
|
||||
|
||||
listView.setOnItemClickListener(new OnItemClickListener() {
|
||||
|
||||
@Override
|
||||
|
@ -347,21 +352,29 @@ public class ConversationActivity extends XmppActivity
|
|||
}
|
||||
|
||||
private void updateActionBarTitle(boolean titleShouldBeName) {
|
||||
final ActionBar ab = getActionBar();
|
||||
final Conversation conversation = getSelectedConversation();
|
||||
final ActionBar ab = getSupportActionBar();
|
||||
if (ab != null) {
|
||||
TextView title = (TextView) findViewById(R.id.cplusTitle);
|
||||
FloatingActionButton fab = (FloatingActionButton) findViewById(R.id.fab);
|
||||
|
||||
final Conversation conversation = getSelectedConversation();
|
||||
if (titleShouldBeName && conversation != null) {
|
||||
ab.setDisplayHomeAsUpEnabled(true);
|
||||
ab.setHomeButtonEnabled(true);
|
||||
ab.setDisplayHomeAsUpEnabled(true);
|
||||
ab.setHomeButtonEnabled(true);
|
||||
fab.setImageBitmap(AvatarService.getInstance().getCircled(getSelectedConversation(), getResources().getDimensionPixelSize(R.dimen.avatar_size)));
|
||||
fab.setOnClickListener(new AvatarLogoOnClickListener(getSelectedConversation()));
|
||||
fab.setVisibility(View.VISIBLE);
|
||||
|
||||
if (conversation.getMode() == Conversation.MODE_SINGLE || ConversationsPlusPreferences.useSubject()) {
|
||||
ab.setTitle(conversation.getName());
|
||||
title.setText(conversation.getName());
|
||||
} else {
|
||||
ab.setTitle(conversation.getJid().toBareJid().toString());
|
||||
title.setText(conversation.getJid().toBareJid().toString());
|
||||
}
|
||||
} else {
|
||||
ab.setDisplayHomeAsUpEnabled(false);
|
||||
ab.setHomeButtonEnabled(false);
|
||||
ab.setTitle(R.string.app_name);
|
||||
ab.setDisplayHomeAsUpEnabled(false);
|
||||
ab.setHomeButtonEnabled(false);
|
||||
title.setText(R.string.app_name);
|
||||
fab.setVisibility(View.GONE);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1084,7 +1097,7 @@ public class ConversationActivity extends XmppActivity
|
|||
super.onResume();
|
||||
final int theme = findTheme();
|
||||
final boolean usingEnterKey = ConversationsPlusPreferences.displayEnterKey();
|
||||
if (this.mTheme != theme || usingEnterKey != mUsingEnterKey) {
|
||||
if (this.useDefaultActionBar && (this.mTheme != theme || usingEnterKey != mUsingEnterKey)) {
|
||||
recreate();
|
||||
}
|
||||
this.mActivityPaused = false;
|
||||
|
|
|
@ -5,7 +5,6 @@ import android.app.AlertDialog.Builder;
|
|||
import android.app.PendingIntent;
|
||||
import android.content.DialogInterface;
|
||||
import android.content.Intent;
|
||||
import android.content.SharedPreferences;
|
||||
import android.graphics.Bitmap;
|
||||
import android.net.Uri;
|
||||
import android.os.Bundle;
|
||||
|
@ -512,14 +511,10 @@ public class EditAccountActivity extends XmppActivity implements OnAccountUpdate
|
|||
this.messageFingerprint = getIntent().getStringExtra("fingerprint");
|
||||
if (!mInitMode) {
|
||||
this.mRegisterNew.setVisibility(View.GONE);
|
||||
if (getActionBar() != null) {
|
||||
getActionBar().setTitle(getString(R.string.account_details));
|
||||
}
|
||||
this.setActionBarTitle(R.string.account_details);
|
||||
} else {
|
||||
this.mAvatar.setVisibility(View.GONE);
|
||||
if (getActionBar() != null) {
|
||||
getActionBar().setTitle(R.string.action_add_account);
|
||||
}
|
||||
this.setActionBarTitle(R.string.action_add_account);
|
||||
}
|
||||
}
|
||||
this.mShowOptions = ConversationsPlusPreferences.showConnectionOptions();
|
||||
|
@ -541,11 +536,7 @@ public class EditAccountActivity extends XmppActivity implements OnAccountUpdate
|
|||
updateAccountInformation(true);
|
||||
}
|
||||
} else if (this.xmppConnectionService.getAccounts().size() == 0) {
|
||||
if (getActionBar() != null) {
|
||||
getActionBar().setDisplayHomeAsUpEnabled(false);
|
||||
getActionBar().setDisplayShowHomeEnabled(false);
|
||||
getActionBar().setHomeButtonEnabled(false);
|
||||
}
|
||||
this.disableHomeButtonAsUp();
|
||||
TextViewUtil.disable(mCancelButton, ConversationsPlusColors.secondaryText());
|
||||
}
|
||||
if (Config.DOMAIN_LOCK == null) {
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
package de.thedevstack.conversationsplus.ui;
|
||||
|
||||
import android.app.ActionBar;
|
||||
import android.app.AlertDialog;
|
||||
import android.content.ActivityNotFoundException;
|
||||
import android.content.DialogInterface;
|
||||
|
@ -61,11 +60,9 @@ public class ManageAccountActivity extends XmppActivity implements OnAccountUpda
|
|||
accountList.clear();
|
||||
accountList.addAll(xmppConnectionService.getAccounts());
|
||||
}
|
||||
ActionBar actionBar = getActionBar();
|
||||
if (actionBar != null) {
|
||||
actionBar.setHomeButtonEnabled(this.accountList.size() > 0);
|
||||
actionBar.setDisplayHomeAsUpEnabled(this.accountList.size() > 0);
|
||||
}
|
||||
|
||||
this.setHomeButtonAsUpEnabled(this.accountList.size() > 0);
|
||||
|
||||
invalidateOptionsMenu();
|
||||
mAccountAdapter.notifyDataSetChanged();
|
||||
}
|
||||
|
|
|
@ -143,10 +143,7 @@ public class ShareWithActivity extends XmppActivity implements XmppConnectionSer
|
|||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
|
||||
if (getActionBar() != null) {
|
||||
getActionBar().setDisplayHomeAsUpEnabled(false);
|
||||
getActionBar().setHomeButtonEnabled(false);
|
||||
}
|
||||
this.disableHomeButtonAsUp();
|
||||
|
||||
setContentView(R.layout.share_with);
|
||||
setTitle(getString(R.string.title_activity_sharewith));
|
||||
|
|
|
@ -3,12 +3,8 @@ package de.thedevstack.conversationsplus.ui;
|
|||
import android.Manifest;
|
||||
import android.annotation.SuppressLint;
|
||||
import android.annotation.TargetApi;
|
||||
import android.app.ActionBar;
|
||||
import android.app.ActionBar.Tab;
|
||||
import android.app.ActionBar.TabListener;
|
||||
import android.app.AlertDialog;
|
||||
import android.app.Fragment;
|
||||
import android.app.FragmentTransaction;
|
||||
import android.app.ListFragment;
|
||||
import android.content.Context;
|
||||
import android.content.DialogInterface;
|
||||
|
@ -23,7 +19,12 @@ import android.os.Build;
|
|||
import android.os.Bundle;
|
||||
import android.os.Parcelable;
|
||||
import android.support.v13.app.FragmentPagerAdapter;
|
||||
import android.support.v4.app.FragmentTransaction;
|
||||
import android.support.v4.view.MenuItemCompat;
|
||||
import android.support.v4.view.ViewPager;
|
||||
import android.support.v7.app.ActionBar;
|
||||
import android.support.v7.app.ActionBar.Tab;
|
||||
import android.support.v7.app.ActionBar.TabListener;
|
||||
import android.text.Editable;
|
||||
import android.text.TextWatcher;
|
||||
import android.view.ContextMenu;
|
||||
|
@ -97,7 +98,7 @@ public class StartConversationActivity extends XmppActivity implements OnRosterU
|
|||
private AtomicBoolean mRequestedContactsPermission = new AtomicBoolean(false);
|
||||
private final int REQUEST_SYNC_CONTACTS = 0x3b28cf;
|
||||
|
||||
private MenuItem.OnActionExpandListener mOnActionExpandListener = new MenuItem.OnActionExpandListener() {
|
||||
private MenuItemCompat.OnActionExpandListener mOnActionExpandListener = new MenuItemCompat.OnActionExpandListener() {
|
||||
|
||||
@Override
|
||||
public boolean onMenuItemActionExpand(MenuItem item) {
|
||||
|
@ -147,8 +148,8 @@ public class StartConversationActivity extends XmppActivity implements OnRosterU
|
|||
private ViewPager.SimpleOnPageChangeListener mOnPageChangeListener = new ViewPager.SimpleOnPageChangeListener() {
|
||||
@Override
|
||||
public void onPageSelected(int position) {
|
||||
if (getActionBar() != null) {
|
||||
getActionBar().setSelectedNavigationItem(position);
|
||||
if (getSupportActionBar() != null) {
|
||||
getSupportActionBar().setSelectedNavigationItem(position);
|
||||
}
|
||||
onTabChanged();
|
||||
}
|
||||
|
@ -195,7 +196,7 @@ public class StartConversationActivity extends XmppActivity implements OnRosterU
|
|||
setContentView(R.layout.activity_start_conversation);
|
||||
this.mHideOfflineContacts = ConversationsPlusPreferences.hideOffline();
|
||||
mViewPager = (ViewPager) findViewById(R.id.start_conversation_view_pager);
|
||||
ActionBar actionBar = getActionBar();
|
||||
ActionBar actionBar = getSupportActionBar();
|
||||
actionBar.setNavigationMode(ActionBar.NAVIGATION_MODE_TABS);
|
||||
|
||||
mContactsTab = actionBar.newTab().setText(R.string.contacts)
|
||||
|
@ -519,12 +520,11 @@ public class StartConversationActivity extends XmppActivity implements OnRosterU
|
|||
MenuItem menuHideOffline = menu.findItem(R.id.action_hide_offline);
|
||||
menuHideOffline.setChecked(this.mHideOfflineContacts);
|
||||
mMenuSearchView = menu.findItem(R.id.action_search);
|
||||
mMenuSearchView.setOnActionExpandListener(mOnActionExpandListener);
|
||||
View mSearchView = mMenuSearchView.getActionView();
|
||||
mSearchEditText = (EditText) mSearchView
|
||||
.findViewById(R.id.search_field);
|
||||
MenuItemCompat.setOnActionExpandListener(mMenuSearchView, mOnActionExpandListener);
|
||||
View mSearchView = MenuItemCompat.getActionView(mMenuSearchView);
|
||||
mSearchEditText = (EditText) mSearchView.findViewById(R.id.search_field);
|
||||
mSearchEditText.addTextChangedListener(mSearchTextWatcher);
|
||||
if (getActionBar().getSelectedNavigationIndex() == 0) {
|
||||
if (getSupportActionBar().getSelectedNavigationIndex() == 0) {
|
||||
menuCreateConference.setVisible(false);
|
||||
} else {
|
||||
menuCreateContact.setVisible(false);
|
||||
|
@ -637,11 +637,9 @@ public class StartConversationActivity extends XmppActivity implements OnRosterU
|
|||
}
|
||||
}
|
||||
final Intent intent = getIntent();
|
||||
final ActionBar ab = getActionBar();
|
||||
if (intent != null && intent.getBooleanExtra("init",false) && ab != null) {
|
||||
ab.setDisplayShowHomeEnabled(false);
|
||||
ab.setDisplayHomeAsUpEnabled(false);
|
||||
ab.setHomeButtonEnabled(false);
|
||||
|
||||
if (intent != null && intent.getBooleanExtra("init",false)) {
|
||||
this.disableHomeButtonAsUp();
|
||||
}
|
||||
this.mKnownHosts = xmppConnectionService.getKnownHosts();
|
||||
this.mKnownConferenceHosts = xmppConnectionService.getKnownConferenceHosts();
|
||||
|
|
|
@ -94,11 +94,7 @@ public class TrustKeysActivity extends XmppActivity implements OnKeyStatusUpdate
|
|||
mSaveButton = (Button) findViewById(R.id.save_button);
|
||||
mSaveButton.setOnClickListener(mSaveButtonListener);
|
||||
|
||||
|
||||
if (getActionBar() != null) {
|
||||
getActionBar().setHomeButtonEnabled(true);
|
||||
getActionBar().setDisplayHomeAsUpEnabled(true);
|
||||
}
|
||||
this.enableHomeButtonAsUp();
|
||||
}
|
||||
|
||||
private void populateView() {
|
||||
|
|
|
@ -255,27 +255,20 @@ public class VerifyOTRActivity extends XmppActivity implements XmppConnectionSer
|
|||
|
||||
protected void updateView() {
|
||||
if (this.mConversation.hasValidOtrSession()) {
|
||||
final ActionBar actionBar = getActionBar();
|
||||
this.mVerificationExplain.setText(R.string.no_otr_session_found);
|
||||
invalidateOptionsMenu();
|
||||
switch(this.mode) {
|
||||
case MODE_ASK_QUESTION:
|
||||
if (actionBar != null ) {
|
||||
actionBar.setTitle(R.string.ask_question);
|
||||
}
|
||||
this.setActionBarTitle(R.string.ask_question);
|
||||
this.updateViewAskQuestion();
|
||||
break;
|
||||
case MODE_ANSWER_QUESTION:
|
||||
if (actionBar != null ) {
|
||||
actionBar.setTitle(R.string.smp_requested);
|
||||
}
|
||||
this.setActionBarTitle(R.string.smp_requested);
|
||||
this.updateViewAnswerQuestion();
|
||||
break;
|
||||
case MODE_MANUAL_VERIFICATION:
|
||||
default:
|
||||
if (actionBar != null ) {
|
||||
actionBar.setTitle(R.string.manually_verify);
|
||||
}
|
||||
this.setActionBarTitle(R.string.manually_verify);
|
||||
this.updateViewManualVerification();
|
||||
break;
|
||||
}
|
||||
|
|
|
@ -3,8 +3,6 @@ package de.thedevstack.conversationsplus.ui;
|
|||
import android.Manifest;
|
||||
import android.annotation.SuppressLint;
|
||||
import android.annotation.TargetApi;
|
||||
import android.app.ActionBar;
|
||||
import android.app.Activity;
|
||||
import android.app.AlertDialog;
|
||||
import android.app.AlertDialog.Builder;
|
||||
import android.app.PendingIntent;
|
||||
|
@ -17,7 +15,6 @@ import android.content.DialogInterface.OnClickListener;
|
|||
import android.content.Intent;
|
||||
import android.content.IntentSender.SendIntentException;
|
||||
import android.content.ServiceConnection;
|
||||
import android.content.SharedPreferences;
|
||||
import android.content.pm.PackageManager;
|
||||
import android.content.pm.ResolveInfo;
|
||||
import android.content.res.Resources;
|
||||
|
@ -38,7 +35,9 @@ import android.os.Handler;
|
|||
import android.os.IBinder;
|
||||
import android.os.PowerManager;
|
||||
import android.os.SystemClock;
|
||||
import android.preference.PreferenceManager;
|
||||
import android.support.annotation.StringRes;
|
||||
import android.support.v7.app.ActionBar;
|
||||
import android.support.v7.app.AppCompatActivity;
|
||||
import android.text.InputType;
|
||||
import android.util.DisplayMetrics;
|
||||
import android.view.Menu;
|
||||
|
@ -86,12 +85,13 @@ import de.thedevstack.conversationsplus.services.XmppConnectionService;
|
|||
import de.thedevstack.conversationsplus.services.XmppConnectionService.XmppConnectionBinder;
|
||||
import de.thedevstack.conversationsplus.utils.CryptoHelper;
|
||||
import de.thedevstack.conversationsplus.utils.ExceptionHelper;
|
||||
import de.thedevstack.conversationsplus.utils.ui.TextViewUtil;
|
||||
import de.thedevstack.conversationsplus.xmpp.OnKeyStatusUpdated;
|
||||
import de.thedevstack.conversationsplus.xmpp.OnUpdateBlocklist;
|
||||
import de.thedevstack.conversationsplus.xmpp.jid.InvalidJidException;
|
||||
import de.thedevstack.conversationsplus.xmpp.jid.Jid;
|
||||
|
||||
public abstract class XmppActivity extends Activity {
|
||||
public abstract class XmppActivity extends AppCompatActivity {
|
||||
|
||||
protected static final int REQUEST_ANNOUNCE_PGP = 0x0101;
|
||||
protected static final int REQUEST_INVITE_TO_CONVERSATION = 0x0102;
|
||||
|
@ -103,6 +103,7 @@ public abstract class XmppActivity extends Activity {
|
|||
public XmppConnectionService xmppConnectionService;
|
||||
public boolean xmppConnectionServiceBound = false;
|
||||
protected boolean registeredListeners = false;
|
||||
protected boolean useDefaultActionBar = true;
|
||||
|
||||
private DisplayMetrics metrics;
|
||||
protected int mTheme;
|
||||
|
@ -348,12 +349,11 @@ public abstract class XmppActivity extends Activity {
|
|||
super.onCreate(savedInstanceState);
|
||||
metrics = getResources().getDisplayMetrics();
|
||||
ExceptionHelper.init(getApplicationContext());
|
||||
this.mTheme = findTheme();
|
||||
setTheme(this.mTheme);
|
||||
final ActionBar ab = getActionBar();
|
||||
if (ab!=null) {
|
||||
ab.setDisplayHomeAsUpEnabled(true);
|
||||
}
|
||||
if (this.useDefaultActionBar) {
|
||||
this.mTheme = findTheme();
|
||||
setTheme(this.mTheme);
|
||||
enableHomeButtonAsUp();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -369,6 +369,46 @@ public abstract class XmppActivity extends Activity {
|
|||
return super.onCreateOptionsMenu(menu);
|
||||
}
|
||||
|
||||
protected void enableHomeButtonAsUp() {
|
||||
this.setHomeButtonAsUpEnabled(true);
|
||||
}
|
||||
|
||||
protected void disableHomeButtonAsUp() {
|
||||
this.setHomeButtonAsUpEnabled(false);
|
||||
}
|
||||
|
||||
protected void setHomeButtonAsUpEnabled(boolean enabled) {
|
||||
ActionBar ab = getSupportActionBar();
|
||||
if (null != ab) {
|
||||
ab.setHomeButtonEnabled(enabled);
|
||||
ab.setDisplayHomeAsUpEnabled(enabled);
|
||||
}
|
||||
}
|
||||
|
||||
protected void setActionBarTitle(String titleText) {
|
||||
if (this.useDefaultActionBar) {
|
||||
ActionBar ab = getSupportActionBar();
|
||||
if (null != ab) {
|
||||
ab.setTitle(titleText);
|
||||
}
|
||||
} else {
|
||||
TextView title = (TextView) findViewById(R.id.cplusTitle);
|
||||
title.setText(titleText);
|
||||
}
|
||||
}
|
||||
|
||||
protected void setActionBarTitle(@StringRes int resid) {
|
||||
if (this.useDefaultActionBar) {
|
||||
ActionBar ab = getSupportActionBar();
|
||||
if (null != ab) {
|
||||
ab.setTitle(resid);
|
||||
}
|
||||
} else {
|
||||
TextView title = (TextView) findViewById(R.id.cplusTitle);
|
||||
title.setText(resid);
|
||||
}
|
||||
}
|
||||
|
||||
protected boolean isOptimizingBattery() {
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
|
||||
PowerManager pm = (PowerManager) getSystemService(POWER_SERVICE);
|
||||
|
@ -960,9 +1000,9 @@ public abstract class XmppActivity extends Activity {
|
|||
|
||||
protected int findTheme() {
|
||||
if (ConversationsPlusPreferences.useLargerFont()) {
|
||||
return R.style.ConversationsTheme_LargerText;
|
||||
return R.style.ConversationsPlusTheme_LargerText;
|
||||
} else {
|
||||
return R.style.ConversationsTheme;
|
||||
return R.style.ConversationsPlusTheme;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -166,7 +166,7 @@ public class ConversationAdapter extends ArrayAdapter<Conversation> {
|
|||
|
||||
@Override
|
||||
protected Bitmap doInBackground(Conversation... params) {
|
||||
return AvatarService.getInstance().get(params[0], activity.getPixel(56));
|
||||
return AvatarService.getInstance().get(params[0], activity.getResources().getDimensionPixelSize(R.dimen.avatar_size));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -183,7 +183,7 @@ public class ConversationAdapter extends ArrayAdapter<Conversation> {
|
|||
|
||||
public void loadAvatar(Conversation conversation, ImageView imageView) {
|
||||
if (cancelPotentialWork(conversation, imageView)) {
|
||||
final Bitmap bm = AvatarService.getInstance().get(conversation, activity.getPixel(56), true);
|
||||
final Bitmap bm = AvatarService.getInstance().get(conversation, activity.getResources().getDimensionPixelSize(R.dimen.avatar_size), true);
|
||||
if (bm != null) {
|
||||
imageView.setImageBitmap(bm);
|
||||
imageView.setBackgroundColor(0x00000000);
|
||||
|
|
|
@ -38,6 +38,7 @@ import java.util.concurrent.RejectedExecutionException;
|
|||
import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
import de.thedevstack.android.logcat.Logging;
|
||||
import de.thedevstack.conversationsplus.ConversationsPlusApplication;
|
||||
import de.thedevstack.conversationsplus.ConversationsPlusColors;
|
||||
import de.thedevstack.conversationsplus.ConversationsPlusPreferences;
|
||||
|
@ -62,7 +63,7 @@ public class MessageAdapter extends ArrayAdapter<Message> {
|
|||
private static final int SENT = 0;
|
||||
private static final int RECEIVED = 1;
|
||||
private static final int STATUS = 2;
|
||||
private static final int NULL = 3;
|
||||
private static final int ME_COMMAND = 3;
|
||||
private static final Pattern XMPP_PATTERN = Pattern
|
||||
.compile("xmpp\\:(?:(?:["
|
||||
+ Patterns.GOOD_IRI_CHAR
|
||||
|
@ -102,11 +103,13 @@ public class MessageAdapter extends ArrayAdapter<Message> {
|
|||
|
||||
@Override
|
||||
public int getViewTypeCount() {
|
||||
return 3;
|
||||
return 4;
|
||||
}
|
||||
|
||||
public int getItemViewType(Message message) {
|
||||
if (message.getType() == Message.TYPE_STATUS) {
|
||||
if (message.hasMeCommand()) {
|
||||
return ME_COMMAND;
|
||||
} else if (message.getType() == Message.TYPE_STATUS) {
|
||||
return STATUS;
|
||||
} else if (message.getStatus() <= Message.STATUS_RECEIVED) {
|
||||
return RECEIVED;
|
||||
|
@ -253,7 +256,10 @@ public class MessageAdapter extends ArrayAdapter<Message> {
|
|||
if (viewHolder.download_button != null) {
|
||||
viewHolder.download_button.setVisibility(View.GONE);
|
||||
}
|
||||
viewHolder.image.setVisibility(View.GONE);
|
||||
if (null != viewHolder.image) {
|
||||
viewHolder.image.setVisibility(View.GONE);
|
||||
}
|
||||
|
||||
viewHolder.messageBody.setVisibility(View.VISIBLE);
|
||||
viewHolder.messageBody.setText(text);
|
||||
viewHolder.messageBody.setTextColor(getMessageTextColor(darkBackground, false));
|
||||
|
@ -265,7 +271,9 @@ public class MessageAdapter extends ArrayAdapter<Message> {
|
|||
if (viewHolder.download_button != null) {
|
||||
viewHolder.download_button.setVisibility(View.GONE);
|
||||
}
|
||||
viewHolder.image.setVisibility(View.GONE);
|
||||
if (null != viewHolder.image) {
|
||||
viewHolder.image.setVisibility(View.GONE);
|
||||
}
|
||||
viewHolder.messageBody.setVisibility(View.VISIBLE);
|
||||
viewHolder.messageBody.setText(getContext().getString(
|
||||
R.string.decryption_failed));
|
||||
|
@ -278,7 +286,10 @@ public class MessageAdapter extends ArrayAdapter<Message> {
|
|||
if (viewHolder.download_button != null) {
|
||||
viewHolder.download_button.setVisibility(View.GONE);
|
||||
}
|
||||
viewHolder.image.setVisibility(View.GONE);
|
||||
if (null != viewHolder.image) {
|
||||
viewHolder.image.setVisibility(View.GONE);
|
||||
}
|
||||
|
||||
viewHolder.messageBody.setVisibility(View.VISIBLE);
|
||||
viewHolder.messageBody.setIncludeFontPadding(true);
|
||||
if (message.getBody() != null) {
|
||||
|
@ -383,7 +394,9 @@ public class MessageAdapter extends ArrayAdapter<Message> {
|
|||
|
||||
private void displayDownloadableMessage(ViewHolder viewHolder,
|
||||
final Message message, String text) {
|
||||
viewHolder.image.setVisibility(View.GONE);
|
||||
if (null != viewHolder.image) {
|
||||
viewHolder.image.setVisibility(View.GONE);
|
||||
}
|
||||
viewHolder.messageBody.setVisibility(View.GONE);
|
||||
viewHolder.download_button.setVisibility(View.VISIBLE);
|
||||
viewHolder.download_button.setText(text);
|
||||
|
@ -429,6 +442,10 @@ public class MessageAdapter extends ArrayAdapter<Message> {
|
|||
|
||||
private void displayImageMessage(ViewHolder viewHolder,
|
||||
final Message message) {
|
||||
if (null == viewHolder.image) {
|
||||
Toast.makeText(activity, "ImageView null??? " + message.getBody(), Toast.LENGTH_LONG);
|
||||
return;
|
||||
}
|
||||
if (viewHolder.download_button != null) {
|
||||
viewHolder.download_button.setVisibility(View.GONE);
|
||||
}
|
||||
|
@ -461,6 +478,116 @@ public class MessageAdapter extends ArrayAdapter<Message> {
|
|||
viewHolder.image.setOnLongClickListener(openContextMenu);
|
||||
}
|
||||
|
||||
private View initializeView(Message message, int type, ViewGroup parent) {
|
||||
Integer viewResId = null;
|
||||
|
||||
switch (type) {
|
||||
case SENT:
|
||||
viewResId = R.layout.message_sent;
|
||||
break;
|
||||
case RECEIVED:
|
||||
viewResId = R.layout.message_received;
|
||||
break;
|
||||
case STATUS:
|
||||
viewResId = R.layout.message_status;
|
||||
break;
|
||||
case ME_COMMAND:
|
||||
viewResId = R.layout.message_mecmd;
|
||||
break;
|
||||
}
|
||||
|
||||
return activity.getLayoutInflater().inflate(viewResId, parent, false);
|
||||
}
|
||||
|
||||
private ViewHolder initializeViewHolderAndView(Message message, int type, ViewGroup parent) {
|
||||
View view = initializeView(message, type, parent);
|
||||
ViewHolder viewHolder = new ViewHolder(view);
|
||||
if (SENT == type
|
||||
|| RECEIVED == type
|
||||
|| ME_COMMAND == type) {
|
||||
viewHolder.message_box = (LinearLayout) view.findViewById(R.id.message_box);
|
||||
viewHolder.message_box.setVisibility(View.VISIBLE);
|
||||
viewHolder.indicator = (ImageView) view.findViewById(R.id.security_indicator);
|
||||
viewHolder.messageBody = (TextView) view.findViewById(R.id.message_body);
|
||||
viewHolder.time = (TextView) view.findViewById(R.id.message_time);
|
||||
viewHolder.indicatorReceived = (ImageView) view.findViewById(R.id.indicator_received);
|
||||
}
|
||||
if ((SENT == type
|
||||
|| RECEIVED == type)
|
||||
&& ME_COMMAND != type) {
|
||||
viewHolder.download_button = (Button) view.findViewById(R.id.download_button);
|
||||
viewHolder.image = (ImageView) view.findViewById(R.id.message_image);
|
||||
}
|
||||
if (ME_COMMAND == type
|
||||
|| (RECEIVED == type && message.getConversation().getMode() == Conversation.MODE_MULTI)) {
|
||||
viewHolder.contact_picture = (ImageView) view.findViewById(R.id.message_photo);
|
||||
viewHolder.contact_picture.setVisibility(View.VISIBLE);
|
||||
}
|
||||
if (RECEIVED == type) {
|
||||
viewHolder.encryption = (TextView) view.findViewById(R.id.message_encryption);
|
||||
}
|
||||
if (STATUS == type) {
|
||||
viewHolder.contact_picture = (ImageView) view.findViewById(R.id.message_photo);
|
||||
viewHolder.status_message = (TextView) view.findViewById(R.id.status_message);
|
||||
}
|
||||
view.setTag(viewHolder);
|
||||
|
||||
return viewHolder;
|
||||
}
|
||||
|
||||
private void displayAvatar(final Message message, int type, ViewHolder viewHolder) {
|
||||
if (type == ME_COMMAND || (type == RECEIVED && message.getConversation().getMode() == Conversation.MODE_MULTI)) {
|
||||
ImageView imageView = viewHolder.contact_picture;
|
||||
if (null != imageView) {
|
||||
if (cancelPotentialWork(message, imageView)) {
|
||||
//int avatarPixel = activity.getPixel(48);
|
||||
int avatarPixel = imageView.getResources().getDimensionPixelOffset(message.hasMeCommand() ? R.dimen.msg_mecmd_avatar_size : R.dimen.msg_avatar_size);
|
||||
final Bitmap bm = AvatarService.getInstance().get(message, avatarPixel, true);
|
||||
if (bm != null) {
|
||||
imageView.setImageBitmap(bm);
|
||||
imageView.setBackgroundColor(0x00000000);
|
||||
} else {
|
||||
imageView.setBackgroundColor(UIHelper.getColorForName(UIHelper.getMessageDisplayName(message)));
|
||||
imageView.setImageDrawable(null);
|
||||
final BitmapWorkerTask task = new BitmapWorkerTask(imageView);
|
||||
final AsyncDrawable asyncDrawable = new AsyncDrawable(activity.getResources(), null, task);
|
||||
imageView.setImageDrawable(asyncDrawable);
|
||||
try {
|
||||
task.execute(message);
|
||||
} catch (final RejectedExecutionException ignored) {
|
||||
}
|
||||
}
|
||||
}
|
||||
imageView.setOnClickListener(new OnClickListener() {
|
||||
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
if (MessageAdapter.this.mOnContactPictureClickedListener != null) {
|
||||
MessageAdapter.this.mOnContactPictureClickedListener
|
||||
.onContactPictureClicked(message);
|
||||
}
|
||||
|
||||
}
|
||||
});
|
||||
if (message.getConversation().getMode() == Conversation.MODE_MULTI) {
|
||||
imageView.setOnLongClickListener(new OnLongClickListener() {
|
||||
|
||||
@Override
|
||||
public boolean onLongClick(View v) {
|
||||
if (MessageAdapter.this.mOnContactPictureLongClickedListener != null) {
|
||||
MessageAdapter.this.mOnContactPictureLongClickedListener
|
||||
.onContactPictureLongClicked(message);
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public View getView(int position, View view, ViewGroup parent) {
|
||||
final Message message = getItem(position);
|
||||
|
@ -468,69 +595,18 @@ public class MessageAdapter extends ArrayAdapter<Message> {
|
|||
final Conversation conversation = message.getConversation();
|
||||
final Account account = conversation.getAccount();
|
||||
final int type = getItemViewType(position);
|
||||
ViewHolder viewHolder;
|
||||
if (view == null) {
|
||||
viewHolder = new ViewHolder();
|
||||
switch (type) {
|
||||
case SENT:
|
||||
view = activity.getLayoutInflater().inflate(
|
||||
R.layout.message_sent, parent, false);
|
||||
viewHolder.message_box = (LinearLayout) view
|
||||
.findViewById(R.id.message_box);
|
||||
viewHolder.contact_picture = (ImageView) view
|
||||
.findViewById(R.id.message_photo);
|
||||
viewHolder.download_button = (Button) view
|
||||
.findViewById(R.id.download_button);
|
||||
viewHolder.indicator = (ImageView) view
|
||||
.findViewById(R.id.security_indicator);
|
||||
viewHolder.image = (ImageView) view
|
||||
.findViewById(R.id.message_image);
|
||||
viewHolder.messageBody = (TextView) view
|
||||
.findViewById(R.id.message_body);
|
||||
viewHolder.time = (TextView) view
|
||||
.findViewById(R.id.message_time);
|
||||
viewHolder.indicatorReceived = (ImageView) view
|
||||
.findViewById(R.id.indicator_received);
|
||||
break;
|
||||
case RECEIVED:
|
||||
view = activity.getLayoutInflater().inflate(
|
||||
R.layout.message_received, parent, false);
|
||||
viewHolder.message_box = (LinearLayout) view
|
||||
.findViewById(R.id.message_box);
|
||||
viewHolder.contact_picture = (ImageView) view
|
||||
.findViewById(R.id.message_photo);
|
||||
viewHolder.download_button = (Button) view
|
||||
.findViewById(R.id.download_button);
|
||||
viewHolder.indicator = (ImageView) view
|
||||
.findViewById(R.id.security_indicator);
|
||||
viewHolder.image = (ImageView) view
|
||||
.findViewById(R.id.message_image);
|
||||
viewHolder.messageBody = (TextView) view
|
||||
.findViewById(R.id.message_body);
|
||||
viewHolder.time = (TextView) view
|
||||
.findViewById(R.id.message_time);
|
||||
viewHolder.indicatorReceived = (ImageView) view
|
||||
.findViewById(R.id.indicator_received);
|
||||
viewHolder.encryption = (TextView) view.findViewById(R.id.message_encryption);
|
||||
break;
|
||||
case STATUS:
|
||||
view = activity.getLayoutInflater().inflate(R.layout.message_status, parent, false);
|
||||
viewHolder.contact_picture = (ImageView) view.findViewById(R.id.message_photo);
|
||||
viewHolder.status_message = (TextView) view.findViewById(R.id.status_message);
|
||||
break;
|
||||
default:
|
||||
viewHolder = null;
|
||||
break;
|
||||
}
|
||||
view.setTag(viewHolder);
|
||||
} else {
|
||||
viewHolder = (ViewHolder) view.getTag();
|
||||
if (viewHolder == null) {
|
||||
return view;
|
||||
}
|
||||
}
|
||||
ViewHolder viewHolder;
|
||||
if (null == view) {
|
||||
viewHolder = initializeViewHolderAndView(message, type, parent);
|
||||
view = viewHolder.view;
|
||||
} else {
|
||||
viewHolder = (ViewHolder) view.getTag();
|
||||
if (null == viewHolder) {
|
||||
return view;
|
||||
}
|
||||
}
|
||||
Logging.d("MessageAdapter", "Received: " + (type == RECEIVED) + ", SENT: " + (type == SENT) + ", Status: " + (type == STATUS) + ", /me: " + (type == ME_COMMAND));
|
||||
|
||||
boolean darkBackground = (type == RECEIVED && !isInValidSession);
|
||||
|
||||
if (type == STATUS) {
|
||||
viewHolder.status_message.setVisibility(View.VISIBLE);
|
||||
|
@ -542,36 +618,13 @@ public class MessageAdapter extends ArrayAdapter<Message> {
|
|||
}
|
||||
viewHolder.status_message.setText(message.getBody());
|
||||
return view;
|
||||
} else {
|
||||
loadAvatar(message, viewHolder.contact_picture);
|
||||
}
|
||||
|
||||
viewHolder.contact_picture
|
||||
.setOnClickListener(new OnClickListener() {
|
||||
this.displayAvatar(message, type, viewHolder);
|
||||
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
if (MessageAdapter.this.mOnContactPictureClickedListener != null) {
|
||||
MessageAdapter.this.mOnContactPictureClickedListener
|
||||
.onContactPictureClicked(message);
|
||||
}
|
||||
boolean darkBackground = (type == RECEIVED && !isInValidSession);
|
||||
|
||||
}
|
||||
});
|
||||
viewHolder.contact_picture
|
||||
.setOnLongClickListener(new OnLongClickListener() {
|
||||
|
||||
@Override
|
||||
public boolean onLongClick(View v) {
|
||||
if (MessageAdapter.this.mOnContactPictureLongClickedListener != null) {
|
||||
MessageAdapter.this.mOnContactPictureLongClickedListener
|
||||
.onContactPictureLongClicked(message);
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
});
|
||||
this.displayStatus(viewHolder, message, type, darkBackground);
|
||||
|
||||
final Transferable transferable = message.getTransferable();
|
||||
if (transferable != null && transferable.getStatus() != Transferable.STATUS_UPLOADING) {
|
||||
|
@ -644,8 +697,6 @@ public class MessageAdapter extends ArrayAdapter<Message> {
|
|||
}
|
||||
}
|
||||
|
||||
displayStatus(viewHolder, message, type, darkBackground);
|
||||
|
||||
return view;
|
||||
}
|
||||
|
||||
|
@ -713,7 +764,10 @@ public class MessageAdapter extends ArrayAdapter<Message> {
|
|||
}
|
||||
|
||||
private static class ViewHolder {
|
||||
|
||||
protected ViewHolder(View view) {
|
||||
this.view = view;
|
||||
}
|
||||
protected View view;
|
||||
protected LinearLayout message_box;
|
||||
protected Button download_button;
|
||||
protected ImageView image;
|
||||
|
@ -751,26 +805,6 @@ public class MessageAdapter extends ArrayAdapter<Message> {
|
|||
}
|
||||
}
|
||||
|
||||
public void loadAvatar(Message message, ImageView imageView) {
|
||||
if (cancelPotentialWork(message, imageView)) {
|
||||
final Bitmap bm = AvatarService.getInstance().get(message, activity.getPixel(48), true);
|
||||
if (bm != null) {
|
||||
imageView.setImageBitmap(bm);
|
||||
imageView.setBackgroundColor(0x00000000);
|
||||
} else {
|
||||
imageView.setBackgroundColor(UIHelper.getColorForName(UIHelper.getMessageDisplayName(message)));
|
||||
imageView.setImageDrawable(null);
|
||||
final BitmapWorkerTask task = new BitmapWorkerTask(imageView);
|
||||
final AsyncDrawable asyncDrawable = new AsyncDrawable(activity.getResources(), null, task);
|
||||
imageView.setImageDrawable(asyncDrawable);
|
||||
try {
|
||||
task.execute(message);
|
||||
} catch (final RejectedExecutionException ignored) {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static boolean cancelPotentialWork(Message message, ImageView imageView) {
|
||||
final BitmapWorkerTask bitmapWorkerTask = getBitmapWorkerTask(imageView);
|
||||
|
||||
|
|
|
@ -0,0 +1,75 @@
|
|||
package de.thedevstack.conversationsplus.ui.listeners;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.os.Bundle;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.MenuItem;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
|
||||
import de.thedevstack.conversationsplus.entities.Contact;
|
||||
import de.thedevstack.conversationsplus.entities.Conversation;
|
||||
import de.thedevstack.conversationsplus.ui.ConferenceDetailsActivity;
|
||||
import de.thedevstack.conversationsplus.ui.ContactDetailsActivity;
|
||||
import de.thedevstack.conversationsplus.ui.XmppActivity;
|
||||
|
||||
/**
|
||||
* This listener opens on click
|
||||
* <ul>
|
||||
* <li>the conference details activity if the conversation is a MUC conversation</li>
|
||||
* <li>the contact details activity if the conversation is a One-To-One conversation</li>
|
||||
* </ul>
|
||||
*/
|
||||
public class AvatarLogoOnClickListener implements View.OnClickListener {
|
||||
private final Conversation conversation;
|
||||
|
||||
/**
|
||||
* Initializes the on click listener for a conversation.
|
||||
* @param conversation the conversation to be used
|
||||
*/
|
||||
public AvatarLogoOnClickListener(Conversation conversation) {
|
||||
this.conversation = conversation;
|
||||
}
|
||||
|
||||
/**
|
||||
* Called when a view has been clicked.
|
||||
*
|
||||
* @param v The view that was clicked.
|
||||
*/
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
if (this.conversation.getMode() == Conversation.MODE_MULTI) {
|
||||
this.openConferenceDetails(v.getContext());
|
||||
} else {
|
||||
this.openContactDetails(v.getContext());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Opens the conference details activity.
|
||||
* @see de.thedevstack.conversationsplus.ui.ConversationFragment#onCreateView(LayoutInflater, ViewGroup, Bundle)
|
||||
* @param context the context to start the activity from.
|
||||
*/
|
||||
private void openConferenceDetails(Context context) {
|
||||
Intent intent = new Intent(context, ConferenceDetailsActivity.class);
|
||||
intent.setAction(ConferenceDetailsActivity.ACTION_VIEW_MUC);
|
||||
intent.putExtra("uuid", this.conversation.getUuid());
|
||||
context.startActivity(intent);
|
||||
}
|
||||
|
||||
/**
|
||||
* Opens the contact details activity.
|
||||
* @param context the context to start the activity from.
|
||||
* @see de.thedevstack.conversationsplus.ui.ConversationActivity#onOptionsItemSelected(MenuItem)
|
||||
*/
|
||||
public void openContactDetails(Context context) {
|
||||
Contact contact = this.conversation.getContact();
|
||||
Intent intent = new Intent(context, ContactDetailsActivity.class);
|
||||
intent.setAction(ContactDetailsActivity.ACTION_VIEW_CONTACT);
|
||||
intent.putExtra(XmppActivity.EXTRA_ACCOUNT, contact.getAccount().getJid().toBareJid().toString());
|
||||
intent.putExtra("contact", contact.getJid().toBareJid().toString());
|
||||
intent.putExtra("fingerprint", (String)null);
|
||||
context.startActivity(intent);
|
||||
}
|
||||
}
|
|
@ -4,6 +4,10 @@ import android.graphics.Bitmap;
|
|||
import android.graphics.BitmapFactory;
|
||||
import android.graphics.Canvas;
|
||||
import android.graphics.Matrix;
|
||||
import android.graphics.Paint;
|
||||
import android.graphics.PorterDuff;
|
||||
import android.graphics.PorterDuffXfermode;
|
||||
import android.graphics.Rect;
|
||||
import android.graphics.RectF;
|
||||
import android.media.ExifInterface;
|
||||
import android.net.Uri;
|
||||
|
@ -365,6 +369,34 @@ public final class ImageUtil {
|
|||
return inSampleSize;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get a circled cut-out of a bitmap.
|
||||
* @param bitmap the original bitmap
|
||||
* @return the circled cut-out of the original bitmap
|
||||
* @see <a href="http://stackoverflow.com/questions/11932805/cropping-circular-area-from-bitmap-in-android">http://stackoverflow.com/questions/11932805/cropping-circular-area-from-bitmap-in-android</a>
|
||||
*/
|
||||
public static Bitmap getCircleBitmap(Bitmap bitmap) {
|
||||
Bitmap output = Bitmap.createBitmap(bitmap.getWidth(),
|
||||
bitmap.getHeight(), Bitmap.Config.ARGB_8888);
|
||||
Canvas canvas = new Canvas(output);
|
||||
|
||||
final int color = 0xff424242;
|
||||
final Paint paint = new Paint();
|
||||
final Rect rect = new Rect(0, 0, bitmap.getWidth(), bitmap.getHeight());
|
||||
|
||||
paint.setAntiAlias(true);
|
||||
canvas.drawARGB(0, 0, 0, 0);
|
||||
paint.setColor(color);
|
||||
// canvas.drawRoundRect(rectF, roundPx, roundPx, paint);
|
||||
canvas.drawCircle(bitmap.getWidth() / 2, bitmap.getHeight() / 2,
|
||||
bitmap.getWidth() / 2, paint);
|
||||
paint.setXfermode(new PorterDuffXfermode(PorterDuff.Mode.SRC_IN));
|
||||
canvas.drawBitmap(bitmap, rect, rect, paint);
|
||||
//Bitmap _bmp = Bitmap.createScaledBitmap(output, 60, 60, false);
|
||||
//return _bmp;
|
||||
return output;
|
||||
}
|
||||
|
||||
private ImageUtil() {
|
||||
// Static helper class
|
||||
}
|
||||
|
|
15
src/main/res/drawable/mecmd_message_border.xml
Normal file
15
src/main/res/drawable/mecmd_message_border.xml
Normal file
|
@ -0,0 +1,15 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="rectangle" >
|
||||
|
||||
<corners android:radius="2dp" />
|
||||
|
||||
<padding
|
||||
android:bottom="1.5dp"
|
||||
android:left="1.5dp"
|
||||
android:right="1.5dp"
|
||||
android:top="1.5dp" />
|
||||
|
||||
<solid android:color="@color/black12" />
|
||||
|
||||
</shape>
|
|
@ -1,8 +1,14 @@
|
|||
<android.support.v4.widget.SlidingPaneLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:id="@+id/content_view_spl"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent" >
|
||||
|
||||
|
||||
<android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:fitsSystemWindows="true">
|
||||
<android.support.v4.widget.SlidingPaneLayout
|
||||
android:id="@+id/content_view_spl"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:paddingTop="?attr/actionBarSize">
|
||||
<LinearLayout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="@dimen/conversations_overview_width"
|
||||
|
@ -18,7 +24,6 @@
|
|||
android:divider="@color/black12"
|
||||
android:dividerHeight="1dp" />
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/selected_conversation"
|
||||
android:layout_width="fill_parent"
|
||||
|
@ -27,4 +32,53 @@
|
|||
android:orientation="vertical" >
|
||||
</LinearLayout>
|
||||
|
||||
</android.support.v4.widget.SlidingPaneLayout>
|
||||
</android.support.v4.widget.SlidingPaneLayout>
|
||||
|
||||
<android.support.design.widget.AppBarLayout
|
||||
android:id="@+id/app_bar"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="180dp"
|
||||
android:fitsSystemWindows="true"
|
||||
app:expanded="false"
|
||||
android:theme="@style/ConversationsPlusTheme.AppBarOverlay">
|
||||
|
||||
<android.support.design.widget.CollapsingToolbarLayout
|
||||
android:id="@+id/toolbar_layout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:fitsSystemWindows="true"
|
||||
app:contentScrim="?attr/colorPrimary"
|
||||
app:layout_scrollFlags="scroll|exitUntilCollapsed">
|
||||
|
||||
<android.support.v7.widget.Toolbar
|
||||
android:id="@+id/toolbar"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="?attr/actionBarSize"
|
||||
app:layout_collapseMode="pin"
|
||||
android:layout_marginLeft="72dp"
|
||||
app:popupTheme="@style/ConversationsPlusTheme.PopupOverlay">
|
||||
<TextView
|
||||
android:id="@+id/cplusTitle"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:text="@string/app_name"
|
||||
android:gravity="center_vertical"
|
||||
android:textSize="@dimen/action_bar_title_text_size"/>
|
||||
</android.support.v7.widget.Toolbar>
|
||||
|
||||
</android.support.design.widget.CollapsingToolbarLayout>
|
||||
</android.support.design.widget.AppBarLayout>
|
||||
|
||||
<android.support.design.widget.FloatingActionButton
|
||||
android:id="@+id/fab"
|
||||
android:layout_width="@dimen/avatar_size"
|
||||
android:layout_height="@dimen/avatar_size"
|
||||
android:layout_marginLeft="16dp"
|
||||
android:layout_marginTop="16dp"
|
||||
app:layout_anchorGravity="top|start"
|
||||
android:padding="0dp"
|
||||
app:borderWidth="0dp"
|
||||
app:fabSize="normal"
|
||||
android:visibility="gone"/>
|
||||
|
||||
</android.support.design.widget.CoordinatorLayout>
|
14
src/main/res/layout/logo_view.xml
Normal file
14
src/main/res/layout/logo_view.xml
Normal file
|
@ -0,0 +1,14 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:orientation="vertical"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
<ImageView
|
||||
android:id="@+id/logoViewAvatar"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:src="@drawable/ic_profile"
|
||||
android:scaleType="center"
|
||||
android:layout_marginLeft="10dip"
|
||||
/>
|
||||
</RelativeLayout>
|
112
src/main/res/layout/message_mecmd.xml
Normal file
112
src/main/res/layout/message_mecmd.xml
Normal file
|
@ -0,0 +1,112 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
android:paddingBottom="3dp"
|
||||
android:paddingLeft="8dp"
|
||||
android:paddingRight="8dp"
|
||||
android:paddingTop="3dp">
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/message_box"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentBottom="true"
|
||||
android:layout_alignParentRight="true"
|
||||
android:layout_alignParentLeft="true"
|
||||
android:background="@drawable/mecmd_message_border"
|
||||
android:minHeight="53dp"
|
||||
android:longClickable="true">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="fill_parent"
|
||||
android:background="@color/grey50"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="vertical"
|
||||
android:paddingBottom="4dp"
|
||||
android:paddingLeft="5dp"
|
||||
android:paddingRight="5dp"
|
||||
android:paddingTop="4dp" >
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content">
|
||||
<com.makeramen.roundedimageview.RoundedImageView
|
||||
android:id="@+id/message_photo"
|
||||
android:layout_width="@dimen/msg_mecmd_avatar_size"
|
||||
android:layout_height="@dimen/msg_mecmd_avatar_size"
|
||||
android:layout_alignParentLeft="true"
|
||||
android:layout_alignParentTop="true"
|
||||
android:layout_marginRight="-1.5dp"
|
||||
android:padding="0dp"
|
||||
android:scaleType="fitXY"
|
||||
android:src="@drawable/ic_profile"
|
||||
app:riv_corner_radius="1dp"/>
|
||||
|
||||
<github.ankushsachdeva.emojicon.EmojiconTextView
|
||||
android:id="@+id/message_body"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_toRightOf="@id/message_photo"
|
||||
android:layout_marginLeft="8dp"
|
||||
android:autoLink="web|phone|email"
|
||||
android:textColor="@color/black87"
|
||||
android:textSize="?attr/TextSizeBody"
|
||||
app:emojiconSize="?attr/EmojiconSizeBody"
|
||||
android:text=""/>
|
||||
</RelativeLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="right"
|
||||
android:orientation="horizontal"
|
||||
android:paddingTop="1dp" >
|
||||
|
||||
<TextView
|
||||
android:id="@+id/message_time"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:gravity="center_vertical"
|
||||
android:text="@string/sending"
|
||||
android:textColor="@color/black54"
|
||||
android:textSize="?attr/TextSizeInfo" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/message_encryption"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:gravity="center_vertical"
|
||||
android:layout_marginRight="4sp"
|
||||
android:textColor="@color/white70"
|
||||
android:textStyle="bold"
|
||||
android:textSize="?attr/TextSizeInfo" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/security_indicator"
|
||||
android:layout_width="?attr/TextSizeInfo"
|
||||
android:layout_height="?attr/TextSizeInfo"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:layout_marginLeft="4sp"
|
||||
android:alpha="0.54"
|
||||
android:gravity="center_vertical"
|
||||
android:src="@drawable/ic_lock_black_18dp" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/indicator_received"
|
||||
android:layout_width="?attr/TextSizeInfo"
|
||||
android:layout_height="?attr/TextSizeInfo"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:layout_marginLeft="4sp"
|
||||
android:alpha="0.54"
|
||||
android:gravity="center_vertical"
|
||||
android:src="@drawable/ic_received_indicator" />
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
</RelativeLayout>
|
|
@ -11,13 +11,14 @@
|
|||
|
||||
<com.makeramen.roundedimageview.RoundedImageView
|
||||
android:id="@+id/message_photo"
|
||||
android:layout_width="48dp"
|
||||
android:layout_height="48dp"
|
||||
android:layout_width="@dimen/msg_avatar_size"
|
||||
android:layout_height="@dimen/msg_avatar_size"
|
||||
android:layout_alignParentLeft="true"
|
||||
android:layout_alignParentTop="true"
|
||||
android:scaleType="fitXY"
|
||||
android:src="@drawable/ic_profile"
|
||||
app:riv_corner_radius="2dp" />
|
||||
app:riv_corner_radius="2dp"
|
||||
android:visibility="gone" />
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/message_box"
|
||||
|
@ -29,7 +30,8 @@
|
|||
android:minHeight="53dp"
|
||||
android:layout_marginTop="-2dp"
|
||||
android:layout_marginRight="-4dp"
|
||||
android:longClickable="true">
|
||||
android:longClickable="true"
|
||||
android:visibility="gone">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
|
|
|
@ -31,7 +31,8 @@
|
|||
android:background="@drawable/message_bubble_sent"
|
||||
android:minHeight="53dp"
|
||||
android:layout_marginLeft="-4dp"
|
||||
android:longClickable="true">
|
||||
android:longClickable="true"
|
||||
android:visibility="gone">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
|
@ -106,4 +107,76 @@
|
|||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/mecmd_message_box"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentBottom="true"
|
||||
android:layout_alignParentRight="true"
|
||||
android:layout_alignParentLeft="true"
|
||||
android:background="@drawable/mecmd_message_border"
|
||||
android:minHeight="53dp"
|
||||
android:longClickable="true"
|
||||
android:visibility="gone">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="fill_parent"
|
||||
android:background="@color/grey50"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="vertical"
|
||||
android:paddingBottom="4dp"
|
||||
android:paddingLeft="5dp"
|
||||
android:paddingRight="5dp"
|
||||
android:paddingTop="4dp" >
|
||||
|
||||
<github.ankushsachdeva.emojicon.EmojiconTextView
|
||||
android:id="@+id/mecmd_message_body"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:autoLink="web|phone|email"
|
||||
android:textColor="@color/black87"
|
||||
android:textSize="?attr/TextSizeBody"
|
||||
app:emojiconSize="?attr/EmojiconSizeBody" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="right"
|
||||
android:orientation="horizontal"
|
||||
android:paddingTop="1dp" >
|
||||
|
||||
<TextView
|
||||
android:id="@+id/mecmd_message_time"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:gravity="center_vertical"
|
||||
android:text="@string/sending"
|
||||
android:textColor="@color/black54"
|
||||
android:textSize="?attr/TextSizeInfo" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/mecmd_security_indicator"
|
||||
android:layout_width="?attr/TextSizeInfo"
|
||||
android:layout_height="?attr/TextSizeInfo"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:layout_marginLeft="4sp"
|
||||
android:alpha="0.54"
|
||||
android:gravity="center_vertical"
|
||||
android:src="@drawable/ic_lock_black_18dp" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/mecmd_indicator_received"
|
||||
android:layout_width="?attr/TextSizeInfo"
|
||||
android:layout_height="?attr/TextSizeInfo"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:layout_marginLeft="4sp"
|
||||
android:alpha="0.54"
|
||||
android:gravity="center_vertical"
|
||||
android:src="@drawable/ic_received_indicator" />
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
|
||||
</RelativeLayout>
|
|
@ -11,8 +11,8 @@
|
|||
|
||||
<com.makeramen.roundedimageview.RoundedImageView
|
||||
android:id="@+id/message_photo"
|
||||
android:layout_width="32dp"
|
||||
android:layout_height="32dp"
|
||||
android:layout_width="@dimen/msg_status_avatar_size"
|
||||
android:layout_height="@dimen/msg_status_avatar_size"
|
||||
android:layout_alignParentLeft="true"
|
||||
android:layout_alignParentTop="true"
|
||||
android:layout_marginRight="-1.5dp"
|
||||
|
|
15
src/main/res/layout/title.xml
Normal file
15
src/main/res/layout/title.xml
Normal file
|
@ -0,0 +1,15 @@
|
|||
<?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="wrap_content"
|
||||
android:background="@android:color/transparent"
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text=""
|
||||
android:id="@+id/conversationsTitle"
|
||||
android:textSize="@dimen/action_bar_title_text_size"
|
||||
android:textColor="@color/primaryTextOnDark"/>
|
||||
</LinearLayout>
|
|
@ -1,9 +1,9 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<menu xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<menu xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto">
|
||||
|
||||
<item
|
||||
android:id="@+id/action_search"
|
||||
android:actionLayout="@layout/actionview_search"
|
||||
app:actionLayout="@layout/actionview_search"
|
||||
android:icon="?attr/icon_search"
|
||||
android:showAsAction="collapseActionView|always"
|
||||
android:title="@string/search" />
|
||||
|
|
4
src/main/res/values-land/dimens.xml
Normal file
4
src/main/res/values-land/dimens.xml
Normal file
|
@ -0,0 +1,4 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<dimen name="action_bar_title_text_size">16dp</dimen> <!-- redefinition here, because no access to original from android -->
|
||||
</resources>
|
|
@ -1,7 +1,7 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
|
||||
<style name="ConversationsTheme" parent="@android:style/Theme.Material.Light.DarkActionBar">
|
||||
<style name="ConversationsTheme" parent="@style/Theme.AppCompat.Light.DarkActionBar">
|
||||
<item name="android:colorPrimary">@color/primary</item>
|
||||
<item name="android:colorPrimaryDark">@color/primary_dark</item>
|
||||
<item name="android:colorAccent">@color/accent</item>
|
||||
|
|
|
@ -9,4 +9,10 @@
|
|||
<dimen name="ambilwarna_hsvWidth">240dp</dimen>
|
||||
<dimen name="ambilwarna_hueWidth">30dp</dimen>
|
||||
<dimen name="ambilwarna_spacer">8dp</dimen>
|
||||
<dimen name="action_bar_title_text_size">18dp</dimen> <!-- redefinition here, because no access to original from android -->
|
||||
<dimen name="avatar_size">56dp</dimen>
|
||||
<dimen name="design_fab_image_size">@dimen/avatar_size</dimen>
|
||||
<dimen name="msg_mecmd_avatar_size">24dp</dimen>
|
||||
<dimen name="msg_avatar_size">48dp</dimen>
|
||||
<dimen name="msg_status_avatar_size">32dp</dimen>
|
||||
</resources>
|
||||
|
|
|
@ -1,13 +1,13 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
|
||||
<style name="ConversationsTheme" parent="@android:style/Theme.Holo.Light.DarkActionBar">
|
||||
<item name="android:actionBarStyle">@style/ConversationsActionBar</item>
|
||||
<item name="android:actionBarWidgetTheme">@style/ConversationsActionBarWidget</item>
|
||||
<item name="android:actionBarTabStyle">@style/ConversationsActionBarTabs</item>
|
||||
<style name="ConversationsPlusTheme" parent="@style/Theme.AppCompat.Light.DarkActionBar">
|
||||
<item name="TextSizeInfo">12sp</item>
|
||||
<item name="TextSizeBody">14sp</item>
|
||||
<item name="TextSizeHeadline">20sp</item>
|
||||
<item name="colorPrimary">@color/primary</item>
|
||||
<item name="colorPrimaryDark">@color/primaryTextOnDark</item>
|
||||
<item name="colorAccent">@color/secondaryBackground</item>
|
||||
|
||||
<item name="EmojiconSizeBody">19sp</item>
|
||||
<item name="EmojiconSizeInput">24sp</item>
|
||||
|
@ -36,27 +36,39 @@
|
|||
<item name="attr/icon_share">@drawable/ic_action_share</item>
|
||||
</style>
|
||||
|
||||
<style name="ConversationsTheme.LargerText" parent="ConversationsTheme">
|
||||
<style name="ConversationsPlusTheme.LargerText" parent="ConversationsPlusTheme">
|
||||
<item name="TextSizeInfo">14sp</item>
|
||||
<item name="TextSizeBody">16sp</item>
|
||||
<item name="TextSizeHeadline">22sp</item>
|
||||
<item name="EmojiconSizeBody">22sp</item>
|
||||
</style>
|
||||
|
||||
<style name="ConversationsActionBar" parent="@android:style/Widget.Holo.Light.ActionBar.Solid.Inverse">
|
||||
<style name="ConversationsPlusTheme.AppBarOverlay" parent="ThemeOverlay.AppCompat.Dark.ActionBar" />
|
||||
|
||||
<style name="ConversationsPlusTheme.PopupOverlay" parent="ThemeOverlay.AppCompat.Light" />
|
||||
|
||||
<style name="ConversationsPlusTheme.NoActionBar">
|
||||
<item name="windowActionBar">false</item>
|
||||
<item name="windowNoTitle">true</item>
|
||||
</style>
|
||||
|
||||
<style name="ConversationsPlusTheme.ActionBar">
|
||||
<item name="android:actionBarStyle">@style/ConversationsActionBar</item>
|
||||
<item name="android:actionBarWidgetTheme">@style/ConversationsActionBarWidget</item>
|
||||
<item name="android:actionBarTabStyle">@style/ConversationsActionBarTabs</item>
|
||||
</style>
|
||||
|
||||
<style name="ConversationsActionBar" parent="@style/Widget.AppCompat.Light.ActionBar.Solid.Inverse">
|
||||
<item name="android:background">@color/primary</item>
|
||||
<item name="android:backgroundStacked">@color/primary_dark</item>
|
||||
<item name="android:displayOptions">showHome|homeAsUp|showTitle</item>
|
||||
<item name="android:icon">@android:color/transparent</item>
|
||||
</style>
|
||||
|
||||
<style name="ConversationsActionBarWidget" parent="android:Theme.Holo.Light">
|
||||
<item name="android:popupMenuStyle">@android:style/Widget.Holo.Light.PopupMenu</item>
|
||||
<item name="android:dropDownListViewStyle">@android:style/Widget.Holo.Light.ListView.DropDown</item>
|
||||
<style name="ConversationsActionBarWidget" parent="@style/Theme.AppCompat.Light">
|
||||
<item name="android:popupMenuStyle">@style/Widget.AppCompat.Light.PopupMenu</item>
|
||||
<item name="android:dropDownListViewStyle">@style/Widget.AppCompat.Light.ListView.DropDown</item>
|
||||
</style>
|
||||
|
||||
<style name="ConversationsActionBarTabs" parent="@android:style/Widget.Holo.ActionBar.TabView">
|
||||
<style name="ConversationsActionBarTabs" parent="@style/Widget.AppCompat.ActionBar.TabView">
|
||||
<item name="android:background">@drawable/actionbar_tab_indicator</item>
|
||||
</style>
|
||||
|
||||
</resources>
|
Loading…
Add table
Reference in a new issue