Skip to content

Commit 2f846f1

Browse files
2 Dec 2022
1 parent 5e73224 commit 2f846f1

28 files changed

Lines changed: 741 additions & 203 deletions

.idea/compiler.xml

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/misc.xml

Lines changed: 12 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

app/build.gradle

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ android {
2929
}
3030
}
3131

32+
3233
dependencies {
3334

3435
// Import the Firebase BoM
@@ -43,6 +44,19 @@ dependencies {
4344
// When using the BoM, you don't specify versions in Firebase library dependencies
4445
implementation 'com.google.firebase:firebase-database'
4546

47+
// Declare the dependency for the Cloud Storage library
48+
// When using the BoM, you don't specify versions in Firebase library dependencies
49+
implementation 'com.google.firebase:firebase-storage'
50+
51+
// Declare the dependency for the Firebase Authentication library
52+
// When using the BoM, you don't specify versions in Firebase library dependencies
53+
implementation 'com.google.firebase:firebase-auth'
54+
55+
implementation 'com.firebaseui:firebase-ui-auth:7.2.0'
56+
57+
// Required only if Facebook login support is required
58+
// Find the latest Facebook SDK releases here: https://goo.gl/Ce5L94
59+
implementation 'com.facebook.android:facebook-android-sdk:12.2.0'
4660

4761
implementation 'androidx.appcompat:appcompat:1.4.0'
4862
implementation 'com.google.android.material:material:1.4.0'
@@ -54,4 +68,14 @@ dependencies {
5468
//Implement glide library
5569
implementation 'com.github.bumptech.glide:glide:4.12.0'
5670
annotationProcessor 'com.github.bumptech.glide:compiler:4.12.0'
57-
}
71+
implementation 'com.firebaseui:firebase-ui-storage:6.2.0'
72+
73+
//Country Code Selector lib
74+
implementation 'com.hbb20:ccp:2.4.7'
75+
76+
//rounded ImageView
77+
implementation 'de.hdodenhof:circleimageview:3.1.0'
78+
implementation 'com.mikhaellopez:circularimageview:4.3.0'
79+
}
80+
81+
apply plugin: 'com.google.gms.google-services'

app/src/main/AndroidManifest.xml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,45 @@
99
android:roundIcon="@mipmap/ic_launcher_round"
1010
android:supportsRtl="true"
1111
android:theme="@style/Theme.BolChal">
12+
<activity
13+
android:name=".details"
14+
android:exported="true" >
15+
<!-- <intent-filter>-->
16+
<!-- <action android:name="android.intent.action.MAIN" />-->
17+
18+
19+
<!-- <category android:name="android.intent.category.LAUNCHER" />-->
20+
<!-- </intent-filter>-->
21+
</activity>
22+
<activity
23+
android:name=".Otp_verification"
24+
android:exported="true"
25+
android:parentActivityName=".LogIn_page">
26+
<meta-data
27+
android:name="android.support.PARENT_ACTIVITY"
28+
android:value=".LogIn_page" />
29+
<!-- <intent-filter> -->
30+
<!-- <action android:name="android.intent.action.MAIN" /> -->
31+
32+
33+
<!-- <category android:name="android.intent.category.LAUNCHER" /> -->
34+
<!-- </intent-filter> -->
35+
</activity>
36+
<activity
37+
android:name=".LogIn_page"
38+
android:exported="true"
39+
android:parentActivityName=".MainActivity">
40+
<meta-data
41+
android:name="android.support.PARENT_ACTIVITY"
42+
android:value=".MainActivity" />
43+
<!-- <intent-filter> -->
44+
<!-- <action android:name="android.intent.action.MAIN" /> -->
45+
46+
47+
<!-- <category android:name="android.intent.category.LAUNCHER" /> -->
48+
<!-- </intent-filter> -->
49+
50+
</activity>
1251
<activity
1352
android:name=".MainActivity"
1453
android:exported="true">

app/src/main/java/com/assistant/android/bolchal/ChatAdapter.java

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,10 @@
88
import android.widget.ArrayAdapter;
99
import android.widget.ImageView;
1010
import android.widget.TextView;
11+
import android.widget.Toast;
1112

1213
import androidx.annotation.NonNull;
1314
import androidx.annotation.Nullable;
14-
import androidx.recyclerview.widget.RecyclerView;
1515

1616
import com.bumptech.glide.Glide;
1717

@@ -33,19 +33,30 @@ public View getView(int position, @Nullable View convertView, @NonNull ViewGroup
3333
TextView AuthorTxtView = (TextView)convertView.findViewById(R.id.nameTextView);
3434
ImageView photoImageView = (ImageView)convertView.findViewById(R.id.photoImageView);
3535
TextView messageTxtView = (TextView) convertView.findViewById(R.id.messageTextView);
36+
TextView timeTxtView = (TextView) convertView.findViewById(R.id.timeTextView);
3637

3738
Message message = getItem(position);
3839

3940
boolean isPhotoAvailable = message.getPhotoUrl()!=null;
41+
boolean isTimeAvailable = message.getTime()!=null;
42+
4043
if(isPhotoAvailable){
4144
messageTxtView.setVisibility(View.GONE);
4245
photoImageView.setVisibility(View.VISIBLE);
43-
Glide.with(photoImageView.getContext()).load(message.getPhotoUrl()).into(photoImageView);
46+
Glide.with(photoImageView.getContext())
47+
.load(message.getPhotoUrl())
48+
.centerCrop().placeholder(R.drawable.placeholder).into(photoImageView);
4449
}else{
4550
messageTxtView.setVisibility(View.VISIBLE);
4651
photoImageView.setVisibility(View.GONE);
4752
messageTxtView.setText(message.getText());
4853
}
54+
55+
if(isTimeAvailable){
56+
timeTxtView.setVisibility(View.VISIBLE);
57+
timeTxtView.setText(message.getTime());
58+
}else timeTxtView.setVisibility(View.GONE);
59+
4960
AuthorTxtView.setText(message.getName());
5061

5162
return convertView;
Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
package com.assistant.android.bolchal;
2+
3+
import androidx.annotation.NonNull;
4+
import androidx.appcompat.app.AppCompatActivity;
5+
6+
import android.app.Activity;
7+
import android.content.Intent;
8+
import android.os.Bundle;
9+
import android.util.Log;
10+
import android.view.View;
11+
import android.widget.Button;
12+
import android.widget.EditText;
13+
import android.widget.Toast;
14+
15+
import com.google.android.gms.tasks.OnCompleteListener;
16+
import com.google.android.gms.tasks.Task;
17+
import com.google.firebase.FirebaseException;
18+
import com.google.firebase.auth.AuthResult;
19+
import com.google.firebase.auth.FirebaseAuth;
20+
import com.google.firebase.auth.FirebaseAuthInvalidCredentialsException;
21+
import com.google.firebase.auth.FirebaseUser;
22+
import com.google.firebase.auth.PhoneAuthCredential;
23+
import com.google.firebase.auth.PhoneAuthOptions;
24+
import com.google.firebase.auth.PhoneAuthProvider;
25+
import com.hbb20.CountryCodePicker;
26+
27+
import java.util.Objects;
28+
import java.util.concurrent.TimeUnit;
29+
30+
public class LogIn_page extends Activity { //Before it was AppCompActivity
31+
32+
private CountryCodePicker codePicker;
33+
34+
@Override
35+
protected void onCreate(Bundle savedInstanceState) {
36+
super.onCreate(savedInstanceState);
37+
setContentView(R.layout.layout_log_in_page);
38+
39+
if(getActionBar()!=null) getActionBar().hide();
40+
41+
EditText phoneNum = findViewById(R.id.phoneTxtView);
42+
codePicker = findViewById(R.id.countryCodeHolder);
43+
Button sendSms = findViewById(R.id.send_code);
44+
45+
codePicker.registerCarrierNumberEditText(phoneNum);
46+
47+
sendSms.setOnClickListener(new View.OnClickListener() {
48+
@Override
49+
public void onClick(View view) {
50+
Intent intent = new Intent(LogIn_page.this,Otp_verification.class);
51+
intent.putExtra("phoneNum",codePicker.getFullNumberWithPlus().replace(" ",""));
52+
startActivity(intent);
53+
finish();
54+
}
55+
});
56+
57+
}
58+
59+
}

0 commit comments

Comments
 (0)