Skip to content

Commit

Permalink
changes: some compile issues fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
mukul2428 committed Jan 22, 2022
1 parent fb116ec commit b08517d
Show file tree
Hide file tree
Showing 12 changed files with 78 additions and 109 deletions.
1 change: 1 addition & 0 deletions .idea/.name

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion .idea/compiler.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

17 changes: 17 additions & 0 deletions .idea/deploymentTargetDropDown.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 1 addition & 2 deletions .idea/gradle.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 0 additions & 12 deletions .idea/runConfigurations.xml

This file was deleted.

30 changes: 15 additions & 15 deletions app/build.gradle
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
apply plugin: 'com.android.application'

android {
compileSdkVersion 30
buildToolsVersion "29.0.3"
compileSdkVersion 31
buildToolsVersion "30.0.2"

compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
Expand All @@ -12,7 +12,7 @@ android {
defaultConfig {
applicationId "com.techexpert.indianvaarta"
minSdkVersion 22
targetSdkVersion 30
targetSdkVersion 31
versionCode 1
versionName "1.0"

Expand All @@ -31,19 +31,19 @@ android {
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])

implementation 'androidx.appcompat:appcompat:1.2.0'
implementation 'androidx.constraintlayout:constraintlayout:2.0.4'
implementation 'androidx.appcompat:appcompat:1.4.1'
implementation 'androidx.constraintlayout:constraintlayout:2.1.3'
implementation 'androidx.legacy:legacy-support-v4:1.0.0'

implementation 'com.google.firebase:firebase-auth:20.0.3'
implementation 'com.google.firebase:firebase-database:19.6.0'
implementation 'com.google.firebase:firebase-storage:19.2.1'
implementation 'com.google.firebase:firebase-auth:21.0.1'
implementation 'com.google.firebase:firebase-database:20.0.3'
implementation 'com.google.firebase:firebase-storage:20.0.0'
implementation 'com.firebaseui:firebase-ui-database:6.2.1'
implementation 'com.firebaseui:firebase-ui-storage:6.2.1'
implementation 'com.google.firebase:firebase-dynamic-links:19.1.1'
implementation 'com.google.firebase:firebase-messaging:21.0.1'
implementation 'com.google.firebase:firebase-dynamic-links:21.0.0'
implementation 'com.google.firebase:firebase-messaging:23.0.0'
implementation platform('com.google.firebase:firebase-bom:26.2.0')
implementation 'com.google.firebase:firebase-analytics:18.0.2'
implementation 'com.google.firebase:firebase-analytics:20.0.2'

implementation 'com.squareup.retrofit2:retrofit:2.9.0'
implementation 'com.squareup.retrofit2:converter-gson:2.9.0'
Expand All @@ -53,8 +53,8 @@ dependencies {
implementation 'com.github.bumptech.glide:glide:4.11.0'

annotationProcessor 'com.github.bumptech.glide:compiler:4.11.0'
testImplementation 'junit:junit:4.13.1'
androidTestImplementation 'androidx.test.ext:junit:1.1.2'
testImplementation 'junit:junit:4.13.2'
androidTestImplementation 'androidx.test.ext:junit:1.1.3'

implementation 'com.squareup.picasso:picasso:2.71828'

Expand All @@ -64,10 +64,10 @@ dependencies {

implementation 'de.hdodenhof:circleimageview:3.1.0'

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

implementation 'id.zelory:compressor:3.0.0'
implementation "androidx.lifecycle:lifecycle-extensions:2.2.0"
androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
}
apply plugin: 'com.google.gms.google-services'
5 changes: 3 additions & 2 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,8 @@
android:name="firebase_analytics_collection_enabled"
android:value="false" />

<activity android:name=".SplashScreen">
<activity android:name=".SplashScreen"
android:exported="true">
<intent-filter>
<action android:name="android.intent.action.MAIN" />

Expand Down Expand Up @@ -69,7 +70,7 @@
android:parentActivityName=".Activities.MainActivity" />
<activity android:name=".Activities.RegisterActivity" />
<activity android:name=".Activities.LoginActivity" />
<activity android:name=".Activities.MainActivity" />
<activity android:name=".Activities.MainActivity" android:exported="true" />
<activity
android:name="com.theartofdev.edmodo.cropper.CropImageActivity"
android:theme="@style/Base.Theme.AppCompat" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -385,37 +385,20 @@ protected void onActivityResult(int requestCode, int resultCode, @Nullable Inten
final File outputFile =new File(ImageFolder,messagePushId+".pdf");

storageImageRef.child(messagePushId+".pdf").getFile(outputFile)
.addOnSuccessListener(new OnSuccessListener<FileDownloadTask.TaskSnapshot>()
{
@Override
public void onSuccess(FileDownloadTask.TaskSnapshot taskSnapshot)
{

//Toast.makeText(holder.itemView.getContext(), "Image sent", Toast.LENGTH_SHORT).show();
}
.addOnSuccessListener(taskSnapshot -> {

//Toast.makeText(holder.itemView.getContext(), "Image sent", Toast.LENGTH_SHORT).show();
})
.addOnFailureListener(new OnFailureListener()
{
@Override
public void onFailure(@NonNull Exception e)
{
Toast.makeText(ChatActivity.this, "Failed", Toast.LENGTH_SHORT).show();
}
});
.addOnFailureListener(e -> Toast.makeText(ChatActivity.this, "Failed", Toast.LENGTH_SHORT).show());
}
else if(checker.equals("docx"))
{
final File outputFile =new File(ImageFolder,messagePushId+".docx");

storageImageRef.child(messagePushId+".docx").getFile(outputFile)
.addOnSuccessListener(new OnSuccessListener<FileDownloadTask.TaskSnapshot>()
{
@Override
public void onSuccess(FileDownloadTask.TaskSnapshot taskSnapshot)
{

//Toast.makeText(holder.itemView.getContext(), "Image sent", Toast.LENGTH_SHORT).show();
}
.addOnSuccessListener(taskSnapshot -> {

//Toast.makeText(holder.itemView.getContext(), "Image sent", Toast.LENGTH_SHORT).show();
})
.addOnFailureListener(e -> Toast.makeText(ChatActivity.this, "Failed", Toast.LENGTH_SHORT).show());
}
Expand Down Expand Up @@ -493,65 +476,48 @@ else if(checker.equals("image"))
messageBodyDetails.put(MessageSenderRef + "/" + messagePushId, messageImageBody);
messageBodyDetails.put(MessageReceiverRef + "/" + messagePushId, messageImageBody);

RootRef.updateChildren(messageBodyDetails).addOnCompleteListener(new OnCompleteListener()
{
@Override
public void onComplete(@NonNull Task task)
RootRef.updateChildren(messageBodyDetails).addOnCompleteListener(task12 -> {
if(task12.isSuccessful())
{
if(task.isSuccessful())
{
loadingBar.dismiss();
Toast.makeText(ChatActivity.this, "Message Sent", Toast.LENGTH_SHORT).show();
loadingBar.dismiss();
Toast.makeText(ChatActivity.this, "Message Sent", Toast.LENGTH_SHORT).show();

//creating a sent folder of files which are send by user
final File ImageFolder =new File(Environment.getExternalStorageDirectory()+ File.separator+"Vaarta"+ File.separator+"Vaarta Images" + File.separator+"Sent");

//downloading the files from firebase which you have sent
//and storing to sent folder
//creating a sent folder of files which are send by user
final File ImageFolder =new File(Environment.getExternalStorageDirectory()+ File.separator+"Vaarta"+ File.separator+"Vaarta Images" + File.separator+"Sent");

boolean success = true;
if(!ImageFolder.exists())
{
success = ImageFolder.mkdirs();
}
if(success)
{
final File outputFile =new File(ImageFolder,messagePushId+".jpg");
//downloading the files from firebase which you have sent
//and storing to sent folder

StorageReference storageImageRef = FirebaseStorage.getInstance().getReference("Image Files/");
boolean success = true;
if(!ImageFolder.exists())
{
success = ImageFolder.mkdirs();
}
if(success)
{
final File outputFile =new File(ImageFolder,messagePushId+".jpg");

storageImageRef.child(messagePushId+".jpg").getFile(outputFile)
.addOnSuccessListener(new OnSuccessListener<FileDownloadTask.TaskSnapshot>()
{
@Override
public void onSuccess(FileDownloadTask.TaskSnapshot taskSnapshot)
{
StorageReference storageImageRef = FirebaseStorage.getInstance().getReference("Image Files/");

//Toast.makeText(holder.itemView.getContext(), "Image sent", Toast.LENGTH_SHORT).show();
}
})
.addOnFailureListener(new OnFailureListener()
{
@Override
public void onFailure(@NonNull Exception e)
{
Toast.makeText(ChatActivity.this, "Failed", Toast.LENGTH_SHORT).show();
}
});
}
else
{
Toast.makeText(ChatActivity.this, "Please grant permission for storage...", Toast.LENGTH_SHORT).show();
}
storageImageRef.child(messagePushId+".jpg").getFile(outputFile)
.addOnSuccessListener(taskSnapshot -> {

//Toast.makeText(holder.itemView.getContext(), "Image sent", Toast.LENGTH_SHORT).show();
})
.addOnFailureListener(e -> Toast.makeText(ChatActivity.this, "Failed", Toast.LENGTH_SHORT).show());
}
else
{
loadingBar.dismiss();
Toast.makeText(ChatActivity.this, "Error", Toast.LENGTH_SHORT).show();
Toast.makeText(ChatActivity.this, "Please grant permission for storage...", Toast.LENGTH_SHORT).show();
}
MessageInputText.setText("");

}
else
{
loadingBar.dismiss();
Toast.makeText(ChatActivity.this, "Error", Toast.LENGTH_SHORT).show();
}
MessageInputText.setText("");
});

}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,6 @@
import com.google.firebase.auth.FirebaseUser;
import com.google.firebase.database.DatabaseReference;
import com.google.firebase.database.FirebaseDatabase;
import com.google.firebase.iid.FirebaseInstanceId;
import com.google.firebase.iid.FirebaseInstanceIdService;
import com.google.firebase.installations.FirebaseInstallations;
import com.google.firebase.messaging.FirebaseMessagingService;

public class MyFirebaseIdService extends FirebaseMessagingService
Expand Down
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ buildscript {
maven {url 'https://maven.google.com'}
}
dependencies {
classpath 'com.android.tools.build:gradle:4.1.2'
classpath 'com.android.tools.build:gradle:7.0.4'
classpath 'com.google.gms:google-services:4.3.5'


Expand Down
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.5-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-7.0.2-bin.zip

0 comments on commit b08517d

Please sign in to comment.