Skip to content

Commit

Permalink
Done Lots of Changes Final Version 2.5
Browse files Browse the repository at this point in the history
  • Loading branch information
MohammedAbidNafi committed Jun 7, 2021
1 parent 748b9ee commit c2a50ea
Show file tree
Hide file tree
Showing 133 changed files with 686 additions and 1,473 deletions.
20 changes: 12 additions & 8 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -21,16 +21,17 @@ android {
applicationId "com.margsapp.messenger"
minSdkVersion 21
targetSdkVersion 30
versionCode 16
versionName "2.4"
versionCode 18
versionName "2.5"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
multiDexEnabled true

}

buildTypes {
release {
minifyEnabled false
shrinkResources true
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'

}
Expand All @@ -43,15 +44,16 @@ android {

dependencies {

implementation 'androidx.appcompat:appcompat:1.2.0'
implementation 'androidx.appcompat:appcompat:1.3.0'
implementation 'androidx.constraintlayout:constraintlayout:2.0.4'
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
implementation 'com.google.android.material:material:1.3.0'
implementation 'com.google.firebase:firebase-auth:21.0.1'
implementation 'com.google.firebase:firebase-database:20.0.0'
implementation 'com.android.support:multidex:1.0.3'
implementation 'com.gjiazhe:springrecyclerview:1.0'
implementation 'jp.wasabeef:recyclerview-animators:4.0.2'

implementation 'com.google.firebase:firebase-appcheck-debug:16.0.0-beta01'
implementation 'com.google.firebase:firebase-appcheck-safetynet:16.0.0-beta01'

implementation 'com.github.castorflex.smoothprogressbar:library:1.1.0'

Expand All @@ -66,7 +68,6 @@ dependencies {
implementation 'com.github.bumptech.glide:glide:4.12.0'
implementation 'com.google.firebase:firebase-storage:20.0.0'

implementation 'com.h6ah4i.android.widget.advrecyclerview:advrecyclerview:1.0.0'

implementation 'com.google.android.material:material:1.3.0'

Expand All @@ -87,6 +88,8 @@ dependencies {
implementation 'com.airbnb.android:lottie:3.6.1'




implementation 'com.squareup.retrofit2:retrofit:2.9.0'
implementation 'com.squareup.retrofit2:converter-gson:2.9.0'
implementation 'com.google.firebase:firebase-messaging:21.1.0'
Expand All @@ -98,14 +101,15 @@ dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
implementation 'androidx.preference:preference-ktx:1.1.1'

implementation 'com.chauthai.swipereveallayout:swipe-reveal-layout:1.4.1'

testImplementation 'junit:junit:4.13.2'
androidTestImplementation 'androidx.test.ext:junit:1.1.2'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0'

implementation 'com.factor:bouncy:1.8'
implementation 'com.willowtreeapps:signinwithapplebutton:0.3'
implementation 'com.r0adkll:slidableactivity:2.1.0'



}
Binary file added app/release/app-release.apk
Binary file not shown.
18 changes: 18 additions & 0 deletions app/release/output-metadata.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"version": 2,
"artifactType": {
"type": "APK",
"kind": "Directory"
},
"applicationId": "com.margsapp.messenger",
"variantName": "release",
"elements": [
{
"type": "SINGLE",
"filters": [],
"versionCode": 18,
"versionName": "2.5",
"outputFile": "app-release.apk"
}
]
}
9 changes: 5 additions & 4 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
tools:ignore="ScopedStorage" />

<application
android:name=".Utils.FireBaseOffline"
android:name=".utils.FirebaseOffline"
android:allowBackup="true"
android:icon="@mipmap/ic_launcher_appicon"
android:label="@string/app_name"
Expand All @@ -34,7 +34,6 @@
<activity android:name=".groupclass.create_groupActivity" />
<activity android:name=".Settings.ChatViewActivity" />
<activity android:name=".AppDetails.privacyActivity" />
<activity android:name=".Authentication.setupActivity" />
<activity
android:name="com.theartofdev.edmodo.cropper.CropImageActivity"
android:theme="@style/Theme.Messenger.Crop" />
Expand All @@ -61,11 +60,13 @@
<activity android:name=".Main.FindUsersActivity" />
<activity android:name=".AppDetails.Terms_ConditionsActivity" />
<activity android:name=".Settings.edit_profile" />
<activity android:name=".Main.MessageActivity" />
<activity android:name=".Settings.Chat_settings" />
<activity android:name=".Main.MessageActivity"
android:theme="@style/Theme.Messenger.Message"/>
<activity android:name=".Main.MainActivity" />
<activity android:name=".Authentication.StartActivity"
android:theme="@style/Loader"/>
<activity android:name=".Settings.Chat_settings" />


<service
android:name=".Notifications.MyFirebaseIdService"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ private void remove(String id, String name,String groupId) {
hash.put("sender", "LOGS");
hash.put("group", groupId);
hash.put("reply","false");
hash.put("message", name + mContext.getResources().getString(R.string.log_removed));
hash.put("message", name + " has been removed from group.");
hash.put("timestamp", timestamp);
databaseReference2.push().setValue(hash);

Expand Down
21 changes: 17 additions & 4 deletions app/src/main/java/com/margsapp/messenger/Adapter/GroupAdapter.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import android.content.Context;
import android.content.Intent;
import android.view.LayoutInflater;
import android.view.MotionEvent;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
Expand Down Expand Up @@ -70,13 +71,24 @@ public void onBindViewHolder(@NonNull ViewHolder holder, int position) {
}


holder.itemView.setOnTouchListener((v, event) -> {
holder.itemView.setBackgroundColor(mContext.getResources().getColor(R.color.onAdapClick));
return false;
holder.itemView.setOnTouchListener(new View.OnTouchListener() {
@Override
public boolean onTouch(View v, MotionEvent event) {

if(event.getAction() == MotionEvent.ACTION_DOWN) {
holder.itemView.setBackgroundColor(mContext.getResources().getColor(R.color.onAdapClick));


}else {
holder.itemView.setBackgroundColor(mContext.getResources().getColor(R.color.background));

}

return false;
}
});

holder.itemView.setOnClickListener(v -> {
holder.itemView.setBackgroundColor(mContext.getResources().getColor(R.color.background));
launch(groupid);

});
Expand Down Expand Up @@ -159,3 +171,4 @@ public ViewHolder(View view){


}

Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ public boolean onTouch(View v, MotionEvent event) {

if(event.getAction()== MotionEvent.ACTION_DOWN){
holder.itemView.setBackgroundColor(mContext.getResources().getColor(R.color.onAdapClick));
}else if(event.getAction()==MotionEvent.ACTION_UP){
}else {
holder.itemView.setBackgroundColor(mContext.getResources().getColor(R.color.background));
}
return false;
Expand Down Expand Up @@ -150,4 +150,6 @@ public ViewHolder(@NonNull View itemView) {
}
}



}
Original file line number Diff line number Diff line change
Expand Up @@ -209,4 +209,6 @@ public ViewHolder(View view){
}




}
62 changes: 43 additions & 19 deletions app/src/main/java/com/margsapp/messenger/Adapter/UserAdapter.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,10 @@

import android.annotation.SuppressLint;
import android.app.Activity;
import android.app.ActivityOptions;
import android.content.Context;
import android.content.Intent;
import android.util.Pair;
import android.view.LayoutInflater;
import android.view.MotionEvent;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
Expand All @@ -25,7 +24,6 @@
import com.google.firebase.database.DatabaseReference;
import com.google.firebase.database.FirebaseDatabase;
import com.google.firebase.database.ValueEventListener;
import com.margsapp.messenger.Main.MainActivity;
import com.margsapp.messenger.Main.MessageActivity;
import com.margsapp.messenger.Model.Chat;
import com.margsapp.messenger.Model.Chatlist;
Expand All @@ -36,8 +34,6 @@

import java.util.List;

import de.hdodenhof.circleimageview.CircleImageView;

public class UserAdapter extends RecyclerView.Adapter<UserAdapter.ViewHolder> {
private final Context mContext;
private final List<User> mUsers;
Expand All @@ -52,14 +48,17 @@ public class UserAdapter extends RecyclerView.Adapter<UserAdapter.ViewHolder> {
String date_time;
String UnreadMessage;

Activity activity;



public UserAdapter(Context mContext, List<User> mUsers, boolean isChat, boolean isAdd, boolean isBlock) {
public UserAdapter(Context mContext, List<User> mUsers, boolean isChat, boolean isAdd, boolean isBlock,Activity activity) {
this.mUsers = mUsers;
this.mContext = mContext;
this.isChat = isChat;
this.isAdd = isAdd;
this.isBlock = isBlock;
this.activity = activity;


}
Expand Down Expand Up @@ -117,7 +116,18 @@ public void onBindViewHolder(@NonNull ViewHolder holder, int position) {


holder.UsernameText.setText(user.getUsername());
holder.dt.setText(user.getDt());

if (user.getStatus().equals("online")) {
holder.img_on.setVisibility(View.VISIBLE);
holder.img_off.setVisibility(View.GONE);
} else {
holder.img_off.setVisibility(View.VISIBLE);
holder.img_on.setVisibility(View.GONE);
}

lastmessage(user.getId(), holder.last_msg,holder.date_lastmsg);
UnreadMessage(user.getId(), holder.unread);


if (user.getImageUrl().equals("default")) {
holder.profile.setImageResource(R.drawable.user);
Expand All @@ -134,26 +144,18 @@ public void onBindViewHolder(@NonNull ViewHolder holder, int position) {
}

if (isChat) {
if (user.getStatus().equals("online")) {
holder.img_on.setVisibility(View.VISIBLE);
holder.img_off.setVisibility(View.GONE);
} else {
holder.img_off.setVisibility(View.VISIBLE);
holder.img_on.setVisibility(View.GONE);
}
holder.date_lastmsg.setVisibility(View.VISIBLE);
lastmessage(user.getId(), holder.last_msg,holder.date_lastmsg);
UnreadMessage(user.getId(), holder.unread);

holder.dt.setVisibility(View.GONE);

}
if (!isChat) {

holder.dt.setText(user.getDt());
holder.last_msg.setVisibility(View.GONE);
holder.img_on.setVisibility(View.GONE);
holder.img_off.setVisibility(View.VISIBLE);
holder.date_lastmsg.setVisibility(View.GONE);
holder.dt.setVisibility(View.VISIBLE);

}

holder.UnBlock_btn.setOnClickListener(v -> {
Expand All @@ -172,8 +174,23 @@ public void onBindViewHolder(@NonNull ViewHolder holder, int position) {
});


holder.itemView.setOnTouchListener(new View.OnTouchListener() {
@SuppressLint("ClickableViewAccessibility")
@Override
public boolean onTouch(View v, MotionEvent event) {
if(event.getAction() == MotionEvent.ACTION_DOWN) {
holder.itemView.setBackgroundColor(mContext.getResources().getColor(R.color.onAdapClick));

}else {
holder.itemView.setBackgroundColor(mContext.getResources().getColor(R.color.background));

}
return false;
}
});

holder.itemView.setOnClickListener(v -> {
holder.itemView.setBackgroundColor(mContext.getResources().getColor(R.color.onAdapClick));

String userid = user.getId();
OnMessage(userid);
});
Expand Down Expand Up @@ -323,15 +340,20 @@ public void onDataChange(@NonNull DataSnapshot snapshot) {

}
else {

Intent intent = new Intent(mContext, MessageActivity.class);

intent.putExtra("userid", userid);
mContext.startActivity(intent);
activity.overridePendingTransition(R.anim.activity_slide_in_left,R.anim.activity_slider_out_right);


}
}else if(!snapshot.exists()){
Intent intent = new Intent(mContext, MessageActivity.class);
intent.putExtra("userid", userid);
mContext.startActivity(intent);
activity.overridePendingTransition(R.anim.activity_slide_in_left,R.anim.activity_slider_out_right);
}


Expand All @@ -353,4 +375,6 @@ public void onCancelled(@NonNull DatabaseError error) {
}




}
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ public void onAdFailedToLoad(@NonNull LoadAdError loadAdError) {




agree.setOnClickListener(v -> {
Intent intent = new Intent(Terms_ConditionsActivity.this, privacyActivity.class);
intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TASK | Intent.FLAG_ACTIVITY_NEW_TASK);
Expand All @@ -80,4 +81,5 @@ public void onAdFailedToLoad(@NonNull LoadAdError loadAdError) {
finish();
});
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
public class PhoneAuthActivity extends AppCompatActivity {

EditText phoneInputLayout;

CountryCodePicker countryCodePicker;

@Override
Expand All @@ -23,6 +24,7 @@ protected void onCreate(Bundle savedInstanceState) {
setContentView(R.layout.activity_phone_auth);

phoneInputLayout = findViewById(R.id.phone_number);

countryCodePicker = findViewById(R.id.country_code_picker);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,6 @@ public void onComplete(@NonNull Task<Uri> task) {
}
}
}

private String getFileExtension(Uri uri){
ContentResolver contentResolver = Phone_setupActivity.this.getContentResolver();
MimeTypeMap mimeTypeMap = MimeTypeMap.getSingleton();
Expand Down
Loading

0 comments on commit c2a50ea

Please sign in to comment.