GUI optimizations
This commit is contained in:
@@ -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
|
||||
}
|
||||
]
|
||||
|
||||
@@ -143,6 +143,7 @@ public class Group implements Parcelable {
|
||||
return users.get(i).isEmployee;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -362,7 +362,7 @@ public class LoginPresenter extends MVPAbstractPresenter<LoginView> implements L
|
||||
return;
|
||||
}
|
||||
|
||||
deleteData(true);
|
||||
deleteData(false);
|
||||
getView().customerIdIsNotValid(mStatus);
|
||||
}
|
||||
//endregion
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 6.5 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 4.5 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 3.2 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 17 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 25 KiB |
Reference in New Issue
Block a user