Sigma - coding for everyone!
- By olbriar
- Apps & Games
- 1 Replies
I created a channel for your app. Good luck and thanks for sharing.
Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
package com.example.library;
import android.content.DialogInterface;
import android.content.Intent;
import android.os.Bundle;
import android.text.TextUtils;
import android.util.Patterns;
import android.view.View;
import android.view.WindowManager;
import android.widget.EditText;
import android.widget.ImageView;
import android.widget.TextView;
import android.widget.Toast;
import androidx.annotation.NonNull;
import androidx.appcompat.app.AlertDialog;
import androidx.appcompat.app.AppCompatActivity;
import com.google.android.gms.tasks.OnCompleteListener;
import com.google.android.gms.tasks.OnFailureListener;
import com.google.android.gms.tasks.OnSuccessListener;
import com.google.android.gms.tasks.Task;
import com.google.firebase.auth.AuthResult;
import com.google.firebase.auth.FirebaseAuth;
public class signin extends AppCompatActivity {
TextView regsi, sifpwd;
ImageView sib;
EditText siema, sipwd;
FirebaseAuth firebaseAuth;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_signin);
getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,WindowManager.LayoutParams.FLAG_FULLSCREEN);
regsi = findViewById(R.id.regsi);
sifpwd = findViewById(R.id.sifpwd);
sib = findViewById(R.id.sib);
siema = findViewById(R.id.siem);
sipwd = findViewById(R.id.sipwd);
firebaseAuth = FirebaseAuth.getInstance();
regsi.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
if(!signin.this.isFinishing()){
startActivity(new Intent(signin.this, signup.class));
}
}
});
sib.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
String siem = siema.getText().toString().trim();
String sip = sipwd.getText().toString().trim();
if (TextUtils.isEmpty(siem) ) {
siema.setError("Email is Required");
return;
}
if (!Patterns.EMAIL_ADDRESS.matcher(siem).matches()){
siema.setError("Email is not in format");
return;
}
if(TextUtils.isEmpty(sip)){
sipwd.setError("Confirm Password is Required");
return;
}
if (sip.length() < 8){
sipwd.setError("Password is Required minimum 8 characters");
return;
}
if (firebaseAuth.getCurrentUser() == null){
Toast.makeText(signin.this, "User is not registered", Toast.LENGTH_SHORT).show();
startActivity(new Intent(getApplicationContext(), signup.class));
}
firebaseAuth.signInWithEmailAndPassword(siem, sip).addOnCompleteListener(new OnCompleteListener<AuthResult>() {
@Override
public void onComplete(@NonNull Task<AuthResult> task) {
if (task.isSuccessful()){
Toast.makeText(signin.this, "User logged in successfully", Toast.LENGTH_SHORT).show();
startActivity(new Intent(getApplicationContext(),load.class));
}
else {
Toast.makeText(signin.this, "User login unsuccessful"+ task.getException().getMessage(), Toast.LENGTH_SHORT).show();
}
}
});
}
});
sifpwd.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
EditText resetEmail = new EditText(view.getContext());
AlertDialog.Builder passwordResetDialog = new AlertDialog.Builder(view.getContext());
passwordResetDialog.setTitle("Reset Password?");
passwordResetDialog.setMessage("Enter Your Email to Received Reset Link:");
passwordResetDialog.setView(resetEmail);
passwordResetDialog.setPositiveButton("Yes", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialogInterface, int i) {
String mail = resetEmail.getText().toString();
firebaseAuth.sendPasswordResetEmail(mail).addOnSuccessListener(new OnSuccessListener<Void>() {
@Override
public void onSuccess(Void aVoid) {
Toast.makeText(signin.this, "Reset mail sent to you", Toast.LENGTH_SHORT).show();
}
}).addOnFailureListener(new OnFailureListener() {
@Override
public void onFailure(@NonNull Exception e) {
Toast.makeText(signin.this, "Error has been occur"+ e.getMessage(), Toast.LENGTH_SHORT).show();
}
});
}
});
passwordResetDialog.setNegativeButton("No", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialogInterface, int i) {
}
});
passwordResetDialog.create().show();
}
});
}
}
You can always approach to wake it up too, same app, just head over to the app and set as "approach to wake up the phone" It is kind of a default settings of the cell. Sound like when you tap it, I know there is vibration feed, but there is no sound I know of ontop of my head...
I'm still hungover from the SuperbowlIs it preseason yet? I'm in need of some football.![]()
Hello folks i had the same problem suddenly just b4 yesterday and I tried everything to fix it with no luck so i decided it was a hardware issue . I took a sewing needle and started playing with the clips inside the headphone jack with no luck either for 2 days and today I found an xray image of the s7 edge and got an idea since the right channel doesnt work the problem must be either the right ear clip or the right ear ground ( the second and third clips of the jack ) i took the needle and with only one magic gentle bend outwardly to the second clip from the left side as phone faces you everything came back to work i will attach the image and hope this helps you
View attachment 116789 View attachment 116790 I