Merge branch 'master' of ssh://float.beyondsoft.de/git/beyondSoft/Chat

This commit is contained in:
Waldi
2017-10-20 07:35:09 +02:00
61 changed files with 69 additions and 50 deletions

View File

@@ -1,43 +1,35 @@
{
"project_info": {
"project_number": "1021949586645",
"firebase_url": "https://bewoplaner-chat-android.firebaseio.com",
"project_id": "bewoplaner-chat-android",
"storage_bucket": "bewoplaner-chat-android.appspot.com"
"project_number": "975648037658",
"firebase_url": "https://api-6660704302827515492-860965.firebaseio.com",
"project_id": "api-6660704302827515492-860965",
"storage_bucket": "api-6660704302827515492-860965.appspot.com"
},
"client": [
{
"client_info": {
"mobilesdk_app_id": "1:1021949586645:android:113c5b5fc97fb0bb",
"mobilesdk_app_id": "1:975648037658:android:220d52417bd0e0d6",
"android_client_info": {
"package_name": "de.beyondsoft.ownchat"
}
},
"oauth_client": [
{
"client_id": "1021949586645-vnidi5tjof2kgsal6qgqrbokel0q0hvi.apps.googleusercontent.com",
"client_id": "975648037658-os4qq20iddsfjbvi5i23vgq9thnfub8u.apps.googleusercontent.com",
"client_type": 1,
"android_info": {
"package_name": "de.beyondsoft.ownchat",
"certificate_hash": "349feb470feaf535c1074c91721714ced3d81f0c"
"certificate_hash": "7fbe0ab908219a12378a92e2c4e78a1f62734798"
}
},
{
"client_id": "1021949586645-ttle1pv465pp7gdigqh93futan4cmn8p.apps.googleusercontent.com",
"client_type": 1,
"android_info": {
"package_name": "de.beyondsoft.ownchat",
"certificate_hash": "458abe7a8928c32f3ad3fbcc575373b613070aae"
}
},
{
"client_id": "1021949586645-lu3hc8hjsul10dhpj22o3k6vfcg6ol9v.apps.googleusercontent.com",
"client_id": "975648037658-snv7hat9a1r8oqrheu1r14hbnsjk3h4j.apps.googleusercontent.com",
"client_type": 3
}
],
"api_key": [
{
"current_key": "AIzaSyAh9aJq_Hxjp9z9_Q3h5qNUg-l_Z4Grr98"
"current_key": "AIzaSyDa3E_8SjE2NyDWXmAp1jI2E2KH9xhrWfc"
}
],
"services": {
@@ -48,7 +40,14 @@
"status": 2,
"other_platform_oauth_client": [
{
"client_id": "1021949586645-lu3hc8hjsul10dhpj22o3k6vfcg6ol9v.apps.googleusercontent.com",
"client_id": "975648037658-u22ch31ebdpcaa1f96ihv1ne386n8bf7.apps.googleusercontent.com",
"client_type": 2,
"ios_info": {
"bundle_id": "de.beyondsoft.ownchat"
}
},
{
"client_id": "975648037658-snv7hat9a1r8oqrheu1r14hbnsjk3h4j.apps.googleusercontent.com",
"client_type": 3
}
]

View File

@@ -143,6 +143,7 @@ public class Group implements Parcelable {
return users.get(i).isEmployee;
}
}
return false;
}
}

View File

@@ -2,6 +2,7 @@ package de.beyondsoft.ownchat.page.chat;
import com.bumptech.glide.Glide;
import de.beyondsoft.ownchat.R;
import de.beyondsoft.ownchat.model.Group;
import de.beyondsoft.ownchat.model.Message;
import de.beyondsoft.ownchat.utils.Constants;
@@ -104,10 +105,10 @@ public class SingleChatActivity extends BaseChatActivity {
protected void setToolbar() {
mSingleChatTitleTextView.setVisibility(View.VISIBLE);
mSingleChatTitleTextView.setText(mGroup.name);
mSingleChatTitleTextView.setTextColor(ContextCompat.getColor(this, mGroup.isEmployee(mGroup.users) ? de.beyondsoft.ownchat.R.color.colorHelpGroup : de.beyondsoft.ownchat.R.color.colorBlack));
mSingleChatTitleTextView.setTextColor(ContextCompat.getColor(this, mGroup.onlyEmployees ? de.beyondsoft.ownchat.R.color.colorBlack : de.beyondsoft.ownchat.R.color.colorHelpGroup));
if (TextUtils.isEmpty(mGroup.avatar)) {
mChatImageView.setImageResource(de.beyondsoft.ownchat.R.drawable.avatar);
mChatImageView.setImageResource(mGroup.onlyEmployees ? de.beyondsoft.ownchat.R.drawable.avatar : R.drawable.avatar_help);
} else {
Glide.with(this).load(mGroup.avatar)
.placeholder(de.beyondsoft.ownchat.R.drawable.avatar)

View File

@@ -52,9 +52,11 @@ class ContactsAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder> {
void setGroups(ArrayList<Group> groups) {
mGroups.clear();
if (groups != null) {
mGroups.addAll(groups);
}
notifyDataSetChanged();
}
@@ -63,13 +65,13 @@ class ContactsAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder> {
if (mGroups.get(position).users.size() > 2) {
return GROUP_TYPE;
}
return CONTACT_TYPE;
}
@Override
public RecyclerView.ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
View view = LayoutInflater.from(parent.getContext()).inflate(R.layout.item_contact, parent,
false);
View view = LayoutInflater.from(parent.getContext()).inflate(R.layout.item_contact, parent, false);
return new ContactViewHolder(view);
}
@@ -82,19 +84,21 @@ class ContactsAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder> {
int type = getItemViewType(position);
if (type == GROUP_TYPE) {
viewHolder.name.setText(group.name);
viewHolder.name.setTextColor(ContextCompat.getColor(viewHolder.name.getContext(),
group.isHelpGroup() ? R.color.colorHelpGroup : R.color.colorTeamGroup));
viewHolder.avatar.setImageResource(group.isHelpGroup() ?
R.drawable.avatar_help_group : R.drawable.avatar_team_group);
viewHolder.name.setTextColor(ContextCompat.getColor(viewHolder.name.getContext(), group.isHelpGroup() ? R.color.colorHelpGroup : R.color.colorTeamGroup));
viewHolder.avatar.setImageResource(group.isHelpGroup() ? R.drawable.avatar_help_group : R.drawable.avatar_team_group);
return;
} else if(!group.onlyEmployees) {
viewHolder.avatar.setImageResource(R.drawable.avatar_help);
}
if(type == CONTACT_TYPE) {
viewHolder.name.setTextColor(ContextCompat.getColor(viewHolder.name.getContext(),
group.isEmployee(mGroups.get(position).users) ? R.color.colorBlack : R.color.colorHelpGroup));
viewHolder.name.setTextColor(ContextCompat.getColor(viewHolder.name.getContext(), group.isEmployee(mGroups.get(position).users) ? R.color.colorBlack : R.color.colorHelpGroup));
}
viewHolder.name.setText(group.name);
Glide.with(viewHolder.avatar.getContext()).load(group.avatar)
.placeholder(R.drawable.avatar_list)
.placeholder(group.onlyEmployees ? R.drawable.avatar_list : R.drawable.avatar_help)
.dontAnimate()
.diskCacheStrategy(DiskCacheStrategy.ALL)
.into(viewHolder.avatar);
@@ -107,7 +111,9 @@ class ContactsAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder> {
viewHolder.messageStatus.setImageResource(0);
return;
}
boolean isMessageSentByUser = group.lastMessage.senderId == mUserId;
if (!group.isRead() && !isMessageSentByUser) {
viewHolder.lastMessage.setTypeface(null, Typeface.BOLD);
viewHolder.lastMessage.setTextColor(ContextCompat.getColor(viewHolder.lastMessage.getContext(), R.color.colorDefaultBright));
@@ -115,13 +121,17 @@ class ContactsAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder> {
viewHolder.lastMessage.setTypeface(null);
viewHolder.lastMessage.setTextColor(ContextCompat.getColor(viewHolder.lastMessage.getContext(), R.color.colorSubtitle));
}
viewHolder.lastMessage.setText(TextUtils.isEmpty(group.lastMessage.message) ? group.lastMessage.originalFilename : group.lastMessage.message);
viewHolder.messageTimestamp.setText(DateUtils.toHourOrDateFormatHour(group.lastMessage.createdAt));
if (!isMessageSentByUser) {
viewHolder.messageStatus.setImageResource(0);
return;
}
int resourceId = group.lastMessage.getStatusResourceId();
if (resourceId != 0) {
viewHolder.messageStatusPending.setVisibility(resourceId == -1 ? View.VISIBLE : View.GONE);
if (resourceId != -1) {

View File

@@ -88,7 +88,7 @@ public class LoginActivity extends AppCompatActivity implements LoginView {
showError(R.string.login_again);
}
mCallback.logout(Settings.Secure.getString(this.getContentResolver(), Settings.Secure.ANDROID_ID), true, null);
mCallback.logout(Settings.Secure.getString(this.getContentResolver(), Settings.Secure.ANDROID_ID), false, null);
}
@OnEditorAction(R.id.login_password)

View File

@@ -201,7 +201,7 @@ public class LoginPresenter extends MVPAbstractPresenter<LoginView> implements L
switch(ErrorUtils.getErrorType(throwable)) {
case DATA_INPUT:
if (errorThrowable.getError().loginFailed != null && errorThrowable.getError().loginFailed.size() > 0) {
getView().showError(errorThrowable.getError().loginFailed.get(0));
getView().showError(R.string.error_invalid_login_credentials);
return;
}
case WRONG_CHATCODE:
@@ -362,7 +362,7 @@ public class LoginPresenter extends MVPAbstractPresenter<LoginView> implements L
return;
}
deleteData(true);
deleteData(false);
getView().customerIdIsNotValid(mStatus);
}
//endregion
@@ -477,7 +477,7 @@ public class LoginPresenter extends MVPAbstractPresenter<LoginView> implements L
String chatCode = mChatCodePreference.get();
String customerId = mAccountNumberPreference.get();
String userId = (mIsEmployee.get() ? "E" : "C") + mUserIdReference.get().toString();
String userId = mUserIdReference.get().toString();
Subscription subscription = mLoginService.verifyChatCode(customerId, userId, chatCode)
.compose(RxUtils.provideDefaultTransformer())

View File

@@ -16,7 +16,7 @@ import de.beyondsoft.ownchat.page.login.LoginActivity;
import de.beyondsoft.ownchat.page.login.LoginPresenter;
import de.beyondsoft.ownchat.page.profile.ProfileFragment;
import de.beyondsoft.ownchat.utils.Constants;
import de.beyondsoft.ownchat.utils.DialogHandler;
import de.beyondsoft.ownchat.utils.DialogHandler;/**/
import de.beyondsoft.ownchat.utils.SystemUtils;
import de.beyondsoft.ownchat.utils.Utils;

Binary file not shown.

Before

Width:  |  Height:  |  Size: 10 KiB

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.7 KiB

After

Width:  |  Height:  |  Size: 5.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.0 KiB

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.7 KiB

After

Width:  |  Height:  |  Size: 4.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 540 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 593 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.5 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.8 KiB

After

Width:  |  Height:  |  Size: 3.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.8 KiB

After

Width:  |  Height:  |  Size: 3.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 632 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 343 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 677 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 375 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 15 KiB

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.8 KiB

After

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.8 KiB

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.9 KiB

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 442 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 479 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 24 KiB

After

Width:  |  Height:  |  Size: 3.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.7 KiB

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.2 KiB

After

Width:  |  Height:  |  Size: 3.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.9 KiB

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 35 KiB

After

Width:  |  Height:  |  Size: 6.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.9 KiB

After

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.8 KiB

After

Width:  |  Height:  |  Size: 6.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.1 KiB

After

Width:  |  Height:  |  Size: 19 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

View File

@@ -19,12 +19,12 @@
app:layout_behavior="de.beyondsoft.ownchat.utils.ui.LayoutBehavior">
<EditText
android:id="@+id/login_chat_code"
android:id="@+id/login_account"
style="@style/AppTheme.EditText"
android:layout_width="match_parent"
android:background="@drawable/shape_round_top_corners"
android:hint="@string/login_chat_code_hint"
android:inputType="text" />
android:hint="@string/login_account_number_hint"
android:inputType="number" />
<View
android:id="@+id/login_divider1"
@@ -33,12 +33,12 @@
android:background="@color/colorDivider" />
<EditText
android:id="@+id/login_account"
android:id="@+id/login_chat_code"
style="@style/AppTheme.EditText"
android:layout_width="match_parent"
android:background="@color/colorWhite"
android:hint="@string/login_account_number_hint"
android:inputType="number" />
android:hint="@string/login_chat_code_hint"
android:inputType="text" />
<View
android:id="@+id/login_divider2"

View File

@@ -64,6 +64,7 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="@dimen/activity_horizontal_margin"
android:text="@string/profile_save_button" />
android:text="@string/profile_save_button"
android:visibility="invisible"/>
</LinearLayout>

View File

@@ -22,6 +22,7 @@
<RelativeLayout
style="@style/LeftChatItemRelativeLayout"
android:padding="7dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="5dp"
@@ -74,8 +75,9 @@
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:visibility="gone"
custom:donut_finished_color="@color/colorWhite"
custom:donut_text_color="@color/colorBlack" />
custom:donut_finished_color="@color/colorDefault"
custom:donut_text_color="@color/colorBlack"
tools:visibility="visible"/>
<hani.momanii.supernova_emoji_library.Helper.EmojiconTextView
android:id="@+id/chat_item_message"

View File

@@ -25,6 +25,7 @@
<RelativeLayout
style="@style/RightChatItemRelativeLayout"
android:padding="7dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="5dp"

View File

@@ -12,6 +12,7 @@
<RelativeLayout
style="@style/LeftChatItemRelativeLayout"
android:padding="7dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content">
@@ -51,8 +52,9 @@
android:layout_below="@id/chat_item_time"
android:layout_marginTop="4dp"
android:visibility="gone"
custom:donut_finished_color="@color/colorWhite"
custom:donut_text_color="@color/colorBlack" />
custom:donut_finished_color="@color/colorDefault"
custom:donut_text_color="@color/colorBlack"
tools:visibility="visible"/>
<hani.momanii.supernova_emoji_library.Helper.EmojiconTextView
android:id="@+id/chat_item_message"

View File

@@ -18,7 +18,8 @@
<RelativeLayout
style="@style/RightChatItemRelativeLayout"
android:layout_width="wrap_content"
android:layout_height="wrap_content">
android:layout_height="wrap_content"
android:padding="7dp">
<TextView
android:id="@+id/chat_item_sending_failed"

View File

@@ -14,8 +14,8 @@
<color name="colorManatee">#A0A0A0</color>
<color name="colorHarvard">#D0021B</color>
<color name="colorImpressum">#9B9B9B</color>
<color name="colorHelpGroup">#00a1d1</color>
<color name="colorTeamGroup">#AAB100</color>
<color name="colorHelpGroup">#FF3B7799</color>
<color name="colorTeamGroup">#FF45993B</color>
<color name="colorSubtitle">#9B9B9B</color>
<color name="colorTimestamp">#636363</color>
<color name="colorLeftChat">#515151</color>

View File

@@ -64,6 +64,7 @@
<string name="error_deactivated_chat_code">Chat-Code ist deaktiviert</string>
<string name="error_chat_code_too_short">Chat-Code hat eine falsche Länge</string>
<string name="error_token_validation_failed">Bitte stellen Sie sicher, dass Sie mit dem Internet verbunden sind.</string>
<string name="error_invalid_login_credentials">Ungültige Anmeldedaten</string>
<!-- Permissions -->
<string name="permission_grant">Erlauben</string>

View File

@@ -102,11 +102,11 @@
</style>
<style name="RightChatItemRelativeLayout">
<item name="android:background">@drawable/chat_right</item>
<item name="android:background">@drawable/chat_right_v2</item>
</style>
<style name="LeftChatItemRelativeLayout">
<item name="android:background">@drawable/chat_left</item>
<item name="android:background">@drawable/chat_left_v2</item>
</style>
</resources>