Skip to content

Commit

Permalink
Updated UI changes - MD on login and user list
Browse files Browse the repository at this point in the history
Changed default icon for users.
Changed chat list item and contact list item to look like cards.
Changed the whole app to white background
  • Loading branch information
Satyam Mittal committed May 3, 2020
2 parents 37af1ac + 1bcd392 commit 9f787cd
Show file tree
Hide file tree
Showing 52 changed files with 200 additions and 217 deletions.
Binary file added app/src/main/ic_profile-playstore.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,6 @@ protected void onCreate(Bundle savedInstanceState) {
mAdapter.setOnItemLongClickListener(this);
chatsRecyclerView.setAdapter(mAdapter);
FloatingActionButton newConversationButton = findViewById(R.id.new_conversation_floating_button);
newConversationButton.setBackgroundTintList(getResources().getColorStateList(R.color.colorPrimary));
newConversationButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ protected void onCreate(Bundle savedInstanceState) {
setTitle(contactJid);
ImageView profileImage = findViewById(R.id.contact_details_user_profile);
RoosterConnection rc = RoosterConnectionService.getConnection();
profileImage.setImageResource(R.drawable.ic_profile);
profileImage.setImageResource(R.mipmap.ic_profile);
if(rc != null)
{
String imageAbsPath = rc.getProfileImageAbsolutePath(contactJid);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ protected void onCreate(Bundle savedInstanceState) {
Toolbar toolbar = findViewById(R.id.toolbar);
setSupportActionBar(toolbar);
FloatingActionButton newContactButton = findViewById(R.id.new_contact_button);
newContactButton.setBackgroundTintList(getResources().getColorStateList(R.color.colorPrimary));
newContactButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
Expand Down
51 changes: 10 additions & 41 deletions app/src/main/java/com/scalability4all/sathi/LoginActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,12 @@
import android.view.inputmethod.EditorInfo;
import android.widget.AutoCompleteTextView;
import android.widget.EditText;
import android.widget.ImageView;
import android.widget.TextView;

import androidx.appcompat.app.AppCompatActivity;

import com.google.android.material.button.MaterialButton;
import com.google.android.material.textfield.TextInputEditText;
import com.scalability4all.sathi.services.VolleyCallback;
import com.scalability4all.sathi.services.VolleyService;
import com.scalability4all.sathi.xmpp.RoosterConnectionService;
Expand Down Expand Up @@ -49,8 +50,8 @@

public class LoginActivity extends AppCompatActivity {
private static final String LOGTAG = "RoosterPlus";
private AutoCompleteTextView mJidView;
private EditText mPasswordView;
private TextInputEditText mJidView;
private TextInputEditText mPasswordView;
private View mProgressView;
private View mLoginFormView;
private BroadcastReceiver mBroadcastReceiver;
Expand All @@ -72,7 +73,7 @@ public boolean onEditorAction(TextView textView, int id, KeyEvent keyEvent) {
return false;
}
});
ImageView mJidSignInButton = findViewById(R.id.jid_sign_in_button);
MaterialButton mJidSignInButton = findViewById(R.id.jid_sign_in_button);
mJidSignInButton.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View view) {
Expand All @@ -89,39 +90,7 @@ public void onClick(View view) {
startActivity(i);
}
});
// ImageView mJidRegisterButton = findViewById(R.id.jid_register_button);
// // Registrierungsdialog
// mJidRegisterButton.setOnClickListener(new OnClickListener() {
// @Override
// public void onClick(View view) {
// final Dialog dialog = new Dialog(LoginActivity.this);
// dialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
// dialog.setCancelable(false);
// dialog.setContentView(R.layout.register_dialog);
// ImageView rJidReg = dialog.findViewById(R.id.login_register_reg);
// ImageView rJidCancel = dialog.findViewById(R.id.login_register_cancel);
// rJidReg.setOnClickListener(new OnClickListener() {
// @Override
// public void onClick(View view) {
// EditText username = dialog.findViewById(R.id.dialog_register_jid);
// EditText password = dialog.findViewById(R.id.dialog_register_password);
// try {
// attemptRegister(username.getText().toString(), password.getText().toString());
// dialog.dismiss();
// } catch (IOException e) {
// e.printStackTrace();
// }
// }
// });
// rJidCancel.setOnClickListener(new OnClickListener() {
// @Override
// public void onClick(View view) {
// dialog.dismiss();
// }
// });
// dialog.show();
// }
// });

}
@Override
protected void onPause() {
Expand Down Expand Up @@ -160,20 +129,20 @@ public void onReceive(Context context, Intent intent) {
this.registerReceiver(mBroadcastReceiver, filter);
}
private void attemptLogin() {
// Errors zurücksetzen
// Errors reset to default
mJidView.setError(null);
mPasswordView.setError(null);
String jid = mJidView.getText().toString();
String password = mPasswordView.getText().toString();
boolean cancel = false;
View focusView = null;
// Passwortüberprüfung (hier nur noch Länge, nicht ob auf Server richtig
//Password check (length only here, not correct on server
if (!TextUtils.isEmpty(password) && !isPasswordValid(password)) {
mPasswordView.setError(getString(R.string.error_invalid_password));
focusView = mPasswordView;
cancel = true;
}
// JID überprüfen (per @)
// JID check (per @)
if (TextUtils.isEmpty(jid)) {
mJidView.setError(getString(R.string.error_field_required));
focusView = mJidView;
Expand All @@ -196,7 +165,7 @@ private boolean isJidValid(String email) {
private boolean isPasswordValid(String password) {
return password.length() > 4;
}
// Progressbar zeigen und Login ausblenden
// Show progress bar and hide login
@TargetApi(Build.VERSION_CODES.HONEYCOMB_MR2)
private void showProgress(final boolean show) {
mProgressView.setVisibility(show ? View.VISIBLE : View.GONE);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ protected void onCreate(Bundle savedInstanceState) {
profileImageView.setOnClickListener(this);
String selfJid = PreferenceManager.getDefaultSharedPreferences(getApplicationContext()).getString("xmpp_jid",null);
RoosterConnection rc = RoosterConnectionService.getConnection();
profileImageView.setImageResource(R.drawable.ic_profile);
profileImageView.setImageResource(R.mipmap.ic_profile);
if(rc != null)
{
String imageAbsPath = rc.getProfileImageAbsolutePath(selfJid);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ public void bindChat(Chat chat)
timestampTextView.setMovementMethod(LinkMovementMethod.getInstance());
timestampTextView.setText(Utilities.getFormattedTime(mChat.getLastMessageTimeStamp()));

profileImage.setImageResource(R.drawable.ic_profile);
profileImage.setImageResource(R.mipmap.ic_profile);
RoosterConnection rc = RoosterConnectionService.getConnection();
if(rc != null)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ public void bindChat(ChatMessage chatMessage)
mChatMessage = chatMessage;
mMessageBody.setText(chatMessage.getMessage());
mMessageTimestamp.setText(Utilities.getFormattedTime(chatMessage.getTimestamp()));
profileImage.setImageResource(R.drawable.ic_profile);
profileImage.setImageResource(R.mipmap.ic_profile);
ChatMessage.Type type = mChatMessage.getType();
if( type == ChatMessage.Type.RECEIVED)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ void bindContact(Contact c)
}
jidTexView.setText(mContact.getJid());
subscriptionTypeTextView.setText(mContact.getTypeStringValue(mContact.getSubscriptionType()));
profile_image.setImageResource(R.drawable.ic_profile);
profile_image.setImageResource(R.mipmap.ic_profile);
RoosterConnection rc = RoosterConnectionService.getConnection();
if(rc != null)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -689,7 +689,7 @@ private void gatherCredentials()
if( jid != null)
{
mUsername = jid.split("@")[0];
mServiceName = jid.split("@")[1];
mServiceName = jid.split("@").length>1?jid.split("@")[1]:"";
}else
{
mUsername ="";
Expand Down
Binary file removed app/src/main/res/drawable-hdpi/ic_profile.png
Binary file not shown.
Binary file removed app/src/main/res/drawable-mdpi/ic_profile.png
Binary file not shown.
Binary file removed app/src/main/res/drawable-xhdpi/ic_profile.png
Binary file not shown.
Binary file removed app/src/main/res/drawable-xxhdpi/ic_profile.png
Binary file not shown.
Binary file added app/src/main/res/drawable-xxhdpi/logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
17 changes: 17 additions & 0 deletions app/src/main/res/drawable/background_border.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle" >
<!-- This is the stroke you want to define -->
<stroke android:width="1dp"
android:color="@color/grey"/>

<!-- Optional, round your corners -->
<corners android:bottomLeftRadius="0dp"
android:topLeftRadius="5dp"
android:bottomRightRadius="5dp"
android:topRightRadius="0dp" />

<!-- Optional, fill the rest of your background with a color or gradient, use transparent if you only want the border to be displayed-->
<gradient android:startColor="@android:color/transparent"
android:endColor="@android:color/transparent"
android:angle="90"/>
</shape>
17 changes: 17 additions & 0 deletions app/src/main/res/drawable/ic_profile_foreground.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="108dp"
android:height="108dp"
android:viewportWidth="30.379747"
android:viewportHeight="30.379747">
<group android:translateX="3.1898735"
android:translateY="3.1898735">
<path
android:fillColor="#FF000000"
android:pathData="M12,4c-4.41,0 -8,3.59 -8,8 0,1.82 0.62,3.49 1.64,4.83 1.43,-1.74 4.9,-2.33 6.36,-2.33s4.93,0.59 6.36,2.33C19.38,15.49 20,13.82 20,12c0,-4.41 -3.59,-8 -8,-8zM12,13c-1.94,0 -3.5,-1.56 -3.5,-3.5S10.06,6 12,6s3.5,1.56 3.5,3.5S13.94,13 12,13z"
android:strokeAlpha="0.3"
android:fillAlpha="0.3"/>
<path
android:fillColor="#FF000000"
android:pathData="M12,2C6.48,2 2,6.48 2,12s4.48,10 10,10 10,-4.48 10,-10S17.52,2 12,2zM7.07,18.28c0.43,-0.9 3.05,-1.78 4.93,-1.78s4.51,0.88 4.93,1.78C15.57,19.36 13.86,20 12,20s-3.57,-0.64 -4.93,-1.72zM18.36,16.83c-1.43,-1.74 -4.9,-2.33 -6.36,-2.33s-4.93,0.59 -6.36,2.33C4.62,15.49 4,13.82 4,12c0,-4.41 3.59,-8 8,-8s8,3.59 8,8c0,1.82 -0.62,3.49 -1.64,4.83zM12,6c-1.94,0 -3.5,1.56 -3.5,3.5S10.06,13 12,13s3.5,-1.56 3.5,-3.5S13.94,6 12,6zM12,11c-0.83,0 -1.5,-0.67 -1.5,-1.5S11.17,8 12,8s1.5,0.67 1.5,1.5S12.83,11 12,11z"/>
</group>
</vector>
2 changes: 1 addition & 1 deletion app/src/main/res/drawable/tinput_border.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle" >
<solid android:color="@color/cardview_light_background" />
<solid android:color="@color/white" />
<stroke android:width="1dip" android:color="@color/colorPrimaryDark"/>
<corners android:radius="50dp"/>
<padding android:left="0dp" android:top="0dp" android:right="0dp" android:bottom="0dp" />
Expand Down
7 changes: 4 additions & 3 deletions app/src/main/res/layout/activity_chat_list.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/cardview_light_background"
android:background="@color/white"
android:orientation="vertical"
android:paddingBottom="@dimen/activity_vertical_margin"
android:paddingLeft="@dimen/activity_horizontal_margin"
Expand All @@ -15,19 +15,20 @@
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/chatsRecyclerView"
android:layout_width="match_parent"
android:layout_height="match_parent">
android:layout_height="match_parent"
android:padding="4dp">


</androidx.recyclerview.widget.RecyclerView>

<com.google.android.material.floatingactionbutton.FloatingActionButton
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/new_conversation_floating_button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="bottom|right"
android:layout_margin="16dp"
android:src="@drawable/message"
app:backgroundTint="@color/floating_button"
app:layout_anchor="@id/chatsRecyclerView"
app:layout_anchorGravity="bottom|right|end" />

Expand Down
4 changes: 2 additions & 2 deletions app/src/main/res/layout/activity_contact_details.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
android:layout_width="match_parent"
android:layout_height="match_parent"

android:background="@color/cardview_light_background"
android:background="@color/white"

android:paddingBottom="@dimen/activity_vertical_margin"
tools:context="com.scalability4all.sathi.ContactDetailsActivity">
Expand All @@ -19,7 +19,7 @@
android:layout_centerHorizontal="true"
android:layout_marginRight="16dp"
android:layout_marginTop="5dp"
android:src="@drawable/ic_profile"
android:src="@mipmap/ic_profile"
app:riv_border_color="@color/riv_border_color"
app:riv_border_width="1dip"
app:riv_corner_radius="12dp" />
Expand Down
4 changes: 2 additions & 2 deletions app/src/main/res/layout/activity_contact_list.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/cardview_light_background"
android:background="@color/white"
tools:context="com.scalability4all.sathi.ContactListActivity">

<com.google.android.material.appbar.AppBarLayout
Expand All @@ -16,7 +16,6 @@
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:background="?attr/colorPrimary"
app:popupTheme="@style/AppTheme.PopupOverlay" />

</com.google.android.material.appbar.AppBarLayout>
Expand All @@ -38,6 +37,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="bottom|end"
app:backgroundTint="@color/floating_button"
android:layout_margin="@dimen/fab_margin"
android:src="@drawable/add_contact" />

Expand Down
Loading

0 comments on commit 9f787cd

Please sign in to comment.